Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 0/7] r8169: mark device as detached in PCI D3 and improve locking
From: Heiner Kallweit @ 2020-06-20 20:33 UTC (permalink / raw)
  To: David Miller, Realtek linux nic maintainers, Jakub Kicinski
  Cc: netdev@vger.kernel.org

Mark the netdevice as detached whenever parent is in PCI D3hot and not
accessible. This mainly applies to runtime-suspend state.
In addition take RTNL lock in suspend calls, this allows to remove
the driver-specific mutex and improve PM callbacks in general.

Heiner Kallweit (7):
  net: core: try to runtime-resume detached device in __dev_open
  r8169: mark device as not present when in PCI D3
  r8169: remove no longer needed checks for device being runtime-active
  r8169: add rtl8169_up
  r8169: use RTNL to protect critical sections
  r8169: remove driver-specific mutex
  r8169: improve rtl8169_runtime_resume

 drivers/net/ethernet/realtek/r8169_main.c | 181 +++++-----------------
 net/core/dev.c                            |  10 +-
 2 files changed, 49 insertions(+), 142 deletions(-)

-- 
2.27.0


^ permalink raw reply

* [PATCH net-next 1/7] net: core: try to runtime-resume detached device in __dev_open
From: Heiner Kallweit @ 2020-06-20 20:35 UTC (permalink / raw)
  To: David Miller, Realtek linux nic maintainers, Jakub Kicinski
  Cc: netdev@vger.kernel.org
In-Reply-To: <2e68df85-4f64-d45b-3c4c-bb8cb9a4411d@gmail.com>

A netdevice may be marked as detached because the parent is
runtime-suspended and not accessible whilst interface or link is down.
An example are PCI network devices that go into PCI D3hot, see e.g.
__igc_shutdown() or rtl8169_net_suspend().
If netdevice is down and marked as detached we can only open it if
we runtime-resume it before __dev_open() calls netif_device_present().

Therefore, if netdevice is detached, try to runtime-resume the parent
and only return with an error if it's still detached.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 net/core/dev.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 6bc238814..ffa8c371d 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -143,6 +143,7 @@
 #include <linux/net_namespace.h>
 #include <linux/indirect_call_wrapper.h>
 #include <net/devlink.h>
+#include <linux/pm_runtime.h>
 
 #include "net-sysfs.h"
 
@@ -1492,8 +1493,13 @@ static int __dev_open(struct net_device *dev, struct netlink_ext_ack *extack)
 
 	ASSERT_RTNL();
 
