aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ethernet
AgeCommit message (Collapse)AuthorFilesLines
2022-07-02net/mlx5e: Add post meter table for flow meteringJianbo Liu7-3/+245
Flow meter object monitors the packets rate for the flows it is attached to, and color packets with GREEN or RED. The post meter table is used to check the color. Packet is dropped if it's RED, or forwarded to post_act table if GREEN. Packet color will be set to 8 LSB of the register C5, so they are reserved for metering, which are previously used for matching fte id. Signed-off-by: Jianbo Liu <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Reviewed-by: Ariel Levkovich <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2022-07-02net/mlx5e: Add generic macros to use metadata register mappingJianbo Liu5-10/+12
There are many definitions to get bits and mask for different types of metadata register mapping, add generic macros to unify them. Signed-off-by: Jianbo Liu <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Reviewed-by: Ariel Levkovich <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2022-07-02net/mlx5e: Get or put meter by the index of tc police actionJianbo Liu2-0/+226
Add functions to create and destroy flow meter aso object. This object only supports the range allocation. 64 objects are allocated at a time, and there are two meters in each object. Usually only one meter is allocated for a flow, so bitmap is used to manage these 128 meters. TC police action is mapped to hardware meter. As the index is unique for each police action, add APIs to allocate or free hardware meter by the index. If the meter is already created, increment its refcnt, otherwise create new one. If police action has different parameters, update hardware meter accordingly. Signed-off-by: Jianbo Liu <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2022-07-02net/mlx5e: Add support to modify hardware flow meter parametersJianbo Liu3-0/+192
The policing rate and burst from user are converted to flow meter parameters in hardware. These parameters are set or modified by ACCESS_ASO WQE, add function to support it. Signed-off-by: Jianbo Liu <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Reviewed-by: Ariel Levkovich <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2022-07-02net/mlx5e: Prepare for flow meter offload if hardware supports itJianbo Liu7-1/+129
If flow meter aso object is supported, set the allocated range, and initialize aso wqe. The allocated range is indicated by log_meter_aso_granularity in HW capabilities, and currently is 6. Signed-off-by: Jianbo Liu <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Reviewed-by: Maor Dickman <[email protected]> Reviewed-by: Ariel Levkovich <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2022-07-02net/mlx5: Implement interfaces to control ASO SQ and CQJianbo Liu2-0/+162
Add interfaces to use ASO object control channel. The channel consists of a control SQ and CQ to which user can post ACCESS_ASO work requests to modify ASO objects. The functions to get wqe from SQ, fill wqe, post the request, and poll the completion of the work, are provided. Signed-off-by: Jianbo Liu <[email protected]> Reviewed-by: Ariel Levkovich <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2022-07-02net/mlx5: Add support to create SQ and CQ for ASOJianbo Liu3-1/+350
Add a separate API to create SQ and CQ for advanced steering operations (ASO). Since the mlx5_en API to create these resources is strongly coupled with netdev channels and datapath elements, this API provides an alternative for creating send queues that are used for ASO. Currently the API allows creating channels with 2 wqbbs only - meaning the support will be for a single ACCESS_ASO wqe with data at a time. Signed-off-by: Jianbo Liu <[email protected]> Reviewed-by: Ariel Levkovich <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2022-07-02net/mlx5: E-switch: Change eswitch mode only via devlink commandChris Mi3-22/+15
Enable or disable switchdev according to the eswitch mode set by devlink command. So it is not changed by other functions anymore. Signed-off-by: Chris Mi <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2022-07-02net/mlx5: E-switch, Remove dependency between sriov and eswitch modeChris Mi7-81/+83
Currently, there are three eswitch modes, none, legacy and switchdev. None is the default mode. Remove redundant none mode as eswitch mode should always be either legacy mode or switchdev mode. With this patch, there are two behavior changes: 1. Legacy becomes the default mode. When querying eswitch mode using devlink, a valid mode is always returned. 2. When disabling sriov, the eswitch mode will not change, only vfs are unloaded. Signed-off-by: Chris Mi <[email protected]> Reviewed-by: Maor Dickman <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2022-07-02net/mlx5: E-switch, Introduce flag to indicate if fdb table is createdChris Mi2-0/+12
Introduce flag to indicate if fdb table is created as a pre-step to prepare for removing dependency between sriov and eswitch mode in the downstream patches. Signed-off-by: Chris Mi <[email protected]> Reviewed-by: Mark Bloch <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2022-07-02net/mlx5: E-switch, Introduce flag to indicate if vport acl namespace is createdChris Mi2-0/+6
Eswitch vport acl namespace is needed when loading vfs. There is no need to free and reallocate it when switching eswitch mode. Introduce flag to indicate if it is created or not. When needed, create it. Only free it when the driver is unloaded or in bare metal mode. Signed-off-by: Chris Mi <[email protected]> Reviewed-by: Mark Bloch <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2022-07-02net/mlx5: delete dead code in mlx5_esw_unlock()Dan Carpenter1-2/+0
Smatch complains about this function: drivers/net/ethernet/mellanox/mlx5/core/eswitch.c:2000 mlx5_esw_unlock() warn: inconsistent returns '&esw->mode_lock'. Before commit ec2fa47d7b98 ("net/mlx5: Lag, use lag lock") there used to be a matching mlx5_esw_lock() function and the lock and unlock functions were symmetric. But now we take the lock unconditionally and must unlock unconditionally as well. As near as I can tell this is dead code and can just be deleted. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2022-07-02net/mlx5: Delete ipsec_fs header file as not usedLeon Romanovsky1-21/+0
ipsec_fs.h is not used and can be safely deleted. Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2022-07-02net: add skb_[inner_]tcp_all_headers helpersEric Dumazet42-104/+82
Most drivers use "skb_transport_offset(skb) + tcp_hdrlen(skb)" to compute headers length for a TCP packet, but others use more convoluted (but equivalent) ways. Add skb_tcp_all_headers() and skb_inner_tcp_all_headers() helpers to harmonize this a bit. Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-07-01qlogic/qed: fix repeated words in commentsJilin Yuan1-1/+1
Delete the redundant word 'a'. Signed-off-by: Jilin Yuan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-07-01samsung/sxgbe: fix repeated words in commentsJilin Yuan1-1/+1
Delete the redundant word 'are'. Signed-off-by: Jilin Yuan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-07-01stmicro/stmmac: fix repeated words in commentsJilin Yuan1-1/+1
Delete the redundant word 'all'. Signed-off-by: Jilin Yuan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-07-01ethernet/sun: fix repeated words in commentsJilin Yuan4-4/+4
Delete the redundant word 'the'. Delete the redundant word 'is'. Delete the redundant word 'start'. Delete the redundant word 'checking'. Signed-off-by: Jilin Yuan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-07-01octeontx2-af: fix operand size in bitwise operationShijith Thotton1-2/+2
Made size of operands same in bitwise operations. The patch fixes the klocwork issue, operands in a bitwise operation have different size at line 375 and 483. Signed-off-by: Shijith Thotton <[email protected]> Link: https://lore.kernel.org/r/f4fba33fe4f89b420b4da11d51255e7cc6ea1dbf.1656586269.git.sthotton@marvell.com Signed-off-by: Jakub Kicinski <[email protected]>
2022-07-01nfp: support VF rate limit with NFDKBin Chen1-0/+1
Support VF rate limiting with NFDK by adding ndo_set_vf_rate to the NFDK ops structure. NFDK is used to communicate via PCIE to NFP-3800 based NICs while NFD3 is used for other NICs supported by the NFP driver. The VF rate limit feature is already supported by the driver for NFD3. Signed-off-by: Bin Chen <[email protected]> Reviewed-by: Baowen Zheng <[email protected]> Reviewed-by: Louis Peens <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-07-01cxgb4: Fix typo in stringLi kunyu1-1/+1
Remove the repeated ',' from string Signed-off-by: Li kunyu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-07-01Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/nexDavid S. Miller7-189/+283
t-queue Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2022-06-30 This series contains updates to ice driver only. Martyna adds support for VLAN related TC switchdev filters and reworks dummy packet implementation of VLANs to enable dynamic header insertion to allow for more rule types. Lu Wei utilizes eth_broadcast_addr() helper over an open coded version. Ziyang Xuan removes unneeded NULL checks. ==================== Signed-off-by: David S. Miller <[email protected]>
2022-07-01neterion/vxge: fix repeated words in commentsJilin Yuan2-2/+2
Delete the redundant word 'frame'. Signed-off-by: Jilin Yuan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-07-01ethernet/neterion: fix repeated words in commentsJilin Yuan1-5/+5
Delete the redundant word 'the'. Delete the redundant word 'a'. Delete the redundant word 'frame'. Delete the redundant word 'is'. Delete the redundant word 'not'. Signed-off-by: Jilin Yuan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-07-01ethernet/natsemi: fix repeated words in commentsJilin Yuan1-1/+1
Delete the redundant word 'in'. Signed-off-by: Jilin Yuan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-07-01mellanox/mlxsw: fix repeated words in commentsJilin Yuan3-3/+3
Delete the redundant word 'action'. Delete the redundant word 'refer'. Delete the redundant word 'for'. Signed-off-by: Jilin Yuan <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-07-01ethernet/marvell: fix repeated words in commentsJilin Yuan1-1/+1
Delete the redundant word 'a'. Signed-off-by: Jilin Yuan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-07-01marvell/octeontx2/af: fix repeated words in commentsJilin Yuan1-1/+1
Delete the redundant word 'so'. Signed-off-by: Jilin Yuan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-06-30net: gianfar: add support for software TX timestampingVladimir Oltean2-1/+6
These are required by certain network profiling applications in order to measure delays. Signed-off-by: Vladimir Oltean <[email protected]> Acked-by: Richard Cochran <[email protected]> Reviewed-by: Claudiu Manoil <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-06-30hisilicon/hns3/hns3vf:fix repeated words in commentsJilin Yuan1-1/+1
Delete the redundant word 'new'. Signed-off-by: Jilin Yuan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-06-30google/gve:fix repeated words in commentsJilin Yuan1-1/+1
Delete the redundant word 'a'. Signed-off-by: Jilin Yuan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-06-30freescale/fs_enet:fix repeated words in commentsJilin Yuan1-1/+1
Delete the redundant word 'a'. Signed-off-by: Jilin Yuan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-06-30ethernet/emulex:fix repeated words in commentsJilin Yuan1-1/+1
Delete the redundant word 'the'. Signed-off-by: Jilin Yuan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-06-30atheros/atl1e:fix repeated words in commentsJilin Yuan1-1/+1
Delete the redundant word 'slot'. Signed-off-by: Jilin Yuan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-06-30Merge branch '1GbE' of ↵Jakub Kicinski31-46/+20
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 1GbE Intel Wired LAN Driver Updates 2022-06-30 This series contains updates to misc Intel drivers. Jesse removes unused macros from e100, e1000, e1000e, i40e, iavf, igc, ixgb, ixgbe, and ixgbevf drivers. Jiang Jian removes repeated words from ixgbe, fm10k, igb, and ixgbe drivers. Jilin Yuan removes repeated words from e1000, e1000e, fm10k, i40e, iavf, igb, igbvf, igc, ixgbevf, and ice drivers. * '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: intel/ice:fix repeated words in comments intel/ixgbevf:fix repeated words in comments intel/igc:fix repeated words in comments intel/igbvf:fix repeated words in comments intel/igb:fix repeated words in comments intel/iavf:fix repeated words in comments intel/i40e:fix repeated words in comments intel/fm10k:fix repeated words in comments intel/e1000e:fix repeated words in comments intel/e1000:fix repeated words in comments ixgbe: drop unexpected word 'for' in comments igb: remove unexpected word "the" fm10k: remove unexpected word "the" ixgbe: remove unexpected word "the" intel: remove unused macros ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-06-30net/ice: fix initializing the bitmap in the switch codeAlexander Lobakin1-1/+1
Kbuild spotted the following bug during the testing of one of the optimizations: In file included from include/linux/cpumask.h:12, [...] from drivers/net/ethernet/intel/ice/ice_switch.c:4: drivers/net/ethernet/intel/ice/ice_switch.c: In function 'ice_find_free_recp_res_idx.constprop': include/linux/bitmap.h:447:22: warning: 'possible_idx[0]' is used uninitialized [-Wuninitialized] 447 | *map |= GENMASK(start + nbits - 1, start); | ^~ In file included from drivers/net/ethernet/intel/ice/ice.h:7, from drivers/net/ethernet/intel/ice/ice_lib.h:7, from drivers/net/ethernet/intel/ice/ice_switch.c:4: drivers/net/ethernet/intel/ice/ice_switch.c:4929:24: note: 'possible_idx[0]' was declared here 4929 | DECLARE_BITMAP(possible_idx, ICE_MAX_FV_WORDS); | ^~~~~~~~~~~~ include/linux/types.h:11:23: note: in definition of macro 'DECLARE_BITMAP' 11 | unsigned long name[BITS_TO_LONGS(bits)] | ^~~~ %ICE_MAX_FV_WORDS is 48, so bitmap_set() here was initializing only 48 bits, leaving a junk in the rest 16. It was previously hidden due to that filling 48 bits makes bitmap_set() call external __bitmap_set(), but after making it use plain bit arithmetics on small bitmaps, compilers started seeing the issue. It was still working because those 16 weren't used anywhere anyhow. bitmap_{clear,set}() are not really intended to initialize bitmaps, rather to modify already initialized ones, as they don't do anything past the passed number of bits. The correct function to do this in that particular case is bitmap_fill(), so use it here. It will do `*possible_idx = ~0UL` instead of `*possible_idx |= GENMASK(47, 0)`, not leaving anything in an undefined state. Fixes: fd2a6b71e300 ("ice: create advanced switch recipe") Reported-by: kernel test robot <[email protected]> Signed-off-by: Alexander Lobakin <[email protected]> Signed-off-by: Yury Norov <[email protected]>
2022-06-30Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netJakub Kicinski4-4/+22
drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c 9c5de246c1db ("net: sparx5: mdb add/del handle non-sparx5 devices") fbb89d02e33a ("net: sparx5: Allow mdb entries to both CPU and ports") Signed-off-by: Jakub Kicinski <[email protected]>
2022-06-30intel/ice:fix repeated words in commentsJilin Yuan1-1/+1
Delete the redundant word 'a'. Signed-off-by: Jilin Yuan <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2022-06-30ice: Remove unnecessary NULL check before dev_putZiyang Xuan1-4/+2
Since commit b37a46683739 ("netdevice: add the case if dev is NULL"), dev_put(NULL) is safe, check NULL before dev_put() is not needed. Signed-off-by: Ziyang Xuan <[email protected]> Tested-by: Gurucharan <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
2022-06-30ice: use eth_broadcast_addr() to set broadcast addressLu Wei1-1/+1
Use eth_broadcast_addr() to set broadcast address instead of memset(). Signed-off-by: Lu Wei <[email protected]> Tested-by: Gurucharan <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
2022-06-30ice: switch: dynamically add VLAN headers to dummy packetsMartyna Szapar-Mudlaw1-397/+140
Enable the support of creating all kinds of declared dummy packets with the VLAN tags by inserting VLAN headers (single VLAN and QinQ cases) if needed. Decrease the number of declared dummy packets and increase in the possible packet's combinations for adding switch rules. This change enables support of creating filters that match both on VLAN + tunnels properties in switchdev. Signed-off-by: Martyna Szapar-Mudlaw <[email protected]> Reviewed-by: Alexander Lobakin <[email protected]> Tested-by: Sandeep Penigalapati <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2022-06-30ice: Add support for VLAN TPID filters in switchdevMartyna Szapar-Mudlaw6-5/+85
Enable support for adding TC rules that filter on the VLAN tag type in switchdev mode. Signed-off-by: Martyna Szapar-Mudlaw <[email protected]> Tested-by: Sandeep Penigalapati <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2022-06-30ice: Add support for double VLAN in switchdevMartyna Szapar-Mudlaw4-2/+275
Enable support for adding TC rules with both C-tag and S-tag that can filter on the inner and outer VLAN in QinQ for basic packets (not tunneled cases). Signed-off-by: Wiktor Pilarczyk <[email protected]> Signed-off-by: Martyna Szapar-Mudlaw <[email protected]> Reviewed-by: Alexander Lobakin <[email protected]> Tested-by: Sandeep Penigalapati <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2022-06-30i40e: Fix VF's MAC Address change on VMNorbert Zulinski1-0/+4
Clear VF MAC from parent PF and remove VF filter from VSI when both conditions are true: -VIRTCHNL_VF_OFFLOAD_USO is not used -VM MAC was not set from PF level It affects older version of IAVF and it allow them to change MAC Address on VM, newer IAVF won't change their behaviour. Previously it wasn't possible to change VF's MAC Address on VM because there is flag on IAVF driver that won't allow to change MAC Address if this address is given from PF driver. Fixes: 155f0ac2c96b ("iavf: allow permanent MAC address to change") Signed-off-by: Norbert Zulinski <[email protected]> Signed-off-by: Jan Sokolowski <[email protected]> Tested-by: Konrad Jankowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2022-06-30i40e: Fix dropped jumbo frames statisticsLukasz Cieplicki4-0/+103
Dropped packets caused by too large frames were not included in dropped RX packets statistics. Issue was caused by not reading the GL_RXERR1 register. That register stores count of packet which was have been dropped due to too large size. Fix it by reading GL_RXERR1 register for each interface. Repro steps: Send a packet larger than the set MTU to SUT Observe rx statists: ethtool -S <interface> | grep rx | grep -v ": 0" Fixes: 41a9e55c89be ("i40e: add missing VSI statistics") Signed-off-by: Lukasz Cieplicki <[email protected]> Signed-off-by: Jedrzej Jagielski <[email protected]> Tested-by: Gurucharan <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
2022-06-30net: sparx5: mdb add/del handle non-sparx5 devicesCasper Andersson1-0/+6
When adding/deleting mdb entries on other net_devices, eg., tap interfaces, it should not crash. Fixes: 3bacfccdcb2d ("net: sparx5: Add mdb handlers") Signed-off-by: Casper Andersson <[email protected]> Reviewed-by: Steen Hegelund <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-06-30intel/ixgbevf:fix repeated words in commentsJilin Yuan2-2/+2
Delete the redundant word 'slot'. Delete the redundant word 'we'. Signed-off-by: Jilin Yuan <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2022-06-30intel/igc:fix repeated words in commentsJilin Yuan1-1/+1
Delete the redundant word 'frames'. Signed-off-by: Jilin Yuan <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2022-06-30intel/igbvf:fix repeated words in commentsJilin Yuan2-2/+2
Delete the redundant word 'on'. Delete the redundant word 'slot'. Signed-off-by: Jilin Yuan <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2022-06-30intel/igb:fix repeated words in commentsJilin Yuan2-3/+3
Delete the redundant word 'frames'. Delete the redundant word 'set'. Delete the redundant word 'slot'. Signed-off-by: Jilin Yuan <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>