[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <MW4PR11MB57764352D74749A0045B1212FD789@MW4PR11MB5776.namprd11.prod.outlook.com>
Date: Wed, 31 Aug 2022 10:24:45 +0000
From: "Drewek, Wojciech" <wojciech.drewek@...el.com>
To: Guillaume Nault <gnault@...hat.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"Lobakin, Alexandr" <alexandr.lobakin@...el.com>,
"Brandeburg, Jesse" <jesse.brandeburg@...el.com>,
"Nguyen, Anthony L" <anthony.l.nguyen@...el.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"jhs@...atatu.com" <jhs@...atatu.com>,
"xiyou.wangcong@...il.com" <xiyou.wangcong@...il.com>,
"jiri@...nulli.us" <jiri@...nulli.us>,
"marcin.szycik@...ux.intel.com" <marcin.szycik@...ux.intel.com>,
"michal.swiatkowski@...ux.intel.com"
<michal.swiatkowski@...ux.intel.com>,
"kurt@...utronix.de" <kurt@...utronix.de>,
"boris.sukholitko@...adcom.com" <boris.sukholitko@...adcom.com>,
"vladbu@...dia.com" <vladbu@...dia.com>,
"komachi.yoshiki@...il.com" <komachi.yoshiki@...il.com>,
"paulb@...dia.com" <paulb@...dia.com>,
"baowen.zheng@...igine.com" <baowen.zheng@...igine.com>,
"louis.peens@...igine.com" <louis.peens@...igine.com>,
"simon.horman@...igine.com" <simon.horman@...igine.com>,
"pablo@...filter.org" <pablo@...filter.org>,
"maksym.glubokiy@...ision.eu" <maksym.glubokiy@...ision.eu>,
"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
"jchapman@...alix.com" <jchapman@...alix.com>
Subject: RE: [RFC PATCH net-next v2 2/5] flow_dissector: Add L2TPv3 dissectors
Hi Guillaume,
Thanks for the review!
> -----Original Message-----
> From: Guillaume Nault <gnault@...hat.com>
> Sent: środa, 31 sierpnia 2022 12:07
> To: Drewek, Wojciech <wojciech.drewek@...el.com>
> Cc: netdev@...r.kernel.org; Lobakin, Alexandr <alexandr.lobakin@...el.com>; Brandeburg, Jesse <jesse.brandeburg@...el.com>;
> Nguyen, Anthony L <anthony.l.nguyen@...el.com>; davem@...emloft.net; edumazet@...gle.com; kuba@...nel.org;
> pabeni@...hat.com; jhs@...atatu.com; xiyou.wangcong@...il.com; jiri@...nulli.us; marcin.szycik@...ux.intel.com;
> michal.swiatkowski@...ux.intel.com; kurt@...utronix.de; boris.sukholitko@...adcom.com; vladbu@...dia.com;
> komachi.yoshiki@...il.com; paulb@...dia.com; baowen.zheng@...igine.com; louis.peens@...igine.com;
> simon.horman@...igine.com; pablo@...filter.org; maksym.glubokiy@...ision.eu; intel-wired-lan@...ts.osuosl.org;
> jchapman@...alix.com
> Subject: Re: [RFC PATCH net-next v2 2/5] flow_dissector: Add L2TPv3 dissectors
>
> 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.
Makes sense to me, I'll change that in the next version.
>
> In any case the code looks good to me.
>
> Acked-by: Guillaume Nault <gnault@...hat.com>
Powered by blists - more mailing lists