DPDK patches and discussions
 help / color / mirror / Atom feed
* UDP-GRO not working
@ 2022-03-10 12:52 kumaraparameshwaran rathinavel
  2022-06-09  8:11 ` Thomas Monjalon
  0 siblings, 1 reply; 5+ messages in thread
From: kumaraparameshwaran rathinavel @ 2022-03-10 12:52 UTC (permalink / raw)
  To: dev; +Cc: jiayu.hu, olivier.matz, kraghav

[-- Attachment #1: Type: text/plain, Size: 1649 bytes --]

Hi ,

I tried using the UDP GRO feature in DPDK recently and it did not see
working. I understand the GRO for UDP is applicable only for fragmented
packets, there is the following check in gro_udp4.c
/*
* Don't process non-fragment packet.
*/
if (!is_ipv4_fragment(ipv4_hdr))
return -1;


There looks to be some conflict in the definition of RTE_PTYPE in
rte_mbuf_ptype.h and the usage of this in GRO layer, rte_gro.c

The below are the definitions,

#define RTE_PTYPE_L4_TCP                    0x00000100
#define RTE_PTYPE_L4_UDP                    0x00000200
#define RTE_PTYPE_L4_FRAG                   0x00000300

Below is the check in GRO layer,

#define IS_IPV4_TCP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \
        ((ptype & RTE_PTYPE_L4_TCP) == RTE_PTYPE_L4_TCP) && \
        (RTE_ETH_IS_TUNNEL_PKT(ptype) == 0))

#define IS_IPV4_UDP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \
        ((ptype & RTE_PTYPE_L4_UDP) == RTE_PTYPE_L4_UDP) && \
        (RTE_ETH_IS_TUNNEL_PKT(ptype) == 0))

So, for a fragmented UDP packet both RTE_PTYPE_L4_TCP & RTE_PTYPE_L4_UDP would
be set and the GRO layer would be unable to interpret the packet type
correctly.

I am using rte_net_get_ptype API before the packet is being sent to the GRO
subsystem as the DPDK PMD for the NIC I am using would not set the packet
types as required by the GRO subsystem.

I would like to contribute a patch for this bug if this indeed is an issue,
I was thinking if the GRO subsystem is L4 fragmented then in the GRO layer
invoked the appropriate handler, either gro_tcp4_reassemble or
gro_ud4_reassemble.

Please let me know if I am missing something here.

Thanks,
Param.

[-- Attachment #2: Type: text/html, Size: 29432 bytes --]

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

* Re: UDP-GRO not working
  2022-03-10 12:52 UDP-GRO not working kumaraparameshwaran rathinavel
@ 2022-06-09  8:11 ` Thomas Monjalon
  2022-06-09 15:24   ` Hu, Jiayu
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Monjalon @ 2022-06-09  8:11 UTC (permalink / raw)
  To: jiayu.hu; +Cc: dev, olivier.matz, kraghav, kumaraparameshwaran rathinavel

Jiayu, please could you comment the explanation below?


10/03/2022 13:52, kumaraparameshwaran rathinavel:
> Hi ,
> 
> I tried using the UDP GRO feature in DPDK recently and it did not see
> working. I understand the GRO for UDP is applicable only for fragmented
> packets, there is the following check in gro_udp4.c
> /*
> * Don't process non-fragment packet.
> */
> if (!is_ipv4_fragment(ipv4_hdr))
> return -1;
> 
> 
> There looks to be some conflict in the definition of RTE_PTYPE in
> rte_mbuf_ptype.h and the usage of this in GRO layer, rte_gro.c
> 
> The below are the definitions,
> 
> #define RTE_PTYPE_L4_TCP                    0x00000100
> #define RTE_PTYPE_L4_UDP                    0x00000200
> #define RTE_PTYPE_L4_FRAG                   0x00000300
> 
> Below is the check in GRO layer,
> 
> #define IS_IPV4_TCP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \
>         ((ptype & RTE_PTYPE_L4_TCP) == RTE_PTYPE_L4_TCP) && \
>         (RTE_ETH_IS_TUNNEL_PKT(ptype) == 0))
> 
> #define IS_IPV4_UDP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \
>         ((ptype & RTE_PTYPE_L4_UDP) == RTE_PTYPE_L4_UDP) && \
>         (RTE_ETH_IS_TUNNEL_PKT(ptype) == 0))
> 
> So, for a fragmented UDP packet both RTE_PTYPE_L4_TCP & RTE_PTYPE_L4_UDP would
> be set and the GRO layer would be unable to interpret the packet type
> correctly.
> 
> I am using rte_net_get_ptype API before the packet is being sent to the GRO
> subsystem as the DPDK PMD for the NIC I am using would not set the packet
> types as required by the GRO subsystem.
> 
> I would like to contribute a patch for this bug if this indeed is an issue,
> I was thinking if the GRO subsystem is L4 fragmented then in the GRO layer
> invoked the appropriate handler, either gro_tcp4_reassemble or
> gro_ud4_reassemble.
> 
> Please let me know if I am missing something here.
> 
> Thanks,
> Param.
> 






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

* RE: UDP-GRO not working
  2022-06-09  8:11 ` Thomas Monjalon
