netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* hardware filter for matching GTP-U TEID
@ 2023-08-29  6:18 Subbaraya Sundeep Bhatta
  2023-08-29 10:42 ` Marcin Szycik
  0 siblings, 1 reply; 3+ messages in thread
From: Subbaraya Sundeep Bhatta @ 2023-08-29  6:18 UTC (permalink / raw)
  To: marcin.szycik@linux.intel.com, jesse.brandeburg@intel.com,
	anthony.l.nguyen@intel.com, intel-wired-lan@lists.osuosl.org
  Cc: Jakub Kicinski, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, netdev@vger.kernel.org, Sunil Kovvuri Goutham,
	Naveen Mamindlapalli, Suman Ghosh, Ratheesh Kannoth,
	Hariprasad Kelam, Geethasowjanya Akula

Hi Marcin Szycik,

Below commit demonstrates that we need to create a GTP tunnel netdev and
create a tc filter on top of it. I am unable to understand how the tc filter on top of
tunnel netdev $GTP0 propagates to the interface $PF0 for hardware offload?


commit 97aeb877de7f14f819fc2cf8388d7a2d8090489d
Merge: 4d17d43 9a225f8
Author: David S. Miller <davem@davemloft.net>
Date:   Sat Mar 12 11:54:29 2022 +0000

    Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue

    Tony Nguyen says:

    ====================
    ice: GTP support in switchdev

    Marcin Szycik says:

    Add support for adding GTP-C and GTP-U filters in switchdev mode.

    To create a filter for GTP, create a GTP-type netdev with ip tool, enable
    hardware offload, add qdisc and add a filter in tc:

    ip link add $GTP0 type gtp role <sgsn/ggsn> hsize <hsize>
    ethtool -K $PF0 hw-tc-offload on
    tc qdisc add dev $GTP0 ingress
    tc filter add dev $GTP0 ingress prio 1 flower enc_key_id 1337 \
    action mirred egress redirect dev $VF1_PR


I have to redirect GTP-U packets with a TEID to a VF which may be in guest using hardware tc filter on PF.
From my understanding current TC and ethtool cannot specify match filters beyond L4 header fields.
Can I add new command something like gtp-teid to tc filter?
Please help me understand this.

Thanks,
Sundeep


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: hardware filter for matching GTP-U TEID
  2023-08-29  6:18 hardware filter for matching GTP-U TEID Subbaraya Sundeep Bhatta
@ 2023-08-29 10:42 ` Marcin Szycik
  2023-08-30  9:18   ` [EXT] " Subbaraya Sundeep Bhatta
  0 siblings, 1 reply; 3+ messages in thread
From: Marcin Szycik @ 2023-08-29 10:42 UTC (permalink / raw)
  To: Subbaraya Sundeep Bhatta, jesse.brandeburg@intel.com,
	anthony.l.nguyen@intel.com, intel-wired-lan@lists.osuosl.org
  Cc: Jakub Kicinski, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, netdev@vger.kernel.org, Sunil Kovvuri Goutham,
	Naveen Mamindlapalli, Suman Ghosh, Ratheesh Kannoth,
	Hariprasad Kelam, Geethasowjanya Akula, Wojciech Drewek

On 29.08.2023 08:18, Subbaraya Sundeep Bhatta wrote:
> Hi Marcin Szycik,
> 
> Below commit demonstrates that we need to create a GTP tunnel netdev and
> create a tc filter on top of it. I am unable to understand how the tc filter on top of
> tunnel netdev $GTP0 propagates to the interface $PF0 for hardware offload?

It propagates via a notification from tunnel netdev to PF, and then to driver.
 
> commit 97aeb877de7f14f819fc2cf8388d7a2d8090489d
> Merge: 4d17d43 9a225f8
> Author: David S. Miller <davem@davemloft.net>
> Date:   Sat Mar 12 11:54:29 2022 +0000
> 
>     Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
> 
>     Tony Nguyen says:
> 
>     ====================
>     ice: GTP support in switchdev
> 
>     Marcin Szycik says:
> 
>     Add support for adding GTP-C and GTP-U filters in switchdev mode.
> 
>     To create a filter for GTP, create a GTP-type netdev with ip tool, enable
>     hardware offload, add qdisc and add a filter in tc:
> 
>     ip link add $GTP0 type gtp role <sgsn/ggsn> hsize <hsize>
>     ethtool -K $PF0 hw-tc-offload on
>     tc qdisc add dev $GTP0 ingress
>     tc filter add dev $GTP0 ingress prio 1 flower enc_key_id 1337 \
>     action mirred egress redirect dev $VF1_PR
> 
> 
> I have to redirect GTP-U packets with a TEID to a VF which may be in guest using hardware tc filter on PF.
>>From my understanding current TC and ethtool cannot specify match filters beyond L4 header fields.
> Can I add new command something like gtp-teid to tc filter?
> Please help me understand this.

You can specify TEID field with the enc_key_id option in tc (like in above
example). Meaning of that option changes depending on tunnel used, in case of
GTP it's TEID.

> 
> Thanks,
> Sundeep
> 
> 

I hope that answers your questions,
Marcin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [EXT] Re: hardware filter for matching GTP-U TEID
  2023-08-29 10:42 ` Marcin Szycik