-	if (!netif_device_present(dev))
-		return -ENODEV;
+	if (!netif_device_present(dev)) {
+		/* may be detached because parent is runtime-suspended */
+		if (dev->dev.parent)
+			pm_runtime_resume(dev->dev.parent);
+		if (!netif_device_present(dev))
+			return -ENODEV;
+	}
 
 	/* Block netpoll from trying to do any rx path servicing.
 	 * If we don't do this there is a chance ndo_poll_controller
-- 
2.27.0



^ permalink raw reply related

* [PATCH net-next 2/7] r8169: mark device as not present when in PCI D3
From: Heiner Kallweit @ 2020-06-20 20:36 UTC (permalink / raw)
  To: David Miller, Realtek linux nic maintainers, Jakub Kicinski
  Cc: netdev@vger.kernel.org
In-Reply-To: <2e68df85-4f64-d45b-3c4c-bb8cb9a4411d@gmail.com>

Mark the netdevice as detached whenever we go into PCI D3hot.
This allows to remove some checks e.g. from ethtool ops because
dev_ethtool() checks for netif_device_present() in the beginning.

In this context move waking up the queue out of rtl_reset_work()
because in cases where netif_device_attach() is called afterwards
the queue should be woken up by the latter function only.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/ethernet/realtek/r8169_main.c | 25 +++++++++++++----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 98391797b..91e3ada64 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -3980,10 +3980,9 @@ static void rtl8169_cleanup(struct rtl8169_private *tp, bool going_down)
 
 static void rtl_reset_work(struct rtl8169_private *tp)
 {
-	struct net_device *dev = tp->dev;
 	int i;
 
-	netif_stop_queue(dev);
+	netif_stop_queue(tp->dev);
 
 	rtl8169_cleanup(tp, false);
 
@@ -3992,7 +3991,6 @@ static void rtl_reset_work(struct rtl8169_private *tp)
 
 	napi_enable(&tp->napi);
 	rtl_hw_start(tp);
-	netif_wake_queue(dev);
 }
 
 static void rtl8169_tx_timeout(struct net_device *dev, unsigned int txqueue)
@@ -4577,8 +4575,10 @@ static void rtl_task(struct work_struct *work)
 	    !test_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags))
 		goto out_unlock;
 
-	if (test_and_clear_bit(RTL_FLAG_TASK_RESET_PENDING, tp->wk.flags))
+	if (test_and_clear_bit(RTL_FLAG_TASK_RESET_PENDING, tp->wk.flags)) {
 		rtl_reset_work(tp);
+		netif_wake_queue(tp->dev);
+	}
 out_unlock:
 	rtl_unlock_work(tp);
 }
@@ -4823,11 +4823,10 @@ rtl8169_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
 
 static void rtl8169_net_suspend(struct rtl8169_private *tp)
 {
-	if (!netif_running(tp->dev))
-		return;
-
 	netif_device_detach(tp->dev);
-	rtl8169_down(tp);
+
+	if (netif_running(tp->dev))
+		rtl8169_down(tp);
 }
 
 #ifdef CONFIG_PM
@@ -4843,8 +4842,6 @@ static int __maybe_unused rtl8169_suspend(struct device *device)
 
 static void __rtl8169_resume(struct rtl8169_private *tp)
 {
-	netif_device_attach(tp->dev);
-
 	rtl_pll_power_up(tp);
 	rtl8169_init_phy(tp);
 
@@ -4866,6 +4863,8 @@ static int __maybe_unused rtl8169_resume(struct device *device)
 	if (netif_running(tp->dev))
 		__rtl8169_resume(tp);
 
+	netif_device_attach(tp->dev);
+
 	return 0;
 }
 
@@ -4873,8 +4872,10 @@ static int rtl8169_runtime_suspend(struct device *device)
 {
 	struct rtl8169_private *tp = dev_get_drvdata(device);
 
-	if (!tp->TxDescArray)
+	if (!tp->TxDescArray) {
+		netif_device_detach(tp->dev);
 		return 0;
+	}
 
 	rtl_lock_work(tp);
 	__rtl8169_set_wol(tp, WAKE_PHY);
@@ -4898,6 +4899,8 @@ static int rtl8169_runtime_resume(struct device *device)
 	if (tp->TxDescArray)
 		__rtl8169_resume(tp);
 
+	netif_device_attach(tp->dev);
+
 	return 0;
 }
 
-- 
2.27.0



^ permalink raw reply related

* [PATCH net-next 4/7] r8169: add rtl8169_up
From: Heiner Kallweit @ 2020-06-20 20:37 UTC (permalink / raw)
  To: David Miller, Realtek linux nic maintainers, Jakub Kicinski
  Cc: netdev@vger.kernel.org
In-Reply-To: <2e68df85-4f64-d45b-3c4c-bb8cb9a4411d@gmail.com>

Factor out bringing device up to a new function rtl8169_up(), similar
to rtl8169_down() for bringing the device down.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/ethernet/realtek/r8169_main.c | 48 ++++++++---------------
 1 file changed, 16 insertions(+), 32 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index c8e0f2bb5..2414df29c 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4616,6 +4616,19 @@ static void rtl8169_down(struct rtl8169_private *tp)
 	rtl_unlock_work(tp);
 }
 
+static void rtl8169_up(struct rtl8169_private *tp)
+{
+	rtl_lock_work(tp);
+	rtl_pll_power_up(tp);
+	rtl8169_init_phy(tp);
+	napi_enable(&tp->napi);
+	set_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);
+	rtl_reset_work(tp);
+
+	phy_start(tp->phydev);
+	rtl_unlock_work(tp);
+}
+
 static int rtl8169_close(struct net_device *dev)
 {
 	struct rtl8169_private *tp = netdev_priv(dev);
@@ -4691,25 +4704,10 @@ static int rtl_open(struct net_device *dev)
 	if (retval)
 		goto err_free_irq;
 
-	rtl_lock_work(tp);
-
-	set_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);
-
-	napi_enable(&tp->napi);
-
-	rtl8169_init_phy(tp);
-
-	rtl_pll_power_up(tp);
-
-	rtl_hw_start(tp);
-
+	rtl8169_up(tp);
 	rtl8169_init_counter_offsets(tp);
-
-	phy_start(tp->phydev);
 	netif_start_queue(dev);
 
-	rtl_unlock_work(tp);
-
 	pm_runtime_put_sync(&pdev->dev);
 out:
 	return retval;
@@ -4798,20 +4796,6 @@ static int __maybe_unused rtl8169_suspend(struct device *device)
 	return 0;
 }
 
-static void __rtl8169_resume(struct rtl8169_private *tp)
-{
-	rtl_pll_power_up(tp);
-	rtl8169_init_phy(tp);
-
-	phy_start(tp->phydev);
-
-	rtl_lock_work(tp);
-	napi_enable(&tp->napi);
-	set_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);
-	rtl_reset_work(tp);
-	rtl_unlock_work(tp);
-}
-
 static int __maybe_unused rtl8169_resume(struct device *device)
 {
 	struct rtl8169_private *tp = dev_get_drvdata(device);
@@ -4819,7 +4803,7 @@ static int __maybe_unused rtl8169_resume(struct device *device)
 	rtl_rar_set(tp, tp->dev->dev_addr);
 
 	if (netif_running(tp->dev))
-		__rtl8169_resume(tp);
+		rtl8169_up(tp);
 
 	netif_device_attach(tp->dev);
 
@@ -4855,7 +4839,7 @@ static int rtl8169_runtime_resume(struct device *device)
 	rtl_unlock_work(tp);
 
 	if (tp->TxDescArray)
-		__rtl8169_resume(tp);
+		rtl8169_up(tp);
 
 	netif_device_attach(tp->dev);
 
-- 
2.27.0



^ permalink raw reply related

* [PATCH net-next 3/7] r8169: remove no longer needed checks for device being runtime-active
From: Heiner Kallweit @ 2020-06-20 20:37 UTC (permalink / raw)
  To: David Miller, Realtek linux nic maintainers, Jakub Kicinski
  Cc: netdev@vger.kernel.org
In-Reply-To: <2e68df85-4f64-d45b-3c4c-bb8cb9a4411d@gmail.com>

Because the netdevice is marked as detached now when parent is not
accessible we can remove quite some checks.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/ethernet/realtek/r8169_main.c | 54 +++--------------------
 1 file changed, 6 insertions(+), 48 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 91e3ada64..c8e0f2bb5 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -1422,24 +1422,17 @@ static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts)
 static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 {
 	struct rtl8169_private *tp = netdev_priv(dev);
-	struct device *d = tp_to_dev(tp);
 
 	if (wol->wolopts & ~WAKE_ANY)
 		return -EINVAL;
 
-	pm_runtime_get_noresume(d);
-
 	rtl_lock_work(tp);
 
 	tp->saved_wolopts = wol->wolopts;
-
-	if (pm_runtime_active(d))
-		__rtl8169_set_wol(tp, tp->saved_wolopts);
+	__rtl8169_set_wol(tp, tp->saved_wolopts);
 
 	rtl_unlock_work(tp);
 
-	pm_runtime_put_noidle(d);
-
 	return 0;
 }
 
@@ -1657,17 +1650,10 @@ static void rtl8169_get_ethtool_stats(struct net_device *dev,
 				      struct ethtool_stats *stats, u64 *data)
 {
 	struct rtl8169_private *tp = netdev_priv(dev);
-	struct device *d = tp_to_dev(tp);
-	struct rtl8169_counters *counters = tp->counters;
-
-	ASSERT_RTNL();
-
-	pm_runtime_get_noresume(d);
-
-	if (pm_runtime_active(d))
-		rtl8169_update_counters(tp);
+	struct rtl8169_counters *counters;
 
-	pm_runtime_put_noidle(d);
+	counters = tp->counters;
+	rtl8169_update_counters(tp);
 
 	data[0] = le64_to_cpu(counters->tx_packets);
 	data[1] = le64_to_cpu(counters->rx_packets);
@@ -1899,48 +1885,26 @@ static int rtl_set_coalesce(struct net_device *dev, struct ethtool_coalesce *ec)
 static int rtl8169_get_eee(struct net_device *dev, struct ethtool_eee *data)
 {
 	struct rtl8169_private *tp = netdev_priv(dev);
-	struct device *d = tp_to_dev(tp);
-	int ret;
 
 	if (!rtl_supports_eee(tp))
 		return -EOPNOTSUPP;
 
-	pm_runtime_get_noresume(d);
-
-	if (!pm_runtime_active(d)) {
-		ret = -EOPNOTSUPP;
-	} else {
-		ret = phy_ethtool_get_eee(tp->phydev, data);
-	}
-
-	pm_runtime_put_noidle(d);
-
-	return ret;
+	return phy_ethtool_get_eee(tp->phydev, data);
 }
 
 static int rtl8169_set_eee(struct net_device *dev, struct ethtool_eee *data)
 {
 	struct rtl8169_private *tp = netdev_priv(dev);
-	struct device *d = tp_to_dev(tp);
 	int ret;
 
 	if (!rtl_supports_eee(tp))
 		return -EOPNOTSUPP;
 
-	pm_runtime_get_noresume(d);
-
-	if (!pm_runtime_active(d)) {
-		ret = -EOPNOTSUPP;
-		goto out;
-	}
-
 	ret = phy_ethtool_set_eee(tp->phydev, data);
 
 	if (!ret)
 		tp->eee_adv = phy_read_mmd(dev->phydev, MDIO_MMD_AN,
 					   MDIO_AN_EEE_ADV);
-out:
-	pm_runtime_put_noidle(d);
 	return ret;
 }
 
@@ -2222,19 +2186,13 @@ static void rtl_rar_set(struct rtl8169_private *tp, u8 *addr)
 static int rtl_set_mac_address(struct net_device *dev, void *p)
 {
 	struct rtl8169_private *tp = netdev_priv(dev);
-	struct device *d = tp_to_dev(tp);
 	int ret;
 
 	ret = eth_mac_addr(dev, p);
 	if (ret)
 		return ret;
 
-	pm_runtime_get_noresume(d);
-
-	if (pm_runtime_active(d))
-		rtl_rar_set(tp, dev->dev_addr);
-
-	pm_runtime_put_noidle(d);
+	rtl_rar_set(tp, dev->dev_addr);
 
 	return 0;
 }
-- 
2.27.0



^ permalink raw reply related

* [PATCH net-next 6/7] r8169: remove driver-specific mutex
From: Heiner Kallweit @ 2020-06-20 20:38 UTC (permalink / raw)
  To: David Miller, Realtek linux nic maintainers, Jakub Kicinski
  Cc: netdev@vger.kernel.org
In-Reply-To: <2e68df85-4f64-d45b-3c4c-bb8cb9a4411d@gmail.com>

Now that the critical sections are protected with RTNL lock, we don't
need a separate mutex any longer.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/ethernet/realtek/r8169_main.c | 45 -----------------------
 1 file changed, 45 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index e70797311..e09732c9d 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -611,7 +611,6 @@ struct rtl8169_private {
 
 	struct {
 		DECLARE_BITMAP(flags, RTL_FLAG_MAX);
-		struct mutex mutex;
 		struct work_struct work;
 	} wk;
 
@@ -663,16 +662,6 @@ static inline struct device *tp_to_dev(struct rtl8169_private *tp)
 	return &tp->pci_dev->dev;
 }
 
-static void rtl_lock_work(struct rtl8169_private *tp)
-{
-	mutex_lock(&tp->wk.mutex);
-}
-
-static void rtl_unlock_work(struct rtl8169_private *tp)
-{
-	mutex_unlock(&tp->wk.mutex);
-}
-
 static void rtl_lock_config_regs(struct rtl8169_private *tp)
 {
 	RTL_W8(tp, Cfg9346, Cfg9346_Lock);
@@ -1348,10 +1337,8 @@ static void rtl8169_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 {
 	struct rtl8169_private *tp = netdev_priv(dev);
 
-	rtl_lock_work(tp);
 	wol->supported = WAKE_ANY;
 	wol->wolopts = tp->saved_wolopts;
-	rtl_unlock_work(tp);
 }
 
 static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts)
@@ -1426,13 +1413,9 @@ static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 	if (wol->wolopts & ~WAKE_ANY)
 		return -EINVAL;
 
-	rtl_lock_work(tp);
-
 	tp->saved_wolopts = wol->wolopts;
 	__rtl8169_set_wol(tp, tp->saved_wolopts);
 
-	rtl_unlock_work(tp);
-
 	return 0;
 }
 
@@ -1495,8 +1478,6 @@ static int rtl8169_set_features(struct net_device *dev,
 {
 	struct rtl8169_private *tp = netdev_priv(dev);
 
-	rtl_lock_work(tp);
-
 	rtl_set_rx_config_features(tp, features);
 
 	if (features & NETIF_F_RXCSUM)
@@ -1514,8 +1495,6 @@ static int rtl8169_set_features(struct net_device *dev,
 	RTL_W16(tp, CPlusCmd, tp->cp_cmd);
 	rtl_pci_commit(tp);
 
-	rtl_unlock_work(tp);
-
 	return 0;
 }
 
@@ -1541,10 +1520,8 @@ static void rtl8169_get_regs(struct net_device *dev, struct ethtool_regs *regs,
 	u32 *dw = p;
 	int i;
 
-	rtl_lock_work(tp);
 	for (i = 0; i < R8169_REGS_SIZE; i += 4)
 		memcpy_fromio(dw++, data++, 4);
-	rtl_unlock_work(tp);
 }
 
 static const char rtl8169_gstrings[][ETH_GSTRING_LEN] = {
@@ -1860,8 +1837,6 @@ static int rtl_set_coalesce(struct net_device *dev, struct ethtool_coalesce *ec)
 	units = DIV_ROUND_UP(ec->rx_coalesce_usecs * 1000U, scale);
 	w |= FIELD_PREP(RTL_COALESCE_RX_USECS, units);
 
-	rtl_lock_work(tp);
-
 	RTL_W16(tp, IntrMitigate, w);
 
 	/* Meaning of PktCntrDisable bit changed from RTL8168e-vl */
