diff mbox series

[v2,25/28] net/cnxk: allow zero udp6 checksum for non inline device

Message ID 20210930170113.29030-26-ndabilpuram@marvell.com (mailing list archive)
State Changes Requested, archived
Delegated to: Jerin Jacob
Headers show
Series net/cnxk: support for inline ipsec | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Nithin Dabilpuram Sept. 30, 2021, 5:01 p.m. UTC
From: Srujana Challa <schalla@marvell.com>

Sets IP6_UDP_OPT in NIX RX config to allow optional
UDP checksum for IPv6 in case of security offload.
Also disable drop_re when inline inbound is enabled.

Signed-off-by: Srujana Challa <schalla@marvell.com>
---
 drivers/net/cnxk/cn10k_ethdev.c | 5 +++++
 drivers/net/cnxk/cnxk_ethdev.c  | 9 +++++++++
 drivers/net/cnxk/cnxk_ethdev.h  | 1 +
 3 files changed, 15 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/cnxk/cn10k_ethdev.c b/drivers/net/cnxk/cn10k_ethdev.c
index fa2343c..9dfea99 100644
--- a/drivers/net/cnxk/cn10k_ethdev.c
+++ b/drivers/net/cnxk/cn10k_ethdev.c
@@ -553,6 +553,11 @@  cn10k_nix_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 
 	dev = cnxk_eth_pmd_priv(eth_dev);
 
+	/* DROP_RE is not supported with inline IPSec for CN10K A0 */
+	if (roc_model_is_cn10ka_a0() || roc_model_is_cnf10ka_a0() ||
+	    roc_model_is_cnf10kb_a0())
+		dev->ipsecd_drop_re_dis = 1;
+
 	/* Register up msg callbacks for PTP information */
 	roc_nix_ptp_info_cb_register(&dev->nix, cn10k_nix_ptp_info_update_cb);
 
diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c
index 5a64691..2367d5c 100644
--- a/drivers/net/cnxk/cnxk_ethdev.c
+++ b/drivers/net/cnxk/cnxk_ethdev.c
@@ -1021,6 +1021,15 @@  cnxk_nix_configure(struct rte_eth_dev *eth_dev)
 		   ROC_NIX_LF_RX_CFG_LEN_IL4 | ROC_NIX_LF_RX_CFG_LEN_IL3 |
 		   ROC_NIX_LF_RX_CFG_LEN_OL4 | ROC_NIX_LF_RX_CFG_LEN_OL3);
 
+	if (dev->rx_offloads & DEV_RX_OFFLOAD_SECURITY) {
+		rx_cfg |= ROC_NIX_LF_RX_CFG_IP6_UDP_OPT;
+		/* Disable drop re if rx offload security is enabled and
+		 * platform does not support it.
+		 */
+		if (dev->ipsecd_drop_re_dis)
+			rx_cfg &= ~(ROC_NIX_LF_RX_CFG_DROP_RE);
+	}
+
 	nb_rxq = RTE_MAX(data->nb_rx_queues, 1);
 	nb_txq = RTE_MAX(data->nb_tx_queues, 1);
 
diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
index a2bcea2..6fd50da 100644
--- a/drivers/net/cnxk/cnxk_ethdev.h
+++ b/drivers/net/cnxk/cnxk_ethdev.h
@@ -269,6 +269,7 @@  struct cnxk_eth_dev {
 	union {
 		struct {
 			uint64_t cq_min_4k : 1;
+			uint64_t ipsecd_drop_re_dis : 1;
 		};
 		uint64_t hwcap;
 	};