@ 2023-08-30  9:18   ` Subbaraya Sundeep Bhatta
  0 siblings, 0 replies; 3+ messages in thread
From: Subbaraya Sundeep Bhatta @ 2023-08-30  9:18 UTC (permalink / raw)
  To: Marcin Szycik, jesse.brandeburg@intel.com,
	anthony.l.nguyen@intel.com, intel-wired-lan@lists.osuosl.org
  Cc: Jakub Kicinski, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, netdev@vger.kernel.org, Sunil Kovvuri Goutham,
	Naveen Mamindlapalli, Suman Ghosh, Ratheesh Kannoth,
	Hariprasad Kelam, Geethasowjanya Akula, Wojciech Drewek

Hi Marcin,

>-----Original Message-----
>From: Marcin Szycik <marcin.szycik@linux.intel.com>
>Sent: Tuesday, August 29, 2023 4:13 PM
>To: Subbaraya Sundeep Bhatta <sbhatta@marvell.com>;
>jesse.brandeburg@intel.com; anthony.l.nguyen@intel.com; intel-wired-
>lan@lists.osuosl.org
>Cc: Jakub Kicinski <kuba@kernel.org>; davem@davemloft.net;
>edumazet@google.com; pabeni@redhat.com; netdev@vger.kernel.org; Sunil
>Kovvuri Goutham <sgoutham@marvell.com>; Naveen Mamindlapalli
><naveenm@marvell.com>; Suman Ghosh <sumang@marvell.com>; Ratheesh
>Kannoth <rkannoth@marvell.com>; Hariprasad Kelam
><hkelam@marvell.com>; Geethasowjanya Akula <gakula@marvell.com>;
>Wojciech Drewek <wojciech.drewek@intel.com>
>Subject: [EXT] Re: hardware filter for matching GTP-U TEID
>
>External Email
>
>----------------------------------------------------------------------
>On 29.08.2023 08:18, Subbaraya Sundeep Bhatta wrote:
>> Hi Marcin Szycik,
>>
>> Below commit demonstrates that we need to create a GTP tunnel netdev
>> and create a tc filter on top of it. I am unable to understand how the
>> tc filter on top of tunnel netdev $GTP0 propagates to the interface $PF0 for
>hardware offload?
>
>It propagates via a notification from tunnel netdev to PF, and then to driver.
>
Got it. It is done with flow_indr_dev_register function. 

>> commit 97aeb877de7f14f819fc2cf8388d7a2d8090489d
>> Merge: 4d17d43 9a225f8
>> Author: David S. Miller <davem@davemloft.net>
>> Date:   Sat Mar 12 11:54:29 2022 +0000
>>
>>     Merge branch '100GbE' of
>> git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
>>
>>     Tony Nguyen says:
>>
>>     ====================
>>     ice: GTP support in switchdev
>>
>>     Marcin Szycik says:
>>
>>     Add support for adding GTP-C and GTP-U filters in switchdev mode.
>>
>>     To create a filter for GTP, create a GTP-type netdev with ip tool, enable
>>     hardware offload, add qdisc and add a filter in tc:
>>
>>     ip link add $GTP0 type gtp role <sgsn/ggsn> hsize <hsize>
>>     ethtool -K $PF0 hw-tc-offload on
>>     tc qdisc add dev $GTP0 ingress
>>     tc filter add dev $GTP0 ingress prio 1 flower enc_key_id 1337 \
>>     action mirred egress redirect dev $VF1_PR
>>
>>
>> I have to redirect GTP-U packets with a TEID to a VF which may be in guest
>using hardware tc filter on PF.
>>>From my understanding current TC and ethtool cannot specify match filters
>beyond L4 header fields.
>> Can I add new command something like gtp-teid to tc filter?
>> Please help me understand this.
>
>You can specify TEID field with the enc_key_id option in tc (like in above
>example). Meaning of that option changes depending on tunnel used, in case
>of GTP it's TEID.
>
>>
>> Thanks,
>> Sundeep
>>
>>
>
>I hope that answers your questions,

Yes. Thanks.

Sundeep

>Marcin


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-30  9:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-29  6:18 hardware filter for matching GTP-U TEID Subbaraya Sundeep Bhatta
2023-08-29 10:42 ` Marcin Szycik
2023-08-30  9:18   ` [EXT] " Subbaraya Sundeep Bhatta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).