Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2231664ybi; Thu, 20 Jun 2019 11:16:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0A3PcbJFtO3xPY5kKiS9UiguPf5CAqs7JhUk3Zq6HIxY05wKV7iZKEmH6/X8K24BMreB2 X-Received: by 2002:a17:902:e306:: with SMTP id cg6mr93144349plb.341.1561054601452; Thu, 20 Jun 2019 11:16:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561054601; cv=none; d=google.com; s=arc-20160816; b=wpn4uhRUYy3Qj5JTiU40kLjLOBmXBujSHsTIirs8HyiZ7F1njXd1HZbgZnaq8shPjG aCHXAWIUqFNYSSDy1AgYTPR34J7rB/07RdfYteqHkT+BVowdg0xtti754xaAhdrnqgx7 ky1L9aLgF1uIaEQR4i56uC+7jtqEN/urMeTvoRjxjPTgFH05RITyL+Ji5p1T7ZUtrKPL vPpNbcLxKhkbJhkBw3xVlWEH/l59pI/2BAncwoWS3rObIcffOkAM+XskuNJbXYMxee2w 6QTSERtrUpRVQkc0FBfx8ue7PMDkTtRLfV96KeWKyNyrd3Df10589PZNNz3l1DRJeSDA tl7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=N+Zvm7l9UeDYQsxRZshW9IhTDSkWRKUtX/2u5YwmlKw=; b=UJFPrubVx3RngufETpixSW1R+3CPu3UH7N/L4MIqTws9lLSasXroI4mfCB5Z3aWfAN itl484cdPvkJxnGkDe8mKkUIDxGn647TEREtG4SAYatQ2cPQjiY4weB0LqPUqndVinjz s9SwtwQ064RQfr9dQzhq5FfLXQ8gvTaJaLu4B4hVGhWPvPw1fi4ib1je5rv1df0QP0fV GWr8D+OZTgdNyRE5QRqLQg7o/q8zSbQDN33T8o1Xamtcsln4It6BhMJKcrnFp7Wt0XVM 6jgi1m+ma23toPzR5iWDqLzwdVmF2qsxDXs/V0cSJbMiR+d3z6fdu1RHAqQcKgONLBNU AMcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=C7ebzLXk; 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 u23si148047pfh.177.2019.06.20.11.16.26; Thu, 20 Jun 2019 11:16:41 -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; dkim=pass header.i=@kernel.org header.s=default header.b=C7ebzLXk; 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 S1729549AbfFTSPG (ORCPT + 99 others); Thu, 20 Jun 2019 14:15:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:43686 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729537AbfFTSPF (ORCPT ); Thu, 20 Jun 2019 14:15:05 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 10F9721655; Thu, 20 Jun 2019 18:15:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561054504; bh=7Jwudyk8gLrRqbOd0GnOM9PbiioVLQlwYWYtl1inm6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C7ebzLXkeYWfWJfzBVXE9y2pJFtjelgaOvSCDpUbNEDgmtGJZgsxBqR04klMniltI RtlfJNyJPmOFHt96Ji7tVNZ5WxFu83rcL/bAhRiZ5M18n8YMGORCMI6ES7+YZwJ0D/ JkmGpa12j6sjvkXeq93/74L66FnXBz7FtKdnY7qs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= , Maxime Chevallier , "David S. Miller" Subject: [PATCH 5.1 22/98] net: ethtool: Allow matching on vlan DEI bit Date: Thu, 20 Jun 2019 19:56:49 +0200 Message-Id: <20190620174350.214938409@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190620174349.443386789@linuxfoundation.org> References: <20190620174349.443386789@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maxime Chevallier [ Upstream commit f0d2ca1531377e7da888913e277eefac05a59b6f ] Using ethtool, users can specify a classification action matching on the full vlan tag, which includes the DEI bit (also previously called CFI). However, when converting the ethool_flow_spec to a flow_rule, we use dissector keys to represent the matching patterns. Since the vlan dissector key doesn't include the DEI bit, this information was silently discarded when translating the ethtool flow spec in to a flow_rule. This commit adds the DEI bit into the vlan dissector key, and allows propagating the information to the driver when parsing the ethtool flow spec. Fixes: eca4205f9ec3 ("ethtool: add ethtool_rx_flow_spec to flow_rule structure translator") Reported-by: Michał Mirosław Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- include/net/flow_dissector.h | 1 + net/core/ethtool.c | 5 +++++ 2 files changed, 6 insertions(+) --- a/include/net/flow_dissector.h +++ b/include/net/flow_dissector.h @@ -46,6 +46,7 @@ struct flow_dissector_key_tags { struct flow_dissector_key_vlan { u16 vlan_id:12, + vlan_dei:1, vlan_priority:3; __be16 vlan_tpid; }; --- a/net/core/ethtool.c +++ b/net/core/ethtool.c @@ -3022,6 +3022,11 @@ ethtool_rx_flow_rule_create(const struct match->mask.vlan.vlan_id = ntohs(ext_m_spec->vlan_tci) & 0x0fff; + match->key.vlan.vlan_dei = + !!(ext_h_spec->vlan_tci & htons(0x1000)); + match->mask.vlan.vlan_dei = + !!(ext_m_spec->vlan_tci & htons(0x1000)); + match->key.vlan.vlan_priority = (ntohs(ext_h_spec->vlan_tci) & 0xe000) >> 13; match->mask.vlan.vlan_priority =