lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240712192405.505553-2-nnac123@linux.ibm.com>
Date: Fri, 12 Jul 2024 14:24:05 -0500
From: Nick Child <nnac123@...ux.ibm.com>
To: netdev@...r.kernel.org
Cc: Nick Child <nnac123@...ux.ibm.com>
Subject: [RFC PATCH net-next 1/1] bonding: Return TX congested if no active slave

When the bonding device cannot find an active slave, it is safe to
assume that monitoring will eventually call carrier_off on the bonding
device.

This means that eventually the bonding devices qdisc will become noop
and return congested. But, there is an indefinite amount of time
between no active slaves and the bonding devices qdisc becoming noop.

Previously, during this period, NET_XMIT_DROP was returned. Upper level
networking functions react differently to a drop vs congested.

Therefore, return NET_XMIT_CN instead of NET_XMIT_DROP because it
accurately predicts the impending noop_enqueue return code and helps
to keep sockets alive until then.

Signed-off-by: Nick Child <nnac123@...ux.ibm.com>
---
 include/net/bonding.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/net/bonding.h b/include/net/bonding.h
index b61fb1aa3a56..22da0916d4a6 100644
--- a/include/net/bonding.h
+++ b/include/net/bonding.h
@@ -805,8 +805,15 @@ extern const u8 lacpdu_mcast_addr[];
 
 static inline netdev_tx_t bond_tx_drop(struct net_device *dev, struct sk_buff *skb)
 {
+	struct bonding *bond = netdev_priv(dev);
+
 	dev_core_stats_tx_dropped_inc(dev);
 	dev_kfree_skb_any(skb);
+
+	/* monitoring will trigger dev_deactivate soon, imitate noop until then */
+	if (bond_has_slaves(bond))
+		return NET_XMIT_CN;
+
 	return NET_XMIT_DROP;
 }
 
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