From patchwork Fri Nov 4 12:19:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 15496 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp371783wru; Fri, 4 Nov 2022 05:34:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4p1YTeVQTgSJC0Mk53LlT43oCo5gGTW2LwoFol/kwyINubyoKku3S2E/3BJIc5oiiIHwWw X-Received: by 2002:a05:6402:4505:b0:451:1551:7b14 with SMTP id ez5-20020a056402450500b0045115517b14mr14351189edb.300.1667565241631; Fri, 04 Nov 2022 05:34:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667565241; cv=none; d=google.com; s=arc-20160816; b=m+mPLSv5aDRWxFan5TTBOnucZpRKATgMUBgBjvaAzuVR4qxtVKSkds85x9rmhcmlPX wxqu4+BKy00bzTyRB2P8k8sJHykCIGCBPo130l+lF32AE9m32oBHhht9b4mH0ja8+Z+d qxIBTIPphmTWEu1RNbZvQEf08prAC9oT0KilaDLy2anEONSCnhIglwHVpwR3dMLOvnjv h+MKtsuS6H6DdKN2kv5FJ0sB7Cd3oUOQ+lbvO5ZiRn8Y6Y/OXv04DcNVX+qGO0AXRmXS bvHEF1QvQQcjeKKLl2FLsKmtGjS68y0hjA9kyGXuvLcVgCVeSVEluFAz7fkjyzVNbLR0 dzxw== 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=hXLoUlIHIFjrejBE0rwqc8rcIx67Q1zdeA7inD97Xh4=; b=tF34H9kF83Vk5cyjidJE1UyjoCfUnBRKVHKPOsliQYFVjl1gthK8mrdhj1lEDvpPo/ wmPkcX+LMNvNttqJO+llAxZZxNjOLsQTgfMjC33gGrt8E9/QIDKpnxjc8/6L4+ZdQQdH T2rAu5dE2RQ5yfhSXLK2NoAnYzVzqoUOUX89jizFn4ul6osKpW6GD4+ZFf4GfgF4wfkS MTrnb/X7Gk9N2vX0aAkBgrRhAC7/XNNaOS8mcKu5GITNZX0gTXDlfLK1726QMbdR5BI6 XQ9SPheHlWCX3XFlXNrrUgnueykDUCBEaqeXrLrvV1EyE+krT3UGt99z453R/VV29D8Q BATw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=difmHZFw; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q18-20020a056402041200b0045c9313faf7si3973475edv.353.2022.11.04.05.33.35; Fri, 04 Nov 2022 05:34:01 -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=difmHZFw; 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 S231810AbiKDMUE (ORCPT + 99 others); Fri, 4 Nov 2022 08:20:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230402AbiKDMUC (ORCPT ); Fri, 4 Nov 2022 08:20:02 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 909D0120A0; Fri, 4 Nov 2022 05:20:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1667564400; x=1699100400; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=b8IIA3P7AcrfkQStqWsci42IpheCko9C3MblZ4EP9F4=; b=difmHZFwsa3K6yjqdkzC51muIYFiozjRCDA/5JyXCp6CGTs9iTVBhc7G 8f4M+MjzvLyF06SKHWLb3M+nAMzdXjVF3OcAj4xga3LytJmUo563Nl85n lBWLW3k22XYaw3VCpbsDAEMBHjYh5Kig6/9QFOLu4WPRGHckvKSh4L6yE yZD2667C+QE0DKMx1KtoEVce1M1Ah3SyqOZIbUSTzr84/Vubd2T2u/YZq bqYCRyjAHYB8/IUJnzFgUCHlu9tJGdMqFpre4mwpwR1j4N+iAQQnZw+QH MUd26TBM5zD441PWVZ+E+laOhQXMQIEoC7x+06dkRdN16aEzc5uvITpe1 A==; X-IronPort-AV: E=Sophos;i="5.96,137,1665471600"; d="scan'208";a="121821692" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 Nov 2022 05:19:59 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) 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:19:44 -0700 Received: from den-dk-m31857.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 4 Nov 2022 05:19:41 -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:19:15 +0100 Message-ID: <20221104121915.1317246-1-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748568890644430480?= X-GMAIL-MSGID: =?utf-8?q?1748568890644430480?= flow_rule_match_arp allows drivers 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) {