@@ -1877,8 +1852,6 @@ static int rtl_set_coalesce(struct net_device *dev, struct ethtool_coalesce *ec)
 	RTL_W16(tp, CPlusCmd, tp->cp_cmd);
 	rtl_pci_commit(tp);
 
-	rtl_unlock_work(tp);
-
 	return 0;
 }
 
@@ -2165,8 +2138,6 @@ static void rtl8169_init_phy(struct rtl8169_private *tp)
 
 static void rtl_rar_set(struct rtl8169_private *tp, u8 *addr)
 {
-	rtl_lock_work(tp);
-
 	rtl_unlock_config_regs(tp);
 
 	RTL_W32(tp, MAC4, addr[4] | addr[5] << 8);
@@ -2179,8 +2150,6 @@ static void rtl_rar_set(struct rtl8169_private *tp, u8 *addr)
 		rtl_rar_exgmac_set(tp, addr);
 
 	rtl_lock_config_regs(tp);
-
-	rtl_unlock_work(tp);
 }
 
 static int rtl_set_mac_address(struct net_device *dev, void *p)
@@ -4528,7 +4497,6 @@ static void rtl_task(struct work_struct *work)
 		container_of(work, struct rtl8169_private, wk.work);
 
 	rtnl_lock();
-	rtl_lock_work(tp);
 
 	if (!netif_running(tp->dev) ||
 	    !test_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags))
