Skip to contentSkip to conversation

net/ena: fix assigning Rx csum support to Tx flag

PATCH Applied Michal Krawczyk 2 participants 2 messages Apr 8, 2019 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ena: fix assigning Rx csum support to Tx flag

The boolean value was assigned to Tx flag twice, so it could cause bug whenever Rx checksum will not be supported and Tx will be.

It was detected by the coverity scan, with CID 336831.

Fixes 117ba4a60488 ("net/ena: get device info statically")
---
 drivers/net/ena/ena_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ena/ena_ethdev.c +1 -1
index a55b4a719..3eb38165c 100644
@@ -1808,7 +1808,7 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)
 		ENA_ADMIN_FEATURE_OFFLOAD_DESC_TSO_IPV4_MASK) != 0;
 	adapter->offloads.tx_csum_supported = (get_feat_ctx.offload.tx &
 		ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L4_IPV4_CSUM_PART_MASK) != 0;
-	adapter->offloads.tx_csum_supported =
+	adapter->offloads.rx_csum_supported =
 		(get_feat_ctx.offload.rx_supported &
 		ENA_ADMIN_FEATURE_OFFLOAD_DESC_RX_L4_IPV4_CSUM_MASK) != 0;
 
Signature · 1 line
2.14.1
Applied
#1 lore raw
Quoted 9 lines · Michal Krawczyk

The boolean value was assigned to Tx flag twice, so it could cause bug whenever Rx checksum will not be supported and Tx will be.

It was detected by the coverity scan, with CID 336831.

Fixes 117ba4a60488 ("net/ena: get device info statically")
    Coverity issue: 336831
    Fixes: 117ba4a60488 ("net/ena: get device info statically")

(No "Cc: [email protected]" required since the issue has been introduced in this release)

Applied to dpdk-next-net/master, thanks.