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=-7.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 42F26C2D0A3 for ; Fri, 6 Nov 2020 22:15:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA668206F9 for ; Fri, 6 Nov 2020 22:15:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604700939; bh=UP+8rgY4i9tm/nAHJCDhNq40B/ZxohNdGNwVhE25CRo=; h=Subject:From:To:Cc:Date:In-Reply-To:References:List-ID:From; b=bJD/Ucco44fFqw0PjSSKuKtfc2BdYvYeNl7SqIeFwI9y9nQuYfmnDagIVNdLWXxBQ GGLAmsnxRGStIj9AEC6PwMBIZ/K98vNat5jKk2f69wTJ+F0OrBQ9o+j6x22Ed3HPl/ IylMkiDwTxZwh9rTO0ZHVnTaHW7zji+FUo0fxSto= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728558AbgKFWPi (ORCPT ); Fri, 6 Nov 2020 17:15:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:39558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728131AbgKFWPg (ORCPT ); Fri, 6 Nov 2020 17:15:36 -0500 Received: from sx1.lan (c-24-6-56-119.hsd1.ca.comcast.net [24.6.56.119]) (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 C441F206F9; Fri, 6 Nov 2020 22:15:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604700935; bh=UP+8rgY4i9tm/nAHJCDhNq40B/ZxohNdGNwVhE25CRo=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=RcgDz53skk1FQzig+pXQUZ4yJTfFg9GggA+RZdYUiuwrcX3sU66kMJMNq0biEjapJ V6JbDjsvaZs72FVnERxbX/dNJ9O003T+W4Cexghvc5n1dy5CbTyzkrzTwBAM5GGbN6 3cFihHKxtuJam+Aen2QpmVangYyf8YZgUeNRE0do= Message-ID: Subject: Re: [PATCH v2 net-next 06/13] octeontx2-pf: Add support for unicast MAC address filtering From: Saeed Mahameed To: Naveen Mamindlapalli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: kuba@kernel.org, davem@davemloft.net, sgoutham@marvell.com, lcherian@marvell.com, gakula@marvell.com, jerinj@marvell.com, sbhatta@marvell.com, hkelam@marvell.com Date: Fri, 06 Nov 2020 14:15:33 -0800 In-Reply-To: <20201105092816.819-7-naveenm@marvell.com> References: <20201105092816.819-1-naveenm@marvell.com> <20201105092816.819-7-naveenm@marvell.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-11-05 at 14:58 +0530, Naveen Mamindlapalli wrote: > From: Hariprasad Kelam > > Add unicast MAC address filtering support using install flow > message. Total of 8 MCAM entries are allocated for adding > unicast mac filtering rules. If the MCAM allocation fails, > the unicast filtering support will not be advertised. > > Signed-off-by: Hariprasad Kelam > Signed-off-by: Sunil Goutham > Signed-off-by: Naveen Mamindlapalli > --- > .../ethernet/marvell/octeontx2/nic/otx2_common.h | 10 ++ > .../ethernet/marvell/octeontx2/nic/otx2_flows.c | 138 > +++++++++++++++++++-- > .../net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 5 + > 3 files changed, 146 insertions(+), 7 deletions(-) > > +int otx2_add_macfilter(struct net_device *netdev, const u8 *mac) > +{ > + struct otx2_nic *pf = netdev_priv(netdev); > + int err; > + > + err = otx2_do_add_macfilter(pf, mac); > + if (err) { > + netdev->flags |= IFF_PROMISC; I don't think you are allowed to change netdev->flags inside the driver like this, this can easily conflict with other users of this netdev; netdev promiscuity is managed by the stack via refcount Please see: __dev_set_promiscuity() and dev_set_promiscuity() And you will need to notify stack and userspace of flags changes.