[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <MW4PR11MB5776B6030D3EB7ADBB1D9612FD7B9@MW4PR11MB5776.namprd11.prod.outlook.com>
Date: Thu, 1 Sep 2022 12:58:19 +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 v3 2/5] flow_dissector: Add L2TPv3 dissectors
> -----Original Message-----
> From: Guillaume Nault <gnault@...hat.com>
> Sent: czwartek, 1 wrzeĊnia 2022 14:35
> 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 v3 2/5] flow_dissector: Add L2TPv3 dissectors
>
> On Thu, Sep 01, 2022 at 02:01:28PM +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
>
> Nit: you didn't fix the spelling of "protocold". It's probably not
> worth to send a new version just because of this typo though.
Sorry, of course I forgot about something.
It will be fixed in the PR.
>
> > Acked-by: Guillaume Nault <gnault@...hat.com>
> > Signed-off-by: Wojciech Drewek <wojciech.drewek@...el.com>
> > ---
> > v3: move !dissector_uses_key() check before calling
> > __skb_header_pointer
> > ---
> > include/net/flow_dissector.h | 9 +++++++++
> > net/core/flow_dissector.c | 28 ++++++++++++++++++++++++++++
> > 2 files changed, 37 insertions(+)
> >
> > diff --git a/include/net/flow_dissector.h b/include/net/flow_dissector.h
> > index 6c74812d64b2..5ccf52ef8809 100644
> > --- a/include/net/flow_dissector.h
> > +++ b/include/net/flow_dissector.h
> > @@ -289,6 +289,14 @@ struct flow_dissector_key_pppoe {
> > __be16 type;
> > };
> >
> > +/**
> > + * struct flow_dissector_key_l2tpv3:
> > + * @session_id: identifier for a l2tp session
> > + */
> > +struct flow_dissector_key_l2tpv3 {
> > + __be32 session_id;
> > +};
> > +
> > enum flow_dissector_key_id {
> > FLOW_DISSECTOR_KEY_CONTROL, /* struct flow_dissector_key_control */
> > FLOW_DISSECTOR_KEY_BASIC, /* struct flow_dissector_key_basic */
> > @@ -320,6 +328,7 @@ enum flow_dissector_key_id {
> > FLOW_DISSECTOR_KEY_HASH, /* struct flow_dissector_key_hash */
> > FLOW_DISSECTOR_KEY_NUM_OF_VLANS, /* struct flow_dissector_key_num_of_vlans */
> > FLOW_DISSECTOR_KEY_PPPOE, /* struct flow_dissector_key_pppoe */
> > + FLOW_DISSECTOR_KEY_L2TPV3, /* struct flow_dissector_key_l2tpv3 */
> >
> > FLOW_DISSECTOR_KEY_MAX,
> > };
> > diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
> > index 764c4cb3fe8f..8180e65ab8e2 100644
> > --- a/net/core/flow_dissector.c
> > +++ b/net/core/flow_dissector.c
> > @@ -204,6 +204,30 @@ static void __skb_flow_dissect_icmp(const struct sk_buff *skb,
> > skb_flow_get_icmp_tci(skb, key_icmp, data, thoff, hlen);
> > }
> >
> > +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;
> > +
> > + if (!dissector_uses_key(flow_dissector, FLOW_DISSECTOR_KEY_L2TPV3))
> > + return;
> > +
> > + hdr = __skb_header_pointer(skb, nhoff, sizeof(_hdr), data, hlen, &_hdr);
> > + if (!hdr)
> > + return;
> > +
> > + key_l2tpv3 = skb_flow_dissector_target(flow_dissector,
> > + FLOW_DISSECTOR_KEY_L2TPV3,
> > + target_container);
> > +
> > + key_l2tpv3->session_id = hdr->session_id;
> > +}
> > +
> > void skb_flow_dissect_meta(const struct sk_buff *skb,
> > struct flow_dissector *flow_dissector,
> > void *target_container)
> > @@ -1497,6 +1521,10 @@ bool __skb_flow_dissect(const struct net *net,
> > __skb_flow_dissect_icmp(skb, flow_dissector, target_container,
> > data, nhoff, hlen);
> > break;
> > + case IPPROTO_L2TP:
> > + __skb_flow_dissect_l2tpv3(skb, flow_dissector, target_container,
> > + data, nhoff, hlen);
> > + break;
> >
> > default:
> > break;
> > --
> > 2.31.1
> >
Powered by blists - more mailing lists