@ 2022-06-09 15:24   ` Hu, Jiayu
  0 siblings, 0 replies; 5+ messages in thread
From: Hu, Jiayu @ 2022-06-09 15:24 UTC (permalink / raw)
  To: kumaraparameshwaran rathinavel
  Cc: dev, olivier.matz, kraghav, Thomas Monjalon

Hi Param,

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Thursday, June 9, 2022 4:11 PM
> To: Hu, Jiayu <jiayu.hu@intel.com>
> Cc: dev@dpdk.org; olivier.matz@6wind.com; kraghav@vmware.com;
> kumaraparameshwaran rathinavel <kumaraparamesh92@gmail.com>
> Subject: Re: UDP-GRO not working
> 
> Jiayu, please could you comment the explanation below?
> 
> 
> 10/03/2022 13:52, kumaraparameshwaran rathinavel:
> > Hi ,
> >
> > I tried using the UDP GRO feature in DPDK recently and it did not see
> > working. I understand the GRO for UDP is applicable only for
> > fragmented packets, there is the following check in gro_udp4.c
> > /*
> > * Don't process non-fragment packet.
> > */
> > if (!is_ipv4_fragment(ipv4_hdr))
> > return -1;
> >
> >
> > There looks to be some conflict in the definition of RTE_PTYPE in
> > rte_mbuf_ptype.h and the usage of this in GRO layer, rte_gro.c
> >
> > The below are the definitions,
> >
> > #define RTE_PTYPE_L4_TCP                    0x00000100
> > #define RTE_PTYPE_L4_UDP                    0x00000200
> > #define RTE_PTYPE_L4_FRAG                   0x00000300
> >
> > Below is the check in GRO layer,
> >
> > #define IS_IPV4_TCP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \
> >         ((ptype & RTE_PTYPE_L4_TCP) == RTE_PTYPE_L4_TCP) && \
> >         (RTE_ETH_IS_TUNNEL_PKT(ptype) == 0))
> >
> > #define IS_IPV4_UDP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \
> >         ((ptype & RTE_PTYPE_L4_UDP) == RTE_PTYPE_L4_UDP) && \
> >         (RTE_ETH_IS_TUNNEL_PKT(ptype) == 0))
> >
> > So, for a fragmented UDP packet both RTE_PTYPE_L4_TCP &
> > RTE_PTYPE_L4_UDP would be set and the GRO layer would be unable to
> > interpret the packet type correctly.

Yes, it's an issue. IS_IPV4_TCP_PKT will recognize a UDP/IPv4 fragment as a TCP/IPv4
packet, and the packet will not go into any UDP based gro function. Thanks for pointing
that out.

Thanks,
Jiayu

> >
> > I am using rte_net_get_ptype API before the packet is being sent to
> > the GRO subsystem as the DPDK PMD for the NIC I am using would not set
> > the packet types as required by the GRO subsystem.
> >
> > I would like to contribute a patch for this bug if this indeed is an
> > issue, I was thinking if the GRO subsystem is L4 fragmented then in
> > the GRO layer invoked the appropriate handler, either
> > gro_tcp4_reassemble or gro_ud4_reassemble.
> >
> > Please let me know if I am missing something here.
> >
> > Thanks,
> > Param.
> >
> 
> 
> 
> 


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

* Re: UDP-GRO not working
  2022-03-10 12:49 Kumara Parameshwaran
@ 2022-03-11 17:15 ` Stephen Hemminger
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2022-03-11 17:15 UTC (permalink / raw)
  To: Kumara Parameshwaran
  Cc: dev, jiayu.hu, olivier.matz, Ferruh Yigit, Raghav Kempanna

On Thu, 10 Mar 2022 12:49:04 +0000
Kumara Parameshwaran <kparameshwar@vmware.com> wrote:

> Hi ,
> 
> I tried using the UDP GRO feature in DPDK recently and it did not see working. I understand the GRO for UDP is applicable only for fragmented packets, there is the following check in gro_udp4.c
> /*
> * Don't process non-fragment packet.
> */
> if (!is_ipv4_fragment(ipv4_hdr))
> return -1;
> 
> 
> There looks to be some conflict in the definition of RTE_PTYPE in rte_mbuf_ptype.h and the usage of this in GRO layer, rte_gro.c
> 
> The below are the definitions,
> 
> #define RTE_PTYPE_L4_TCP                    0x00000100
> #define RTE_PTYPE_L4_UDP                    0x00000200
> #define RTE_PTYPE_L4_FRAG                   0x00000300
> 
> Below is the check in GRO layer,
> 
> #define IS_IPV4_TCP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \
>         ((ptype & RTE_PTYPE_L4_TCP) == RTE_PTYPE_L4_TCP) && \
>         (RTE_ETH_IS_TUNNEL_PKT(ptype) == 0))
> 
> #define IS_IPV4_UDP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \
>         ((ptype & RTE_PTYPE_L4_UDP) == RTE_PTYPE_L4_UDP) && \
>         (RTE_ETH_IS_TUNNEL_PKT(ptype) == 0))
> 
> So, for a fragmented UDP packet both RTE_PTYPE_L4_TCP & RTE_PTYPE_L4_UDP would be set and the GRO layer would be not able to interpret the packet type right.
> 
> I am using rte_net_get_ptype API before the packet is being sent to the GRO subsystem as the DPDK PMD for the NIC I am using would not set the packet types as required by the GRO subsystem.
> 
> I would like to contribute a patch for this bug if this indeed is an issue, I was thinking if the GRO subsystem is L4 fragmented then in the GRO layer invoked the appropriate handler, either gro_tcp4_reassemble or gro_ud4_reassemble.
> 
> Please let me know if I am missing something here.
> 
> Thanks,
> Param.

Are you using RSS, perhaps the fragmented packet is arriving on a different queue.
Since fragments don't have UDP header, often the arrive on a default queue.

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

* UDP-GRO not working
@ 2022-03-10 12:49 Kumara Parameshwaran
  2022-03-11 17:15 ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: Kumara Parameshwaran @ 2022-03-10 12:49 UTC (permalink / raw)
  To: dev; +Cc: jiayu.hu, olivier.matz, Ferruh Yigit, Raghav Kempanna

[-- Attachment #1: Type: text/plain, Size: 1685 bytes --]

Hi ,

I tried using the UDP GRO feature in DPDK recently and it did not see working. I understand the GRO for UDP is applicable only for fragmented packets, there is the following check in gro_udp4.c
/*
* Don't process non-fragment packet.
*/
if (!is_ipv4_fragment(ipv4_hdr))
return -1;


There looks to be some conflict in the definition of RTE_PTYPE in rte_mbuf_ptype.h and the usage of this in GRO layer, rte_gro.c

The below are the definitions,

#define RTE_PTYPE_L4_TCP                    0x00000100
#define RTE_PTYPE_L4_UDP                    0x00000200
#define RTE_PTYPE_L4_FRAG                   0x00000300

Below is the check in GRO layer,

#define IS_IPV4_TCP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \
        ((ptype & RTE_PTYPE_L4_TCP) == RTE_PTYPE_L4_TCP) && \
        (RTE_ETH_IS_TUNNEL_PKT(ptype) == 0))

#define IS_IPV4_UDP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \
        ((ptype & RTE_PTYPE_L4_UDP) == RTE_PTYPE_L4_UDP) && \
        (RTE_ETH_IS_TUNNEL_PKT(ptype) == 0))

So, for a fragmented UDP packet both RTE_PTYPE_L4_TCP & RTE_PTYPE_L4_UDP would be set and the GRO layer would be not able to interpret the packet type right.

I am using rte_net_get_ptype API before the packet is being sent to the GRO subsystem as the DPDK PMD for the NIC I am using would not set the packet types as required by the GRO subsystem.

I would like to contribute a patch for this bug if this indeed is an issue, I was thinking if the GRO subsystem is L4 fragmented then in the GRO layer invoked the appropriate handler, either gro_tcp4_reassemble or gro_ud4_reassemble.

Please let me know if I am missing something here.

Thanks,
Param.

[-- Attachment #2: Type: text/html, Size: 10754 bytes --]

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

end of thread, other threads:[~2022-06-09 15:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-10 12:52 UDP-GRO not working kumaraparameshwaran rathinavel
2022-06-09  8:11 ` Thomas Monjalon
2022-06-09 15:24   ` Hu, Jiayu
  -- strict thread matches above, loose matches on Subject: below --
2022-03-10 12:49 Kumara Parameshwaran
2022-03-11 17:15 ` Stephen Hemminger

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).