summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-08-02tc: flower: support for SPIRatheesh Kannoth2-0/+38
tc flower rules support to classify ESP/AH packets matching SPI field. Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-08-02net: flow_dissector: Add IPSEC dissectorRatheesh Kannoth2-1/+61
Support for dissecting IPSEC field SPI (which is 32bits in size) for ESP and AH packets. Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-08-02Merge branch 'oxnas=dwmac-removal'David S. Miller4-297/+0
Neil Armstrong says: ==================== net: ethernet: dwmac: oxnas glue removal With [1] removing MPCore SMP support, this makes the OX820 barely usable, associated with a clear lack of maintainance, development and migration to dt-schema it's clear that Linux support for OX810 and OX820 should be removed. In addition, the OX810 hasn't been booted for years and isn't even present in an ARM config file. For the OX820, lack of USB and SATA support makes the platform not usable in the current Linux support and relies on off-tree drivers hacked from the vendor (defunct for years) sources. The last users are in the OpenWRT distribution, and today's removal means support will still be in stable 6.1 LTS kernel until end of 2026. If someone wants to take over the development even with lack of SMP, I'll be happy to hand off maintainance. It has been a fun time adding support for this architecture, but it's time to get over! This patchset only removes net changes, and is derived from: https://lore.kernel.org/r/20230630-topic-oxnas-upstream-remove-v2-0-fb6ab3dea87c@linaro.org --- Changes in v3: - Removed applied changes - Added Andy's tags - Reduced for net - Link to v2: https://lore.kernel.org/r/20230630-topic-oxnas-upstream-remove-v2-0-fb6ab3dea87c@linaro.org Changes in v2: - s/maintainance/maintenance/ - added acked/review tags - dropped already applied patches - drop RFC - Link to v1: https://lore.kernel.org/r/20230331-topic-oxnas-upstream-remove-v1-0-5bd58fd1dd1f@linaro.org ==================== Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-08-02dt-bindings: net: oxnas-dwmac: remove obsolete bindingsNeil Armstrong1-41/+0
Due to lack of maintenance and stall of development for a few years now, and since no new features will ever be added upstream, remove the OX810 and OX820 dwmac glue. Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Daniel Golle <daniel@makrotopia.org> Acked-by: Conor Dooley <conor.dooley@microchip.com> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-08-02net: stmmac: dwmac-oxnas: remove obsolete dwmac glue driverNeil Armstrong3-256/+0
Due to lack of maintenance and stall of development for a few years now, and since no new features will ever be added upstream, remove support for OX810 and OX820 ethernet. Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Daniel Golle <daniel@makrotopia.org> Acked-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-08-02Merge branch 'selftests-mlxsw'David S. Miller9-0/+1580
Petr Machata says: ==================== selftests: New selftests for out-of-order-operations patches in mlxsw In the past, the mlxsw driver made the assumption that the user applies configuration in a bottom-up manner. Thus netdevices needed to be added to the bridge before IP addresses were configured on that bridge or SVI added on top of it, because whatever happened before a netdevice was mlxsw upper was generally ignored by mlxsw. Recently, several patch series were pushed to introduce the bookkeeping and replays necessary to offload the full state, not just the immediate configuration step. In this patchset, introduce new selftests that directly exercise the out of order code paths in mlxsw. - Patch #1 adds new tests into the existing selftest router_bridge.sh. - Patches #2-#5 add new generic selftests. - Patches #6-#8 add new mlxsw-specific selftests. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2023-08-02selftests: mlxsw: rif_bridge: Add a new selftestPetr Machata1-0/+183
This test verifies driver behavior with regards to creation of RIFs for a bridge as LAGs are added or removed to/from it, and ports added or removed to/from the LAG. Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Danielle Ratson <danieller@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-08-02selftests: mlxsw: rif_lag_vlan: Add a new selftestPetr Machata1-0/+146
This test verifies driver behavior with regards to creation of RIFs for LAG VLAN uppers as ports are added or removed to/from the LAG. Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Danielle Ratson <danieller@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-08-02selftests: mlxsw: rif_lag: Add a new selftestPetr Machata1-0/+136
This test verifies driver behavior with regards to creation of RIFs for a LAG as ports are added or removed to/from it. Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Danielle Ratson <danieller@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-08-02selftests: router_bridge_1d_lag: Add a new selftestPetr Machata2-0/+409
Add a selftest to verify that routing through several bridges works when LAG VLANs are used instead of physical ports, and that routing through LAG VLANs themselves works as physical ports are de/enslaved. Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Danielle Ratson <danieller@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-08-02selftests: router_bridge_lag: Add a new selftestPetr Machata2-0/+324
Add a selftest to verify that routing through a bridge works when LAG is used instead of physical ports. Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Danielle Ratson <danieller@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-08-02selftests: router_bridge_vlan_upper: Add a new selftestPetr Machata2-0/+170
Add a selftest that verifies routing through VLAN bridge uppers. Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Danielle Ratson <danieller@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-08-02selftests: router_bridge_1d: Add a new selftestPetr Machata2-0/+186
Add a selftest to verify that routing through a 1d bridge works when VLAN upper of a physical port is used instead of a physical port. Also verify that when a port is attached to an already-configured bridge, the configuration is applied. Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Danielle Ratson <danieller@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-08-02selftests: router_bridge: Add remastering testsPetr Machata1-0/+26
Add two tests to deslave a port from and reenslave to a bridge. This should retain the ability of the system to forward traffic, but on an offloading driver that is sensitive to ordering of operations, it might not. The first test does this configuration in a way that relies on vlan_default_pvid to assign the PVID. The second test disables that autoconfiguration and configures PVID by hand in a separate step. Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Danielle Ratson <danieller@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-08-02net: stmmac: XGMAC support for mdio C22 addr > 3Rohan G Thomas2-12/+25
For XGMAC versions < 2.2 number of supported mdio C22 addresses is restricted to 3. From XGMAC version 2.2 there are no restrictions on the C22 addresses, it supports all valid mdio addresses(0 to 31). Signed-off-by: Rohan G Thomas <rohan.g.thomas@intel.com> Acked-by: Jose Abreu <Jose.Abreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2023-08-02Merge branch 'add-tja1120-support'Jakub Kicinski2-274/+864
Radu Pirea says: ==================== Add TJA1120 support This patch series got bigger than I expected. It cleans up the next-c45-tja11xx driver and adds support for the TJA1120(1000BaseT1 automotive phy). Master/slave custom implementation was replaced with the generic implementation (genphy_c45_config_aneg/genphy_c45_read_status). The TJA1120 and TJA1103 are a bit different when it comes to the PTP interface. The timestamp read procedure was changed, some addresses were changed and some bits were moved from one register to another. Adding TJA1120 support was tricky, and I tried not to duplicate the code. If something looks too hacky to you, I am open to suggestions. ==================== Link: https://lore.kernel.org/r/20230731091619.77961-1-radu-nicolae.pirea@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-02net: phy: nxp-c45-tja11xx: reset PCS if the link goes downRadu Pirea (NXP OSS)1-0/+17
During PTP testing on early TJA1120 engineering samples I observed that if the link is lost and recovered, the tx timestamps will be randomly lost. To avoid this HW issue, the PCS should be reset. Resetting the PCS will break the link and we should reset the PCS on LINK UP -> LINK DOWN transition, otherwise we will trigger and infinite loop of LINK UP -> LINK DOWN events. Signed-off-by: Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20230731091619.77961-12-radu-nicolae.pirea@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-02net: phy: nxp-c45-tja11xx: read ext trig ts on TJA1120Radu Pirea (NXP OSS)1-6/+58
On TJA1120, the external trigger timestamp now has a VALID bit. This changes the logic and we can't use the TJA1103 procedure. For TJA1103, we can always read a valid timestamp from the registers, compare the new timestamp with the old timestamp and, if they are not the same, an event occurred. This logic cannot be applied for TJA1120 because the timestamp is 0 if the VALID bit is not set. Signed-off-by: Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com> Link: https://lore.kernel.org/r/20230731091619.77961-11-radu-nicolae.pirea@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-02net: phy: nxp-c45-tja11xx: run cable test with the PHY in test modeRadu Pirea (NXP OSS)1-0/+5
For TJA1120, the enable bit for cable test is not writable if the PHY is not in test mode. Signed-off-by: Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20230731091619.77961-10-radu-nicolae.pirea@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-02net: phy: nxp-c45-tja11xx: handle FUSA irqRadu Pirea (NXP OSS)1-2/+77
TJA1120 and TJA1103 have a set of functional safety hardware tests executed after every reset, and when the tests are done, the IRQ line is asserted. For the moment, the purpose of these handlers is to acknowledge the IRQ and not to check the FUSA tests status. Signed-off-by: Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20230731091619.77961-9-radu-nicolae.pirea@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-02net: phy: nxp-c45-tja11xx: read egress ts on TJA1120Radu Pirea (NXP OSS)1-18/+92
The egress timestamp FIFO/circular buffer work different on TJA1120 than TJA1103. For TJA1103 the new timestamp should be manually moved from the FIFO to the hardware buffer before checking if the timestamp is valid. For TJA1120 the hardware will move automatically the new timestamp from the FIFO to the buffer and the user should check the valid bit, read the timestamp and unlock the buffer by writing any of the buffer registers(which are read only). Another change for the TJA1120 is the behaviour of the EGR TS IRQ bit. This bit was a self-clear bit for TJA1103, but now should be cleared before reading the timestamp. Signed-off-by: Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com> Link: https://lore.kernel.org/r/20230731091619.77961-8-radu-nicolae.pirea@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-02net: phy: nxp-c45-tja11xx: enable LTC sampling on both ext_ts edgesRadu Pirea (NXP OSS)1-8/+52
The external trigger configuration for TJA1120 has changed. The PHY supports sampling of the LTC on rising and on falling edge. Signed-off-by: Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20230731091619.77961-7-radu-nicolae.pirea@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-02net: phy: nxp-c45-tja11xx: add TJA1120 supportRadu Pirea (NXP OSS)2-1/+160
Add TJA1120 driver entry and its driver_data. Signed-off-by: Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20230731091619.77961-6-radu-nicolae.pirea@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-02net: phy: nxp-c45-tja11xx: use get_featuresRadu Pirea (NXP OSS)1-1/+9
PHY_BASIC_T1_FEATURES are not the right features supported by TJA1103 anymore. For example ethtool reports: [root@alarm ~]# ethtool end0 Settings for end0: Supported ports: [ TP ] Supported link modes: 100baseT1/Full 10baseT1L/Full 10baseT1L/Full is not supported by TJA1103 and supported ports list is not completed. The PHY also have a MII port. genphy_c45_pma_read_abilities implementation can detect the PHY features and they look like this. [root@alarm ~]# ethtool end0 Settings for end0: Supported ports: [ TP MII ] Supported link modes: 100baseT1/Full Supported pause frame use: Symmetric Supports auto-negotiation: No Supported FEC modes: Not reported Advertised link modes: 100baseT1/Full Advertised pause frame use: Symmetric Advertised auto-negotiation: No Advertised FEC modes: Not reported Speed: 100Mb/s Duplex: Full Auto-negotiation: off master-slave cfg: forced master master-slave status: master Port: Twisted Pair PHYAD: 1 Transceiver: external MDI-X: Unknown Supports Wake-on: g Wake-on: d Link detected: yes SQI: 7/7 Signed-off-by: Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20230731091619.77961-5-radu-nicolae.pirea@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-02net: phy: nxp-c45-tja11xx: prepare the ground for TJA1120Radu Pirea (NXP OSS)1-168/+406
Between TJA1120 and TJA1103 the hardware was improved, but some register addresses were changed and some bit fields were moved from one register to another. Introduce the nxp_c45_reg_field structure and its associated functions to abstract the differences between the PHYs. Remove the defined bits and register addresses that are not common between TJA1103 and TJA1120 and replace them with reg_fields and register addresses from phydev->drv->driver_data. Signed-off-by: Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com> Link: https://lore.kernel.org/r/20230731091619.77961-4-radu-nicolae.pirea@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-02net: phy: nxp-c45-tja11xx: remove RX BIST frame countersRadu Pirea (NXP OSS)1-9/+0
Remove RX BIST frame counters from the PHY statistics. In production mode, these counters are always read as 0. Signed-off-by: Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20230731091619.77961-3-radu-nicolae.pirea@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-02net: phy: nxp-c45-tja11xx: use phylib master/slave implementationRadu Pirea (NXP OSS)1-75/+2
Remove the custom implementation of master/save setup and read status and use genphy_c45_config_aneg and genphy_c45_read_status since phylib has support for master/slave setup and master/slave status. Signed-off-by: Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20230731091619.77961-2-radu-nicolae.pirea@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-02Merge branch 'virtio_net-add-per-queue-interrupt-coalescing-support'Jakub Kicinski2-24/+177
Gavin Li says: ==================== virtio_net: add per queue interrupt coalescing support Currently, coalescing parameters are grouped for all transmit and receive virtqueues. This patch series add support to set or get the parameters for a specified virtqueue. When the traffic between virtqueues is unbalanced, for example, one virtqueue is busy and another virtqueue is idle, then it will be very useful to control coalescing parameters at the virtqueue granularity. Example command: $ ethtool -Q eth5 queue_mask 0x1 --coalesce tx-packets 10 Would set max_packets=10 to VQ 1. $ ethtool -Q eth5 queue_mask 0x1 --coalesce rx-packets 10 Would set max_packets=10 to VQ 0. $ ethtool -Q eth5 queue_mask 0x1 --show-coalesce Queue: 0 Adaptive RX: off TX: off stats-block-usecs: 0 sample-interval: 0 pkt-rate-low: 0 pkt-rate-high: 0 rx-usecs: 222 rx-frames: 0 rx-usecs-irq: 0 rx-frames-irq: 256 tx-usecs: 222 tx-frames: 0 tx-usecs-irq: 0 tx-frames-irq: 256 rx-usecs-low: 0 rx-frame-low: 0 tx-usecs-low: 0 tx-frame-low: 0 rx-usecs-high: 0 rx-frame-high: 0 tx-usecs-high: 0 tx-frame-high: 0 ==================== Link: https://lore.kernel.org/r/20230731070656.96411-1-gavinl@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-02virtio_net: enable per queue interrupt coalesce featureGavin Li1-0/+3
Enable per queue interrupt coalesce feature bit in driver and validate its dependency with control queue. Signed-off-by: Gavin Li <gavinl@nvidia.com> Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Heng Qi <hengqi@linux.alibaba.com> Acked-by: Jason Wang <jasowang@redhat.com> Link: https://lore.kernel.org/r/20230731070656.96411-4-gavinl@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-02virtio_net: support per queue interrupt coalesce commandGavin Li2-8/+155
Add interrupt_coalesce config in send_queue and receive_queue to cache user config. Send per virtqueue interrupt moderation config to underlying device in order to have more efficient interrupt moderation and cpu utilization of guest VM. Additionally, address all the VQs when updating the global configuration, as now the individual VQs configuration can diverge from the global configuration. Signed-off-by: Gavin Li <gavinl@nvidia.com> Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Heng Qi <hengqi@linux.alibaba.com> Acked-by: Jason Wang <jasowang@redhat.com> Link: https://lore.kernel.org/r/20230731070656.96411-3-gavinl@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-02virtio_net: extract interrupt coalescing settings to a structureGavin Li1-16/+19
Extract interrupt coalescing settings to a structure so that it could be reused in other data structures. Signed-off-by: Gavin Li <gavinl@nvidia.com> Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Acked-by: Jason Wang <jasowang@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Heng Qi <hengqi@linux.alibaba.com> Link: https://lore.kernel.org/r/20230731070656.96411-2-gavinl@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-02inet6: Remove unused function declaration udpv6_connect()Yue Haibing1-2/+0
This is never implemented since the beginning of git history. Signed-off-by: Yue Haibing <yuehaibing@huawei.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com> Link: https://lore.kernel.org/r/20230731140437.37056-1-yuehaibing@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-02net: make sure we never create ifindex = 0Jakub Kicinski1-2/+1
Instead of allocating from 1 use proper xa_init flag, to protect ourselves from IDs wrapping back to 0. Fixes: 759ab1edb56c ("net: store netdevs in an xarray") Reported-by: Stephen Hemminger <stephen@networkplumber.org> Link: https://lore.kernel.org/all/20230728162350.2a6d4979@hermes.local/ Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Link: https://lore.kernel.org/r/20230731171159.988962-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-02net/macmace: Replace zero-length array with DECLARE_FLEX_ARRAY() helperAtul Raut1-1/+1
Since zero-length arrays are deprecated, we are replacing them with C99 flexible-array members. As a result, instead of declaring a zero-length array, use the new DECLARE_FLEX_ARRAY() helper macro. This fixes warnings such as: ./drivers/net/ethernet/apple/macmace.c:80:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Atul Raut <rauji.raut@gmail.com> Link: https://lore.kernel.org/r/20230730231442.15003-1-rauji.raut@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-01net: dsa: qca8k: use dsa_for_each macro instead of for loopChristian Marangi1-53/+54
Convert for loop to dsa_for_each macro to save some redundant write on unconnected/unused port and tidy things up. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://lore.kernel.org/r/20230730074113.21889-5-ansuelsmth@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2023-08-01net: dsa: qca8k: move qca8xxx hol fixup to separate functionChristian Marangi1-36/+42
Move qca8xxx hol fixup to separate function to tidy things up and to permit using a more efficent loop in future patch. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://lore.kernel.org/r/20230730074113.21889-4-ansuelsmth@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2023-08-01net: dsa: qca8k: limit user ports access to the first CPU port on setupChristian Marangi1-8/+6
In preparation for multi-CPU support, set CPU port LOOKUP MEMBER outside the port loop and setup the LOOKUP MEMBER mask for user ports only to the first CPU port. This is to handle flooding condition where every CPU port is set as target and prevent packet duplication for unknown frames from user ports. Secondary CPU port LOOKUP MEMBER mask will be setup later when port_change_master will be implemented. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Link: https://lore.kernel.org/r/20230730074113.21889-3-ansuelsmth@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2023-08-01net: dsa: qca8k: make learning configurable and keep off if standaloneChristian Marangi3-3/+58
Address learning should initially be turned off by the driver for port operation in standalone mode, then the DSA core handles changes to it via ds->ops->port_bridge_flags(). Currently this is not the case for qca8k where learning is enabled unconditionally in qca8k_setup for every user port. Handle ports configured in standalone mode by making the learning configurable and not enabling it by default. Implement .port_pre_bridge_flags and .port_bridge_flags dsa ops to enable learning for bridge that request it and tweak .port_stp_state_set to correctly disable learning when port is configured in standalone mode. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://lore.kernel.org/r/20230730074113.21889-2-ansuelsmth@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2023-08-01net: dsa: tag_qca: return early if dev is not foundChristian Marangi1-4/+4
Currently checksum is recalculated and dsa tag stripped even if we later don't find the dev. To improve code, exit early if we don't find the dev and skip additional operation on the skb since it will be freed anyway. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://lore.kernel.org/r/20230730074113.21889-1-ansuelsmth@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2023-08-01Merge branch 'net-sched-improve-class-lifetime-handling'Paolo Abeni5-20/+49
Pedro Tammela says: ==================== net/sched: improve class lifetime handling Valis says[0]: ============ Three classifiers (cls_fw, cls_u32 and cls_route) always copy tcf_result struct into the new instance of the filter on update. This causes a problem when updating a filter bound to a class, as tcf_unbind_filter() is always called on the old instance in the success path, decreasing filter_cnt of the still referenced class and allowing it to be deleted, leading to a use-after-free. ============ Turns out these could have been spotted easily with proper warnings. Improve the current class lifetime with wrappers that check for overflow/underflow. While at it add an extack for when a class in use is deleted. [0] https://lore.kernel.org/all/20230721174856.3045-1-sec@valis.email/ ==================== Link: https://lore.kernel.org/r/20230728153537.1865379-1-pctammela@mojatatu.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2023-08-01net/sched: sch_qfq: warn about class in use while deletingPedro Tammela1-1/+3
Add extack to warn that delete was rejected because the class is still in use Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Pedro Tammela <pctammela@mojatatu.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2023-08-01net/sched: sch_htb: warn about class in use while deletingPedro Tammela1-1/+3
Add extack to warn that delete was rejected because the class is still in use Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Pedro Tammela <pctammela@mojatatu.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2023-08-01net/sched: sch_hfsc: warn about class in use while deletingPedro Tammela1-1/+3
Add extack to warn that delete was rejected because the class is still in use Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Pedro Tammela <pctammela@mojatatu.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2023-08-01net/sched: sch_drr: warn about class in use while deletingPedro Tammela1-1/+3
Add extack to warn that delete was rejected because the class is still in use Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Pedro Tammela <pctammela@mojatatu.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2023-08-01net/sched: wrap open coded Qdics class filter counterPedro Tammela5-20/+41
The 'filter_cnt' counter is used to control a Qdisc class lifetime. Each filter referecing this class by its id will eventually increment/decrement this counter in their respective 'add/update/delete' routines. As these operations are always serialized under rtnl lock, we don't need an atomic type like 'refcount_t'. It also means that we lose the overflow/underflow checks already present in refcount_t, which are valuable to hunt down bugs where the unsigned counter wraps around as it aids automated tools like syzkaller to scream in such situations. Wrap the open coded increment/decrement into helper functions and add overflow checks to the operations. Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Pedro Tammela <pctammela@mojatatu.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2023-08-01Merge branch 'mptcp-cleanup-and-improvements-in-the-selftests'Jakub Kicinski5-301/+329
Matthieu Baerts says: ==================== mptcp: cleanup and improvements in the selftests This small series of 4 patches adds some improvements in MPTCP selftests: - Patch 1 reworks the detailed report of mptcp_join.sh selftest to better display what went well or wrong per test. - Patch 2 adds colours (if supported, forced and/or not disabled) in mptcp_join.sh selftest output to help spotting issues. - Patch 3 modifies an MPTCP selftest tool to interact with the path-manager via Netlink to always look for errors if any. This makes sure odd behaviours can be seen in the logs and errors can be caught later if needed. - Patch 4 removes stdout and stderr redirections to /dev/null when using pm_nl_ctl if no errors are expected in order to log odd behaviours. ==================== Link: https://lore.kernel.org/r/20230730-upstream-net-next-20230728-mptcp-selftests-misc-v1-0-7e9cc530a9cd@tessares.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-01selftests: mptcp: userspace_pm: unmute unexpected errorsMatthieu Baerts1-50/+50
All pm_nl_ctl commands were muted. If there was an unexpected error with one of them, this was simply not visible in the logs, making the analysis very hard. It could also hide misuse of commands by mistake. Now the output is only muted when we do expect to have an error, e.g. when giving invalid arguments on purpose. Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> Link: https://lore.kernel.org/r/20230730-upstream-net-next-20230728-mptcp-selftests-misc-v1-4-7e9cc530a9cd@tessares.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-01selftests: mptcp: pm_nl_ctl: always look for errorsMatthieu Baerts3-15/+26
If a Netlink command for the MPTCP path-managers is not valid, it is important to check if there are errors. If yes, they need to be reported instead of being ignored and exiting without errors. Now if no replies are expected, an ACK from the kernelspace is asked by the userspace in order to always expect a reply. We can use the same buffer that is currently always >1024 bytes. Then we can check if there is an error (err->error), print it if any and report the error. After this modification, it is required to mute expected errors in mptcp_join.sh and pm_netlink.sh selftests: - when trying to add a bad endpoint, e.g. duplicated - when trying to set the two limits above the hard limit Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> Link: https://lore.kernel.org/r/20230730-upstream-net-next-20230728-mptcp-selftests-misc-v1-3-7e9cc530a9cd@tessares.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-01selftests: mptcp: join: colored resultsMatthieu Baerts2-4/+43
Thanks to the parent commit, it is easy to change the output and add some colours to help spotting issues. The colours are not used if stdout is redirected or if NO_COLOR env var is set to 1 as specified in https://no-color.org. It is possible to force displaying the colours even if stdout is redirected by setting this env var: SELFTESTS_MPTCP_LIB_COLOR_FORCE=1 Acked-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> Link: https://lore.kernel.org/r/20230730-upstream-net-next-20230728-mptcp-selftests-misc-v1-2-7e9cc530a9cd@tessares.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-01selftests: mptcp: join: rework detailed reportMatthieu Baerts1-236/+214
This patch modifies how the detailed results are printed, mainly to improve what is displayed in case of issue: - Now the test name (title) is printed earlier, when starting the test if it is not intentionally skipped: by doing that, errors linked to a test will be printed after having written the test name and then avoid confusions. - Due to the previous item, it is required to add a new line after having printed the test name because in case of error with a command, it is better not to have the output in the middle of the screen. - Each check is printed on a dedicated line with aligned status (ok, skip, fail): it is easier to spot which one has failed, simpler to manage in the code not having to deal with alignment case by case and helpers can be used to uniform what is done. These helpers can also be useful later to do more actions depending on the results or change in one place what is printed. - Info messages have been reduced and aligned as well. And info messages about the creation of the default test files of 1 KB are no longer printed. Example: 001 no JOIN syn [ ok ] synack [ ok ] ack [ ok ] Or with a skip and a failure: 001 no JOIN syn [ ok ] synack [fail] got 42 JOIN[s] synack expected 0 Server ns stats (...) Client ns stats (...) ack [skip] Or with info: 104 Infinite map Test file (size 128 KB) for client Test file (size 128 KB) for server file received by server has inverted byte at 169 5 corrupted pkts syn [ ok ] synack [ ok ] While at it, verify_listener_events() now also print more info in case of failure and in pm_nl_check_endpoint(), the test is marked as failed instead of skipped if no ID has been given (internal selftest issue). Acked-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> Link: https://lore.kernel.org/r/20230730-upstream-net-next-20230728-mptcp-selftests-misc-v1-1-7e9cc530a9cd@tessares.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>