From: Andrew Boyer <aboyer@pensando.io>
To: dev@dpdk.org
Cc: Alfredo Cardigliano <cardigliano@ntop.org>,
Andrew Boyer <aboyer@pensando.io>,
stable@dpdk.org
Subject: [dpdk-stable] [PATCH 10/13] net/ionic: fix to allow separate L3 and L4 csum offload
Date: Mon, 18 Jan 2021 12:35:05 -0800 [thread overview]
Message-ID: <20210118203508.1332-11-aboyer@pensando.io> (raw)
In-Reply-To: <20210118203508.1332-1-aboyer@pensando.io>
DTS, at least, expects to be able to specify L4 checksum offload
without L3 csum offload. Split up the flag checks.
Fixes: a27d901331da ("net/ionic: add Rx and Tx handling")
Cc: stable@dpdk.org
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
---
drivers/net/ionic/ionic_rxtx.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c
index c3a44faa21..d0f8954753 100644
--- a/drivers/net/ionic/ionic_rxtx.c
+++ b/drivers/net/ionic/ionic_rxtx.c
@@ -460,18 +460,22 @@ ionic_tx(struct ionic_queue *q, struct rte_mbuf *txm,
uint8_t flags = 0;
if ((ol_flags & PKT_TX_IP_CKSUM) &&
- (offloads & DEV_TX_OFFLOAD_IPV4_CKSUM)) {
+ (offloads & DEV_TX_OFFLOAD_IPV4_CKSUM)) {
opcode = IONIC_TXQ_DESC_OPCODE_CSUM_HW;
flags |= IONIC_TXQ_DESC_FLAG_CSUM_L3;
- if (((ol_flags & PKT_TX_TCP_CKSUM) &&
- (offloads & DEV_TX_OFFLOAD_TCP_CKSUM)) ||
- ((ol_flags & PKT_TX_UDP_CKSUM) &&
- (offloads & DEV_TX_OFFLOAD_UDP_CKSUM)))
- flags |= IONIC_TXQ_DESC_FLAG_CSUM_L4;
- } else {
- stats->no_csum++;
}
+ if (((ol_flags & PKT_TX_TCP_CKSUM) &&
+ (offloads & DEV_TX_OFFLOAD_TCP_CKSUM)) ||
+ ((ol_flags & PKT_TX_UDP_CKSUM) &&
+ (offloads & DEV_TX_OFFLOAD_UDP_CKSUM))) {
+ opcode = IONIC_TXQ_DESC_OPCODE_CSUM_HW;
+ flags |= IONIC_TXQ_DESC_FLAG_CSUM_L4;
+ }
+
+ if (opcode == IONIC_TXQ_DESC_OPCODE_CSUM_NONE)
+ stats->no_csum++;
+
has_vlan = (ol_flags & PKT_TX_VLAN_PKT);
encap = ((ol_flags & PKT_TX_OUTER_IP_CKSUM) ||
(ol_flags & PKT_TX_OUTER_UDP_CKSUM)) &&
--
2.17.1
next parent reply other threads:[~2021-01-18 20:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210118203508.1332-1-aboyer@pensando.io>
2021-01-18 20:35 ` Andrew Boyer [this message]
2021-01-18 20:35 ` [dpdk-stable] [PATCH 12/13] net/ionic: fix up function attribute tags Andrew Boyer
2021-01-18 20:35 ` [dpdk-stable] [PATCH 13/13] net/ionic: fix address handling in transmit code Andrew Boyer
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=20210118203508.1332-11-aboyer@pensando.io \
--to=aboyer@pensando.io \
--cc=cardigliano@ntop.org \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
/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).