diff mbox

[dpdk-dev,5/6] net/mlx5: support TX common tunnel offloads

Message ID 20180109141110.146250-6-xuemingl@mellanox.com (mailing list archive)
State Superseded, archived
Headers show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply patch file failure

Commit Message

Xueming Li Jan. 9, 2018, 2:11 p.m. UTC
Support new TX common offloads DEV_TX_OFFLOAD_COMMON_TNL including
common tunnel chksum and common tunnel tso.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
 drivers/net/mlx5/mlx5_ethdev.c | 3 ++-
 drivers/net/mlx5/mlx5_txq.c    | 5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index adaa34fff..80d984312 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -1400,7 +1400,8 @@  priv_select_tx_function(struct priv *priv, struct rte_eth_dev *dev)
 	uint64_t tx_offloads = dev->data->dev_conf.txmode.offloads;
 	int tso = !!(tx_offloads & (DEV_TX_OFFLOAD_TCP_TSO |
 				    DEV_TX_OFFLOAD_VXLAN_TNL_TSO |
-				    DEV_TX_OFFLOAD_GRE_TNL_TSO));
+				    DEV_TX_OFFLOAD_GRE_TNL_TSO |
+				    DEV_TX_OFFLOAD_GENERIC_TNL_CKSUM_TSO));
 	int vlan_insert = !!(tx_offloads & DEV_TX_OFFLOAD_VLAN_INSERT);
 
 	assert(priv != NULL);
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 0e8498161..f4a75b41c 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -143,6 +143,8 @@  mlx5_priv_get_tx_port_offloads(struct priv *priv)
 		if (config->tso)
 			offloads |= (DEV_TX_OFFLOAD_VXLAN_TNL_TSO |
 				     DEV_TX_OFFLOAD_GRE_TNL_TSO);
+		if (config->swp)
+			offloads |= DEV_TX_OFFLOAD_GENERIC_TNL_CKSUM_TSO;
 	}
 	return offloads;
 }
@@ -729,7 +731,8 @@  txq_set_params(struct mlx5_txq_ctrl *txq_ctrl)
 		txq_ctrl->txq.tso_en = 1;
 	}
 	txq_ctrl->txq.tunnel_en = config->tunnel_en;
-	txq_ctrl->txq.swp_en = config->swp;
+	txq_ctrl->txq.swp_en = (DEV_TX_OFFLOAD_GENERIC_TNL_CKSUM_TSO &
+				txq_ctrl->txq.offloads) && config->swp;
 }
 
 /**