From: Stephen Hemminger <stephen@networkplumber.org>
To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
Cc: Usama Nadeem <usama.nadeem@emumba.com>,
"thomas@monjalon.net" <thomas@monjalon.net>,
"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2] Warns if IPv4, UDP or TCP checksum offload not available
Date: Tue, 14 Sep 2021 16:44:15 -0700 [thread overview]
Message-ID: <20210914164415.020dd967@hermes.local> (raw)
In-Reply-To: <DM6PR11MB4491FBD46048338114A83D269ADA9@DM6PR11MB4491.namprd11.prod.outlook.com>
On Tue, 14 Sep 2021 22:22:04 +0000
"Ananyev, Konstantin" <konstantin.ananyev@intel.com> wrote:
> >
> > From: usamanadeem321 <usama.nadeem@emumba.com>
> >
> > Checks if IPV4, UDP and TCP Checksum offloads are available.
> > If not available, prints a warning message.
> >
> > Bugzilla ID: 545
> > Signed-off-by: usamanadeem321 <usama.nadeem@emumba.com>
> > ---
> > examples/l3fwd/main.c | 22 +++++++++++++++++++++-
> > 1 file changed, 21 insertions(+), 1 deletion(-)
> >
> > diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
> > index 00ac267af1..ae62bc570d 100644
> > --- a/examples/l3fwd/main.c
> > +++ b/examples/l3fwd/main.c
> > @@ -123,7 +123,6 @@ static struct rte_eth_conf port_conf = {
> > .mq_mode = ETH_MQ_RX_RSS,
> > .max_rx_pkt_len = RTE_ETHER_MAX_LEN,
> > .split_hdr_size = 0,
> > - .offloads = DEV_RX_OFFLOAD_CHECKSUM,
> > },
> > .rx_adv_conf = {
> > .rss_conf = {
> > @@ -1039,6 +1038,27 @@ l3fwd_poll_resource_setup(void)
> > local_port_conf.txmode.offloads |=
> > DEV_TX_OFFLOAD_MBUF_FAST_FREE;
> >
> > + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_IPV4_CKSUM)
> > + local_port_conf.rxmode.offloads |=
> > + DEV_RX_OFFLOAD_IPV4_CKSUM;
> > + else {
> > + printf("WARNING: IPV4 Checksum offload not available.\n");
> > + }
> > +
> > + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_UDP_CKSUM)
> > + local_port_conf.rxmode.offloads |=
> > + DEV_RX_OFFLOAD_UDP_CKSUM;
> > +
> > + else
> > + printf("WARNING: UDP Checksum offload not available.\n");
> > +
> > + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_CKSUM)
> > + local_port_conf.rxmode.offloads |=
> > + DEV_RX_OFFLOAD_TCP_CKSUM;
> > +
> > + else
> > + printf("WARNING: TCP Checksum offload not available.\n");
> > +
>
> Sorry, but I didn't get the logic:
> Application expects some offloads to be supported by HW.
The application is expecting more offloads than is necessary for basic
IP level forwarding which is all the example is documented to do.
"The application performs L3 forwarding."
> You add the code that checks for offloads, but if they are not supported just prints warning
> and continues, as if everything is ok. Doesn't look like correct behaviour to me.
> I think, it should either terminate with error message or be prepared to work properly
> on HW without these offloads (check cksums in SW if necessary).
> In fact I don't see what was wrong with original behaviour, one thing that probably
> was missing - more descriptive error message.
It is not a problem with your patch, it is fine.
It is a problem in how l3fwd has grown and changed and no longer really what
was intended in the original version. There is no reason that the application
should be looking at L4 data. In fact, it shouldn't care if it gets TCP, UDP, SCP or DCCP;
but the application now depends on ptype.
It should be possible to do L3 forwarding independent of packet type.
The application only needs to look at Ether type and do IPv4 or IPv6 based on that.
next prev parent reply other threads:[~2021-09-14 23:44 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-13 12:09 [dpdk-dev] [PATCH] examples: ipv4, udp and tcp checksum offload warning usamanadeem321
2021-09-13 15:11 ` Stephen Hemminger
2021-09-14 18:08 ` [dpdk-dev] [PATCH v2] Warns if IPv4, UDP or TCP checksum offload not available Usama Nadeem
2021-09-14 18:28 ` Stephen Hemminger
2021-09-14 22:22 ` Ananyev, Konstantin
2021-09-14 23:44 ` Stephen Hemminger [this message]
2021-09-15 8:43 ` Ananyev, Konstantin
2021-10-08 15:51 ` [dpdk-dev] [PATCH v3] ipv4 and udp/tcp cksum verification through software Usama Nadeem
2021-10-14 18:43 ` [dpdk-dev] [PATCH v4] examples/l3fwd: " Usama Nadeem
2021-11-01 8:33 ` Usama Nadeem
2021-11-04 11:11 ` Walsh, Conor
2021-11-04 16:19 ` Medvedkin, Vladimir
2021-11-16 5:20 ` Usama Nadeem
2021-11-16 5:21 ` Usama Nadeem
2023-06-30 21:50 ` Stephen Hemminger
2021-11-04 13:19 ` Ananyev, Konstantin
2021-11-16 5:18 ` Usama Nadeem
2022-01-14 9:30 ` Usama Nadeem
2022-01-14 12:05 ` Ananyev, Konstantin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210914164415.020dd967@hermes.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=konstantin.ananyev@intel.com \
--cc=thomas@monjalon.net \
--cc=usama.nadeem@emumba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).