Subject: Re: [PATCH net-next 5/5] tls: Add generic NIC offload infrastructure.

From: Hannes Frederic Sowa <[email-masked]>
Date: Mon, 18 Sep 2017 16:52:21 +0200

Ilya Lesokhin <[email-masked]> writes:

> +/* We assume that the socket is already connected */
> +static struct net_device *get_netdev_for_sock(struct sock *sk)
> +{
> +	struct inet_sock *inet = inet_sk(sk);
> +	struct net_device *netdev = NULL;
> +
> +	netdev = dev_get_by_index(sock_net(sk), inet->cork.fl.flowi_oif);
> +
> +	return netdev;
> +}

The user should be aware of that they can't migrate the socket to
another interface if they got hw offloaded. This is not the case for
software offload. Thus I think the user has to opt in and it shouldn't
be a heuristic until we can switch back to sw offload path.

Maybe change flowi_oif to sk_bound_dev_if and somwhow lock it against
further changes if hw tls is in use?

Thanks,
Hannes