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();
>       }
>  }

Reply via email to