@@ -4539,7 +4507,6 @@ static void rtl_task(struct work_struct *work)
 		netif_wake_queue(tp->dev);
 	}
 out_unlock:
-	rtl_unlock_work(tp);
 	rtnl_unlock();
 }
 
@@ -4602,8 +4569,6 @@ static int r8169_phy_connect(struct rtl8169_private *tp)
 
 static void rtl8169_down(struct rtl8169_private *tp)
 {
-	rtl_lock_work(tp);
-
 	/* Clear all task flags */
 	bitmap_zero(tp->wk.flags, RTL_FLAG_MAX);
 
@@ -4614,13 +4579,10 @@ static void rtl8169_down(struct rtl8169_private *tp)
 	rtl8169_cleanup(tp, true);
 
 	rtl_pll_power_down(tp);
-
-	rtl_unlock_work(tp);
 }
 
 static void rtl8169_up(struct rtl8169_private *tp)
 {
-	rtl_lock_work(tp);
 	rtl_pll_power_up(tp);
 	rtl8169_init_phy(tp);
 	napi_enable(&tp->napi);
@@ -4628,7 +4590,6 @@ static void rtl8169_up(struct rtl8169_private *tp)
 	rtl_reset_work(tp);
 
 	phy_start(tp->phydev);
-	rtl_unlock_work(tp);
 }
 
 static int rtl8169_close(struct net_device *dev)
@@ -4824,10 +4785,7 @@ static int rtl8169_runtime_suspend(struct device *device)
 	}
 
 	rtnl_lock();
-	rtl_lock_work(tp);
 	__rtl8169_set_wol(tp, WAKE_PHY);
-	rtl_unlock_work(tp);
-
 	rtl8169_net_suspend(tp);
 	rtnl_unlock();
 
@@ -4840,9 +4798,7 @@ static int rtl8169_runtime_resume(struct device *device)
 
 	rtl_rar_set(tp, tp->dev->dev_addr);
 
-	rtl_lock_work(tp);
 	__rtl8169_set_wol(tp, tp->saved_wolopts);
-	rtl_unlock_work(tp);
 
 	if (tp->TxDescArray)
 		rtl8169_up(tp);
@@ -5299,7 +5255,6 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 		return rc;
 	}
 
-	mutex_init(&tp->wk.mutex);
 	INIT_WORK(&tp->wk.work, rtl_task);
 	u64_stats_init(&tp->rx_stats.syncp);
 	u64_stats_init(&tp->tx_stats.syncp);
-- 
2.27.0



^ permalink raw reply related

* [PATCH net-next 7/7] r8169: improve rtl8169_runtime_resume
From: Heiner Kallweit @ 2020-06-20 20:39 UTC (permalink / raw)
  To: David Miller, Realtek linux nic maintainers, Jakub Kicinski
  Cc: netdev@vger.kernel.org
In-Reply-To: <2e68df85-4f64-d45b-3c4c-bb8cb9a4411d@gmail.com>

Simplify rtl8169_runtime_resume() by calling rtl8169_resume().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/ethernet/realtek/r8169_main.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index e09732c9d..247fad1c6 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4761,13 +4761,13 @@ static int __maybe_unused rtl8169_suspend(struct device *device)
 	return 0;
 }
 
-static int __maybe_unused rtl8169_resume(struct device *device)
+static int rtl8169_resume(struct device *device)
 {
 	struct rtl8169_private *tp = dev_get_drvdata(device);
 
 	rtl_rar_set(tp, tp->dev->dev_addr);
 
-	if (netif_running(tp->dev))
+	if (tp->TxDescArray)
 		rtl8169_up(tp);
 
 	netif_device_attach(tp->dev);
@@ -4796,16 +4796,9 @@ static int rtl8169_runtime_resume(struct device *device)
 {
 	struct rtl8169_private *tp = dev_get_drvdata(device);
 
-	rtl_rar_set(tp, tp->dev->dev_addr);
-
 	__rtl8169_set_wol(tp, tp->saved_wolopts);
 
-	if (tp->TxDescArray)
-		rtl8169_up(tp);
-
-	netif_device_attach(tp->dev);
-
-	return 0;
+	return rtl8169_resume(device);
 }
 
 static int rtl8169_runtime_idle(struct device *device)
-- 
2.27.0



^ permalink raw reply related

* [PATCH net-next 5/7] r8169: use RTNL to protect critical sections
From: Heiner Kallweit @ 2020-06-20 20:38 UTC (permalink / raw)
  To: David Miller, Realtek linux nic maintainers, Jakub Kicinski
  Cc: netdev@vger.kernel.org
In-Reply-To: <2e68df85-4f64-d45b-3c4c-bb8cb9a4411d@gmail.com>

Most relevant ops (open, close, ethtool ops) are protected with RTNL
lock by net core. Make sure that such ops can't be interrupted by
e.g. (runtime-)suspending by taking the RTNL lock in suspend ops
and the PCI error handler.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/ethernet/realtek/r8169_main.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 2414df29c..e70797311 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4527,6 +4527,7 @@ static void rtl_task(struct work_struct *work)
 	struct rtl8169_private *tp =
 		container_of(work, struct rtl8169_private, wk.work);
 
+	rtnl_lock();
 	rtl_lock_work(tp);
 
 	if (!netif_running(tp->dev) ||
@@ -4539,6 +4540,7 @@ static void rtl_task(struct work_struct *work)
 	}
 out_unlock:
 	rtl_unlock_work(tp);
+	rtnl_unlock();
 }
 
 static int rtl8169_poll(struct napi_struct *napi, int budget)
@@ -4791,7 +4793,9 @@ static int __maybe_unused rtl8169_suspend(struct device *device)
 {
 	struct rtl8169_private *tp = dev_get_drvdata(device);
 
+	rtnl_lock();
 	rtl8169_net_suspend(tp);
+	rtnl_unlock();
 
 	return 0;
 }
@@ -4819,11 +4823,13 @@ static int rtl8169_runtime_suspend(struct device *device)
 		return 0;
 	}
 
+	rtnl_lock();
 	rtl_lock_work(tp);
 	__rtl8169_set_wol(tp, WAKE_PHY);
 	rtl_unlock_work(tp);
 
 	rtl8169_net_suspend(tp);
+	rtnl_unlock();
 
 	return 0;
 }
