Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp815246ybi; Thu, 30 May 2019 07:12:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxy4OZeev+B0Kip2uAJJU3Ti9oGFKrPSJA2S/xSMQo1A8ngUXIGhKr+OM+XZGs7v43uH1xB X-Received: by 2002:a63:1622:: with SMTP id w34mr3913033pgl.45.1559225547992; Thu, 30 May 2019 07:12:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559225547; cv=none; d=google.com; s=arc-20160816; b=blN/W05aNWiM56z7obvGXJEJNG4M09ycHRWeK3TJSMFlw1xPYXp9XGErkiXpkGQfRL 7J8A0zNcKcFXfHgaAjWT8g5RlsKElDvra0lY0p+0d7Qq902eKu8o2gfcegviIu2wOaa+ Ghz9M6XDGhSk3fK/TXNnUgCkEBR1pQTlymkC1EgkJV6+EwPlAbx/ZgWe5lqQmRFFHvzw yzkdw1bDjtShLagRYuYTP3Qhn7quXjWnJ9BUbzWhnrGj+JiaXKA/KpgctPtaHOCDJCGI Qs+pAuRImQMsK8tEFofHLUj+9K/GhXf97irXWk+nXX4SZzRig4/dE5CbU+5aHVOGy9Qa 5JmA== 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=DVFdkYwiShqnHFIbjFp+wG+h935DjLAwI6gwBp7doAI=; b=PQOFA844N96wxoZK2c8XR3fvJASHlDyNeiAszz0g8VPM9kbW+M5jDqq/loge/MXfDI X+JRk+ZuWl3qXh0yIYsS3STXKgVXoZlnvPnkscxhFEixlJr0UdIxdlAwvkbuip8tyCuG o5kx0BThXRZpUON0t6nrTdzYVlidk/MdKbP3skVbPvTt/IALi1La+XqLxfjUVqXyjdjb l73tAbxS1fKlFsNcixlzGLNvrOPfC2tQYZ4/vMyJEifCZmS+CERVfzTsBsA895WPoKL1 KCrCaSvQ+8fZqUNk8qsKL4rJX7rLqD6uBboQU8ESIhA63XFBx7v2zcn2mnxVI0iCSiry ZtMQ== 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 6si3475782pld.293.2019.05.30.07.12.02; Thu, 30 May 2019 07:12:27 -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 S1727183AbfE3OKC (ORCPT + 99 others); Thu, 30 May 2019 10:10:02 -0400 Received: from mail.us.es ([193.147.175.20]:57956 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726454AbfE3OKB (ORCPT ); Thu, 30 May 2019 10:10:01 -0400 Received: from antivirus1-rhel7.int (unknown [192.168.2.11]) by mail.us.es (Postfix) with ESMTP id F213F15AEAF for ; Thu, 30 May 2019 16:09:59 +0200 (CEST) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id E3D0EDA708 for ; Thu, 30 May 2019 16:09:59 +0200 (CEST) Received: by antivirus1-rhel7.int (Postfix, from userid 99) id C34CADA710; Thu, 30 May 2019 16:09:59 +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 67829DA702; Thu, 30 May 2019 16:09:57 +0200 (CEST) Received: from 192.168.1.97 (192.168.1.97) by antivirus1-rhel7.int (F-Secure/fsigk_smtp/550/antivirus1-rhel7.int); Thu, 30 May 2019 16:09:57 +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 3B9E54265A5B; Thu, 30 May 2019 16:09:57 +0200 (CEST) Date: Thu, 30 May 2019 16:09:56 +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] ethtool: Check for vlan etype or vlan tci when parsing flow_rule Message-ID: <20190530140956.w67rqecfnqazizrb@salvia> References: <20190530140840.741-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190530140840.741-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 Thu, May 30, 2019 at 04:08:40PM +0200, Maxime Chevallier wrote: > When parsing an ethtool flow spec to build a flow_rule, the code checks > if both the vlan etype and the vlan tci are specified by the user to add > a FLOW_DISSECTOR_KEY_VLAN match. > > However, when the user only specified a vlan etype or a vlan tci, this > check silently ignores these parameters. > > For example, the following rule : > > ethtool -N eth0 flow-type udp4 vlan 0x0010 action -1 loc 0 > > will result in no error being issued, but the equivalent rule will be > created and passed to the NIC driver : > > ethtool -N eth0 flow-type udp4 action -1 loc 0 > > In the end, neither the NIC driver using the rule nor the end user have > a way to know that these keys were dropped along the way, or that > incorrect parameters were entered. > > This kind of check should be left to either the driver, or the ethtool > flow spec layer. > > This commit makes so that ethtool parameters are forwarded as-is to the > NIC driver. > > Since none of the users of ethtool_rx_flow_rule_create are using the > VLAN dissector, I don't think this qualifies as a regression. > > Fixes: eca4205f9ec3 ("ethtool: add ethtool_rx_flow_spec to flow_rule structure translator") > Signed-off-by: Maxime Chevallier Acked-by: Pablo Neira Ayuso Thanks!