From 627a1d2991c81292d8b96dd8968a7257d6ba88a5 Mon Sep 17 00:00:00 2001
From: Ghalem Boudour <ghalem.boudour@6wind.com>
Date: Fri, 30 Jul 2021 10:34:41 +0200
Subject: [PATCH 166/166] net/ena: enable multi-segment in Tx offload flags

The DPDK ENA driver does not provide multi-segment tx offload capability.
Let's add DEV_TX_OFFLOAD_MULTI_SEGS to ports offload capability by
default, and always set it in dev->data->dev_conf.txmode.offload.

This flag in not listed in doc/guides/nics/features/default.ini, so
ena.ini does not need to be updated.

Fixes: 1173fca25af9 ("ena: add polling-mode driver")
Cc: stable@dpdk.org

Signed-off-by: Ghalem Boudour <ghalem.boudour@6wind.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
---
 drivers/net/ena/ena_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index ac2146ce0e..26e4b3a58a 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1891,8 +1891,11 @@ static int ena_dev_configure(struct rte_eth_dev *dev)
 
 	adapter->state = ENA_ADAPTER_STATE_CONFIG;
 
+	dev->data->dev_conf.txmode.offloads |= DEV_TX_OFFLOAD_MULTI_SEGS;
+
 	adapter->tx_selected_offloads = tx_offloads;
 	adapter->rx_selected_offloads = rx_offloads;
+
 	return 0;
 }
 
@@ -1993,6 +1996,7 @@ static void ena_infos_get(struct rte_eth_dev *dev,
 
 	rx_feat |= DEV_RX_OFFLOAD_JUMBO_FRAME;
 	rx_feat |= DEV_RX_OFFLOAD_CRC_STRIP;
+	tx_feat |= DEV_TX_OFFLOAD_MULTI_SEGS;
 
 	/* Inform framework about available features */
 	dev_info->rx_offload_capa = rx_feat;
-- 
2.25.1

