From patchwork Fri Jul 8 12:24:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Szycik X-Patchwork-Id: 12911117 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56593C43334 for ; Fri, 8 Jul 2022 12:25:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237913AbiGHMZE (ORCPT ); Fri, 8 Jul 2022 08:25:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237634AbiGHMZB (ORCPT ); Fri, 8 Jul 2022 08:25:01 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0E111EC78 for ; Fri, 8 Jul 2022 05:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657283100; x=1688819100; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=L4H1ia+czzedEKJRAgfchzILqKSfJxhzzsSV0Hsf6k4=; b=VuYlqam5PsPc6ib3nEIrDmFM4fn4P6u+6FpZHzAoLtqQkq1xchjQNVd3 4Hfkzt8Zvc3L4ygUAKzyxkv3dC8gfJ5VzwNX6VkmoV5fT+I59WydKZW7F l7Ls0Dq9AKP6txmcTPWWaaBiHtgMmU2rOdNs+ioKzEhSeDZM0rSYwbd5Y /AcyWWSUrAKy7TYTLNQ8OrbMb2t4Wur0F7s3xgdKvYndpL9mJqBVumiBd Nt5TNbzwQ4xyoLE4BxjLh4ErhNq2vUj0s5L3Oq+obVgvetk2LQOhltDkZ mLhdRumRa54XJxh3IM1DcRkJJQnLWpf3Tw5pndY8yJF/HhPihP4f/QDnH g==; X-IronPort-AV: E=McAfee;i="6400,9594,10401"; a="264681770" X-IronPort-AV: E=Sophos;i="5.92,255,1650956400"; d="scan'208";a="264681770" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2022 05:25:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,255,1650956400"; d="scan'208";a="621198433" Received: from irvmail001.ir.intel.com ([10.43.11.63]) by orsmga008.jf.intel.com with ESMTP; 08 Jul 2022 05:24:55 -0700 Received: from rozewie.igk.intel.com (rozewie.igk.intel.com [10.211.8.69]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 268COncb014111; Fri, 8 Jul 2022 13:24:53 +0100 From: Marcin Szycik To: netdev@vger.kernel.org Cc: anthony.l.nguyen@intel.com, davem@davemloft.net, xiyou.wangcong@gmail.com, jesse.brandeburg@intel.com, gustavoars@kernel.org, baowen.zheng@corigine.com, boris.sukholitko@broadcom.com, edumazet@google.com, kuba@kernel.org, jhs@mojatatu.com, jiri@resnulli.us, kurt@linutronix.de, pablo@netfilter.org, pabeni@redhat.com, paulb@nvidia.com, simon.horman@corigine.com, komachi.yoshiki@gmail.com, zhangkaiheb@126.com, intel-wired-lan@lists.osuosl.org, michal.swiatkowski@linux.intel.com, wojciech.drewek@intel.com, alexandr.lobakin@intel.com, gnault@redhat.com, mostrows@earthlink.net, paulus@samba.org Subject: [RFC PATCH net-next v4 3/4] flow_offload: Introduce flow_match_pppoe Date: Fri, 8 Jul 2022 14:24:20 +0200 Message-Id: <20220708122421.19309-4-marcin.szycik@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220708122421.19309-1-marcin.szycik@linux.intel.com> References: <20220708122421.19309-1-marcin.szycik@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC From: Wojciech Drewek Allow to offload PPPoE filters by adding flow_rule_match_pppoe. Drivers can extract PPPoE specific fields from now on. Signed-off-by: Wojciech Drewek --- 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 7ac313858037..8826606c8464 100644 --- a/include/net/flow_offload.h +++ b/include/net/flow_offload.h @@ -72,6 +72,10 @@ struct flow_match_ct { struct flow_dissector_key_ct *key, *mask; }; +struct flow_match_pppoe { + struct flow_dissector_key_pppoe *key, *mask; +}; + struct flow_rule; void flow_rule_match_meta(const struct flow_rule *rule, @@ -116,6 +120,8 @@ void flow_rule_match_enc_opts(const struct flow_rule *rule, struct flow_match_enc_opts *out); void flow_rule_match_ct(const struct flow_rule *rule, struct flow_match_ct *out); +void flow_rule_match_pppoe(const struct flow_rule *rule, + struct flow_match_pppoe *out); enum flow_action_id { FLOW_ACTION_ACCEPT = 0, diff --git a/net/core/flow_offload.c b/net/core/flow_offload.c index 929f6379a279..d13d293e3de2 100644 --- a/net/core/flow_offload.c +++ b/net/core/flow_offload.c @@ -223,6 +223,13 @@ void flow_rule_match_ct(const struct flow_rule *rule, } EXPORT_SYMBOL(flow_rule_match_ct); +void flow_rule_match_pppoe(const struct flow_rule *rule, + struct flow_match_pppoe *out) +{ + FLOW_DISSECTOR_MATCH(rule, FLOW_DISSECTOR_KEY_PPPOE, out); +} +EXPORT_SYMBOL(flow_rule_match_pppoe); + struct flow_block_cb *flow_block_cb_alloc(flow_setup_cb_t *cb, void *cb_ident, void *cb_priv, void (*release)(void *cb_priv))