diff options
| author | Jakub Kicinski <[email protected]> | 2023-06-13 20:50:06 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2023-06-15 08:01:05 +0000 |
| commit | ed3c9a2fcab3b60b0766eb5d7566fd3b10df9a8e (patch) | |
| tree | 76d8edce93760a8a518efaa9fb774ced54907009 /net/tls/tls_device.c | |
| parent | Merge branch 'macb-partial-store-and-forward' (diff) | |
| download | kernel-ed3c9a2fcab3b60b0766eb5d7566fd3b10df9a8e.tar.gz kernel-ed3c9a2fcab3b60b0766eb5d7566fd3b10df9a8e.zip | |
net: tls: make the offload check helper take skb not socket
All callers of tls_is_sk_tx_device_offloaded() currently do
an equivalent of:
if (skb->sk && tls_is_skb_tx_device_offloaded(skb->sk))
Have the helper accept skb and do the skb->sk check locally.
Two drivers have local static inlines with similar wrappers
already.
While at it change the ifdef condition to TLS_DEVICE.
Only TLS_DEVICE selects SOCK_VALIDATE_XMIT, so the two are
equivalent. This makes removing the duplicated IS_ENABLED()
check in funeth more obviously correct.
Signed-off-by: Jakub Kicinski <[email protected]>
Acked-by: Maxim Mikityanskiy <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Acked-by: Tariq Toukan <[email protected]>
Acked-by: Dimitris Michailidis <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/tls/tls_device.c')
| -rw-r--r-- | net/tls/tls_device.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c index b4864d55900f..b82770f68807 100644 --- a/net/tls/tls_device.c +++ b/net/tls/tls_device.c @@ -1219,7 +1219,7 @@ int tls_set_device_offload(struct sock *sk, struct tls_context *ctx) tls_device_attach(ctx, sk, netdev); up_read(&device_offload_lock); - /* following this assignment tls_is_sk_tx_device_offloaded + /* following this assignment tls_is_skb_tx_device_offloaded * will return true and the context might be accessed * by the netdev's xmit function. */ @@ -1372,7 +1372,7 @@ static int tls_device_down(struct net_device *netdev) list_for_each_entry_safe(ctx, tmp, &list, list) { /* Stop offloaded TX and switch to the fallback. - * tls_is_sk_tx_device_offloaded will return false. + * tls_is_skb_tx_device_offloaded will return false. */ WRITE_ONCE(ctx->sk->sk_validate_xmit_skb, tls_validate_xmit_skb_sw); |
