From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD5E8C43613 for ; Thu, 20 Jun 2019 18:15:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BD2C7215EA for ; Thu, 20 Jun 2019 18:15:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561054508; bh=7Jwudyk8gLrRqbOd0GnOM9PbiioVLQlwYWYtl1inm6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=2iyEU2r4shB71Y9oKam3Eqqa4UKkwgRWXOf4VhqV7sSL4m6ceygMzvY7UlvP64nlR w0YFA/1Ien1tbBNZUdK8lKgkirQK5MPpxgsFnD7+CfgO2L9UNpAL05hAN9d4phm/go NIlq6nC86StvCZ8Ve+4h4jongxLUsoe1htx6HDHw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729552AbfFTSPH (ORCPT ); Thu, 20 Jun 2019 14:15:07 -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 =