From: Guillaume Nault <gnault@redhat.com>
To: Wojciech Drewek <wojciech.drewek@intel.com>
Cc: simon.horman@corigine.com, kurt@linutronix.de,
komachi.yoshiki@gmail.com, jchapman@katalix.com,
edumazet@google.com, boris.sukholitko@broadcom.com,
louis.peens@corigine.com, intel-wired-lan@lists.osuosl.org,
vladbu@nvidia.com, kuba@kernel.org, pabeni@redhat.com,
pablo@netfilter.org, baowen.zheng@corigine.com,
maksym.glubokiy@plvision.eu, jiri@resnulli.us, paulb@nvidia.com,
jhs@mojatatu.com, xiyou.wangcong@gmail.com,
netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [Intel-wired-lan] [RFC PATCH net-next v2 2/5] flow_dissector: Add L2TPv3 dissectors
Date: Wed, 31 Aug 2022 12:07:15 +0200 [thread overview]
Message-ID: <20220831100715.GB18919@pc-4.home> (raw)
In-Reply-To: <20220829094412.554018-3-wojciech.drewek@intel.com>
On Mon, Aug 29, 2022 at 11:44:09AM +0200, Wojciech Drewek wrote:
> Allow to dissect L2TPv3 specific field which is:
> - session ID (32 bits)
>
> L2TPv3 might be transported over IP or over UDP,
> this ipmplementation is only about L2TPv3 over IP.
> IP protocold carries L2TPv3 when ip_proto is
s/protocold/protocol/
> +static void __skb_flow_dissect_l2tpv3(const struct sk_buff *skb,
> + struct flow_dissector *flow_dissector,
> + void *target_container, const void *data,
> + int nhoff, int hlen)
> +{
> + struct flow_dissector_key_l2tpv3 *key_l2tpv3;
> + struct {
> + __be32 session_id;
> + } *hdr, _hdr;
> +
> + hdr = __skb_header_pointer(skb, nhoff, sizeof(_hdr), data, hlen, &_hdr);
> + if (!hdr)
> + return;
> +
> + if (!dissector_uses_key(flow_dissector, FLOW_DISSECTOR_KEY_L2TPV3))
> + return;
I'd find it more logical to test !dissector_uses_key() first, then call
__skb_header_pointer(). But that probably just a personnal preference.
In any case the code looks good to me.
Acked-by: Guillaume Nault <gnault@redhat.com>
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
WARNING: multiple messages have this Message-ID (diff)
From: Guillaume Nault <gnault@redhat.com>
To: Wojciech Drewek <wojciech.drewek@intel.com>
Cc: netdev@vger.kernel.org, alexandr.lobakin@intel.com,
jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, jhs@mojatatu.com, xiyou.wangcong@gmail.com,
jiri@resnulli.us, marcin.szycik@linux.intel.com,
michal.swiatkowski@linux.intel.com, kurt@linutronix.de,
boris.sukholitko@broadcom.com, vladbu@nvidia.com,
komachi.yoshiki@gmail.com, paulb@nvidia.com,
baowen.zheng@corigine.com, louis.peens@corigine.com,
simon.horman@corigine.com, pablo@netfilter.org,
maksym.glubokiy@plvision.eu, intel-wired-lan@lists.osuosl.org,
jchapman@katalix.com
Subject: Re: [RFC PATCH net-next v2 2/5] flow_dissector: Add L2TPv3 dissectors
Date: Wed, 31 Aug 2022 12:07:15 +0200 [thread overview]
Message-ID: <20220831100715.GB18919@pc-4.home> (raw)
In-Reply-To: <20220829094412.554018-3-wojciech.drewek@intel.com>
On Mon, Aug 29, 2022 at 11:44:09AM +0200, Wojciech Drewek wrote:
> Allow to dissect L2TPv3 specific field which is:
> - session ID (32 bits)
>
> L2TPv3 might be transported over IP or over UDP,
> this ipmplementation is only about L2TPv3 over IP.
> IP protocold carries L2TPv3 when ip_proto is
s/protocold/protocol/
> +static void __skb_flow_dissect_l2tpv3(const struct sk_buff *skb,
> + struct flow_dissector *flow_dissector,
> + void *target_container, const void *data,
> + int nhoff, int hlen)
> +{
> + struct flow_dissector_key_l2tpv3 *key_l2tpv3;
> + struct {
> + __be32 session_id;
> + } *hdr, _hdr;
> +
> + hdr = __skb_header_pointer(skb, nhoff, sizeof(_hdr), data, hlen, &_hdr);
> + if (!hdr)
> + return;
> +
> + if (!dissector_uses_key(flow_dissector, FLOW_DISSECTOR_KEY_L2TPV3))
> + return;
I'd find it more logical to test !dissector_uses_key() first, then call
__skb_header_pointer(). But that probably just a personnal preference.
In any case the code looks good to me.
Acked-by: Guillaume Nault <gnault@redhat.com>
next prev parent reply other threads:[~2022-08-31 10:07 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-29 9:44 [Intel-wired-lan] [RFC PATCH net-next v2 0/5] ice: L2TPv3 offload support Wojciech Drewek
2022-08-29 9:44 ` Wojciech Drewek
2022-08-29 9:44 ` [Intel-wired-lan] [RFC PATCH net-next v2 1/5] uapi: move IPPROTO_L2TP to in.h Wojciech Drewek
2022-08-29 9:44 ` Wojciech Drewek
2022-08-31 10:02 ` [Intel-wired-lan] " Guillaume Nault
2022-08-31 10:02 ` Guillaume Nault
2022-08-29 9:44 ` [Intel-wired-lan] [RFC PATCH net-next v2 2/5] flow_dissector: Add L2TPv3 dissectors Wojciech Drewek
2022-08-29 9:44 ` Wojciech Drewek
2022-08-31 10:07 ` Guillaume Nault [this message]
2022-08-31 10:07 ` Guillaume Nault
2022-08-31 10:24 ` [Intel-wired-lan] " Drewek, Wojciech
2022-08-31 10:24 ` Drewek, Wojciech
2022-08-29 9:44 ` [Intel-wired-lan] [RFC PATCH net-next v2 3/5] net/sched: flower: Add L2TPv3 filter Wojciech Drewek
2022-08-29 9:44 ` Wojciech Drewek
2022-08-31 10:23 ` [Intel-wired-lan] " Guillaume Nault
2022-08-31 10:23 ` Guillaume Nault
2022-08-29 9:44 ` [Intel-wired-lan] [RFC PATCH net-next v2 4/5] flow_offload: Introduce flow_match_l2tpv3 Wojciech Drewek
2022-08-29 9:44 ` Wojciech Drewek
2022-08-29 9:44 ` [Intel-wired-lan] [RFC PATCH net-next v2 5/5] ice: Add L2TPv3 hardware offload support Wojciech Drewek
2022-08-29 9:44 ` Wojciech Drewek
2022-08-31 9:16 ` [Intel-wired-lan] " Michal Swiatkowski
2022-08-31 9:16 ` Michal Swiatkowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220831100715.GB18919@pc-4.home \
--to=gnault@redhat.com \
--cc=baowen.zheng@corigine.com \
--cc=boris.sukholitko@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jchapman@katalix.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=komachi.yoshiki@gmail.com \
--cc=kuba@kernel.org \
--cc=kurt@linutronix.de \
--cc=louis.peens@corigine.com \
--cc=maksym.glubokiy@plvision.eu \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
--cc=paulb@nvidia.com \
--cc=simon.horman@corigine.com \
--cc=vladbu@nvidia.com \
--cc=wojciech.drewek@intel.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.