@@ -4885,7 +4891,9 @@ static void rtl_shutdown(struct pci_dev *pdev)
 {
 	struct rtl8169_private *tp = pci_get_drvdata(pdev);
 
+	rtnl_lock();
 	rtl8169_net_suspend(tp);
+	rtnl_unlock();
 
 	/* Restore original MAC address */
 	rtl_rar_set(tp, tp->dev->perm_addr);
-- 
2.27.0



^ permalink raw reply related

* [BISECTED REGRESSION] ath9k: Fix general protection fault in ath9k_hif_usb_rx_cb
From: Roman Mamedov @ 2020-06-20 21:04 UTC (permalink / raw)
  To: Qiujun Huang
  Cc: kvalo, ath9k-devel, davem, linux-wireless, netdev, linux-kernel,
	anenbupt, syzkaller-bugs
In-Reply-To: <20200404041838.10426-6-hqjagain@gmail.com>

On Sat,  4 Apr 2020 12:18:38 +0800
Qiujun Huang <hqjagain@gmail.com> wrote:

> In ath9k_hif_usb_rx_cb interface number is assumed to be 0.
> usb_ifnum_to_if(urb->dev, 0)
> But it isn't always true.
> 
> The case reported by syzbot:
> https://lore.kernel.org/linux-usb/000000000000666c9c05a1c05d12@google.com
> usb 2-1: new high-speed USB device number 2 using dummy_hcd
> usb 2-1: config 1 has an invalid interface number: 2 but max is 0
> usb 2-1: config 1 has no interface number 0
> usb 2-1: New USB device found, idVendor=0cf3, idProduct=9271, bcdDevice=
> 1.08
> usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> general protection fault, probably for non-canonical address
> 0xdffffc0000000015: 0000 [#1] SMP KASAN
> KASAN: null-ptr-deref in range [0x00000000000000a8-0x00000000000000af]
> CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.6.0-rc5-syzkaller #0
> 
> Call Trace
> __usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650
> usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716
> dummy_timer+0x1258/0x32ae drivers/usb/gadget/udc/dummy_hcd.c:1966
> call_timer_fn+0x195/0x6f0 kernel/time/timer.c:1404
> expire_timers kernel/time/timer.c:1449 [inline]
> __run_timers kernel/time/timer.c:1773 [inline]
> __run_timers kernel/time/timer.c:1740 [inline]
> run_timer_softirq+0x5f9/0x1500 kernel/time/timer.c:1786
> __do_softirq+0x21e/0x950 kernel/softirq.c:292
> invoke_softirq kernel/softirq.c:373 [inline]
> irq_exit+0x178/0x1a0 kernel/softirq.c:413
> exiting_irq arch/x86/include/asm/apic.h:546 [inline]
> smp_apic_timer_interrupt+0x141/0x540 arch/x86/kernel/apic/apic.c:1146
> apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
> 
> Reported-and-tested-by: syzbot+40d5d2e8a4680952f042@syzkaller.appspotmail.com
> Signed-off-by: Qiujun Huang <hqjagain@gmail.com>

This causes complete breakage of ath9k operation across all the stable kernel
series it got backported to, and I guess the mainline as well. Please see:
https://bugzilla.kernel.org/show_bug.cgi?id=208251
https://bugzilla.redhat.com/show_bug.cgi?id=1848631

Thanks


> ---
>  drivers/net/wireless/ath/ath9k/hif_usb.c | 48 ++++++++++++++++++------
>  drivers/net/wireless/ath/ath9k/hif_usb.h |  5 +++
>  2 files changed, 42 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
> index 6049d3766c64..4ed21dad6a8e 100644
> --- a/drivers/net/wireless/ath/ath9k/hif_usb.c
> +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
> @@ -643,9 +643,9 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev,
>  
>  static void ath9k_hif_usb_rx_cb(struct urb *urb)
>  {
> -	struct sk_buff *skb = (struct sk_buff *) urb->context;
> -	struct hif_device_usb *hif_dev =
> -		usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0));
> +	struct rx_buf *rx_buf = (struct rx_buf *)urb->context;
> +	struct hif_device_usb *hif_dev = rx_buf->hif_dev;
> +	struct sk_buff *skb = rx_buf->skb;
>  	int ret;
>  
>  	if (!skb)
> @@ -685,14 +685,15 @@ static void ath9k_hif_usb_rx_cb(struct urb *urb)
>  	return;
>  free:
>  	kfree_skb(skb);
> +	kfree(rx_buf);
>  }
>  
>  static void ath9k_hif_usb_reg_in_cb(struct urb *urb)
>  {
> -	struct sk_buff *skb = (struct sk_buff *) urb->context;
> +	struct rx_buf *rx_buf = (struct rx_buf *)urb->context;
> +	struct hif_device_usb *hif_dev = rx_buf->hif_dev;
> +	struct sk_buff *skb = rx_buf->skb;
>  	struct sk_buff *nskb;
> -	struct hif_device_usb *hif_dev =
> -		usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0));
>  	int ret;
>  
>  	if (!skb)
> @@ -750,6 +751,7 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb)
>  	return;
>  free:
>  	kfree_skb(skb);
> +	kfree(rx_buf);
>  	urb->context = NULL;
>  }
>  
> @@ -795,7 +797,7 @@ static int ath9k_hif_usb_alloc_tx_urbs(struct hif_device_usb *hif_dev)
>  	init_usb_anchor(&hif_dev->mgmt_submitted);
>  
>  	for (i = 0; i < MAX_TX_URB_NUM; i++) {
> -		tx_buf = kzalloc(sizeof(struct tx_buf), GFP_KERNEL);
> +		tx_buf = kzalloc(sizeof(*tx_buf), GFP_KERNEL);
>  		if (!tx_buf)
>  			goto err;
>  
> @@ -832,8 +834,9 @@ static void ath9k_hif_usb_dealloc_rx_urbs(struct hif_device_usb *hif_dev)
>  
>  static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev)
>  {
> -	struct urb *urb = NULL;
> +	struct rx_buf *rx_buf = NULL;
>  	struct sk_buff *skb = NULL;
> +	struct urb *urb = NULL;
>  	int i, ret;
>  
>  	init_usb_anchor(&hif_dev->rx_submitted);
> @@ -841,6 +844,12 @@ static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev)
>  
>  	for (i = 0; i < MAX_RX_URB_NUM; i++) {
>  
> +		rx_buf = kzalloc(sizeof(*rx_buf), GFP_KERNEL);
> +		if (!rx_buf) {
> +			ret = -ENOMEM;
> +			goto err_rxb;
> +		}
> +
>  		/* Allocate URB */
>  		urb = usb_alloc_urb(0, GFP_KERNEL);
>  		if (urb == NULL) {
> @@ -855,11 +864,14 @@ static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev)
>  			goto err_skb;
>  		}
>  
> +		rx_buf->hif_dev = hif_dev;
> +		rx_buf->skb = skb;
> +
>  		usb_fill_bulk_urb(urb, hif_dev->udev,
>  				  usb_rcvbulkpipe(hif_dev->udev,
>  						  USB_WLAN_RX_PIPE),
>  				  skb->data, MAX_RX_BUF_SIZE,
> -				  ath9k_hif_usb_rx_cb, skb);
> +				  ath9k_hif_usb_rx_cb, rx_buf);
>  
>  		/* Anchor URB */
>  		usb_anchor_urb(urb, &hif_dev->rx_submitted);
> @@ -885,6 +897,8 @@ static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev)
>  err_skb:
>  	usb_free_urb(urb);
>  err_urb:
> +	kfree(rx_buf);
> +err_rxb:
>  	ath9k_hif_usb_dealloc_rx_urbs(hif_dev);
>  	return ret;
>  }
> @@ -896,14 +910,21 @@ static void ath9k_hif_usb_dealloc_reg_in_urbs(struct hif_device_usb *hif_dev)
>  
>  static int ath9k_hif_usb_alloc_reg_in_urbs(struct hif_device_usb *hif_dev)
>  {
> -	struct urb *urb = NULL;
> +	struct rx_buf *rx_buf = NULL;
>  	struct sk_buff *skb = NULL;
> +	struct urb *urb = NULL;
>  	int i, ret;
>  
>  	init_usb_anchor(&hif_dev->reg_in_submitted);
>  
>  	for (i = 0; i < MAX_REG_IN_URB_NUM; i++) {
>  
> +		rx_buf = kzalloc(sizeof(*rx_buf), GFP_KERNEL);
> +		if (!rx_buf) {
> +			ret = -ENOMEM;
> +			goto err_rxb;
> +		}
> +
>  		/* Allocate URB */
>  		urb = usb_alloc_urb(0, GFP_KERNEL);
>  		if (urb == NULL) {
> @@ -918,11 +939,14 @@ static int ath9k_hif_usb_alloc_reg_in_urbs(struct hif_device_usb *hif_dev)
>  			goto err_skb;
>  		}
>  
> +		rx_buf->hif_dev = hif_dev;
> +		rx_buf->skb = skb;
> +
>  		usb_fill_int_urb(urb, hif_dev->udev,
>  				  usb_rcvintpipe(hif_dev->udev,
>  						  USB_REG_IN_PIPE),
>  				  skb->data, MAX_REG_IN_BUF_SIZE,
> -				  ath9k_hif_usb_reg_in_cb, skb, 1);
> +				  ath9k_hif_usb_reg_in_cb, rx_buf, 1);
>  
>  		/* Anchor URB */
>  		usb_anchor_urb(urb, &hif_dev->reg_in_submitted);
> @@ -948,6 +972,8 @@ static int ath9k_hif_usb_alloc_reg_in_urbs(struct hif_device_usb *hif_dev)
>  err_skb:
>  	usb_free_urb(urb);
>  err_urb:
> +	kfree(rx_buf);
> +err_rxb:
>  	ath9k_hif_usb_dealloc_reg_in_urbs(hif_dev);
>  	return ret;
>  }
> diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.h b/drivers/net/wireless/ath/ath9k/hif_usb.h
> index a94e7e1c86e9..5985aa15ca93 100644
> --- a/drivers/net/wireless/ath/ath9k/hif_usb.h
> +++ b/drivers/net/wireless/ath/ath9k/hif_usb.h
> @@ -86,6 +86,11 @@ struct tx_buf {
>  	struct list_head list;
>  };
>  
> +struct rx_buf {
> +	struct sk_buff *skb;
> +	struct hif_device_usb *hif_dev;
> +};
> +
>  #define HIF_USB_TX_STOP  BIT(0)
>  #define HIF_USB_TX_FLUSH BIT(1)
>  


