[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200518163303.1dc96e07@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Mon, 18 May 2020 16:33:03 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Rohit Maheshwari <rohitm@...lsio.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, secdev@...lsio.com
Subject: Re: [PATCH net] cxgb4/chcr: Enable ktls settings at run time
On Mon, 18 May 2020 14:29:18 +0530 Rohit Maheshwari wrote:
> for_each_port(adap, i) {
> netdev = adap->port[i];
> - netdev->features |= NETIF_F_HW_TLS_TX;
> netdev->hw_features |= NETIF_F_HW_TLS_TX;
> netdev->tlsdev_ops = &chcr_ktls_ops;
> +
> + rtnl_lock();
> + netdev_update_features(netdev);
> + rtnl_unlock();
> }
> }
>
> @@ -571,6 +584,10 @@ void chcr_disable_ktls(struct adapter *adap)
> netdev->features &= ~NETIF_F_HW_TLS_TX;
> netdev->hw_features &= ~NETIF_F_HW_TLS_TX;
Twiddling with device flags without holding rtnl_lock seems
questionable.
> netdev->tlsdev_ops = NULL;
Clearing the ops pointer at runtime with no synchronization - even more
so. What if TLS code is mid-way through adding a connection?
> + rtnl_lock();
> + netdev_update_features(netdev);
> + rtnl_unlock();
> }
> }
Powered by blists - more mailing lists