netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tariq Toukan <tariqt@nvidia.com>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
	Boris Pismenny <borisp@nvidia.com>,
	netdev@vger.kernel.org, Moshe Shemesh <moshe@nvidia.com>,
	andy@greyhouse.net, vfalico@gmail.com, j.vosburgh@gmail.com,
	Tariq Toukan <ttoukan.linux@gmail.com>,
	Tariq Toukan <tariqt@nvidia.com>
Subject: [PATCH RFC net-next 3/6] net/tls: Except bond interface from some TLS checks
Date: Tue, 29 Dec 2020 13:41:01 +0200	[thread overview]
Message-ID: <20201229114104.7120-4-tariqt@nvidia.com> (raw)
In-Reply-To: <20201229114104.7120-1-tariqt@nvidia.com>

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

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

Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
 net/tls/tls_device.c          | 2 ++
 net/tls/tls_device_fallback.c | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c
index 75ceea0a41bf..d9cd229aa111 100644
--- a/net/tls/tls_device.c
+++ b/net/tls/tls_device.c
@@ -1329,6 +1329,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 d946817ed065..40e4cf321878 100644
--- a/net/tls/tls_device_fallback.c
+++ b/net/tls/tls_device_fallback.c
@@ -424,7 +424,8 @@ 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)
+	/* TODO: verify slave belongs to the master? */
+	if (dev == tls_get_ctx(sk)->netdev || netif_is_bond_master(dev))
 		return skb;
 
 	return tls_sw_fallback(sk, skb);
-- 
2.21.0


  parent reply	other threads:[~2020-12-29 11:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-29 11:40 [PATCH RFC net-next 0/6] RFC: TLS TX HW offload for Bond Tariq Toukan
2020-12-29 11:40 ` [PATCH RFC net-next 1/6] net: netdevice: Add operation ndo_sk_get_slave Tariq Toukan
2020-12-29 11:41 ` [PATCH RFC net-next 2/6] net/tls: Device offload to use lowest netdevice in chain Tariq Toukan
2020-12-29 11:41 ` Tariq Toukan [this message]
2020-12-29 11:41 ` [PATCH RFC net-next 4/6] net/bonding: Take IP hash logic into a helper Tariq Toukan
2020-12-29 11:41 ` [PATCH RFC net-next 5/6] net/bonding: Implement ndo_sk_get_slave Tariq Toukan
2020-12-29 11:41 ` [PATCH RFC net-next 6/6] net/bonding: Support TLS TX device offload Tariq Toukan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201229114104.7120-4-tariqt@nvidia.com \
    --to=tariqt@nvidia.com \
    --cc=andy@greyhouse.net \
    --cc=borisp@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=j.vosburgh@gmail.com \
    --cc=kuba@kernel.org \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    --cc=ttoukan.linux@gmail.com \
    --cc=vfalico@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).