-- 
With respect,
Roman

^ permalink raw reply

* [PATCH bpf v2] restore behaviour of CAP_SYS_ADMIN allowing the loading of networking bpf programs
From: Maciej Żenczykowski @ 2020-06-20 21:26 UTC (permalink / raw)
  To: Maciej Żenczykowski, Alexei Starovoitov, Daniel Borkmann
  Cc: Linux Network Development Mailing List, Linux Kernel Mailing List,
	BPF Mailing List, David S . Miller, John Stultz
In-Reply-To: <CAADnVQ+BqPeVqbgojN+nhYTE0nDcGF2-TfaeqyfPLOF-+DLn5Q@mail.gmail.com>

From: Maciej Żenczykowski <maze@google.com>

This is a fix for a regression introduced in 5.8-rc1 by:
  commit 2c78ee898d8f10ae6fb2fa23a3fbaec96b1b7366
  'bpf: Implement CAP_BPF'

Before the above commit it was possible to load network bpf programs
with just the CAP_SYS_ADMIN privilege.

The Android bpfloader happens to run in such a configuration (it has
SYS_ADMIN but not NET_ADMIN) and creates maps and loads bpf programs
for later use by Android's netd (which has NET_ADMIN but not SYS_ADMIN).

Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Reported-by: John Stultz <john.stultz@linaro.org>
Fixes: 2c78ee898d8f ("bpf: Implement CAP_BPF")
Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
 kernel/bpf/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 8da159936bab..7d946435587d 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -2121,7 +2121,7 @@ static int bpf_prog_load(union bpf_attr *attr, union bpf_attr __user *uattr)
 	    !bpf_capable())
 		return -EPERM;
 
-	if (is_net_admin_prog_type(type) && !capable(CAP_NET_ADMIN))
+	if (is_net_admin_prog_type(type) && !capable(CAP_NET_ADMIN) && !capable(CAP_SYS_ADMIN))
 		return -EPERM;
 	if (is_perfmon_prog_type(type) && !perfmon_capable())
 		return -EPERM;
-- 
2.27.0.111.gc72c7da667-goog


^ permalink raw reply related

* Re: [net-next,v1,0/5] Strict mode for VRF
From: David Ahern @ 2020-06-20 23:32 UTC (permalink / raw)
  To: Andrea Mayer, David Ahern, David S. Miller, Shrijeet Mukherjee,
	Jakub Kicinski, Shuah Khan, netdev, linux-kernel, linux-kselftest
  Cc: Donald Sharp, Roopa Prabhu, Dinesh Dutt, Stephen Hemminger,
	Stefano Salsano, Paolo Lungaroni, Ahmed Abdelsalam
In-Reply-To: <20200619225447.1445-1-andrea.mayer@uniroma2.it>

On 6/19/20 3:54 PM, Andrea Mayer wrote:
> This patch set adds the new "strict mode" functionality to the Virtual
> Routing and Forwarding infrastructure (VRF). Hereafter we discuss the
> requirements and the main features of the "strict mode" for VRF.
> 

For the set:
Acked-by: David Ahern <dsahern@gmail.com>


^ permalink raw reply

