From: Sasha Levin Date: Fri, 13 Sep 2024 23:37:07 +0000 (-0400) Subject: Fixes for 5.4 X-Git-Tag: v6.1.111~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=262a91c93d73ef95d4766ee4527a404450ab1695;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.4 Signed-off-by: Sasha Levin --- diff --git a/queue-5.4/ice-fix-accounting-for-filters-shared-by-multiple-vs.patch b/queue-5.4/ice-fix-accounting-for-filters-shared-by-multiple-vs.patch new file mode 100644 index 00000000000..9a6077120dd --- /dev/null +++ b/queue-5.4/ice-fix-accounting-for-filters-shared-by-multiple-vs.patch @@ -0,0 +1,69 @@ +From d83edbf2885f4c529ee379c6c9dfc5a2741e9579 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jul 2024 09:55:55 -0700 +Subject: ice: fix accounting for filters shared by multiple VSIs + +From: Jacob Keller + +[ Upstream commit e843cf7b34fe2e0c1afc55e1f3057375c9b77a14 ] + +When adding a switch filter (such as a MAC or VLAN filter), it is expected +that the driver will detect the case where the filter already exists, and +return -EEXIST. This is used by calling code such as ice_vc_add_mac_addr, +and ice_vsi_add_vlan to avoid incrementing the accounting fields such as +vsi->num_vlan or vf->num_mac. + +This logic works correctly for the case where only a single VSI has added a +given switch filter. + +When a second VSI adds the same switch filter, the driver converts the +existing filter from an ICE_FWD_TO_VSI filter into an ICE_FWD_TO_VSI_LIST +filter. This saves switch resources, by ensuring that multiple VSIs can +re-use the same filter. + +The ice_add_update_vsi_list() function is responsible for doing this +conversion. When first converting a filter from the FWD_TO_VSI into +FWD_TO_VSI_LIST, it checks if the VSI being added is the same as the +existing rule's VSI. In such a case it returns -EEXIST. + +However, when the switch rule has already been converted to a +FWD_TO_VSI_LIST, the logic is different. Adding a new VSI in this case just +requires extending the VSI list entry. The logic for checking if the rule +already exists in this case returns 0 instead of -EEXIST. + +This breaks the accounting logic mentioned above, so the counters for how +many MAC and VLAN filters exist for a given VF or VSI no longer accurately +reflect the actual count. This breaks other code which relies on these +counts. + +In typical usage this primarily affects such filters generally shared by +multiple VSIs such as VLAN 0, or broadcast and multicast MAC addresses. + +Fix this by correctly reporting -EEXIST in the case of adding the same VSI +to a switch rule already converted to ICE_FWD_TO_VSI_LIST. + +Fixes: 9daf8208dd4d ("ice: Add support for switch filter programming") +Signed-off-by: Jacob Keller +Tested-by: Rafal Romanowski +Signed-off-by: Tony Nguyen +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/intel/ice/ice_switch.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c +index 0c71995e1a70..de520466f23a 100644 +--- a/drivers/net/ethernet/intel/ice/ice_switch.c ++++ b/drivers/net/ethernet/intel/ice/ice_switch.c +@@ -1299,7 +1299,7 @@ ice_add_update_vsi_list(struct ice_hw *hw, + + /* A rule already exists with the new VSI being added */ + if (test_bit(vsi_handle, m_entry->vsi_list_info->vsi_map)) +- return 0; ++ return -EEXIST; + + /* Update the previously created VSI list set with + * the new VSI ID passed in +-- +2.43.0 + diff --git a/queue-5.4/net-dpaa-pad-packets-to-eth_zlen.patch b/queue-5.4/net-dpaa-pad-packets-to-eth_zlen.patch new file mode 100644 index 00000000000..24b038fa156 --- /dev/null +++ b/queue-5.4/net-dpaa-pad-packets-to-eth_zlen.patch @@ -0,0 +1,62 @@ +From 55d8de44bb5acd86da0446e1263a696de3225b57 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 10 Sep 2024 10:31:44 -0400 +Subject: net: dpaa: Pad packets to ETH_ZLEN + +From: Sean Anderson + +[ Upstream commit cbd7ec083413c6a2e0c326d49e24ec7d12c7a9e0 ] + +When sending packets under 60 bytes, up to three bytes of the buffer +following the data may be leaked. Avoid this by extending all packets to +ETH_ZLEN, ensuring nothing is leaked in the padding. This bug can be +reproduced by running + + $ ping -s 11 destination + +Fixes: 9ad1a3749333 ("dpaa_eth: add support for DPAA Ethernet") +Suggested-by: Eric Dumazet +Signed-off-by: Sean Anderson +Reviewed-by: Eric Dumazet +Link: https://patch.msgid.link/20240910143144.1439910-1-sean.anderson@linux.dev +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +index 00c4beb760c3..1d18556f1767 100644 +--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c ++++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +@@ -2053,12 +2053,12 @@ static netdev_tx_t + dpaa_start_xmit(struct sk_buff *skb, struct net_device *net_dev) + { + const int queue_mapping = skb_get_queue_mapping(skb); +- bool nonlinear = skb_is_nonlinear(skb); + struct rtnl_link_stats64 *percpu_stats; + struct dpaa_percpu_priv *percpu_priv; + struct netdev_queue *txq; + struct dpaa_priv *priv; + struct qm_fd fd; ++ bool nonlinear; + int offset = 0; + int err = 0; + +@@ -2068,6 +2068,13 @@ dpaa_start_xmit(struct sk_buff *skb, struct net_device *net_dev) + + qm_fd_clear_fd(&fd); + ++ /* Packet data is always read as 32-bit words, so zero out any part of ++ * the skb which might be sent if we have to pad the packet ++ */ ++ if (__skb_put_padto(skb, ETH_ZLEN, false)) ++ goto enomem; ++ ++ nonlinear = skb_is_nonlinear(skb); + if (!nonlinear) { + /* We're going to store the skb backpointer at the beginning + * of the data buffer, so we need a privately owned skb +-- +2.43.0 + diff --git a/queue-5.4/net-ftgmac100-enable-tx-interrupt-to-avoid-tx-timeou.patch b/queue-5.4/net-ftgmac100-enable-tx-interrupt-to-avoid-tx-timeou.patch new file mode 100644 index 00000000000..db953647e5e --- /dev/null +++ b/queue-5.4/net-ftgmac100-enable-tx-interrupt-to-avoid-tx-timeou.patch @@ -0,0 +1,69 @@ +From 6b186dc5e0f1f142c468303219f20b41efad7770 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 6 Sep 2024 14:28:31 +0800 +Subject: net: ftgmac100: Enable TX interrupt to avoid TX timeout + +From: Jacky Chou + +[ Upstream commit fef2843bb49f414d1523ca007d088071dee0e055 ] + +Currently, the driver only enables RX interrupt to handle RX +packets and TX resources. Sometimes there is not RX traffic, +so the TX resource needs to wait for RX interrupt to free. +This situation will toggle the TX timeout watchdog when the MAC +TX ring has no more resources to transmit packets. +Therefore, enable TX interrupt to release TX resources at any time. + +When I am verifying iperf3 over UDP, the network hangs. +Like the log below. + +root# iperf3 -c 192.168.100.100 -i1 -t10 -u -b0 +Connecting to host 192.168.100.100, port 5201 +[ 4] local 192.168.100.101 port 35773 connected to 192.168.100.100 port 5201 +[ ID] Interval Transfer Bandwidth Total Datagrams +[ 4] 0.00-20.42 sec 160 KBytes 64.2 Kbits/sec 20 +[ 4] 20.42-20.42 sec 0.00 Bytes 0.00 bits/sec 0 +[ 4] 20.42-20.42 sec 0.00 Bytes 0.00 bits/sec 0 +[ 4] 20.42-20.42 sec 0.00 Bytes 0.00 bits/sec 0 +[ 4] 20.42-20.42 sec 0.00 Bytes 0.00 bits/sec 0 +[ 4] 20.42-20.42 sec 0.00 Bytes 0.00 bits/sec 0 +[ 4] 20.42-20.42 sec 0.00 Bytes 0.00 bits/sec 0 +[ 4] 20.42-20.42 sec 0.00 Bytes 0.00 bits/sec 0 +[ 4] 20.42-20.42 sec 0.00 Bytes 0.00 bits/sec 0 +[ 4] 20.42-20.42 sec 0.00 Bytes 0.00 bits/sec 0 +- - - - - - - - - - - - - - - - - - - - - - - - - +[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams +[ 4] 0.00-20.42 sec 160 KBytes 64.2 Kbits/sec 0.000 ms 0/20 (0%) +[ 4] Sent 20 datagrams +iperf3: error - the server has terminated + +The network topology is FTGMAC connects directly to a PC. +UDP does not need to wait for ACK, unlike TCP. +Therefore, FTGMAC needs to enable TX interrupt to release TX resources instead +of waiting for the RX interrupt. + +Fixes: 10cbd6407609 ("ftgmac100: Rework NAPI & interrupts handling") +Signed-off-by: Jacky Chou +Link: https://patch.msgid.link/20240906062831.2243399-1-jacky_chou@aspeedtech.com +Signed-off-by: Paolo Abeni +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/faraday/ftgmac100.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/faraday/ftgmac100.h b/drivers/net/ethernet/faraday/ftgmac100.h +index 63b3e02fab16..4968f6f0bdbc 100644 +--- a/drivers/net/ethernet/faraday/ftgmac100.h ++++ b/drivers/net/ethernet/faraday/ftgmac100.h +@@ -84,7 +84,7 @@ + FTGMAC100_INT_RPKT_BUF) + + /* All the interrupts we care about */ +-#define FTGMAC100_INT_ALL (FTGMAC100_INT_RPKT_BUF | \ ++#define FTGMAC100_INT_ALL (FTGMAC100_INT_RXTX | \ + FTGMAC100_INT_BAD) + + /* +-- +2.43.0 + diff --git a/queue-5.4/net-mlx5e-add-missing-link-modes-to-ptys2ethtool_map.patch b/queue-5.4/net-mlx5e-add-missing-link-modes-to-ptys2ethtool_map.patch new file mode 100644 index 00000000000..12aecec16f6 --- /dev/null +++ b/queue-5.4/net-mlx5e-add-missing-link-modes-to-ptys2ethtool_map.patch @@ -0,0 +1,40 @@ +From 3ac873f77d254b6de8001a828de07cd6b065c463 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 11 Aug 2024 13:56:13 +0300 +Subject: net/mlx5e: Add missing link modes to ptys2ethtool_map + +From: Shahar Shitrit + +[ Upstream commit 7617d62cba4a8a3ff3ed3fda0171c43f135c142e ] + +Add MLX5E_1000BASE_T and MLX5E_100BASE_TX to the legacy +modes in ptys2legacy_ethtool_table, since they were missing. + +Fixes: 665bc53969d7 ("net/mlx5e: Use new ethtool get/set link ksettings API") +Signed-off-by: Shahar Shitrit +Reviewed-by: Tariq Toukan +Reviewed-by: Carolina Jubran +Signed-off-by: Saeed Mahameed +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +index 10411ab89e1c..abe21929bd5d 100644 +--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +@@ -127,6 +127,10 @@ void mlx5e_build_ptys2ethtool_map(void) + ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT); + MLX5_BUILD_PTYS2ETHTOOL_CONFIG(MLX5E_100GBASE_LR4, legacy, + ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT); ++ MLX5_BUILD_PTYS2ETHTOOL_CONFIG(MLX5E_100BASE_TX, legacy, ++ ETHTOOL_LINK_MODE_100baseT_Full_BIT); ++ MLX5_BUILD_PTYS2ETHTOOL_CONFIG(MLX5E_1000BASE_T, legacy, ++ ETHTOOL_LINK_MODE_1000baseT_Full_BIT); + MLX5_BUILD_PTYS2ETHTOOL_CONFIG(MLX5E_10GBASE_T, legacy, + ETHTOOL_LINK_MODE_10000baseT_Full_BIT); + MLX5_BUILD_PTYS2ETHTOOL_CONFIG(MLX5E_25GBASE_CR, legacy, +-- +2.43.0 + diff --git a/queue-5.4/series b/queue-5.4/series index c7ea90a68f6..1a35b0b8e1f 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -3,3 +3,7 @@ net-ethernet-use-ip_hdrlen-instead-of-bit-shift.patch net-phy-vitesse-repair-vsc73xx-autonegotiation.patch scripts-kconfig-merge_config-config-files-add-a-trai.patch arm64-dts-rockchip-override-bios_disable-signal-via-gpio-hog-on-rk3399-puma.patch +ice-fix-accounting-for-filters-shared-by-multiple-vs.patch +net-mlx5e-add-missing-link-modes-to-ptys2ethtool_map.patch +net-ftgmac100-enable-tx-interrupt-to-avoid-tx-timeou.patch +net-dpaa-pad-packets-to-eth_zlen.patch