From patchwork Tue Nov 28 07:48:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kurt Kanzenbach X-Patchwork-Id: 1869157 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=wJ9wNNjW; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SfZYD1pJNz1yRW for ; Tue, 28 Nov 2023 18:57:04 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 6D44940A49; Tue, 28 Nov 2023 07:57:02 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 6D44940A49 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1701158222; bh=oXoNq0TYQX8RyF/Qd4Ulw0I86KyFOkdrCTna13oyDZE=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=wJ9wNNjWp0CWo3ouXekuOw9HpYcDe0dMSsnQq3oeHEhB2tEgUVNGPgeyWYFwIIjse +kMR7veXBub3/CY2Dp/xXnvt1Ip3mKVJFzEHSVcMjuZ0MTdOXVNvGyeVKOWjf0kKYc 93jbUfWj3vig2NjPJcYvOXXWCtiKLNKf1lcFCk43ekXatDrndtm9xUNIfdm79rmsVe dqNednbKWziv13EelWRDwN8MvSbRlqueL9k7yk6w7LurpxWeSWDrddVOJkav46noCR 9LOoKZC0LHaTnJ+cvaCyks7ehIV441/26YxEYTptMlPWTGAjU+SuaxAfRqULZIhC7L 2wdugnpuklD9A== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id unZXyrXV-dOn; Tue, 28 Nov 2023 07:57:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 3CC55408C5; Tue, 28 Nov 2023 07:57:01 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 3CC55408C5 X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 25A941BF3ED for ; Tue, 28 Nov 2023 07:56:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id B402860FC7 for ; Tue, 28 Nov 2023 07:56:49 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org B402860FC7 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 86DyG4-2Rtxr for ; Tue, 28 Nov 2023 07:56:49 +0000 (UTC) X-Greylist: delayed 457 seconds by postgrey-1.37 at util1.osuosl.org; Tue, 28 Nov 2023 07:56:48 UTC DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org EF56D60F81 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by smtp3.osuosl.org (Postfix) with ESMTPS id EF56D60F81 for ; Tue, 28 Nov 2023 07:56:48 +0000 (UTC) From: Kurt Kanzenbach To: Jesse Brandeburg , Tony Nguyen , Vinicius Costa Gomes Date: Tue, 28 Nov 2023 08:48:48 +0100 Message-Id: <20231128074849.16863-5-kurt@linutronix.de> In-Reply-To: <20231128074849.16863-1-kurt@linutronix.de> References: <20231128074849.16863-1-kurt@linutronix.de> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701157751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=a299mGbCOnW9pogbkkKeguw/IHMZOMDhnTiCw8p6fy0=; b=v6Ed3rK+vKrWm8rSN9xYkKpp6sKzjO6Aigcb3tjqK4D57Ld4s9bGZoxcgVnNwxnX2hy8Dv 8f/nbRA/L00HurtL1qsAyFBNHhMAh6C7IEL/hkWrZc776LsVg7QlX6KoFA6LbdsHi0FIpf O9SF1oOtbTxVe8sVZUnGo6v5K5a/hWXDseaQyn5GfdAJNrRgWgiK5Tvgibnby+qW98hY79 vl9WFBZHHrLeeBUzSW1Ge6HDajUQIWlqFpcOQ6PjZK+LdlYM4qYX5Nsxr2QrBjfagzn8B9 P0YTl0mc/znv7oIVMwJYRnvuPOItjgK+/f9Vkg+EE0o3oRveSSVtoRt8HKEFYg== X-Mailman-Original-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701157751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=a299mGbCOnW9pogbkkKeguw/IHMZOMDhnTiCw8p6fy0=; b=GCvleQ5MqWqtMrF7/KF0x/6p5QGEqpOKVY7E73Fs7ZkhGjwVXVpS7GVc21+kQnADudQxtx SpyK97McmpJuiBBA== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=v6Ed3rK+; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=GCvleQ5M Subject: [Intel-wired-lan] [PATCH net-next 4/5] igc: Report VLAN EtherType matching back to user X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, Kurt Kanzenbach , Eric Dumazet , intel-wired-lan@lists.osuosl.org, Jakub Kicinski , Paolo Abeni , "David S. Miller" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Currently the driver allows to configure matching by VLAN EtherType. However, the retrieval function does not report it back to the user. Add it. Before: |root@host:~# ethtool -N enp3s0 flow-type ether vlan-etype 0x8100 action 0 |Added rule with ID 63 |root@host:~# ethtool --show-ntuple enp3s0 |4 RX rings available |Total 1 rules | |Filter: 63 | Flow Type: Raw Ethernet | Src MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF | Dest MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF | Ethertype: 0x0 mask: 0xFFFF | Action: Direct to queue 0 After: |root@host:~# ethtool -N enp3s0 flow-type ether vlan-etype 0x8100 action 0 |Added rule with ID 63 |root@host:~# ethtool --show-ntuple enp3s0 |4 RX rings available |Total 1 rules | |Filter: 63 | Flow Type: Raw Ethernet | Src MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF | Dest MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF | Ethertype: 0x0 mask: 0xFFFF | VLAN EtherType: 0x8100 mask: 0x0 | VLAN: 0x0 mask: 0xffff | User-defined: 0x0 mask: 0xffffffffffffffff | Action: Direct to queue 0 Signed-off-by: Kurt Kanzenbach --- drivers/net/ethernet/intel/igc/igc_ethtool.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c index 8e12ef362b23..b782fb2abf20 100644 --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c @@ -980,6 +980,12 @@ static int igc_ethtool_get_nfc_rule(struct igc_adapter *adapter, fsp->m_u.ether_spec.h_proto = ETHER_TYPE_FULL_MASK; } + if (rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_ETYPE) { + fsp->flow_type |= FLOW_EXT; + fsp->h_ext.vlan_etype = htons(rule->filter.vlan_etype); + fsp->m_ext.vlan_etype = ETHER_TYPE_FULL_MASK; + } + if (rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_TCI) { fsp->flow_type |= FLOW_EXT; fsp->h_ext.vlan_tci = htons(rule->filter.vlan_tci);