Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1605462pxb; Fri, 6 Nov 2020 14:17:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJx4Oo1YRo2TnpkH8vAnkr0418zYefIR6+ts2HFB8ImnrHGVdEUJi/3YpsBjoK980RH+c8ma X-Received: by 2002:a17:907:4186:: with SMTP id mz6mr4410028ejb.175.1604701047373; Fri, 06 Nov 2020 14:17:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604701047; cv=none; d=google.com; s=arc-20160816; b=SA5q5QqLBA/jfKlRboqhuCwQNtr6Y01uivrahDWyyyrRjDy9t3SQdMyjAPAXUj/uKN ereRFazvfse+x9tg/LqE0IxoNZdSFsoPSrNJ2g5Nl/30IIMw07vNUEOJO6qhsxOJcVWS q20vJEQqiD0SZI4YNd34359EHBx1OlGR3Qjml72DQY1Dz8OwRmozzdbGLA8SlIOXqUEU U1zPRahVSTyTKymoq3hXRvfzYiAvBtxRY3hz92WOMDLe3RIhOsKsPdko+3IUFj1B654k nYloqbHGoM76GSr9zhBeJxX3VYS8Zo56BBIVUK5tNdw8wWHlFysXZxFBgyLx8p8RmiWk 6N2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=iEFu7l66Fa3TR/ilbF+OS3KFDVUURYPqU+I60l63Z4U=; b=WJulCH/K6jCIu4wbzddMe3QriMGYtiZ9AudHTJ4KmhaC7eUNpnMUWAg22D9SMdFk60 qnUK7iczXLz+h+E9Te1dRHyxuo/raZub1ibhRyzvWH+5Z36xPDA19qrnJUPvbLPp/gXs rypYxV+x6PRVrPsTMTh5EvV5lfa4bsDYDhWDd5Z0keXCwSf+Hv4TOGWymsIrmZ0snibN yPqgNgMz6KsQb7tuIxplmFwlCSuZZVRLWIXc1I7CwMLzLgrFFEO72rCZSHXYS6dLpTSN lKQ74J9GVtIcXErUAb+UNWiKwaZafGHO2epNWf4BAV6Er530gi7IBAeLfjeqVl8y54C+ GDiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RcgDz53s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c9si1928667eds.291.2020.11.06.14.17.02; Fri, 06 Nov 2020 14:17:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RcgDz53s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728031AbgKFWPg (ORCPT + 99 others); Fri, 6 Nov 2020 17:15:36 -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.