From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5BA40A0C43; Wed, 15 Sep 2021 01:44:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CECCD4014F; Wed, 15 Sep 2021 01:44:20 +0200 (CEST) Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by mails.dpdk.org (Postfix) with ESMTP id 726084003C for ; Wed, 15 Sep 2021 01:44:19 +0200 (CEST) Received: by mail-pj1-f43.google.com with SMTP id f11-20020a17090aa78b00b0018e98a7cddaso854815pjq.4 for ; Tue, 14 Sep 2021 16:44:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wQ6WPAOFfZkuTmhUidzGMWpgDz1FpFkiOqO4IKCX308=; b=K/VdBO5SZaG/IupJFuOkAZb4kwN+EpWInbWl1Zx5XQuvSfknrTCDIi5Vv1aD7l5szD KDVf1Ay9S2G6Ve5ma0I1txMwXVZPjX0hnaIgQFnDHFhO8rzHZ4XGNGjeaa2rw/9kQmAj 56TPAmz43vstxmFxIsw2xRKCFt8VwPKXnjtVVsbbwvVl8sxMBXADgQPZ5CZM6nAnAZUd O6Vn0bkTZ2ZLScoYy7g2oZ469QxvZ+/Q4tsvsFDLd4PugSKCKF+NC3ZxcUnPbhQLwlBU yviaCss0e7lsIUKORbIixCX5HXjMZ0SpbGNN16qIvpHR/6dciKgLKY+9xz1T3MQyZ/Eu 6Qbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wQ6WPAOFfZkuTmhUidzGMWpgDz1FpFkiOqO4IKCX308=; b=quw1iaeaI60dAoE4bGS1cDRy0Q76f1g76/tPxEjVMxVYBbw2CtbS0SLZR7Zrn/bvzX 51+x4zuRfZ1biwKtZNnTfa0dja0ouTerzcfvx0LfVNLIpR1N3NMTVRmfNAY7QWgg+165 sgvIaX24Qlk6jOBpbHRTm3Wionv6qKfXTWx/dTke+P7yVm/hghhNCKxBomWgjHTdoVDV 7TfRDGHtWHWttUrKGTbWj6TT4RaBoMfESz8TNpm1iiO1JNQCnLkuYKhFDpAWXfKxqiYN Z2UZvqbs/MNjocgy7MZq8zS+DxbKudUpkX0r3w6RQXXECaPVNZIvcN6n6NIN37c/9R2Z LsFw== X-Gm-Message-State: AOAM5302NWY9CYdQH7kefCCWn4swCBvpJrKAgp5EbBC+HBLFZgBAz58d tx4dgSl5G/rbfkeTOvXf3aIvYw== X-Google-Smtp-Source: ABdhPJzco7s1h4ToH/1dwxOomBdhuMRPP/6wqHpfHG9wKKuTHHZAtmHpEo4smZm3QMMpOP7d1SlcOw== X-Received: by 2002:a17:90b:3909:: with SMTP id ob9mr957785pjb.151.1631663058374; Tue, 14 Sep 2021 16:44:18 -0700 (PDT) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id d16sm2712988pjd.54.2021.09.14.16.44.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Sep 2021 16:44:18 -0700 (PDT) Date: Tue, 14 Sep 2021 16:44:15 -0700 From: Stephen Hemminger To: "Ananyev, Konstantin" Cc: Usama Nadeem , "thomas@monjalon.net" , "dev@dpdk.org" Message-ID: <20210914164415.020dd967@hermes.local> In-Reply-To: References: <20210913120951.103968-1-usama.nadeem@emumba.com> <20210914180827.184123-1-usama.nadeem@emumba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] Warns if IPv4, UDP or TCP checksum offload not available X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, 14 Sep 2021 22:22:04 +0000 "Ananyev, Konstantin" wrote: > > > > From: usamanadeem321 > > > > Checks if IPV4, UDP and TCP Checksum offloads are available. > > If not available, prints a warning message. > > > > Bugzilla ID: 545 > > Signed-off-by: usamanadeem321 > > --- > > 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.