From: Sasha Levin Date: Sun, 25 Dec 2022 23:54:30 +0000 (-0500) Subject: Drop net-dpaa2-publish-mac-stringset-to-ethtool-s-even-if.patch X-Git-Tag: v5.15.86~68 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f5ce0dc96cbeab24944c538f35ae35cdd7311cee;p=thirdparty%2Fkernel%2Fstable-queue.git Drop net-dpaa2-publish-mac-stringset-to-ethtool-s-even-if.patch Signed-off-by: Sasha Levin --- diff --git a/queue-5.15/net-dpaa2-publish-mac-stringset-to-ethtool-s-even-if.patch b/queue-5.15/net-dpaa2-publish-mac-stringset-to-ethtool-s-even-if.patch deleted file mode 100644 index f7479fd5870..00000000000 --- a/queue-5.15/net-dpaa2-publish-mac-stringset-to-ethtool-s-even-if.patch +++ /dev/null @@ -1,123 +0,0 @@ -From 56aeb6903aecfae9f65677d2625a15b7d68a56cd Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 29 Nov 2022 16:12:16 +0200 -Subject: net: dpaa2: publish MAC stringset to ethtool -S even if MAC is - missing - -From: Vladimir Oltean - -[ Upstream commit 29811d6e19d795efcf26644b66c4152abbac35a6 ] - -DPNIs and DPSW objects can connect and disconnect at runtime from DPMAC -objects on the same fsl-mc bus. The DPMAC object also holds "ethtool -S" -unstructured counters. Those counters are only shown for the entity -owning the netdev (DPNI, DPSW) if it's connected to a DPMAC. - -The ethtool stringset code path is split into multiple callbacks, but -currently, connecting and disconnecting the DPMAC takes the rtnl_lock(). -This blocks the entire ethtool code path from running, see -ethnl_default_doit() -> rtnl_lock() -> ops->prepare_data() -> -strset_prepare_data(). - -This is going to be a problem if we are going to no longer require -rtnl_lock() when connecting/disconnecting the DPMAC, because the DPMAC -could appear between ops->get_sset_count() and ops->get_strings(). -If it appears out of the blue, we will provide a stringset into an array -that was dimensioned thinking the DPMAC wouldn't be there => array -accessed out of bounds. - -There isn't really a good way to work around that, and I don't want to -put too much pressure on the ethtool framework by playing locking games. -Just make the DPMAC counters be always available. They'll be zeroes if -the DPNI or DPSW isn't connected to a DPMAC. - -Signed-off-by: Vladimir Oltean -Reviewed-by: Andrew Lunn -Reviewed-by: Ioana Ciornei -Tested-by: Ioana Ciornei -Signed-off-by: Paolo Abeni -Signed-off-by: Sasha Levin ---- - drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c | 12 +++--------- - .../ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c | 11 ++--------- - 2 files changed, 5 insertions(+), 18 deletions(-) - -diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c -index 2da5f881f630..714a0a058faf 100644 ---- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c -+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c -@@ -184,7 +184,6 @@ static int dpaa2_eth_set_pauseparam(struct net_device *net_dev, - static void dpaa2_eth_get_strings(struct net_device *netdev, u32 stringset, - u8 *data) - { -- struct dpaa2_eth_priv *priv = netdev_priv(netdev); - u8 *p = data; - int i; - -@@ -198,22 +197,17 @@ static void dpaa2_eth_get_strings(struct net_device *netdev, u32 stringset, - strscpy(p, dpaa2_ethtool_extras[i], ETH_GSTRING_LEN); - p += ETH_GSTRING_LEN; - } -- if (dpaa2_eth_has_mac(priv)) -- dpaa2_mac_get_strings(p); -+ dpaa2_mac_get_strings(p); - break; - } - } - - static int dpaa2_eth_get_sset_count(struct net_device *net_dev, int sset) - { -- int num_ss_stats = DPAA2_ETH_NUM_STATS + DPAA2_ETH_NUM_EXTRA_STATS; -- struct dpaa2_eth_priv *priv = netdev_priv(net_dev); -- - switch (sset) { - case ETH_SS_STATS: /* ethtool_get_stats(), ethtool_get_drvinfo() */ -- if (dpaa2_eth_has_mac(priv)) -- num_ss_stats += dpaa2_mac_get_sset_count(); -- return num_ss_stats; -+ return DPAA2_ETH_NUM_STATS + DPAA2_ETH_NUM_EXTRA_STATS + -+ dpaa2_mac_get_sset_count(); - default: - return -EOPNOTSUPP; - } -diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c -index 720c9230cab5..40ee57ef55be 100644 ---- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c -+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c -@@ -145,14 +145,9 @@ dpaa2_switch_set_link_ksettings(struct net_device *netdev, - static int - dpaa2_switch_ethtool_get_sset_count(struct net_device *netdev, int sset) - { -- struct ethsw_port_priv *port_priv = netdev_priv(netdev); -- int num_ss_stats = DPAA2_SWITCH_NUM_COUNTERS; -- - switch (sset) { - case ETH_SS_STATS: -- if (port_priv->mac) -- num_ss_stats += dpaa2_mac_get_sset_count(); -- return num_ss_stats; -+ return DPAA2_SWITCH_NUM_COUNTERS + dpaa2_mac_get_sset_count(); - default: - return -EOPNOTSUPP; - } -@@ -161,7 +156,6 @@ dpaa2_switch_ethtool_get_sset_count(struct net_device *netdev, int sset) - static void dpaa2_switch_ethtool_get_strings(struct net_device *netdev, - u32 stringset, u8 *data) - { -- struct ethsw_port_priv *port_priv = netdev_priv(netdev); - u8 *p = data; - int i; - -@@ -172,8 +166,7 @@ static void dpaa2_switch_ethtool_get_strings(struct net_device *netdev, - ETH_GSTRING_LEN); - p += ETH_GSTRING_LEN; - } -- if (port_priv->mac) -- dpaa2_mac_get_strings(p); -+ dpaa2_mac_get_strings(p); - break; - } - } --- -2.35.1 - diff --git a/queue-5.15/series b/queue-5.15/series index 34c8f9a4f01..1394e235963 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -668,7 +668,6 @@ blk-mq-fix-possible-memleak-when-register-hctx-faile.patch drm-amd-display-use-the-largest-vready_offset-in-pip.patch libbpf-avoid-enum-forward-declarations-in-public-api.patch regulator-core-fix-use_count-leakage-when-handling-b.patch -net-dpaa2-publish-mac-stringset-to-ethtool-s-even-if.patch wifi-mt76-do-not-run-mt76u_status_worker-if-the-devi.patch mmc-f-sdh30-add-quirks-for-broken-timeout-clock-capa.patch mmc-renesas_sdhi-better-reset-from-hs400-mode.patch diff --git a/queue-6.0/net-dpaa2-publish-mac-stringset-to-ethtool-s-even-if.patch b/queue-6.0/net-dpaa2-publish-mac-stringset-to-ethtool-s-even-if.patch deleted file mode 100644 index 166be960197..00000000000 --- a/queue-6.0/net-dpaa2-publish-mac-stringset-to-ethtool-s-even-if.patch +++ /dev/null @@ -1,123 +0,0 @@ -From 003c7169a3d7ed7ba3c30bcf0c5e578634eea1c5 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 29 Nov 2022 16:12:16 +0200 -Subject: net: dpaa2: publish MAC stringset to ethtool -S even if MAC is - missing - -From: Vladimir Oltean - -[ Upstream commit 29811d6e19d795efcf26644b66c4152abbac35a6 ] - -DPNIs and DPSW objects can connect and disconnect at runtime from DPMAC -objects on the same fsl-mc bus. The DPMAC object also holds "ethtool -S" -unstructured counters. Those counters are only shown for the entity -owning the netdev (DPNI, DPSW) if it's connected to a DPMAC. - -The ethtool stringset code path is split into multiple callbacks, but -currently, connecting and disconnecting the DPMAC takes the rtnl_lock(). -This blocks the entire ethtool code path from running, see -ethnl_default_doit() -> rtnl_lock() -> ops->prepare_data() -> -strset_prepare_data(). - -This is going to be a problem if we are going to no longer require -rtnl_lock() when connecting/disconnecting the DPMAC, because the DPMAC -could appear between ops->get_sset_count() and ops->get_strings(). -If it appears out of the blue, we will provide a stringset into an array -that was dimensioned thinking the DPMAC wouldn't be there => array -accessed out of bounds. - -There isn't really a good way to work around that, and I don't want to -put too much pressure on the ethtool framework by playing locking games. -Just make the DPMAC counters be always available. They'll be zeroes if -the DPNI or DPSW isn't connected to a DPMAC. - -Signed-off-by: Vladimir Oltean -Reviewed-by: Andrew Lunn -Reviewed-by: Ioana Ciornei -Tested-by: Ioana Ciornei -Signed-off-by: Paolo Abeni -Signed-off-by: Sasha Levin ---- - drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c | 12 +++--------- - .../ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c | 11 ++--------- - 2 files changed, 5 insertions(+), 18 deletions(-) - -diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c -index eea7d7a07c00..8381cbdb9461 100644 ---- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c -+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c -@@ -186,7 +186,6 @@ static int dpaa2_eth_set_pauseparam(struct net_device *net_dev, - static void dpaa2_eth_get_strings(struct net_device *netdev, u32 stringset, - u8 *data) - { -- struct dpaa2_eth_priv *priv = netdev_priv(netdev); - u8 *p = data; - int i; - -@@ -200,22 +199,17 @@ static void dpaa2_eth_get_strings(struct net_device *netdev, u32 stringset, - strscpy(p, dpaa2_ethtool_extras[i], ETH_GSTRING_LEN); - p += ETH_GSTRING_LEN; - } -- if (dpaa2_eth_has_mac(priv)) -- dpaa2_mac_get_strings(p); -+ dpaa2_mac_get_strings(p); - break; - } - } - - static int dpaa2_eth_get_sset_count(struct net_device *net_dev, int sset) - { -- int num_ss_stats = DPAA2_ETH_NUM_STATS + DPAA2_ETH_NUM_EXTRA_STATS; -- struct dpaa2_eth_priv *priv = netdev_priv(net_dev); -- - switch (sset) { - case ETH_SS_STATS: /* ethtool_get_stats(), ethtool_get_drvinfo() */ -- if (dpaa2_eth_has_mac(priv)) -- num_ss_stats += dpaa2_mac_get_sset_count(); -- return num_ss_stats; -+ return DPAA2_ETH_NUM_STATS + DPAA2_ETH_NUM_EXTRA_STATS + -+ dpaa2_mac_get_sset_count(); - default: - return -EOPNOTSUPP; - } -diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c -index 720c9230cab5..40ee57ef55be 100644 ---- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c -+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c -@@ -145,14 +145,9 @@ dpaa2_switch_set_link_ksettings(struct net_device *netdev, - static int - dpaa2_switch_ethtool_get_sset_count(struct net_device *netdev, int sset) - { -- struct ethsw_port_priv *port_priv = netdev_priv(netdev); -- int num_ss_stats = DPAA2_SWITCH_NUM_COUNTERS; -- - switch (sset) { - case ETH_SS_STATS: -- if (port_priv->mac) -- num_ss_stats += dpaa2_mac_get_sset_count(); -- return num_ss_stats; -+ return DPAA2_SWITCH_NUM_COUNTERS + dpaa2_mac_get_sset_count(); - default: - return -EOPNOTSUPP; - } -@@ -161,7 +156,6 @@ dpaa2_switch_ethtool_get_sset_count(struct net_device *netdev, int sset) - static void dpaa2_switch_ethtool_get_strings(struct net_device *netdev, - u32 stringset, u8 *data) - { -- struct ethsw_port_priv *port_priv = netdev_priv(netdev); - u8 *p = data; - int i; - -@@ -172,8 +166,7 @@ static void dpaa2_switch_ethtool_get_strings(struct net_device *netdev, - ETH_GSTRING_LEN); - p += ETH_GSTRING_LEN; - } -- if (port_priv->mac) -- dpaa2_mac_get_strings(p); -+ dpaa2_mac_get_strings(p); - break; - } - } --- -2.35.1 - diff --git a/queue-6.0/series b/queue-6.0/series index 828319ded23..d7e565e8e88 100644 --- a/queue-6.0/series +++ b/queue-6.0/series @@ -963,7 +963,6 @@ drm-amd-display-fix-dtbclk-disable-requests-and-src_.patch asoc-amd-yc-add-xiaomi-redmi-book-pro-14-2022-into-d.patch libbpf-avoid-enum-forward-declarations-in-public-api.patch regulator-core-fix-use_count-leakage-when-handling-b.patch -net-dpaa2-publish-mac-stringset-to-ethtool-s-even-if.patch wifi-mt76-do-not-run-mt76u_status_worker-if-the-devi.patch hwmon-nct6775-add-asus-crosshair-viii-tuf-proart-b55.patch selftests-bpf-fix-conflicts-with-built-in-functions-.patch diff --git a/queue-6.1/net-dpaa2-publish-mac-stringset-to-ethtool-s-even-if.patch b/queue-6.1/net-dpaa2-publish-mac-stringset-to-ethtool-s-even-if.patch deleted file mode 100644 index 7480902f3ce..00000000000 --- a/queue-6.1/net-dpaa2-publish-mac-stringset-to-ethtool-s-even-if.patch +++ /dev/null @@ -1,123 +0,0 @@ -From 98ba8964c54e8d96a72de719377fc265b417fa6c Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 29 Nov 2022 16:12:16 +0200 -Subject: net: dpaa2: publish MAC stringset to ethtool -S even if MAC is - missing - -From: Vladimir Oltean - -[ Upstream commit 29811d6e19d795efcf26644b66c4152abbac35a6 ] - -DPNIs and DPSW objects can connect and disconnect at runtime from DPMAC -objects on the same fsl-mc bus. The DPMAC object also holds "ethtool -S" -unstructured counters. Those counters are only shown for the entity -owning the netdev (DPNI, DPSW) if it's connected to a DPMAC. - -The ethtool stringset code path is split into multiple callbacks, but -currently, connecting and disconnecting the DPMAC takes the rtnl_lock(). -This blocks the entire ethtool code path from running, see -ethnl_default_doit() -> rtnl_lock() -> ops->prepare_data() -> -strset_prepare_data(). - -This is going to be a problem if we are going to no longer require -rtnl_lock() when connecting/disconnecting the DPMAC, because the DPMAC -could appear between ops->get_sset_count() and ops->get_strings(). -If it appears out of the blue, we will provide a stringset into an array -that was dimensioned thinking the DPMAC wouldn't be there => array -accessed out of bounds. - -There isn't really a good way to work around that, and I don't want to -put too much pressure on the ethtool framework by playing locking games. -Just make the DPMAC counters be always available. They'll be zeroes if -the DPNI or DPSW isn't connected to a DPMAC. - -Signed-off-by: Vladimir Oltean -Reviewed-by: Andrew Lunn -Reviewed-by: Ioana Ciornei -Tested-by: Ioana Ciornei -Signed-off-by: Paolo Abeni -Signed-off-by: Sasha Levin ---- - drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c | 12 +++--------- - .../ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c | 11 ++--------- - 2 files changed, 5 insertions(+), 18 deletions(-) - -diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c -index eea7d7a07c00..8381cbdb9461 100644 ---- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c -+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c -@@ -186,7 +186,6 @@ static int dpaa2_eth_set_pauseparam(struct net_device *net_dev, - static void dpaa2_eth_get_strings(struct net_device *netdev, u32 stringset, - u8 *data) - { -- struct dpaa2_eth_priv *priv = netdev_priv(netdev); - u8 *p = data; - int i; - -@@ -200,22 +199,17 @@ static void dpaa2_eth_get_strings(struct net_device *netdev, u32 stringset, - strscpy(p, dpaa2_ethtool_extras[i], ETH_GSTRING_LEN); - p += ETH_GSTRING_LEN; - } -- if (dpaa2_eth_has_mac(priv)) -- dpaa2_mac_get_strings(p); -+ dpaa2_mac_get_strings(p); - break; - } - } - - static int dpaa2_eth_get_sset_count(struct net_device *net_dev, int sset) - { -- int num_ss_stats = DPAA2_ETH_NUM_STATS + DPAA2_ETH_NUM_EXTRA_STATS; -- struct dpaa2_eth_priv *priv = netdev_priv(net_dev); -- - switch (sset) { - case ETH_SS_STATS: /* ethtool_get_stats(), ethtool_get_drvinfo() */ -- if (dpaa2_eth_has_mac(priv)) -- num_ss_stats += dpaa2_mac_get_sset_count(); -- return num_ss_stats; -+ return DPAA2_ETH_NUM_STATS + DPAA2_ETH_NUM_EXTRA_STATS + -+ dpaa2_mac_get_sset_count(); - default: - return -EOPNOTSUPP; - } -diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c -index 720c9230cab5..40ee57ef55be 100644 ---- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c -+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c -@@ -145,14 +145,9 @@ dpaa2_switch_set_link_ksettings(struct net_device *netdev, - static int - dpaa2_switch_ethtool_get_sset_count(struct net_device *netdev, int sset) - { -- struct ethsw_port_priv *port_priv = netdev_priv(netdev); -- int num_ss_stats = DPAA2_SWITCH_NUM_COUNTERS; -- - switch (sset) { - case ETH_SS_STATS: -- if (port_priv->mac) -- num_ss_stats += dpaa2_mac_get_sset_count(); -- return num_ss_stats; -+ return DPAA2_SWITCH_NUM_COUNTERS + dpaa2_mac_get_sset_count(); - default: - return -EOPNOTSUPP; - } -@@ -161,7 +156,6 @@ dpaa2_switch_ethtool_get_sset_count(struct net_device *netdev, int sset) - static void dpaa2_switch_ethtool_get_strings(struct net_device *netdev, - u32 stringset, u8 *data) - { -- struct ethsw_port_priv *port_priv = netdev_priv(netdev); - u8 *p = data; - int i; - -@@ -172,8 +166,7 @@ static void dpaa2_switch_ethtool_get_strings(struct net_device *netdev, - ETH_GSTRING_LEN); - p += ETH_GSTRING_LEN; - } -- if (port_priv->mac) -- dpaa2_mac_get_strings(p); -+ dpaa2_mac_get_strings(p); - break; - } - } --- -2.35.1 - diff --git a/queue-6.1/series b/queue-6.1/series index 94342595323..a66d40ff77f 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -1034,7 +1034,6 @@ drm-amd-display-fix-dtbclk-disable-requests-and-src_.patch asoc-amd-yc-add-xiaomi-redmi-book-pro-14-2022-into-d.patch libbpf-avoid-enum-forward-declarations-in-public-api.patch regulator-core-fix-use_count-leakage-when-handling-b.patch -net-dpaa2-publish-mac-stringset-to-ethtool-s-even-if.patch wifi-mt76-do-not-run-mt76u_status_worker-if-the-devi.patch hwmon-nct6775-add-asus-crosshair-viii-tuf-proart-b55.patch selftests-bpf-fix-conflicts-with-built-in-functions-.patch