[SRU][F:linux-bluefield][PATCH 32/32] net/tls: Except bond interface from some TLS checks

Daniel Jurgens danielj at nvidia.com
Mon May 3 19:39:17 UTC 2021


From: Tariq Toukan <tariqt at nvidia.com>

BugLink: https://bugs.launchpad.net/bugs/1926994

In the tls_dev_event handler, ignore tlsdev_ops requirement for bond
interfaces, they do not exist as the interaction is done directly with
the lower device.

Also, make the validate function pass when it's called with the upper
bond interface.

Signed-off-by: Tariq Toukan <tariqt at nvidia.com>
Reviewed-by: Boris Pismenny <borisp at nvidia.com>
Signed-off-by: Jakub Kicinski <kuba at kernel.org>
(cherry picked from commit 4e5a73329051e5b24fb1d715a5417ef3f95b08a6)
Signed-off-by: Daniel Jurgens <danielj at nvidia.com>
---
 net/tls/tls_device.c          | 2 ++
 net/tls/tls_device_fallback.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c
index ea2180c..24c4021 100644
--- a/net/tls/tls_device.c
+++ b/net/tls/tls_device.c
@@ -1296,6 +1296,8 @@ static int tls_dev_event(struct notifier_block *this, unsigned long event,
 	switch (event) {
 	case NETDEV_REGISTER:
 	case NETDEV_FEAT_CHANGE:
+		if (netif_is_bond_master(dev))
+			return NOTIFY_DONE;
 		if ((dev->features & NETIF_F_HW_TLS_RX) &&
 		    !dev->tlsdev_ops->tls_dev_resync)
 			return NOTIFY_BAD;
diff --git a/net/tls/tls_device_fallback.c b/net/tls/tls_device_fallback.c
index 2889533..86bfdd7 100644
--- a/net/tls/tls_device_fallback.c
+++ b/net/tls/tls_device_fallback.c
@@ -423,7 +423,7 @@ struct sk_buff *tls_validate_xmit_skb(struct sock *sk,
 				      struct net_device *dev,
 				      struct sk_buff *skb)
 {
-	if (dev == tls_get_ctx(sk)->netdev)
+	if (dev == tls_get_ctx(sk)->netdev || netif_is_bond_master(dev))
 		return skb;
 
 	return tls_sw_fallback(sk, skb);
-- 
1.8.3.1




More information about the kernel-team mailing list