From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Gospodarek Subject: Re: [PATCH net v2 2/6] bnxt_en: do not allow wildcard matches for L2 flows Date: Wed, 11 Apr 2018 16:31:52 -0400 Message-ID: <20180411203152.GD33938@C02RW35GFVH8.dhcp.broadcom.net> References: <1523461818-15774-1-git-send-email-michael.chan@broadcom.com> <1523461818-15774-3-git-send-email-michael.chan@broadcom.com> <20180411114303.6f927c45@cakuba.netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Michael Chan , davem@davemloft.net, netdev@vger.kernel.org To: Jakub Kicinski Return-path: Received: from mail-qt0-f181.google.com ([209.85.216.181]:37780 "EHLO mail-qt0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756345AbeDKUb4 (ORCPT ); Wed, 11 Apr 2018 16:31:56 -0400 Received: by mail-qt0-f181.google.com with SMTP id w12so3538276qti.4 for ; Wed, 11 Apr 2018 13:31:56 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20180411114303.6f927c45@cakuba.netronome.com> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, Apr 11, 2018 at 11:43:14AM -0700, Jakub Kicinski wrote: > On Wed, 11 Apr 2018 11:50:14 -0400, Michael Chan wrote: > > @@ -764,6 +788,41 @@ static bool bnxt_tc_can_offload(struct bnxt *bp, struct bnxt_tc_flow *flow) > > return false; > > } > > > > + /* Currently source/dest MAC cannot be partial wildcard */ > > + if (bits_set(&flow->l2_key.smac, sizeof(flow->l2_key.smac)) && > > + !is_exactmatch(flow->l2_mask.smac, sizeof(flow->l2_mask.smac))) { > > + netdev_info(bp->dev, "Wildcard match unsupported for Source MAC\n"); > > This wouldn't be something to do in net, but how do you feel about > using extack for messages like this? > I agree 'net' would not have been the place for a change like that, but I do think that would be a good idea. It looks like we could easily change the ndo_setup_tc to something like this: int (*ndo_setup_tc)(struct net_device *dev, enum tc_setup_type type, void *type_data, struct netlink_ext_ack *extack); It also looks like most of the callers of ndo_setup_tc have infra in place to pass extack easily when the call is sourced from a netlink message. The others can just pass in NULL or define a local netlink_ext_ack variable for short-term use.