* [PATCH 1/3] net/cnxk: fix data offset extract logic in vector function
@ 2023-10-16 7:04 Nithin Dabilpuram
2023-10-16 7:04 ` [PATCH 2/3] net/cnxk: add support to extract HW error for inline IPsec Nithin Dabilpuram
2023-10-16 7:04 ` [PATCH 3/3] common/cnxk: check for error code in MAC address set Nithin Dabilpuram
0 siblings, 2 replies; 4+ messages in thread
From: Nithin Dabilpuram @ 2023-10-16 7:04 UTC (permalink / raw)
To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao; +Cc: jerinj, dev
Extract data offset from individual mbuf's instead of mbuf0.
Fixes: 6771216c2f44 ("drivers: mark cnxk to support disabling IOVA as PA")
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
drivers/net/cnxk/cn10k_tx.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h
index e7943e3c88..467f0ccc65 100644
--- a/drivers/net/cnxk/cn10k_tx.h
+++ b/drivers/net/cnxk/cn10k_tx.h
@@ -2201,13 +2201,13 @@ cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws,
vsetq_lane_u64(((struct rte_mbuf *)mbuf0)->data_off, vld1q_u64(mbuf0), 1);
len_olflags0 = vld1q_u64(mbuf0 + 3);
dataoff_iova1 =
- vsetq_lane_u64(((struct rte_mbuf *)mbuf0)->data_off, vld1q_u64(mbuf1), 1);
+ vsetq_lane_u64(((struct rte_mbuf *)mbuf1)->data_off, vld1q_u64(mbuf1), 1);
len_olflags1 = vld1q_u64(mbuf1 + 3);
dataoff_iova2 =
- vsetq_lane_u64(((struct rte_mbuf *)mbuf0)->data_off, vld1q_u64(mbuf2), 1);
+ vsetq_lane_u64(((struct rte_mbuf *)mbuf2)->data_off, vld1q_u64(mbuf2), 1);
len_olflags2 = vld1q_u64(mbuf2 + 3);
dataoff_iova3 =
- vsetq_lane_u64(((struct rte_mbuf *)mbuf0)->data_off, vld1q_u64(mbuf3), 1);
+ vsetq_lane_u64(((struct rte_mbuf *)mbuf3)->data_off, vld1q_u64(mbuf3), 1);
len_olflags3 = vld1q_u64(mbuf3 + 3);
/* Move mbufs to point pool */
--
2.25.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/3] net/cnxk: add support to extract HW error for inline IPsec
2023-10-16 7:04 [PATCH 1/3] net/cnxk: fix data offset extract logic in vector function Nithin Dabilpuram
@ 2023-10-16 7:04 ` Nithin Dabilpuram
2023-10-16 7:04 ` [PATCH 3/3] common/cnxk: check for error code in MAC address set Nithin Dabilpuram
1 sibling, 0 replies; 4+ messages in thread
From: Nithin Dabilpuram @ 2023-10-16 7:04 UTC (permalink / raw)
To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao; +Cc: jerinj, dev
Add PMD API support to extract HW error code from mbuf's processed
by inline IPsec inbound.
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
drivers/net/cnxk/cn10k_ethdev_sec.c | 18 ++++++++++++++++++
drivers/net/cnxk/rte_pmd_cnxk.h | 17 +++++++++++++++++
drivers/net/cnxk/version.map | 6 +++++-
3 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/drivers/net/cnxk/cn10k_ethdev_sec.c b/drivers/net/cnxk/cn10k_ethdev_sec.c
index 9a831634da..b54795565d 100644
--- a/drivers/net/cnxk/cn10k_ethdev_sec.c
+++ b/drivers/net/cnxk/cn10k_ethdev_sec.c
@@ -1184,6 +1184,24 @@ rte_pmd_cnxk_hw_sa_write(void *device, struct rte_security_session *sess,
return 0;
}
+void *
+rte_pmd_cnxk_inl_ipsec_res(struct rte_mbuf *mbuf)
+{
+ const union nix_rx_parse_u *rx;
+ uint16_t desc_size;
+ uintptr_t wqe;
+
+ if (!mbuf || !(mbuf->ol_flags & RTE_MBUF_F_RX_SEC_OFFLOAD))
+ return NULL;
+
+ wqe = (uintptr_t)(mbuf + 1);
+ rx = (const union nix_rx_parse_u *)(wqe + 8);
+ desc_size = (rx->desc_sizem1 + 1) * 16;
+
+ /* cpt_res_s sits after SG list at 16B aligned address */
+ return (void *)(wqe + 64 + desc_size);
+}
+
static int
cn10k_eth_sec_session_stats_get(void *device, struct rte_security_session *sess,
struct rte_security_stats *stats)
diff --git a/drivers/net/cnxk/rte_pmd_cnxk.h b/drivers/net/cnxk/rte_pmd_cnxk.h
index d7eadd582d..7827c33ac9 100644
--- a/drivers/net/cnxk/rte_pmd_cnxk.h
+++ b/drivers/net/cnxk/rte_pmd_cnxk.h
@@ -96,4 +96,21 @@ int rte_pmd_cnxk_hw_sa_read(void *device, struct rte_security_session *sess,
__rte_experimental
int rte_pmd_cnxk_hw_sa_write(void *device, struct rte_security_session *sess,
void *data, uint32_t len);
+
+/**
+ * Get pointer to CPT result info for inline inbound processed pkt.
+ *
+ * It is recommended to use this API only when mbuf indicates packet
+ * was processed with inline IPsec and there was a failure with the same i.e
+ * mbuf->ol_flags indicates (RTE_MBUF_F_RX_SEC_OFFLOAD | RTE_MBUF_F_RX_SEC_OFFLOAD_FAILED).
+ *
+ * @param mbuf
+ * Pointer to packet that was just received and was processed with Inline IPsec.
+ *
+ * @return
+ * - Pointer to mbuf location where CPT result info is stored on success.
+ * - NULL on failure.
+ */
+__rte_experimental
+void *rte_pmd_cnxk_inl_ipsec_res(struct rte_mbuf *mbuf);
#endif /* _PMD_CNXK_H_ */
diff --git a/drivers/net/cnxk/version.map b/drivers/net/cnxk/version.map
index 7ae6d80bf0..77f574bb16 100644
--- a/drivers/net/cnxk/version.map
+++ b/drivers/net/cnxk/version.map
@@ -3,10 +3,14 @@ DPDK_24 {
};
EXPERIMENTAL {
+ global:
+
# added in 22.07
- global:
rte_pmd_cnxk_hw_sa_read;
rte_pmd_cnxk_hw_sa_write;
+
+ # added in 23.11
+ rte_pmd_cnxk_inl_ipsec_res;
};
INTERNAL {
--
2.25.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 3/3] common/cnxk: check for error code in MAC address set
2023-10-16 7:04 [PATCH 1/3] net/cnxk: fix data offset extract logic in vector function Nithin Dabilpuram
2023-10-16 7:04 ` [PATCH 2/3] net/cnxk: add support to extract HW error for inline IPsec Nithin Dabilpuram
@ 2023-10-16 7:04 ` Nithin Dabilpuram
2023-10-18 5:34 ` Jerin Jacob
1 sibling, 1 reply; 4+ messages in thread
From: Nithin Dabilpuram @ 2023-10-16 7:04 UTC (permalink / raw)
To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao; +Cc: jerinj, dev
Check for mbox error code in MAC address set.
Fixes: 313cc41830ec ("common/cnxk: support NIX MAC operations")
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
drivers/common/cnxk/roc_nix_mac.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/common/cnxk/roc_nix_mac.c b/drivers/common/cnxk/roc_nix_mac.c
index e2e87be525..2d1c29dd66 100644
--- a/drivers/common/cnxk/roc_nix_mac.c
+++ b/drivers/common/cnxk/roc_nix_mac.c
@@ -84,7 +84,7 @@ roc_nix_mac_addr_set(struct roc_nix *roc_nix, const uint8_t addr[])
struct cgx_mac_addr_set_or_get *req, *rsp;
struct dev *dev = &nix->dev;
struct mbox *mbox = mbox_get(dev->mbox);
- int rc;
+ int rc = -ENOSPC;
if (roc_nix_is_vf_or_sdp(roc_nix)) {
rc = NIX_ERR_OP_NOTSUP;
@@ -97,6 +97,9 @@ roc_nix_mac_addr_set(struct roc_nix *roc_nix, const uint8_t addr[])
}
req = mbox_alloc_msg_cgx_mac_addr_set(mbox);
+ if (req == NULL)
+ goto exit;
+
req->index = nix->dmac_flt_idx;
mbox_memcpy(req->mac_addr, addr, PLT_ETHER_ADDR_LEN);
--
2.25.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 3/3] common/cnxk: check for error code in MAC address set
2023-10-16 7:04 ` [PATCH 3/3] common/cnxk: check for error code in MAC address set Nithin Dabilpuram
@ 2023-10-18 5:34 ` Jerin Jacob
0 siblings, 0 replies; 4+ messages in thread
From: Jerin Jacob @ 2023-10-18 5:34 UTC (permalink / raw)
To: Nithin Dabilpuram; +Cc: Kiran Kumar K, Sunil Kumar Kori, Satha Rao, jerinj, dev
On Mon, Oct 16, 2023 at 12:35 PM Nithin Dabilpuram
<ndabilpuram@marvell.com> wrote:
>
> Check for mbox error code in MAC address set.
> Fixes: 313cc41830ec ("common/cnxk: support NIX MAC operations")
>
> Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Updated the git commit as follows and applied to
dpdk-next-net-mrvl/for-next-net. Thanks
commit 9d88abedf09d2fb966de58f9f14782df3d61389c (HEAD -> for-next-net,
origin/for-next-net)
Author: Nithin Dabilpuram <ndabilpuram@marvell.com>
Date: Mon Oct 16 12:34:37 2023 +0530
common/cnxk: check for error code in MAC address set
Check for mailbox error code in MAC address set.
Fixes: 313cc41830ec ("common/cnxk: support NIX MAC operations")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
commit b1744e2ad03d78517f9337e6377fa5ae72ca5ef2
Author: Nithin Dabilpuram <ndabilpuram@marvell.com>
Date: Mon Oct 16 12:34:36 2023 +0530
net/cnxk: support to extract HW error for inline IPsec
Add PMD API support to extract HW error code from mbuf's processed
by inline IPsec inbound.
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
commit 99b9917b020223f0fe5a3bddf598d2aef53d7da8
Author: Nithin Dabilpuram <ndabilpuram@marvell.com>
Date: Mon Oct 16 12:34:35 2023 +0530
net/cnxk: fix data offset extract logic in vector function
Extract data offset from individual mbuf's instead of mbuf0.
Fixes: 6771216c2f44 ("drivers: mark cnxk to support disabling IOVA as PA")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-10-18 5:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-16 7:04 [PATCH 1/3] net/cnxk: fix data offset extract logic in vector function Nithin Dabilpuram
2023-10-16 7:04 ` [PATCH 2/3] net/cnxk: add support to extract HW error for inline IPsec Nithin Dabilpuram
2023-10-16 7:04 ` [PATCH 3/3] common/cnxk: check for error code in MAC address set Nithin Dabilpuram
2023-10-18 5:34 ` Jerin Jacob
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).