From f603eebc43840fc70a3abdbb5089c2564ce61ec8 Mon Sep 17 00:00:00 2001 From: Andrew Boyer Date: Mon, 18 Jan 2021 12:35:05 -0800 Subject: [PATCH] net/ionic: allow separate L3 and L4 checksum offload 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 --- 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 61ad396469..73e728436b 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.20.1