[dpdk-dev] [PATCH 4/4] ethdev: add Tx offload outer L4 checksum definitions
Jerin Jacob
jerin.jacob at caviumnetworks.com
Tue Oct 2 11:52:40 CEST 2018
-----Original Message-----
> Date: Mon, 1 Oct 2018 14:45:39 +0100
> From: Ferruh Yigit <ferruh.yigit at intel.com>
> To: Jerin Jacob <jerin.jacob at caviumnetworks.com>, Wenzhuo Lu
> <wenzhuo.lu at intel.com>, Jingjing Wu <jingjing.wu at intel.com>, Bernard
> Iremonger <bernard.iremonger at intel.com>, John McNamara
> <john.mcnamara at intel.com>, Marko Kovacevic <marko.kovacevic at intel.com>,
> Thomas Monjalon <thomas at monjalon.net>, Andrew Rybchenko
> <arybchenko at solarflare.com>, Olivier Matz <olivier.matz at 6wind.com>
> CC: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 4/4] ethdev: add Tx offload outer L4
> checksum definitions
> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
> Thunderbird/52.9.1
>
> On 9/13/2018 2:47 PM, Jerin Jacob wrote:
> > Introduced DEV_TX_OFFLOAD_OUTER_UDP_CKSUM, DEV_TX_OFFLOAD_OUTER_TCP_CKSUM
> > and DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM offload flags and
> >
> > PKT_TX_OUTER_L4_NO_CKSUM, PKT_TX_OUTER_TCP_CKSUM, PKT_TX_OUTER_SCTP_CKSUM
> > and PKT_TX_OUTER_UDP_CKSUM mbuf ol_flags to enable Tx outer L4 checksum
> > offload.
> >
> > To use hardware Tx outer L4 checksum offload, the user needs to.
> > # enable following in mbuff:
> > - fill outer_l2_len and outer_l3_len in mbuf
> > - set the flags PKT_TX_OUTER_TCP_CKSUM, PKT_TX_OUTER_SCTP_CKSUM or
> > PKT_TX_OUTER_UDP_CKSUM
> > - set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6
> >
> > # configure DEV_TX_OFFLOAD_OUTER_* offload flags in slow path.
> >
> > Signed-off-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>
> > ---
> > app/test-pmd/config.c | 27 +++++++++++++++++++++++++++
> > doc/guides/nics/features.rst | 6 ++++++
> > lib/librte_ethdev/rte_ethdev.c | 3 +++
> > lib/librte_ethdev/rte_ethdev.h | 6 ++++++
> > lib/librte_mbuf/rte_mbuf.c | 5 +++++
> > lib/librte_mbuf/rte_mbuf.h | 23 ++++++++++++++++++++++-
> > 6 files changed, 69 insertions(+), 1 deletion(-)
> >
> > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> > index 92a177e29..85f832bf0 100644
> > --- a/app/test-pmd/config.c
> > +++ b/app/test-pmd/config.c
> > @@ -773,6 +773,33 @@ port_offload_cap_display(portid_t port_id)
> > else
> > printf("off\n");
> > }
> > +
> > + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) {
> > + printf("TX Outer UDP checksum: ");
> > + if (ports[port_id].dev_conf.txmode.offloads &
> > + DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)
> > + printf("on\n");
> > + else
> > + printf("off\n");
> > + }
> > +
> > + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_TCP_CKSUM) {
> > + printf("TX Outer TCP checksum: ");
> > + if (ports[port_id].dev_conf.txmode.offloads &
> > + DEV_TX_OFFLOAD_OUTER_TCP_CKSUM)
> > + printf("on\n");
> > + else
> > + printf("off\n");
> > + }
> > +
> > + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM) {
> > + printf("TX Outer SCTP checksum: ");
> > + if (ports[port_id].dev_conf.txmode.offloads &
> > + DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM)
> > + printf("on\n");
> > + else
> > + printf("off\n");
> > + }
> > }
>
> There is also "csum show", "csum set" functions, can you please check that too?
+ Shahaf
I checked the details. It is for "csumonly.c" forward engine to select
various Tx checksum in HW or SW(provide fallback SW implementation) for
testing purpose.
If I need to implement this support for this release, I will reduce the
scope to DEV_TX_OFFLOAD_OUTER_UDP_CKSUM and
DEV_RX_OFFLOAD_OUTER_UDP_CKSUM.
Since there is NO real world non encrypted TCP/SCTP based tunnel
protocols(Based on http://patches.dpdk.org/patch/44692/ discussions)
I will limit the offload definition only to DEV_?X_OFFLOAD_OUTER_UDP_CKSUM and
associated test code in "csumonly.c" forward engine in v2.
Thoughts?
I will split 1/4 and 2/4 as separate patch series and and rework 3/4 and
4/4 as separate series to make forward progress.
> And I am not sure why those functions seems only concerned about Tx csum offloads.
It does check for errors in Rx checksum too. See rx_bad_ip_csum,
rx_bad_l4_csum
More information about the dev
mailing list