Re: [PATCH net-next 1/2] nexthop: Restart nexthop dump based on last dumped nexthop identifier

2021-04-18 Thread Ido Schimmel
On Sun, Apr 18, 2021 at 10:06:41AM -0700, David Ahern wrote: > On 4/16/21 8:55 AM, Ido Schimmel wrote: > > From: Ido Schimmel > > > > Currently, a multi-part nexthop dump is restarted based on the number of > > nexthops that have been dumped so far. This can result i

Re: [PATCH net-next 0/9] ethtool: add uAPI for reading standard stats

2021-04-18 Thread Ido Schimmel
On Fri, Apr 16, 2021 at 09:08:16AM -0700, Jakub Kicinski wrote: > On Fri, 16 Apr 2021 18:44:26 +0300 Ido Schimmel wrote: > > Given that you have now standardized these stats, do you plan to feed > > them into some monitoring system? > > Yes and no, I'm only intending

Re: [PATCH net-next v2 3/9] ethtool: add a new command for reading standard stats

2021-04-18 Thread Ido Schimmel
On Fri, Apr 16, 2021 at 12:27:39PM -0700, Jakub Kicinski wrote: > +static int stats_prepare_data(const struct ethnl_req_info *req_base, > + struct ethnl_reply_data *reply_base, > + struct genl_info *info) > +{ > + const struct stats_req_info *

Re: [PATCH net-next v2 6/9] ethtool: add interface to read RMON stats

2021-04-18 Thread Ido Schimmel
On Fri, Apr 16, 2021 at 12:27:42PM -0700, Jakub Kicinski wrote: > +/** > + * struct ethtool_rmon_hist_range - byte range for histogram statistics > + * @low: low bound of the bucket (inclusive) > + * @high: high bound of the bucket (inclusive) > + */ > +struct ethtool_rmon_hist_range { > + u16

Re: [PATCH net-next v2 3/9] ethtool: add a new command for reading standard stats

2021-04-17 Thread Ido Schimmel
On Sat, Apr 17, 2021 at 12:18:08PM -0700, Jakub Kicinski wrote: > On Sat, 17 Apr 2021 12:15:20 -0700 Jakub Kicinski wrote: > > On Sat, 17 Apr 2021 21:53:40 +0300 Ido Schimmel wrote: > > > On Sat, Apr 17, 2021 at 11:13:51AM -0700, Jakub Kicinski wrote: > > > > On S

Re: [RFC ethtool 6/6] netlink: add support for standard stats

2021-04-17 Thread Ido Schimmel
On Sat, Apr 17, 2021 at 11:47:28AM -0700, Jakub Kicinski wrote: > On Sat, 17 Apr 2021 21:14:40 +0300 Ido Schimmel wrote: > > > + if (!is_json_context()) { > > > + fprintf(stdout, "rmon-%s-etherStatsPkts", > > > + mnl_attr_get_t

Re: [PATCH net-next v2 3/9] ethtool: add a new command for reading standard stats

2021-04-17 Thread Ido Schimmel
On Sat, Apr 17, 2021 at 11:13:51AM -0700, Jakub Kicinski wrote: > On Sat, 17 Apr 2021 10:57:42 -0700 Jakub Kicinski wrote: > > > I tried to understand how you add new groups without user space > > > changes and I think this statement is not entirely accurate. > > > > > > At minimum, user space nee

Re: [RFC ethtool 6/6] netlink: add support for standard stats

2021-04-17 Thread Ido Schimmel
On Fri, Apr 16, 2021 at 09:02:52AM -0700, Jakub Kicinski wrote: > # ethtool -S eth0 --groups eth-phy eth-mac rmon > Stats for eth0: > eth-phy-SymbolErrorDuringCarrier: 1 > eth-mac-FramesTransmittedOK: 1 > eth-mac-FrameTooLongErrors: 1 > rmon-etherStatsUndersizePkts: 1 > rmon-etherStatsJabbers: 1 >

Re: [PATCH net-next v2 3/9] ethtool: add a new command for reading standard stats

2021-04-17 Thread Ido Schimmel
On Fri, Apr 16, 2021 at 12:27:39PM -0700, Jakub Kicinski wrote: > Add an interface for reading standard stats, including > stats which don't have a corresponding control interface. > > Start with IEEE 802.3 PHY stats. There seems to be only > one stat to expose there. > > Define API to not requir

Re: [PATCH net-next 7/9] mlxsw: implement ethtool standard stats

2021-04-16 Thread Ido Schimmel
On Thu, Apr 15, 2021 at 07:27:50PM -0700, Jakub Kicinski wrote: > mlxsw has nicely grouped stats, add support for standard uAPI. > I'm guessing the register access part. Compile tested only. Jakub, wanted to let you know that it seems to be working. I'll review the patches tomorrow/Sunday, as it's

Re: [PATCH net-next] scm: fix a typo in put_cmsg()

2021-04-16 Thread Ido Schimmel
On Fri, Apr 16, 2021 at 11:35:38AM -0700, Eric Dumazet wrote: > From: Eric Dumazet > > We need to store cmlen instead of len in cm->cmsg_len. > > Fixes: 38ebcf5096a8 ("scm: optimize put_cmsg()") > Signed-off-by: Eric Dumazet > Reported-by: Jakub Kicinski

[PATCH net-next 2/2] selftests: fib_nexthops: Test large scale nexthop flushing

2021-04-16 Thread Ido Schimmel
From: Ido Schimmel Test that all the nexthops are flushed when a multi-part nexthop dump is required for the flushing. Without previous patch: # ./fib_nexthops.sh TEST: Large scale nexthop flushing [FAIL] With previous patch: # ./fib_nexthops.sh TEST

[PATCH net-next 0/2] nexthop: Support large scale nexthop flushing

2021-04-16 Thread Ido Schimmel
From: Ido Schimmel Patch #1 fixes a day-one bug in the nexthop code and allows "ip nexthop flush" to work correctly with large number of nexthops that do not fit in a single-part dump. Patch #2 adds a test case. Targeting at net-next since this use case never worked, the flow is pret

[PATCH net-next 1/2] nexthop: Restart nexthop dump based on last dumped nexthop identifier

2021-04-16 Thread Ido Schimmel
From: Ido Schimmel Currently, a multi-part nexthop dump is restarted based on the number of nexthops that have been dumped so far. This can result in a lot of nexthops not being dumped when nexthops are simultaneously deleted: # ip nexthop | wc -l 65536 # ip nexthop flush Dump was

Re: [PATCH net-next 0/9] ethtool: add uAPI for reading standard stats

2021-04-16 Thread Ido Schimmel
On Thu, Apr 15, 2021 at 07:27:43PM -0700, Jakub Kicinski wrote: > Continuing the effort of providing a unified access method > to standard stats, and explicitly tying the definitions to > the standards this series adds an API for general stats > which do no fit into more targeted control APIs. > >

Re: [PATCH resend net-next 2/2] net: bridge: switchdev: include local flag in FDB notifications

2021-04-16 Thread Ido Schimmel
m of those addresses. > > Let us now add the 'is_local' bit to bridge FDB entries, and make all > drivers ignore these entries by their own choice. > > Co-developed-by: Tobias Waldekranz > Signed-off-by: Tobias Waldekranz > Signed-off-by: Vladimir Oltea

Re: [PATCH resend net-next 1/2] net: bridge: switchdev: refactor br_switchdev_fdb_notify

2021-04-16 Thread Ido Schimmel
Signed-off-by: Tobias Waldekranz > Reviewed-by: Vladimir Oltean > Signed-off-by: Vladimir Oltean Reviewed-by: Ido Schimmel

Re: [BUG / question] in routing rules, some options (e.g. ipproto, sport) cause rules to be ignored in presence of packet marks

2021-04-09 Thread Ido Schimmel
On Fri, Apr 09, 2021 at 03:02:41PM +0200, Florian Westphal wrote: > Michal Soltys wrote: > > On 3/29/21 10:52 PM, Ido Schimmel wrote: > > > > > > ip_route_me_harder() does not set source / destination port in the > > > flow key, so it explains why fib r

[PATCH net-next] mlxsw: core: Remove critical trip points from thermal zones

2021-04-06 Thread Ido Schimmel
case firmware was not able to perform protection, by hardware. The temperature threshold set for hardware protection is always higher than for firmware. Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel --- .../ethernet/mellanox/mlxsw/core_thermal.c| 27 +-- 1 file

Re: [PATCH v3] ip-nexthop: support flush by id

2021-04-06 Thread Ido Schimmel
On Tue, Apr 06, 2021 at 09:33:23AM +0800, Chunmei Xu wrote: > since id is unique for nexthop, it is heavy to dump all nexthops. > use existing delete_nexthop to support flush by id > > Signed-off-by: Chunmei Xu Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Thanks

Re: [PATCH] ip-nexthop: support flush by id

2021-03-31 Thread Ido Schimmel
On Wed, Mar 31, 2021 at 10:22:34AM +0800, Chunmei Xu wrote: > add id to struct filter to record the 'id', > filter id only when id is set, otherwise flush all. > > Signed-off-by: Chunmei Xu > --- > ip/ipnexthop.c | 9 - > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/

Re: ip-nexthop does not support flush by id

2021-03-30 Thread Ido Schimmel
On Tue, Mar 30, 2021 at 08:44:30PM +0800, xuchunmei wrote: > Hi, > > I use iproute-5.10 with kernel-5.10.6, I found that ip-nexthop does not > support flush by id, is it by design? > > Reproduce steps: > # ip netns add me > # ip -netns me addr add 127.0.0.1/8 dev lo > # ip -netns me link set lo

[PATCH net-next] mlxsw: spectrum_router: Only perform atomic nexthop bucket replacement when requested

2021-03-30 Thread Ido Schimmel
From: Ido Schimmel When cleared, the 'force' parameter in nexthop bucket replacement notifications indicates that a driver should try to perform an atomic replacement. Meaning, only update the contents of the bucket if it is inactive. Since mlxsw only queries buckets' activity on

Re: [BUG / question] in routing rules, some options (e.g. ipproto, sport) cause rules to be ignored in presence of packet marks

2021-03-29 Thread Ido Schimmel
On Mon, Mar 29, 2021 at 11:52:10PM +0300, Ido Schimmel wrote: > On Sun, Mar 28, 2021 at 04:05:29PM +0200, Michal Soltys wrote: > > Hi, > > > > I'm not sure how it behaved in earlier kernels (can check later), but it is > > / looks bugged in at least recent 5.x+ o

Re: [BUG / question] in routing rules, some options (e.g. ipproto, sport) cause rules to be ignored in presence of packet marks

2021-03-29 Thread Ido Schimmel
On Sun, Mar 28, 2021 at 04:05:29PM +0200, Michal Soltys wrote: > Hi, > > I'm not sure how it behaved in earlier kernels (can check later), but it is > / looks bugged in at least recent 5.x+ ones (tests were done with 5.11.8 and > 5.10.25). > > Consider following setup: > > # ip -o ad sh > 1: lo

Re: [PATCH net-next] Documentation: net: Document resilient next-hop groups

2021-03-29 Thread Ido Schimmel
d Ahern Reviewed-by: Ido Schimmel

[PATCH net-next 4/6] selftests: mlxsw: Test matchall failure with protocol match

2021-03-29 Thread Ido Schimmel
From: Ido Schimmel The driver can only offload matchall rules that do not match on a protocol. Test that matchall rules that match on a protocol are vetoed. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko --- .../drivers/net/mlxsw/tc_restrictions.sh| 17 + 1 file

[PATCH net-next 3/6] mlxsw: spectrum_matchall: Perform priority checks earlier

2021-03-29 Thread Ido Schimmel
From: Ido Schimmel Perform the priority check earlier in the function instead of repeating it for every action. This fixes a bug that allowed matchall rules with sample action to be added in front of flower rules on egress. Fixes: 54d0e963f683 ("mlxsw: spectrum_matchall: Add support for e

[PATCH net-next 6/6] selftests: mlxsw: Test vetoing of double sampling

2021-03-29 Thread Ido Schimmel
From: Ido Schimmel Test that two sampling rules cannot be configured on the same port with the same trigger. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko --- .../selftests/drivers/net/mlxsw/tc_sample.sh | 30 +++ 1 file changed, 30 insertions(+) diff --git a/tools

[PATCH net-next 5/6] mlxsw: spectrum: Veto sampling if already enabled on port

2021-03-29 Thread Ido Schimmel
From: Ido Schimmel The per-port sampling triggers (i.e., ingress / egress) cannot be enabled twice. Meaning, the below configuration will not result in packets being sampled twice: # tc filter add dev swp1 ingress matchall skip_sw action sample rate 100 group 1 # tc filter add dev swp1

[PATCH net-next 2/6] mlxsw: spectrum_matchall: Convert if statements to a switch statement

2021-03-29 Thread Ido Schimmel
From: Ido Schimmel Previous patch moved the protocol check out of the action check, so these if statements can now be converted to a switch statement. Perform the conversion. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko --- drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c | 9

[PATCH net-next 1/6] mlxsw: spectrum_matchall: Perform protocol check earlier

2021-03-29 Thread Ido Schimmel
From: Ido Schimmel Perform the protocol check earlier in the function instead of repeating it for every action. Example: # tc filter add dev swp1 ingress proto ip matchall skip_sw action sample group 1 rate 100 Error: matchall rules only supported with 'all' protocol. We hav

[PATCH net-next 0/6] mlxsw: Two sampling fixes

2021-03-29 Thread Ido Schimmel
From: Ido Schimmel This patchset fixes two bugs in recent sampling submissions. The first fix, in patch #3, prevents matchall rules with sample action to be added in front of flower rules on egress. Patches #1-#2 are preparations meant at avoiding similar bugs in the future. Patch #4 is a

Re: [PATCH net mlxsw v2 0/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation

2021-03-29 Thread Ido Schimmel
On Mon, Mar 29, 2021 at 11:29:25AM +0300, Ido Schimmel wrote: > From: Ido Schimmel > > Patch #1 fixes a discrepancy between the software and hardware data > paths with regards to ECN marking after decapsulation. See the changelog > for a detailed description. > > Patch #2

[PATCH net mlxsw v2 2/2] selftests: forwarding: vxlan_bridge_1d: Add more ECN decap test cases

2021-03-29 Thread Ido Schimmel
From: Ido Schimmel Test that all possible combinations of inner and outer ECN bits result in the correct inner ECN marking according to RFC 6040 4.2. Signed-off-by: Ido Schimmel --- .../selftests/net/forwarding/vxlan_bridge_1d.sh | 13 - 1 file changed, 12 insertions(+), 1

[PATCH net mlxsw v2 1/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation

2021-03-29 Thread Ido Schimmel
From: Ido Schimmel Cited commit changed the behavior of the software data path with regards to the ECN marking of decapsulated packets. However, the commit did not change other callers of __INET_ECN_decapsulate(), namely mlxsw. The driver is using the function in order to ensure that the

[PATCH net 2/2] selftests: forwarding: vxlan_bridge_1d: Add more ECN decap test cases

2021-03-29 Thread Ido Schimmel
From: Ido Schimmel Test that all possible combinations of inner and outer ECN bits result in the correct inner ECN marking according to RFC 6040 4.2. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata --- .../selftests/net/forwarding/vxlan_bridge_1d.sh | 13 - 1 file

[PATCH net mlxsw v2 0/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation

2021-03-29 Thread Ido Schimmel
From: Ido Schimmel Patch #1 fixes a discrepancy between the software and hardware data paths with regards to ECN marking after decapsulation. See the changelog for a detailed description. Patch #2 extends the ECN decap test to cover all possible combinations of inner and outer ECN markings. The

[PATCH net 1/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation

2021-03-29 Thread Ido Schimmel
From: Ido Schimmel Cited commit changed the behavior of the software data path with regards to the ECN marking of decapsulated packets. However, the commit did not change other callers of __INET_ECN_decapsulate(), namely mlxsw. The driver is using the function in order to ensure that the

[PATCH net 0/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation

2021-03-29 Thread Ido Schimmel
From: Ido Schimmel Patch #1 fixes a discrepancy between the software and hardware data paths with regards to ECN marking after decapsulation. See the changelog for a detailed description. Patch #2 extends the ECN decap test to cover all possible combinations of inner and outer ECN markings. The

Re: [PATCH net-next 2/2] selftests: forwarding: Add tc-police tests for packets per second

2021-03-29 Thread Ido Schimmel
gt; Signed-off-by: Simon Horman FWIW (I see it was already merged): Reviewed-by: Ido Schimmel Thanks!

Re: [PATCH][next] mlxsw: spectrum_router: remove redundant initialization of variable force

2021-03-29 Thread Ido Schimmel
On Sat, Mar 27, 2021 at 10:33:34PM +, Colin King wrote: > From: Colin Ian King > > The variable force is being initialized with a value that is > never read and it is being updated later with a new value. The > initialization is redundant and can be removed. > > Addresses-Coverity: ("Unused

[PATCH net-next 10/10] selftests: mlxsw: Add resilient nexthop groups configuration tests

2021-03-24 Thread Ido Schimmel
From: Ido Schimmel Test that unsupported resilient nexthop group configurations are rejected and that offload / trap indication is correctly set on nexthop buckets in a resilient group. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata --- .../selftests/drivers/net/mlxsw/rtnetlink.sh

[PATCH net-next 02/10] mlxsw: spectrum_router: Add ability to overwrite adjacency entry only when inactive

2021-03-24 Thread Ido Schimmel
From: Ido Schimmel Allow the driver to instruct the device to only overwrite an adjacency entry if its activity is cleared. Currently, adjacency entry is always overwritten, regardless of activity. This will be used by subsequent patches to prevent replacement of active nexthop buckets. Signed

[PATCH net-next 09/10] selftests: mlxsw: Test unresolved neigh trap with resilient nexthop groups

2021-03-24 Thread Ido Schimmel
From: Ido Schimmel The number of nexthop buckets in a resilient nexthop group never changes, so when the gateway address of a nexthop cannot be resolved, the nexthop buckets are programmed to trap packets to the CPU in order to trigger resolution. For example: # ip nexthop add id 1 via

[PATCH net-next 05/10] mlxsw: spectrum_router: Update hardware flags on nexthop buckets

2021-03-24 Thread Ido Schimmel
From: Ido Schimmel So far, mlxsw only updated hardware flags ('offload' / 'trap') on nexthop objects. For resilient nexthop groups, these flags need to be updated on individual nexthop buckets as well. Update these flags whenever updating the flags of the encapsulatin

[PATCH net-next 08/10] mlxsw: spectrum_router: Enable resilient nexthop groups to be programmed

2021-03-24 Thread Ido Schimmel
From: Ido Schimmel Now that mlxsw supports resilient nexthop groups, allow them to be programmed after validating that their configuration conforms to the device's limitations (e.g., number of buckets is within predefined range). Signed-off-by: Ido Schimmel Reviewed-by: Petr Ma

[PATCH net-next 06/10] mlxsw: reg: Add Router Adjacency Table Activity Dump Register

2021-03-24 Thread Ido Schimmel
From: Ido Schimmel The RATRAD register is used to dump and optionally clear activity bits of router adjacency table entries. Will be used by the next patch to query and clear the activity of nexthop buckets in a resilient nexthop group. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata

[PATCH net-next 07/10] mlxsw: spectrum_router: Periodically update activity of nexthop buckets

2021-03-24 Thread Ido Schimmel
From: Ido Schimmel The kernel periodically checks the idle time of nexthop buckets to determine if they are idle and can be re-populated with a new nexthop. When the resilient nexthop group is offloaded to hardware, the kernel will not see activity on nexthop buckets unless it is reported from

[PATCH net-next 03/10] mlxsw: spectrum_router: Pass payload pointer to nexthop update function

2021-03-24 Thread Ido Schimmel
From: Ido Schimmel Have the caller pass a pointer to the payload of the RATR register to the function updating a single nexthop / adjacency entry. In a subsequent patch, this will allow the caller to make sure replacement was successful by querying the state of the adjacency entry after

[PATCH net-next 04/10] mlxsw: spectrum_router: Add nexthop bucket replacement support

2021-03-24 Thread Ido Schimmel
From: Ido Schimmel Replace a single nexthop bucket upon receiving a 'NEXTHOP_EVENT_BUCKET_REPLACE' notification. When the 'force' parameter is not set, instruct the device to only overwrite an adjacency entry if its activity is cleared, so as not to break existing flows

[PATCH net-next 01/10] mlxsw: spectrum_router: Add support for resilient nexthop groups

2021-03-24 Thread Ido Schimmel
From: Ido Schimmel Parse the configuration of resilient nexthop groups to existing mlxsw data structures. Unlike non-resilient groups, nexthops without a valid MAC or router interface (RIF) are programmed with a trap action instead of not being programmed at all. Signed-off-by: Ido Schimmel

[PATCH net-next 00/10] mlxsw: Add support for resilient nexthop groups

2021-03-24 Thread Ido Schimmel
From: Ido Schimmel This patchset adds support for resilient nexthop groups in mlxsw. As far as the hardware is concerned, resilient groups are the same as regular groups. The differences lie in how mlxsw manages the individual adjacency entries (nexthop buckets) that make up the group. The

[PATCH net] psample: Fix user API breakage

2021-03-24 Thread Ido Schimmel
From: Ido Schimmel Cited commit added a new attribute before the existing group reference count attribute, thereby changing its value and breaking existing applications on new kernels. Before: # psample -l libpsample ERROR psample_group_foreach: failed to recv message: Operation not

[PATCH net-next 06/14] mlxsw: spectrum_router: Prepare for nexthops with trap action

2021-03-22 Thread Ido Schimmel
From: Ido Schimmel Nexthops that need to be programmed with a trap action might not have a valid router interface (RIF) associated with them. Therefore, use the loopback RIF created during initialization to program them to the device. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata

[PATCH net-next 05/14] mlxsw: spectrum_router: Introduce nexthop action field

2021-03-22 Thread Ido Schimmel
From: Ido Schimmel Currently, the action associated with the nexthop is assumed to be 'forward' unless the 'discard' bit is set. Instead, simplify this by introducing a dedicated field to represent the action of the nexthop. This will allow us to more easily introduce more a

[PATCH net-next 11/14] mlxsw: spectrum_router: Avoid unnecessary neighbour updates

2021-03-22 Thread Ido Schimmel
From: Ido Schimmel Avoid updating neighbour and adjacency entries in hardware when the neighbour is already connected and its MAC address did not change. This can happen, for example, when neighbour transitions between valid states such as 'NUD_REACHABLE' and 'NUD_DELAY'.

[PATCH net-next 13/14] mlxsw: spectrum_router: Encode adjacency group size ranges in an array

2021-03-22 Thread Ido Schimmel
From: Ido Schimmel The device supports a fixed set of adjacency group sizes. Encode these sizes in an array, so that the next patch will be able to split it between Spectrum-1 and Spectrum-{2,3}, which support different size ranges. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata

[PATCH net-next 14/14] mlxsw: spectrum_router: Add Spectrum-{2, 3} adjacency group size ranges

2021-03-22 Thread Ido Schimmel
From: Ido Schimmel Spectrum-{2,3} support different adjacency group size ranges compared to Spectrum-1. Add an array describing these ranges and change the common code to use the array which was set during the per-ASIC initialization. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata

[PATCH net-next 12/14] mlxsw: spectrum_router: Create per-ASIC router operations

2021-03-22 Thread Ido Schimmel
From: Ido Schimmel There are several differences in the router module between Spectrum-1 and Spectrum-{2,3}. Currently, this is only apparent in the router interface (RIF) operations that are split between these ASICs. A subsequent patch is going to introduce another difference between these

[PATCH net-next 09/14] mlxsw: spectrum_router: Encapsulate nexthop update in a function

2021-03-22 Thread Ido Schimmel
From: Ido Schimmel Encapsulate this functionality in a separate function, so that it could be invoked by follow-up patches, when replacing a nexthop bucket that is part of a resilient nexthop group. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata --- .../ethernet/mellanox/mlxsw

[PATCH net-next 10/14] mlxsw: spectrum_router: Break nexthop group entry validation to a separate function

2021-03-22 Thread Ido Schimmel
From: Ido Schimmel The validation of a nexthop group entry is also necessary for resilient nexthop groups, so break the validation to a separate function to allow for code reuse in subsequent patches. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata --- .../ethernet/mellanox/mlxsw

[PATCH net-next 00/14] mlxsw: Preparations for resilient nexthop groups

2021-03-22 Thread Ido Schimmel
From: Ido Schimmel This patchset contains preparations for resilient nexthop groups support in mlxsw. A follow-up patchset will add support and selftests. Most of the patches are trivial and small to make review easier. Patchset overview: Patch #1 removes RTNL assertion in nexthop notifier

[PATCH net-next 07/14] mlxsw: spectrum_router: Add nexthop trap action support

2021-03-22 Thread Ido Schimmel
From: Ido Schimmel Currently, nexthops are programmed with either forward or discard action (for blackhole nexthops). Nexthops that do not have a valid MAC address (neighbour) or router interface (RIF) are simply not written to the adjacency table. In resilient nexthop groups, the size of the

[PATCH net-next 08/14] mlxsw: spectrum_router: Rename nexthop update function to reflect its type

2021-03-22 Thread Ido Schimmel
From: Ido Schimmel mlxsw_sp_nexthop_update() is used to update the configuration of Ethernet-type nexthops, as opposed to mlxsw_sp_nexthop_ipip_update(), which is used to update IPinIP-type nexthops. Rename the function to mlxsw_sp_nexthop_eth_update(), so that it is consistent with

[PATCH net-next 04/14] mlxsw: spectrum_router: Adjust comments on nexthop fields

2021-03-22 Thread Ido Schimmel
From: Ido Schimmel The comments assume that nexthops are simple Ethernet nexthops that are programmed to forward packets to the associated neighbour. This is no longer the case, as both IPinIP and blackhole nexthops are now supported. Adjust the comments to reflect these changes. Signed-off-by

[PATCH net-next 02/14] mlxsw: spectrum_router: Consolidate nexthop helpers

2021-03-22 Thread Ido Schimmel
From: Ido Schimmel The helper mlxsw_sp_nexthop_offload() is actually interested in finding out if the nexthop is both written to the adjacency table and forwarding packets (as opposed to discarding them). Rename it to mlxsw_sp_nexthop_is_forward() and remove mlxsw_sp_nexthop_is_discard

[PATCH net-next 03/14] mlxsw: spectrum_router: Only provide MAC address for valid nexthops

2021-03-22 Thread Ido Schimmel
From: Ido Schimmel The helper returns the MAC address associated with the nexthop. It is only valid when the nexthop forwards packets and when it is an Ethernet nexthop. Reflect this in the checks the helper is performing. This is not an issue because the sole caller of the function only

[PATCH net-next 01/14] mlxsw: spectrum_router: Remove RTNL assertion

2021-03-22 Thread Ido Schimmel
From: Ido Schimmel Remove the RTNL assertion in the nexthop notifier block. The assertion is not needed given RTNL is never assumed to be taken. This is a preparation for future patches where mlxsw will start handling nexthop events that are not always sent with RTNL held. Signed-off-by: Ido

Re: [PATCH net] selftests: forwarding: vxlan_bridge_1d: Fix vxlan ecn decapsulate value

2021-03-21 Thread Ido Schimmel
On Fri, Mar 19, 2021 at 10:33:14PM +0800, Hangbin Liu wrote: > The ECN bit defines ECT(1) = 1, ECT(0) = 2. So inner 0x02 + outer 0x01 > should be inner ECT(0) + outer ECT(1). Based on the description of > __INET_ECN_decapsulate, the final decapsulate value should be > ECT(1). So fix the test expect

[PATCH net-next 5/7] mlxsw: Allow 802.1d and .1ad VxLAN bridges to coexist on Spectrum>=2

2021-03-17 Thread Ido Schimmel
hen port joins / leaves an 802.1ad bridge in different ASICs. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel --- .../ethernet/mellanox/mlxsw/spectrum_nve.h| 1 - .../mellanox/mlxsw/spectrum_nve_vxlan.c | 15 ++ .../mellanox/mlxsw/spectrum_switchdev.c | 52 +

[PATCH net-next 6/7] selftests: forwarding: Add test for dual VxLAN bridge

2021-03-17 Thread Ido Schimmel
From: Amit Cohen Configure VxLAN with an 802.1ad bridge and VxLAN with an 802.1d bridge at the same time in same switch, verify that traffic passed as expected. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel --- .../net/forwarding/dual_vxlan_bridge.sh | 366 ++ 1

[PATCH net-next 3/7] mlxsw: spectrum: Add mlxsw_sp_port_egress_ethtype_set()

2021-03-17 Thread Ido Schimmel
through it, instead of the default 802.1q EtherType. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 16 drivers/net/ethernet/mellanox/mlxsw/spectrum.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/drivers

[PATCH net-next 4/7] mlxsw: Add struct mlxsw_sp_switchdev_ops per ASIC

2021-03-17 Thread Ido Schimmel
;. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel --- .../net/ethernet/mellanox/mlxsw/spectrum.c| 3 +++ .../net/ethernet/mellanox/mlxsw/spectrum.h| 6 + .../mellanox/mlxsw/spectrum_switchdev.c | 22 +++ 3 files changed, 31 insertions(+) diff --git a/d

[PATCH net-next 7/7] selftests: mlxsw: spectrum-2: Remove q_in_vni_veto test

2021-03-17 Thread Ido Schimmel
From: Amit Cohen q_in_vni_veto.sh is not needed anymore because VxLAN with an 802.1ad bridge and VxLAN with an 802.1d bridge can coexist. Remove the test. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel --- .../net/mlxsw/spectrum-2/q_in_vni_veto.sh | 77 --- 1 file

[PATCH net-next 2/7] mlxsw: reg: Add Switch Port Egress VLAN EtherType Register

2021-03-17 Thread Ido Schimmel
vely. This allows using dual VxLAN bridges (802.1d and 802.1ad at the same time). Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/reg.h | 36 +++ 1 file changed, 36 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxs

[PATCH net-next 0/7] mlxsw: Allow 802.1d and .1ad VxLAN bridges to coexist on Spectrum>=2

2021-03-17 Thread Ido Schimmel
From: Ido Schimmel This patchset allows user space to simultaneously configure both 802.1d and 802.1ad VxLAN bridges on Spectrum-2 and later ASICs. 802.1ad VxLAN bridges are still forbidden on Spectrum-1. The reason for the current limitation is that up until now the EtherType that was pushed

[PATCH net-next 1/7] mlxsw: reg: Add egr_et_set field to SPVID

2021-03-17 Thread Ido Schimmel
and 802.1ad at the same time). Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/reg.h | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h index 44f836246e33

[PATCH net-next 09/10] selftests: mlxsw: Add tc sample tests for new triggers

2021-03-16 Thread Ido Schimmel
From: Ido Schimmel Test that packets are sampled when tc-sample is used with matchall egress binding and flower classifier. Verify that when performing sampling on egress the end-to-end latency is reported as metadata. Signed-off-by: Ido Schimmel --- .../selftests/drivers/net/mlxsw

[PATCH net-next 10/10] selftests: mlxsw: Test egress sampling limitation on Spectrum-1 only

2021-03-16 Thread Ido Schimmel
From: Ido Schimmel Make sure egress sampling configuration only fails on Spectrum-1, given that mlxsw now supports it on Spectrum-{2,3}. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko --- tools/testing/selftests/drivers/net/mlxsw/tc_restrictions.sh | 4 +++- 1 file changed, 3 insertions

[PATCH net-next 08/10] mlxsw: spectrum_acl: Offload FLOW_ACTION_SAMPLE

2021-03-16 Thread Ido Schimmel
From: Ido Schimmel Implement support for action sample when used with a flower classifier by implementing the required sampler_add() / sampler_del() callbacks and registering an Rx listener for the sampled packets. The sampler_add() callback returns an error for Spectrum-1 as the functionality

[PATCH net-next 06/10] mlxsw: spectrum_matchall: Add support for egress sampling

2021-03-16 Thread Ido Schimmel
From: Ido Schimmel Allow user space to install a matchall classifier with sample action on egress. This is only supported on Spectrum-2 onwards, so Spectrum-1 will continue to return an error. Programming the hardware to sample on egress is identical to ingress sampling with the sole change of

[PATCH net-next 07/10] mlxsw: core_acl_flex_actions: Add mirror sampler action

2021-03-16 Thread Ido Schimmel
From: Ido Schimmel Add core functionality required to support mirror sampler action in the policy engine. The switch driver (e.g., 'mlxsw_spectrum') is required to implement the sampler_add() / sampler_del() callbacks that perform the necessary configuration before the sampler act

[PATCH net-next 05/10] mlxsw: spectrum: Start using sampling triggers hash table

2021-03-16 Thread Ido Schimmel
From: Ido Schimmel Start using the previously introduced sampling triggers hash table to store sampling parameters instead of storing them as attributes of the sampled port. This makes it easier to introduce new sampling triggers. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko

[PATCH net-next 04/10] mlxsw: spectrum: Track sampling triggers in a hash table

2021-03-16 Thread Ido Schimmel
From: Ido Schimmel Currently, mlxsw supports a single sampling trigger type (i.e., received packet). When sampling is configured on an ingress port, the sampling parameters (e.g., pointer to the psample group) are stored as an attribute of the port, so that they could be passed to

[PATCH net-next 03/10] mlxsw: spectrum_matchall: Pass matchall entry to sampling operations

2021-03-16 Thread Ido Schimmel
From: Ido Schimmel The entry will be required by the next patches, so pass it. No functional changes intended. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko --- .../net/ethernet/mellanox/mlxsw/spectrum.h| 9 --- .../mellanox/mlxsw/spectrum_matchall.c| 27

[PATCH net-next 01/10] mlxsw: spectrum_matchall: Propagate extack further

2021-03-16 Thread Ido Schimmel
From: Ido Schimmel Due to the differences between Spectrum-1 and later ASICs, some of the checks currently performed at the common code (where extack is available) will need to be pushed to the per-ASIC operations. As a preparation, propagate extack further to maintain proper error reporting

[PATCH net-next 00/10] mlxsw: Add support for egress and policy-based sampling

2021-03-16 Thread Ido Schimmel
From: Ido Schimmel So far mlxsw only supported ingress sampling using matchall classifier. This series adds support for egress sampling and policy-based sampling using flower classifier on Spectrum-2 and newer ASICs. As such, it is now possible to issue these commands: # tc filter add dev swp1

[PATCH net-next 02/10] mlxsw: spectrum_matchall: Push sampling checks to per-ASIC operations

2021-03-16 Thread Ido Schimmel
From: Ido Schimmel Push some sampling checks to the per-ASIC operations, as they are no longer relevant for all ASICs. The sampling rate validation against the MPSC maximum rate is only relevant for Spectrum-1, as Spectrum-2 and later ASICs no longer use MPSC register for sampling. The ingress

Re: [PATCH v2 net-next 11/12] Documentation: networking: switchdev: clarify device driver behavior

2021-03-16 Thread Ido Schimmel
On Tue, Mar 16, 2021 at 04:04:31PM +0200, Vladimir Oltean wrote: > On Tue, Mar 16, 2021 at 04:01:13PM +0200, Ido Schimmel wrote: > > On Tue, Mar 16, 2021 at 01:24:18PM +0200, Vladimir Oltean wrote: > > > +When the bridge has VLAN filtering enabled and a PVID is not config

Re: [PATCH v2 net-next 12/12] Documentation: networking: switchdev: fix command for static FDB entries

2021-03-16 Thread Ido Schimmel
implementation. > > Signed-off-by: Vladimir Oltean > Reviewed-by: Florian Fainelli Reviewed-by: Ido Schimmel

Re: [PATCH v2 net-next 11/12] Documentation: networking: switchdev: clarify device driver behavior

2021-03-16 Thread Ido Schimmel
On Tue, Mar 16, 2021 at 01:24:18PM +0200, Vladimir Oltean wrote: > +When the bridge has VLAN filtering enabled and a PVID is not configured on > the > +ingress port, untagged 802.1p tagged packets must be dropped. When the bridge I think you meant "untagged and 802.1p tagged packets" ? Looks goo

Re: [BUG] Iproute2 batch-mode fails to bring up veth

2021-03-16 Thread Ido Schimmel
+ Petr On Tue, Mar 16, 2021 at 06:22:08AM +1100, Tim Rice wrote: > Hey all, > > Sorry if this isn't the right place to report Iproute2 bugs. It was implied > by README.devel as well as a couple of entries I saw in bugzilla. > > I use iproute2 batch mode to construct network namespaces. Example

Re: [PATCH v3 net-next 0/3] net/sched: act_police: add support for packet-per-second policing

2021-03-16 Thread Ido Schimmel
Sorry for the delay. Was AFK yesterday On Mon, Mar 15, 2021 at 03:41:56PM +0100, Simon Horman wrote: > On Sun, Mar 14, 2021 at 10:17:37AM +0200, Ido Schimmel wrote: > > On Fri, Mar 12, 2021 at 03:08:28PM +0100, Simon Horman wrote: > > > This series enhances the TC policer action

Re: [PATCH v3 1/5] thermal/drivers/core: Use a char pointer for the cooling device name

2021-03-14 Thread Ido Schimmel
bwantysiliogogogoch" > > A village on the island of Anglesey (Wales), known to have the longest > name in Europe. > > Signed-off-by: Daniel Lezcano > Reviewed-by: Lukasz Luba Tested-by: Ido Schimmel

[PATCH net-next 10/11] mlxsw: spectrum: Report extra metadata to psample module

2021-03-14 Thread Ido Schimmel
From: Ido Schimmel Make use of the previously added metadata and report it to the psample module. The metadata is read from the skb's control block, which was initialized by the bus driver (i.e., 'mlxsw_pci') after decoding the packet's Completion Queue Element (CQE).

[PATCH net-next 11/11] selftests: mlxsw: Add tc sample tests

2021-03-14 Thread Ido Schimmel
From: Ido Schimmel Test that packets are sampled when tc-sample is used and that reported metadata is correct. Two sets of hosts (with and without LAG) are used, since metadata extraction in mlxsw is a bit different when LAG is involved. # ./tc_sample.sh TEST: tc sample rate (forward

[PATCH net-next 08/11] mlxsw: spectrum: Remove unnecessary RCU read-side critical section

2021-03-14 Thread Ido Schimmel
From: Ido Schimmel Since commit 7d8e8f3433dc ("mlxsw: core: Increase scope of RCU read-side critical section"), all Rx handlers are called from an RCU read-side critical section. Remove the unnecessary rcu_read_lock() / rcu_read_unlock(). Signed-off-by: Ido Schimmel Reviewed-by:

[PATCH net-next 07/11] mlxsw: pci: Set extra metadata in skb control block

2021-03-14 Thread Ido Schimmel
From: Ido Schimmel Packets that are mirrored / sampled to the CPU have extra metadata encoded in their corresponding Completion Queue Element (CQE). Retrieve this metadata from the CQE and set it in the skb control block so that it could be accessed by the switch driver (i.e., 'mlxsw_spe

[PATCH net-next 09/11] mlxsw: spectrum: Remove mlxsw_sp_sample_receive()

2021-03-14 Thread Ido Schimmel
From: Ido Schimmel The function resolves the psample sampling group from the Rx port because this is the only form of sampling the driver currently supports. Subsequent patches are going to add support for Tx-based and policy-based sampling, in which case the sampling group would not be resolved

  1   2   3   4   5   6   7   8   9   10   >