Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp512346ybd; Wed, 26 Jun 2019 01:59:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJcrINzNbMp8n9lGgnZCy+3PY3nbkDJpqpw5jorNB+LmJ+HoQlSrkSF441IP5RElmMNwtD X-Received: by 2002:a63:d84e:: with SMTP id k14mr1899100pgj.234.1561539575187; Wed, 26 Jun 2019 01:59:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561539575; cv=none; d=google.com; s=arc-20160816; b=EvJ1fhBQd6HLSWdu3IaxxGFV4ImEa5gRwKkr09zUZOkwS+zTfrAovBlGzEX46RBV4E dyRDCAsVeOA3OiNrwxTcPWw9E0wP586iZiJMlmX4/oCvu3O4s2PJQsBf65Z8tEVNWCf9 Zx0bZGTfbItkfG5gDDd09YPf7s/Bk/f4Iks6QzpWBXdtQgdyHcdqLfhRJ3Q7R8mTPEgS ZSd468+Daj3Gmtln369kgdOsOr6fbAu0l9SosRKCiaGEX6bRnSAlfLQ99WhxMu2xauXm 3pABi4ncWhhBQ4mbROWQXQAI6cgqGYHwyVtSTCsv/JnH/tFxK+wNVXH73qqLA2jtx5S3 +LVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=JAJ19ByEJw8kjX/QajR1KmXfoa6HqxAwiLkz11Do0iU=; b=lLImhWj6x0HVCLSE0vF36QaDNL82lnHILGrVJl/u5PC00P7VKcqAkZVX4mysaELNCu VOAU7KI97bR58Ax0iHBV6pL7phxHGtGaxd4S/pa2siyQQCxLrJlA8bPsMjg3M43PgQ2N JbpT41Gag72eRiGV7ScjfGcjlKoeqmo/ciAsvYlWZRZ0zz8+jI6aHGI7XrvNuXVl7WQj 3n4qRglyPfeXqW0/Al6NtO3acDcKgBngPoR+SOC6ox1wfq5TreuLsjtjYxiGwjeq/kjH 5GzoioPSG0JApLpL0+cOG52wmpW+aXlSkRjH7TmiYNuuh0+oX23GCDm0Popg3jNSJvDz DCGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t5si2674796plr.124.2019.06.26.01.59.19; Wed, 26 Jun 2019 01:59:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726987AbfFZI6x (ORCPT + 99 others); Wed, 26 Jun 2019 04:58:53 -0400 Received: from mail.us.es ([193.147.175.20]:45616 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbfFZI6w (ORCPT ); Wed, 26 Jun 2019 04:58:52 -0400 Received: from antivirus1-rhel7.int (unknown [192.168.2.11]) by mail.us.es (Postfix) with ESMTP id 57B42BAEEA for ; Wed, 26 Jun 2019 10:58:49 +0200 (CEST) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id 48A0F114D9A for ; Wed, 26 Jun 2019 10:58:49 +0200 (CEST) Received: by antivirus1-rhel7.int (Postfix, from userid 99) id 2AF5B6E7A0; Wed, 26 Jun 2019 10:58:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on antivirus1-rhel7.int X-Spam-Level: X-Spam-Status: No, score=-108.2 required=7.5 tests=ALL_TRUSTED,BAYES_50, SMTPAUTH_US2,USER_IN_WHITELIST autolearn=disabled version=3.4.1 Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id CBA72DA4D0; Wed, 26 Jun 2019 10:58:46 +0200 (CEST) Received: from 192.168.1.97 (192.168.1.97) by antivirus1-rhel7.int (F-Secure/fsigk_smtp/550/antivirus1-rhel7.int); Wed, 26 Jun 2019 10:58:46 +0200 (CEST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int) Received: from us.es (sys.soleta.eu [212.170.55.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 1984lsi) by entrada.int (Postfix) with ESMTPSA id 9C4F24265A32; Wed, 26 Jun 2019 10:58:46 +0200 (CEST) Date: Wed, 26 Jun 2019 10:58:46 +0200 X-SMTPAUTHUS: auth mail.us.es From: Pablo Neira Ayuso To: Maxime Chevallier Cc: davem@davemloft.net, Florian Fainelli , Jiri Pirko , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Antoine Tenart , thomas.petazzoni@bootlin.com Subject: Re: [PATCH net-next] net: ethtool: Allow parsing ETHER_FLOW types when using flow_rule Message-ID: <20190626085846.ax277ojvyp5k3abt@salvia> References: <20190626084403.17749-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190626084403.17749-1-maxime.chevallier@bootlin.com> User-Agent: NeoMutt/20170113 (1.7.2) X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 26, 2019 at 10:44:03AM +0200, Maxime Chevallier wrote: > When parsing an ethtool_rx_flow_spec, users can specify an ethernet flow > which could contain matches based on the ethernet header, such as the > MAC address, the VLAN tag or the ethertype. > > Only the ethtype field is specific to the ether flow, the MAC and vlan > fields are processed using the special FLOW_EXT and FLOW_MAC_EXT flags. > > Signed-off-by: Maxime Chevallier > --- > net/core/ethtool.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/net/core/ethtool.c b/net/core/ethtool.c > index 4d1011b2e24f..01ceba556341 100644 > --- a/net/core/ethtool.c > +++ b/net/core/ethtool.c > @@ -2883,6 +2883,18 @@ ethtool_rx_flow_rule_create(const struct ethtool_rx_flow_spec_input *input) > match->mask.basic.n_proto = htons(0xffff); > > switch (fs->flow_type & ~(FLOW_EXT | FLOW_MAC_EXT | FLOW_RSS)) { > + case ETHER_FLOW: { > + const struct ethhdr *ether_spec, *ether_m_spec; > + > + ether_spec = &fs->h_u.ether_spec; > + ether_m_spec = &fs->m_u.ether_spec; > + > + if (ether_m_spec->h_proto) { > + match->key.basic.n_proto = ether_spec->h_proto; > + match->mask.basic.n_proto = ether_m_spec->h_proto; > + } I see some drivers in the tree also interpret the h_source and h_dest fields? https://elixir.bootlin.com/linux/latest/source/drivers/net/ethernet/sfc/falcon/ethtool.c#L1182 Probably good to address this in this patch too? Thanks.