* Re: [net-next,v1,0/5] Strict mode for VRF
From: David Miller @ 2020-06-21  0:22 UTC (permalink / raw)
  To: dsahern
  Cc: andrea.mayer, dsahern, shrijeet, kuba, shuah, netdev,
	linux-kernel, linux-kselftest, sharpd, roopa, didutt, stephen,
	stefano.salsano, paolo.lungaroni, ahabdels
In-Reply-To: <f13c47d2-6b08-8f73-05d2-755a40fba6a8@gmail.com>

From: David Ahern <dsahern@gmail.com>
Date: Sat, 20 Jun 2020 16:32:53 -0700

> On 6/19/20 3:54 PM, Andrea Mayer wrote:
>> This patch set adds the new "strict mode" functionality to the Virtual
>> Routing and Forwarding infrastructure (VRF). Hereafter we discuss the
>> requirements and the main features of the "strict mode" for VRF.
>> 
> 
> For the set:
> Acked-by: David Ahern <dsahern@gmail.com>

Series applied to net-next, thanks.

^ permalink raw reply

* Re: [PATCH net-next 00/12] Ocelot/Felix driver cleanup
From: David Miller @ 2020-06-21  0:25 UTC (permalink / raw)
  To: olteanv
  Cc: netdev, UNGLinuxDriver, andrew, f.fainelli, vivien.didelot,
	claudiu.manoil, alexandru.marginean, xiaoliang.yang_1
In-Reply-To: <20200620154347.3587114-1-olteanv@gmail.com>

From: Vladimir Oltean <olteanv@gmail.com>
Date: Sat, 20 Jun 2020 18:43:35 +0300

> From: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> Some of the code in the mscc felix and ocelot drivers was added while in
> a bit of a hurry. Let's take a moment and put things in relative order.
> 
> First 3 patches are sparse warning fixes.
> 
> Patches 4-9 perform some further splitting between mscc_felix,
> mscc_ocelot, and the common hardware library they share. Meaning that
> some code is being moved from the library into just the mscc_ocelot
> module.
> 
> Patches 10-12 refactor the naming conventions in the existing VCAP code
> (for tc-flower offload), since we're going to be adding some more code
> for VCAP IS1 (previous tentatives already submitted here:
> https://patchwork.ozlabs.org/project/netdev/cover/20200602051828.5734-1-xiaoliang.yang_1@nxp.com/),
> and that code would be confusing to read and maintain using current
> naming conventions.
> 
> No functional modification is intended. I checked that the VCAP IS2 code
> still works by applying a tc ingress filter with an EtherType key and
> 'drop' action.

This looks good, series applied, thanks.

^ permalink raw reply

* Re: [PATCH net] ionic: tame the watchdog timer on reconfig
From: David Miller @ 2020-06-21  0:27 UTC (permalink / raw)
  To: snelson; +Cc: netdev
In-Reply-To: <20200618172904.53814-1-snelson@pensando.io>

From: Shannon Nelson <snelson@pensando.io>
Date: Thu, 18 Jun 2020 10:29:04 -0700

> Even with moving netif_tx_disable() to an earlier point when
> taking down the queues for a reconfiguration, we still end
> up with the occasional netdev watchdog Tx Timeout complaint.
> The old method of using netif_trans_update() works fine for
> queue 0, but has no effect on the remaining queues.  Using
> netif_device_detach() allows us to signal to the watchdog to
> ignore us for the moment.
> 
> Fixes: beead698b173 ("ionic: Add the basic NDO callbacks for netdev support")
> Signed-off-by: Shannon Nelson <snelson@pensando.io>

Applied and queued up for -stable, thanks.

^ permalink raw reply

* Re: [PATCH net] ibmvnic: continue to init in CRQ reset returns H_CLOSED
From: David Miller @ 2020-06-21  0:28 UTC (permalink / raw)
  To: drt; +Cc: netdev, linuxppc-dev, tlfalcon
In-Reply-To: <20200618192413.853441-1-drt@linux.ibm.com>

From: Dany Madden <drt@linux.ibm.com>
Date: Thu, 18 Jun 2020 15:24:13 -0400

> Continue the reset path when partner adapter is not ready or H_CLOSED is
> returned from reset crq. This patch allows the CRQ init to proceed to
> establish a valid CRQ for traffic to flow after reset.
> 
> Signed-off-by: Dany Madden <drt@linux.ibm.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH] [net/sched]: Remove redundant condition in qdisc_graft
From: David Miller @ 2020-06-21  0:30 UTC (permalink / raw)
  To: gaurav1086; +Cc: jhs, xiyou.wangcong, jiri, kuba, netdev, linux-kernel
In-Reply-To: <20200618203632.15438-1-gaurav1086@gmail.com>

From: Gaurav Singh <gaurav1086@gmail.com>
Date: Thu, 18 Jun 2020 16:36:31 -0400

> parent cannot be NULL here since its in the else part
> of the if (parent == NULL) condition. Remove the extra
> check on parent pointer.
> 
> Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>

Applied to net-next, thanks.

^ permalink raw reply

* Re: [net-next PATCH] net: Avoid overwriting valid skb->napi_id
From: David Miller @ 2020-06-21  0:31 UTC (permalink / raw)
  To: amritha.nambiar
  Cc: netdev, edumazet, alexander.h.duyck, eliezer.tamir,
	sridhar.samudrala
In-Reply-To: <159251533557.7557.5381023439094175695.stgit@anambiarhost.jf.intel.com>

From: Amritha Nambiar <amritha.nambiar@intel.com>
Date: Thu, 18 Jun 2020 14:22:15 -0700

> This will be useful to allow busy poll for tunneled traffic. In case of
> busy poll for sessions over tunnels, the underlying physical device's
> queues need to be polled.
> 
> Tunnels schedule NAPI either via netif_rx() for backlog queue or
> schedule the gro_cell_poll(). netif_rx() propagates the valid skb->napi_id
> to the socket. OTOH, gro_cell_poll() stamps the skb->napi_id again by
> calling skb_mark_napi_id() with the tunnel NAPI which is not a busy poll
> candidate. This was preventing tunneled traffic to use busy poll. A valid
> NAPI ID in the skb indicates it was already marked for busy poll by a
> NAPI driver and hence needs to be copied into the socket.
> 
> Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com>

Applied, thank you.

^ permalink raw reply

* Re: [PATCH net] r8169: fix firmware not resetting tp->ocp_base
From: David Miller @ 2020-06-21  0:32 UTC (permalink / raw)
  To: hkallweit1; +Cc: nic_swsd, kuba, mapengyu, netdev
In-Reply-To: <fa7fd9bd-15c0-4533-b698-c4814406ad74@gmail.com>

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Thu, 18 Jun 2020 23:25:50 +0200

