- Mar 18, 2021
-
-
Alexander Duyck authored
So this patch actually does 3 things. First it removes a stray white space at the start of the variable declaration in vmxnet3_get_strings. Second it flips the logic for the string test so that we exit immediately if we are not looking for the stats strings. Doing this we can avoid unnecessary indentation and line wrapping. Then finally it updates the code to use ethtool_sprintf rather than a memcpy and pointer increment to write the ethtool strings. Signed-off-by:
Alexander Duyck <alexanderduyck@fb.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Alexander Duyck authored
Update the code to replace instances of snprintf and a pointer update with just calling ethtool_sprintf. Also replace the char pointer with a u8 pointer to avoid having to recast the pointer type. Acked-by:
Michael S. Tsirkin <mst@redhat.com> Acked-by:
Jason Wang <jasowang@redhat.com> Signed-off-by:
Alexander Duyck <alexanderduyck@fb.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Alexander Duyck authored
Replace instances of sprintf or memcpy with a pointer update with ethtool_sprintf. Signed-off-by:
Alexander Duyck <alexanderduyck@fb.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Alexander Duyck authored
Replace instances of snprintf or memcpy with a pointer update with ethtool_sprintf. Acked-by:
Arthur Kiyanovski <akiyano@amazon.com> Signed-off-by:
Alexander Duyck <alexanderduyck@fb.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Alexander Duyck authored
Update the hisilicon drivers to make use of ethtool_sprintf. The general idea is to reduce code size and overhead by replacing the repeated pattern of string printf statements and ETH_STRING_LEN counter increments. Signed-off-by:
Alexander Duyck <alexanderduyck@fb.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Alexander Duyck authored
The nfp_pr_et function is nearly identical to ethtool_sprintf except for the fact that it passes the pointer by value and as a return whereas ethtool_sprintf passes it as a pointer. Since they are so close just update nfp to make use of ethtool_sprintf Reviewed-by:
Simon Horman <simon.horman@netronome.com> Signed-off-by:
Alexander Duyck <alexanderduyck@fb.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Alexander Duyck authored
Update the Intel drivers to make use of ethtool_sprintf. The general idea is to reduce code size and overhead by replacing the repeated pattern of string printf statements and ETH_STRING_LEN counter increments. Signed-off-by:
Alexander Duyck <alexanderduyck@fb.com> Acked-by:
Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Alexander Duyck authored
Add a function to handle the common pattern of printing a string into the ethtool strings interface and incrementing the string pointer by the ETH_GSTRING_LEN. Most of the drivers end up doing this and several have implemented their own versions of this function so it would make sense to consolidate on one implementation. Signed-off-by:
Alexander Duyck <alexanderduyck@fb.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linuxDavid S. Miller authored
Saeed Mahameed says: ==================== mlx5-updates-2021-03-16 mlx5 uplink representor netdev persistence. Before this patchset we used to have separate netdevs for Native NIC mode and Switchdev mode (uplink representor netdev), meaning that if user switches modes between Native to Switchdev and vice versa, the driver would cleanup the current netdev representor and create a new one for the new mode, such behavior created an administrative nightmare for users, where users need to be aware of such loss of both data path and control path configurations, e.g. netdev attributes and arp/route tables, where the later is more painful. A simple solution for this is not to replace the netdev in first place and use a single netdev to serve the uplink/physical port whether it is in switchdev mode or native mode. We already have different HW profiles for each netdev mode, in this series we just replace the HW profile on the fly and we keep the same netdev attached. Refactoring: Some refactoring has been made to overcome some technical difficulties 1) The netdev is created with the maximum amount of tx/rx queues to serve the two profiles. 2) Some ndos are not supported in some modes, so we added a mode check for such cases, e.g legacy sriov ndos must be blocked in switchdev mode. 3) Some mlx5 netdev private attributes need to be moved out of profiles and kept in a persistent place, where the netdev is created e.g devlink port and other global HW resources 4) The netdev devlink port is now always registered with the switch id Implementation: the last three patches implement the mechanism now as the netdev can be shared. 5) Don't recreate the netdev on switchdev mode changes 6) Prevent changing switchdev mode when some netdev operations are active, mostly when TC rules are being processed. This is required since the netdev is kept registered while switchdev mode can be changed. ==================== Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Mar 17, 2021
-
-
Roi Dayan authored
We re-use the native NIC port net device instance for the Uplink representor, a driver currently cannot unbind TC setup callback actively, hence protect changing E-Switch mode while adding rules. Signed-off-by:
Roi Dayan <roid@nvidia.com> Reviewed-by:
Parav Pandit <parav@nvidia.com> Signed-off-by:
Saeed Mahameed <saeedm@nvidia.com>
-
Roi Dayan authored
E-Switch mode change routine will take the write lock to prevent any consumer to access the E-Switch resources while E-Switch is going through a mode change. In the next patch E-Switch consumers (e.g vport representors) will take read_lock prior to accessing E-Switch resources to prevent E-Switch mode changing in the middle of the operation. Signed-off-by:
Roi Dayan <roid@nvidia.com> Reviewed-by:
Parav Pandit <parav@nvidia.com> Signed-off-by:
Saeed Mahameed <saeedm@nvidia.com>
-
Roi Dayan authored
When switching modes between legacy and switchdev and back, do not reload ethernet interfaces. just change the profile from nic profile to uplink rep profile in switchdev mode. Signed-off-by:
Roi Dayan <roid@nvidia.com> Signed-off-by:
Saeed Mahameed <saeedm@nvidia.com>
-
Roi Dayan authored
When we clean all the interfaces, i.e. rescan or reload module, we need to clean eth-reps devices first, before eth devices. We will re-use the native NIC port net device instance for the Uplink representor. Changing eswitch mode will skip destroying the eth device so the net device won't be destroyed and only change the profile. Creating uplink eth-rep will initialize the representor related resources. In that sense when we destroy all devices we first need to destroy eth-rep devices so uplink eth-rep will clean all representor related resources and only then destroy the eth device which will destroy rest of the resources and the net device. Signed-off-by:
Roi Dayan <roid@nvidia.com> Signed-off-by:
Saeed Mahameed <saeedm@nvidia.com>
-
Roi Dayan authored
We re-use the native NIC port net device instance for the Uplink representor, and the devlink port. When changing profiles we reset the mlx5e priv but we should still use the devlink port so move it to mlx5e resources. Signed-off-by:
Roi Dayan <roid@nvidia.com> Signed-off-by:
Saeed Mahameed <saeedm@nvidia.com>
-
Roi Dayan authored
This is to separate between resources attributes and other attributes we will want to use. Signed-off-by:
Roi Dayan <roid@nvidia.com> Signed-off-by:
Saeed Mahameed <saeedm@nvidia.com>
-
Roi Dayan authored
We will re-use the native NIC port net device instance for the Uplink representor. Since the netdev will be kept registered while we engage switchdev mode also the devlink will be kept registered. Register the nic devlink port with switch id so it will be available when changing profiles. Signed-off-by:
Roi Dayan <roid@nvidia.com> Signed-off-by:
Saeed Mahameed <saeedm@nvidia.com>
-
Roi Dayan authored
We will re-use the native NIC port net device instance for the Uplink representor. As such we also don't want to unregister/register the devlink port as part of the profile. Signed-off-by:
Roi Dayan <roid@nvidia.com> Signed-off-by:
Saeed Mahameed <saeedm@nvidia.com>
-
Roi Dayan authored
We will re-use the native NIC port net device instance for the Uplink representor. While changing profiles private resources are not available but some ndos are not checking if the netdev is present. So for those ndos check the netdev is present in the driver before accessing the private resources. Signed-off-by:
Roi Dayan <roid@nvidia.com> Signed-off-by:
Saeed Mahameed <saeedm@nvidia.com>
-
Roi Dayan authored
Remove dedicated uplink rep netdev ndos and ethtools ops. We will re-use the native NIC port net device instance and ethtool ops for the Uplink representor. Signed-off-by:
Roi Dayan <roid@nvidia.com> Signed-off-by:
Saeed Mahameed <saeedm@nvidia.com>
-
Roi Dayan authored
We will re-use the native NIC port net device instance for the Uplink representor, hence same ndos must be used. Signed-off-by:
Roi Dayan <roid@nvidia.com> Reviewed-by:
Saeed Mahameed <saeedm@nvidia.com> Signed-off-by:
Saeed Mahameed <saeedm@nvidia.com>
-
Roi Dayan authored
We will re-use the native NIC port net device instance for the Uplink representor, hence same ndos will be used. Now we need to distinguish in the TC callback if the mode is legacy or switchdev and set the proper flag. Signed-off-by:
Roi Dayan <roid@nvidia.com> Reviewed-by:
Saeed Mahameed <saeedm@nvidia.com> Signed-off-by:
Saeed Mahameed <saeedm@nvidia.com>
-
Roi Dayan authored
We will re-use the native NIC port net device instance for the Uplink representor. Several VF ndo ops are not relevant in switchdev mode. Disallow them when eswitch mode is not legacy as a preparation. Signed-off-by:
Roi Dayan <roid@nvidia.com> Reviewed-by:
Parav Pandit <parav@nvidia.com> Signed-off-by:
Saeed Mahameed <saeedm@nvidia.com>
-
Saeed Mahameed authored
In downstream patches NIC netdev can change profile dynamically from NIC mode to uplink mode and vise-versa. It is required that both profiles must advertise the same max amount of tx/rx queues. Signed-off-by:
Saeed Mahameed <saeedm@nvidia.com> Reviewed-by:
Roi Dayan <roid@nvidia.com>
-
Roi Dayan authored
Not all ndos check the present bit before calling the ndo and the driver may want to check it. Sometimes the dev parameter passed as const so we pass it to netif_device_present() as const. Since netif_device_present() doesn't modify dev parameter anyway, declare it as const. Signed-off-by:
Roi Dayan <roid@nvidia.com> Signed-off-by:
Saeed Mahameed <saeedm@nvidia.com>
-
Flavio Leitner authored
It is not unusual to have the bridge port down. Sometimes it has the old MTU, which is fine since it's not being used. However, the kernel spams the log with a warning message when a packet is going to be sent over such port. Fix that by warning only if the interface is UP. Signed-off-by:
Flavio Leitner <fbl@sysclose.org> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
David S. Miller authored
This reverts commit 0bb3262c . Breaks things on mips64/qemu Reported-by:
Guenter Roeck <linux@roeck-us.net> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
David S. Miller authored
Horatiu Vultur says: ==================== net: ocelot: Extend MRP This patch series extends the current support of MRP in Ocelot driver. Currently the forwarding of the frames happened in SW because all frames were trapped to CPU. With this patch the MRP frames will be forward in HW. v1 -> v2: - create a patch series instead of single patch - rename ocelot_mrp_find_port to ocelot_mrp_find_partner_port - rename PGID_MRP to PGID_BLACKHOLE - use GFP_KERNEL instead of GFP_ATOMIC - fix other whitespace issues ==================== Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Horatiu Vultur authored
Now when extracting frames from CPU the cpuq is not used anymore so remove it. Signed-off-by:
Horatiu Vultur <horatiu.vultur@microchip.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Horatiu Vultur authored
This patch extends MRP support for Ocelot. It allows to have multiple rings and when the node has the MRC role it forwards MRP Test frames in HW. For MRM there is no change. Signed-off-by:
Horatiu Vultur <horatiu.vultur@microchip.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Horatiu Vultur authored
Add a new PGID that is used not to forward frames anywhere. It is used by MRP to make sure that MRP Test frames will not reach CPU port. Signed-off-by:
Horatiu Vultur <horatiu.vultur@microchip.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queueDavid S. Miller authored
Tony Nguyen says: ==================== 40GbE Intel Wired LAN Driver Updates 2021-03-16 This series contains updates to i40e, ixgbe, and ice drivers. Magnus Karlsson says: Optimize run_xdp_zc() for the XDP program verdict being XDP_REDIRECT in the xsk zero-copy path. This path is only used when having AF_XDP zero-copy on and in that case most packets will be directed to user space. This provides around 100k extra packets in throughput on my server when running l2fwd in xdpsock. ==================== Signed-off-by:
David S. Miller <davem@davemloft.net>
-
David S. Miller authored
Ido Schimmel says: ==================== mlxsw: Add support for egress and policy-based sampling 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 egress pref 1 proto all matchall action sample rate 100 group 1 # tc filter add dev swp2 ingress pref 1 proto ip flower dst_ip 198.51.100.1 action sample rate 100 group 2 When performing egress sampling (using either matchall or flower) the ASIC is able to report the end-to-end latency which is passed to the psample module. Series overview: Patches #1-#3 are preparations without any functional changes Patch #4 generalizes the idea of sampling triggers and creates a hash table to track active sampling triggers in preparation for egress and policy-based triggers. The motivation is explained in the changelog Patch #5 flips mlxsw to start using this hash table instead of storing ingress sampling triggers as an attribute of the sampled port Patch #6 finally adds support for egress sampling using matchall classifier Patches #7-#8 add support for policy-based sampling using flower classifier Patches #9 extends the mlxsw sampling selftest to cover the new triggers Patch #10 makes sure that egress sampling configuration only fails on Spectrum-1 ==================== Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Ido Schimmel authored
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 <idosch@nvidia.com> Reviewed-by:
Jiri Pirko <jiri@nvidia.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Ido Schimmel authored
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 <idosch@nvidia.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Ido Schimmel authored
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 is not supported. In Spectrum-{2,3} the callback creates a mirroring agent towards the CPU. The agent's identifier is used by the policy engine code to mirror towards the CPU with probability. The Rx listener for the sampled packet is registered with the 'policy engine' mirroring reason and passes trapped packets to the psample module after looking up their parameters (e.g., sampling group). Signed-off-by:
Ido Schimmel <idosch@nvidia.com> Reviewed-by:
Jiri Pirko <jiri@nvidia.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Ido Schimmel authored
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 action can be installed. The next patch will implement it for Spectrum-{2,3}, while Spectrum-1 will return an error, given it is not supported. Signed-off-by:
Ido Schimmel <idosch@nvidia.com> Reviewed-by:
Jiri Pirko <jiri@nvidia.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Ido Schimmel authored
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 using a different sampling trigger. Upon receiving a sampled packet, the sampling trigger (ingress vs. egress) will be encoded in the mirroring reason in the Completion Queue Element (CQE). The mirroring reason is used to lookup the sampling parameters (e.g., psample group) which are passed to the psample module. Note that locally generated packets that are sampled are simply consumed. This is done for several reasons. First, such packets do not have an ingress netdev given that their Rx local port is the CPU port. This breaks several basic assumptions. Second, sampling using the same interface (tc), but with flower classifier will not result in locally generated packets being sampled given that such packets are not subject to the policy engine. Third, realistically, this is not a big deal given that the vast majority of the packets being transmitted through the port are not locally generated packets. Fourth, if such packets do need to be sampled, they can be sampled with a 'skip_hw' filter and reported to the same sampling group as the data path packets. The software sampling rate can also be adjusted to fit the rate of the locally generated packets which is much lower than the rate of the data path traffic. Signed-off-by:
Ido Schimmel <idosch@nvidia.com> Reviewed-by:
Jiri Pirko <jiri@nvidia.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Ido Schimmel authored
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 <idosch@nvidia.com> Reviewed-by:
Jiri Pirko <jiri@nvidia.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Ido Schimmel authored
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 psample_sample_packet() when a sampled packet is trapped to the CPU. Subsequent patches are going to add more types of sampling triggers, making it difficult to maintain the current scheme. Instead, store all the active sampling triggers with their associated parameters in a hash table. That way, more trigger types can be easily added. The next patch will flip mlxsw to use the hash table instead of the current scheme. Signed-off-by:
Ido Schimmel <idosch@nvidia.com> Reviewed-by:
Jiri Pirko <jiri@nvidia.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Ido Schimmel authored
The entry will be required by the next patches, so pass it. No functional changes intended. Signed-off-by:
Ido Schimmel <idosch@nvidia.com> Reviewed-by:
Jiri Pirko <jiri@nvidia.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-