Skip to content

Commit

Permalink
net/ionic: allow separate L3 and L4 checksum offload
Browse files Browse the repository at this point in the history
[ upstream commit f603eeb ]

DTS, at least, expects to be able to specify L4 checksum offload
without L3 csum offload. Split up the flag checks.

Fixes: a27d901 ("net/ionic: add Rx and Tx handling")

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
  • Loading branch information
andrewb24 authored and bluca committed Feb 4, 2021
1 parent 9bf462a commit 66ac5ae
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions drivers/net/ionic/ionic_rxtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,18 +448,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)) &&
Expand Down

0 comments on commit 66ac5ae

Please sign in to comment.