# Re: \[PATCH net-next\] net: tls: make the offload check helper take skb not socket

- From: Tariq Toukan \<hidden\>
- Date: 2023-06-14 11:03:25 
- List: netdev
- Page: https://ratatoskr.run/netdev/2023/06/11263761
- Thread: https://ratatoskr.run/netdev/2023/06/11263718/t.md

```text


On 13/06/2023 23:50, Jakub Kicinski wrote:
> 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 <kuba@kernel.org>
> ---
> CC: <redacted>
> CC: andy@greyhouse.net
> CC: <redacted>
> CC: ayush.sawal@chelsio.com
> CC: dmichail@fungible.com
> CC: borisp@nvidia.com
> CC: saeedm@nvidia.com
> CC: leon@kernel.org
> CC: <redacted>
> CC: john.fastabend@gmail.com
> CC: <redacted>
> CC: <redacted>
> CC: tariqt@nvidia.com

Acked-by: Tariq Toukan <tariqt@nvidia.com>

Thanks.
```
