From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BBC8C433DF for ; Mon, 18 May 2020 23:37:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 29FC3207D8 for ; Mon, 18 May 2020 23:37:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589845032; bh=yyTg7ppw/tVZoi/AlS5IXaoCDgkni6tdBM1yJuqpMVA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=rTyYg7twCpGC+GppbRVAbqv03cNurjsJxB6WiT8rYbMQSrC0MnsrXZeJowqM2BI44 bANTUaENUznfn+R1W9+MZLYO3nlssAELMr6patRiJ7V4pSYRnenTo/OzbCZ60/5CVr /DZF82DyfRIOK+A73D+WCDKmUvUZFt0MsFSDz3rA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726442AbgERXdK (ORCPT ); Mon, 18 May 2020 19:33:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:33908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbgERXdK (ORCPT ); Mon, 18 May 2020 19:33:10 -0400 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F22D920756; Mon, 18 May 2020 23:33:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589844790; bh=yyTg7ppw/tVZoi/AlS5IXaoCDgkni6tdBM1yJuqpMVA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mVyMJDA+T9xUb6OZgAnm/mKOkwd543IZYS7WH8y+NY3cjA+IH+IMDqlG9oGuwuc7V nw+B65WzCSyTc1++hCMxk/I4Y8l0jzisv0xe+7uX5Skd6opL8m3ESRjTOb1K/+ypuc s3dfSMhNs2kcCl3oCzVOv//kSDYtPABw6ul9TaU4= Date: Mon, 18 May 2020 16:33:03 -0700 From: Jakub Kicinski To: Rohit Maheshwari Cc: netdev@vger.kernel.org, davem@davemloft.net, secdev@chelsio.com Subject: Re: [PATCH net] cxgb4/chcr: Enable ktls settings at run time Message-ID: <20200518163303.1dc96e07@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20200518085918.32262-1-rohitm@chelsio.com> References: <20200518085918.32262-1-rohitm@chelsio.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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(); > } > }