Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp782196rwl; Fri, 4 Nov 2022 06:24:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4BXScQqvDFK5HqasvpFwqBA7DRFw6SYHNSRsKPxZYcscWeRwXLeJxz+ZC49Foc4cXcJ4Cl X-Received: by 2002:a17:90b:35cc:b0:215:d544:c704 with SMTP id nb12-20020a17090b35cc00b00215d544c704mr12748273pjb.49.1667568247604; Fri, 04 Nov 2022 06:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667568247; cv=none; d=google.com; s=arc-20160816; b=TQna+VK1Fz6+Psgl8zdwzgn8wZpZEZJ1JE6ByOFs+dqwKA9bf0Aa6XO43A5C9i2LfP TYQ+LYPsGAlGwQAMeCa4bZVwY2dd8aZeQ7FSxm6r2AYQxtldk5TmIXnyTnnZYvOKWT9F LsxGM5AAwweXsgkmYIUtr1E5zsZcP7cDnImI6dT55+6oRTVMnlal0fQpqqV4f79Cu8+G /oYZEl59+u1PAhQQLN+1lhsj35dHwJ5jDVJ0SMn836YrUJcxXQ9HNB1lNSmZSsDChw4S p9InQhYV4pUg28H0fcUcNbP2mNDzkbqg7VYreXNqudUDKfvfDADzpgidqOCSFgmphZ6S HUAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=JcKeaXNACpRL9T4GoRcnWnHtoKvZArLeYXgvty/5GPw=; b=hy/H7OlKMffwJJhbDLXe+NIIPHBeuxDJoI3DZnOru6cdX2UUMiHzypOc5dBW2ugWkm YARTuk34k8VkMNhiBUPhIr7xCOiSLBUJ/Ix6qkDR93Na8SiwTUGT3+krb4e2AhXNF2/k 20vBRDmZD3yyj0OqaNexk+4dD2lUpGJnANBFg/CFhru4qlWE+dyBhnzYcsxAzQ9yKTZJ 2olALWusq6rHhLuRQfCkraWXqUses0901khjqryFgQRJ12GR6IT2p7QB3eADHEmpIaM8 CWXyWxNk6aSnoEbmJgRRhZiI3lTCjOJkB8U+PCINGQWennwPl83HJmLbp+uWmDkVEtJ5 iPUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=e55PERic; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oa17-20020a17090b1bd100b0020b15fcac76si4032058pjb.4.2022.11.04.06.23.55; Fri, 04 Nov 2022 06:24:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=e55PERic; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231496AbiKDMda (ORCPT + 96 others); Fri, 4 Nov 2022 08:33:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230132AbiKDMd1 (ORCPT ); Fri, 4 Nov 2022 08:33:27 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 768721583F; Fri, 4 Nov 2022 05:33:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1667565207; x=1699101207; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=B2aH17D9PQ7GFN8pFlZ5kWL8Bi2LgoVEvlSNCoRVYJQ=; b=e55PERic6ywE4LAH/N9NYhGNSGHmQTtlNb5+y5YrrjMksvmtsHq5zKHe SypWYosl3FqeTv2WCA6rn/LFdA+gF/HzArwVjB1v0fZy4V2Ns9o/OHzMr w9BcOASNAy+HsUAr/h/tUuJ3tXHzPRZ+fABvMRYJDuGYBp+Q80Cp1EdhU 7PzTbpcF7200Y4W4/d55PXm5Ky3Leeyr2suVX0SANh3LN8O5WV1Hq6kaV cQWULuNk5Vi9b3mx2vGoIhyBzuJVsNNmzWeZVSsIP/s6vREraovoLRjkS W405v7V2uRqKtmFvXE4i/R2iEfDhfpZNdwb3MVTHpoI3QoBRbqoUxBGOM A==; X-IronPort-AV: E=Sophos;i="5.96,137,1665471600"; d="scan'208";a="181950097" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 Nov 2022 05:33:26 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 4 Nov 2022 05:33:24 -0700 Received: from den-dk-m31857.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 4 Nov 2022 05:33:21 -0700 From: Steen Hegelund To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: Steen Hegelund , Louis Peens , Baowen Zheng , "Simon Horman" , Tony Nguyen , Wojciech Drewek , Maksym Glubokiy , Pablo Neira Ayuso , , , , Horatiu Vultur Subject: [PATCH net-next] net: flow_offload: add support for ARP frame matching Date: Fri, 4 Nov 2022 13:33:14 +0100 Message-ID: <20221104123314.1349814-1-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds a new flow_rule_match_arp function that allows drivers to be able to dissect APR frames. Signed-off-by: Steen Hegelund --- include/net/flow_offload.h | 6 ++++++ net/core/flow_offload.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h index 7a60bc6d72c9..0400a0ac8a29 100644 --- a/include/net/flow_offload.h +++ b/include/net/flow_offload.h @@ -32,6 +32,10 @@ struct flow_match_vlan { struct flow_dissector_key_vlan *key, *mask; }; +struct flow_match_arp { + struct flow_dissector_key_arp *key, *mask; +}; + struct flow_match_ipv4_addrs { struct flow_dissector_key_ipv4_addrs *key, *mask; }; @@ -98,6 +102,8 @@ void flow_rule_match_vlan(const struct flow_rule *rule, struct flow_match_vlan *out); void flow_rule_match_cvlan(const struct flow_rule *rule, struct flow_match_vlan *out); +void flow_rule_match_arp(const struct flow_rule *rule, + struct flow_match_arp *out); void flow_rule_match_ipv4_addrs(const struct flow_rule *rule, struct flow_match_ipv4_addrs *out); void flow_rule_match_ipv6_addrs(const struct flow_rule *rule, diff --git a/net/core/flow_offload.c b/net/core/flow_offload.c index abe423fd5736..acfc1f88ea79 100644 --- a/net/core/flow_offload.c +++ b/net/core/flow_offload.c @@ -97,6 +97,13 @@ void flow_rule_match_cvlan(const struct flow_rule *rule, } EXPORT_SYMBOL(flow_rule_match_cvlan); +void flow_rule_match_arp(const struct flow_rule *rule, + struct flow_match_arp *out) +{ + FLOW_DISSECTOR_MATCH(rule, FLOW_DISSECTOR_KEY_ARP, out); +} +EXPORT_SYMBOL(flow_rule_match_arp); + void flow_rule_match_ipv4_addrs(const struct flow_rule *rule, struct flow_match_ipv4_addrs *out) { -- 2.38.1