> Typically the firmware takes care that tp->ocp_base is reset to its
> default value. That's not the case (at least) for RTL8117.
> As a result subsequent PHY access reads/writes the wrong page and
> the link is broken. Fix this be resetting tp->ocp_base explicitly.
> 
> Fixes: 229c1e0dfd3d ("r8169: load firmware for RTL8168fp/RTL8117")
> Reported-by: Aaron Ma <mapengyu@gmail.com>
> Tested-by: Aaron Ma <mapengyu@gmail.com>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Applied and queued up for v5.5 -stable, thanks.

^ permalink raw reply

* Re: [PATCH net-next] of: mdio: preserve phy dev_flags in of_phy_connect()
From: David Miller @ 2020-06-21  0:33 UTC (permalink / raw)
  To: rentao.bupt
  Cc: andrew, f.fainelli, hkallweit1, linux, robh+dt, frowand.list,
	netdev, devicetree, linux-kernel, openbmc, taoren
In-Reply-To: <20200618220444.5064-1-rentao.bupt@gmail.com>

From: rentao.bupt@gmail.com
Date: Thu, 18 Jun 2020 15:04:44 -0700

> From: Tao Ren <rentao.bupt@gmail.com>
> 
> Replace assignment "=" with OR "|=" for "phy->dev_flags" so "dev_flags"
> configured in phy probe() function can be preserved.
> 
> The idea is similar to commit e7312efbd5de ("net: phy: modify assignment
> to OR for dev_flags in phy_attach_direct").
> 
> Signed-off-by: Tao Ren <rentao.bupt@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCHv2 net] tc-testing: update geneve options match in tunnel_key unit tests
From: David Miller @ 2020-06-21  0:35 UTC (permalink / raw)
  To: liuhangbin; +Cc: netdev, lucasb, simon.horman, dcaratti
In-Reply-To: <20200619032445.664868-1-liuhangbin@gmail.com>

From: Hangbin Liu <liuhangbin@gmail.com>
Date: Fri, 19 Jun 2020 11:24:45 +0800

> Since iproute2 commit f72c3ad00f3b ("tc: m_tunnel_key: add options
> support for vxlan"), the geneve opt output use key word "geneve_opts"
> instead of "geneve_opt". To make compatibility for both old and new
> iproute2, let's accept both "geneve_opt" and "geneve_opts".
> 
> Suggested-by: Davide Caratti <dcaratti@redhat.com>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>

Applied, thanks.

^ permalink raw reply

* Re: sock diag uAPI and MPTCP
From: David Miller @ 2020-06-21  0:44 UTC (permalink / raw)
  To: pabeni; +Cc: eric.dumazet, netdev, mptcp
In-Reply-To: <c5b53444ca4c79b887629c93d954dadbc4a777da.camel@redhat.com>

From: Paolo Abeni <pabeni@redhat.com>
Date: Fri, 19 Jun 2020 12:54:40 +0200

> IPPROTO_MPTCP value (0x106) can't be represented using the current sock
> diag uAPI, as the 'sdiag_protocol' field is 8 bits wide.
> 
> To implement diag support for MPTCP socket, we will likely need a
> 'inet_diag_req_v3' with a wider 'sdiag_protocol'
> field. inet_diag_handler_cmd() could detect the version of
> the inet_diag_req_v* provided by user-space checking nlmsg_len() and
> convert _v2 reqs to _v3.
> 
> This change will be a bit invasive, as all in kernel diag users will
> then operate only on 'inet_diag_req_v3' (many functions' signature
> change required), but the code-related changes will be encapsulated
> by inet_diag_handler_cmd().

Another way to extend the size of a field is to add an attribute which
supercedes the header structure field when present.

We did this when we needed to make the fib rule table ID number larger,
see FRA_TABLE.

You'd only need to specify this when using protocol values larger than
8 bits in size.


^ permalink raw reply

* Re: [PATCH net 0/3] net: ethtool: netdev_features_strings[] cleanup
From: David Miller @ 2020-06-21  0:46 UTC (permalink / raw)
  To: alobakin
  Cc: kuba, mkubecek, f.fainelli, andrew, jiri, antoine.tenart,
	steffen.klassert, ayal, therbert, netdev, linux-kernel
In-Reply-To: <x6AQUs_HEHFh9N-5HYIEIDvv9krP6Fg6OgEuqUBC6jHmWwaeXSkyLVi05uelpCPAZXlXKlJqbJk8ox3xkIs33KVna41w5es0wJlc-cQhb8g=@pm.me>


Please submit this again, I have two copies in my inbox and I have no idea
what is different between them.

Also, in some of your patches you cut the Fixes: tag into mutliple lines
please do not do that.  The Fixes: tag line should be one single line no
matter how long it is.

Thank you.

^ permalink raw reply

* Re: [PATCH net-next 0/2] tcp: remove two indirect calls from xmit path
From: David Miller @ 2020-06-21  0:48 UTC (permalink / raw)
  To: edumazet; +Cc: netdev, eric.dumazet, kuba
In-Reply-To: <20200619191235.199506-1-edumazet@google.com>

From: Eric Dumazet <edumazet@google.com>
Date: Fri, 19 Jun 2020 12:12:33 -0700

> __tcp_transmit_skb() does two indirect calls per packet, lets get rid
> of them.

Series applied, thanks.

^ permalink raw reply

* Patch to correct kernel-doc comments in networking subsystem
From: Colton Lewis @ 2020-06-21  2:22 UTC (permalink / raw)
  To: davem; +Cc: netdev


This patch was sent to Dave last week, but I fear it may have been
ignored because I forgot to set the subject line. Please accept or
comment on this patch.


^ permalink raw reply

* [PATCH 1/3] net: core: correct trivial kernel-doc inconsistencies
From: Colton Lewis @ 2020-06-21  2:22 UTC (permalink / raw)
  To: davem; +Cc: netdev, Colton Lewis
In-Reply-To: <20200621022209.11814-1-colton.w.lewis@protonmail.com>

Silence documentation build warnings by correcting kernel-doc comments.

./net/core/dev.c:7913: warning: Function parameter or member 'dev' not described in 'netdev_get_xmit_slave'

Signed-off-by: Colton Lewis <colton.w.lewis@protonmail.com>
---
 net/core/dev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/dev.c b/net/core/dev.c
index 6bc2388141f6..cf20d286abfc 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -7898,6 +7898,7 @@ EXPORT_SYMBOL(netdev_bonding_info_change);
 
 /**
  * netdev_get_xmit_slave - Get the xmit slave of master device
+ * @dev: The device
  * @skb: The packet
  * @all_slaves: assume all the slaves are active
  *
-- 
2.26.2



^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox