* [PATCH 2/5] event/cnxk: set Rx offload flags
2023-04-25 10:40 [PATCH 1/5] common/cnxk: fix IPsec IPv6 tunnel address byte swap Rahul Bhansali
@ 2023-04-25 10:40 ` Rahul Bhansali
2023-04-25 10:40 ` [PATCH 3/5] event/cnxk: fix Tx adapter data pointer Rahul Bhansali
` (4 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Rahul Bhansali @ 2023-04-25 10:40 UTC (permalink / raw)
To: dev, Pavan Nikhilesh, Shijith Thotton; +Cc: jerinj, Rahul Bhansali
Configure event dev Rx offload flags with rx adapter
start/stop callbacks.
Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
drivers/event/cnxk/cnxk_eventdev_adptr.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/event/cnxk/cnxk_eventdev_adptr.c b/drivers/event/cnxk/cnxk_eventdev_adptr.c
index 5ec436382c..6d975362e8 100644
--- a/drivers/event/cnxk/cnxk_eventdev_adptr.c
+++ b/drivers/event/cnxk/cnxk_eventdev_adptr.c
@@ -331,9 +331,9 @@ int
cnxk_sso_rx_adapter_start(const struct rte_eventdev *event_dev,
const struct rte_eth_dev *eth_dev)
{
- RTE_SET_USED(event_dev);
- RTE_SET_USED(eth_dev);
-
+ struct cnxk_eth_dev *cnxk_eth_dev = eth_dev->data->dev_private;
+ struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
+ dev->rx_offloads |= cnxk_eth_dev->rx_offload_flags;
return 0;
}
@@ -341,9 +341,9 @@ int
cnxk_sso_rx_adapter_stop(const struct rte_eventdev *event_dev,
const struct rte_eth_dev *eth_dev)
{
- RTE_SET_USED(event_dev);
RTE_SET_USED(eth_dev);
-
+ struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
+ dev->rx_offloads = 0;
return 0;
}
--
2.25.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 3/5] event/cnxk: fix Tx adapter data pointer
2023-04-25 10:40 [PATCH 1/5] common/cnxk: fix IPsec IPv6 tunnel address byte swap Rahul Bhansali
2023-04-25 10:40 ` [PATCH 2/5] event/cnxk: set Rx offload flags Rahul Bhansali
@ 2023-04-25 10:40 ` Rahul Bhansali
2023-04-25 10:40 ` [PATCH 4/5] event/cnxk: fix mempool cookies check Rahul Bhansali
` (3 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Rahul Bhansali @ 2023-04-25 10:40 UTC (permalink / raw)
To: dev, Pavan Nikhilesh, Shijith Thotton; +Cc: jerinj, Rahul Bhansali
Dpdk test application crashes when event inline IPsec test ran for
second time onwards.
In case of event device cleanup, Tx adapter data pointer is free
but not set back to NULL, which causes incomplete
initialization on next run.
Fixes: 6a24c7c4bcd ("event/cnxk: add Tx adapter freeing")
Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
drivers/event/cnxk/cnxk_eventdev_adptr.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/event/cnxk/cnxk_eventdev_adptr.c b/drivers/event/cnxk/cnxk_eventdev_adptr.c
index 6d975362e8..9a02026ea6 100644
--- a/drivers/event/cnxk/cnxk_eventdev_adptr.c
+++ b/drivers/event/cnxk/cnxk_eventdev_adptr.c
@@ -635,6 +635,7 @@ cnxk_sso_tx_adapter_free(uint8_t id __rte_unused,
if (dev->tx_adptr_data_sz && dev->tx_adptr_active_mask == 0) {
dev->tx_adptr_data_sz = 0;
free(dev->tx_adptr_data);
+ dev->tx_adptr_data = NULL;
}
return 0;
--
2.25.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 4/5] event/cnxk: fix mempool cookies check
2023-04-25 10:40 [PATCH 1/5] common/cnxk: fix IPsec IPv6 tunnel address byte swap Rahul Bhansali
2023-04-25 10:40 ` [PATCH 2/5] event/cnxk: set Rx offload flags Rahul Bhansali
2023-04-25 10:40 ` [PATCH 3/5] event/cnxk: fix Tx adapter data pointer Rahul Bhansali
@ 2023-04-25 10:40 ` Rahul Bhansali
2023-04-25 10:40 ` [PATCH 5/5] net/cnxk: add mempool check for frag attach Rahul Bhansali
` (2 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Rahul Bhansali @ 2023-04-25 10:40 UTC (permalink / raw)
To: dev, Pavan Nikhilesh, Shijith Thotton; +Cc: jerinj, Rahul Bhansali
Fix for mempool cookies get mark to be done before
meta to mbuf processing.
Fixes: 7a709964d9b ("net/cnxk: use NPA batch burst free for meta buffers")
Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
drivers/event/cnxk/cn10k_worker.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/event/cnxk/cn10k_worker.h b/drivers/event/cnxk/cn10k_worker.h
index 06c71c6092..1e519d8156 100644
--- a/drivers/event/cnxk/cn10k_worker.h
+++ b/drivers/event/cnxk/cn10k_worker.h
@@ -22,9 +22,6 @@ cn10k_wqe_to_mbuf(uint64_t wqe, const uint64_t __mbuf, uint8_t port_id,
(flags & NIX_RX_OFFLOAD_TSTAMP_F ? 8 : 0);
struct rte_mbuf *mbuf = (struct rte_mbuf *)__mbuf;
- /* Mark mempool obj as "get" as it is alloc'ed by NIX */
- RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1);
-
cn10k_nix_cqe_to_mbuf((struct nix_cqe_hdr_s *)wqe, tag,
(struct rte_mbuf *)mbuf, lookup_mem,
mbuf_init | ((uint64_t)port_id) << 48, flags);
@@ -166,6 +163,10 @@ cn10k_sso_hws_post_process(struct cn10k_sso_hws *ws, uint64_t *u64,
mbuf = u64[1] - sizeof(struct rte_mbuf);
rte_prefetch0((void *)mbuf);
+
+ /* Mark mempool obj as "get" as it is alloc'ed by NIX */
+ RTE_MEMPOOL_CHECK_COOKIES(((struct rte_mbuf *)mbuf)->pool, (void **)&mbuf, 1, 1);
+
if (flags & NIX_RX_OFFLOAD_SECURITY_F) {
const uint64_t mbuf_init =
0x100010000ULL | RTE_PKTMBUF_HEADROOM |
--
2.25.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 5/5] net/cnxk: add mempool check for frag attach
2023-04-25 10:40 [PATCH 1/5] common/cnxk: fix IPsec IPv6 tunnel address byte swap Rahul Bhansali
` (2 preceding siblings ...)
2023-04-25 10:40 ` [PATCH 4/5] event/cnxk: fix mempool cookies check Rahul Bhansali
@ 2023-04-25 10:40 ` Rahul Bhansali
2023-05-18 6:31 ` [PATCH 1/5] common/cnxk: fix IPsec IPv6 tunnel address byte swap Jerin Jacob
2023-05-18 15:48 ` [PATCH v2 " Rahul Bhansali
5 siblings, 0 replies; 12+ messages in thread
From: Rahul Bhansali @ 2023-04-25 10:40 UTC (permalink / raw)
To: dev, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
Cc: jerinj, Rahul Bhansali
Add mempool cookies get mark to all frags in case of
reassembly failure.
Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
drivers/net/cnxk/cn10k_rx.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/cnxk/cn10k_rx.h b/drivers/net/cnxk/cn10k_rx.h
index 9fdb5565e9..cbaf994aa2 100644
--- a/drivers/net/cnxk/cn10k_rx.h
+++ b/drivers/net/cnxk/cn10k_rx.h
@@ -211,6 +211,9 @@ nix_sec_attach_frags(const struct cpt_parse_hdr_s *hdr,
/* Update dynamic field with userdata */
*rte_security_dynfield(mbuf) = (uint64_t)inb_priv->userdata;
+ /* Mark frag as get */
+ RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1);
+
cnxk_ip_reassembly_dynfield(mbuf, off)->nb_frags =
hdr->w0.num_frags - 2;
cnxk_ip_reassembly_dynfield(mbuf, off)->next_frag = NULL;
@@ -239,6 +242,9 @@ nix_sec_attach_frags(const struct cpt_parse_hdr_s *hdr,
/* Update dynamic field with userdata */
*rte_security_dynfield(mbuf) = (uint64_t)inb_priv->userdata;
+ /* Mark frag as get */
+ RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1);
+
cnxk_ip_reassembly_dynfield(mbuf, off)->nb_frags =
hdr->w0.num_frags - 3;
cnxk_ip_reassembly_dynfield(mbuf, off)->next_frag = NULL;
@@ -263,6 +269,9 @@ nix_sec_attach_frags(const struct cpt_parse_hdr_s *hdr,
mbuf->ol_flags = ol_flags;
mbuf->next = NULL;
+ /* Mark frag as get */
+ RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1);
+
/* Update dynamic field with userdata */
*rte_security_dynfield(mbuf) = (uint64_t)inb_priv->userdata;
--
2.25.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/5] common/cnxk: fix IPsec IPv6 tunnel address byte swap
2023-04-25 10:40 [PATCH 1/5] common/cnxk: fix IPsec IPv6 tunnel address byte swap Rahul Bhansali
` (3 preceding siblings ...)
2023-04-25 10:40 ` [PATCH 5/5] net/cnxk: add mempool check for frag attach Rahul Bhansali
@ 2023-05-18 6:31 ` Jerin Jacob
2023-05-18 15:48 ` [PATCH v2 " Rahul Bhansali
5 siblings, 0 replies; 12+ messages in thread
From: Jerin Jacob @ 2023-05-18 6:31 UTC (permalink / raw)
To: Rahul Bhansali
Cc: dev, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori,
Satha Rao, jerinj
On Tue, Apr 25, 2023 at 4:11 PM Rahul Bhansali <rbhansali@marvell.com> wrote:
>
> Fix the IPsec IPv6 tunnel address bytes swap during SA
> configurations in session create/update.
>
> Fixes: 78d03027f2c ("common/cnxk: add IPsec common code")
Fix the following in the series
Is it candidate for Cc: stable@dpdk.org backport?
common/cnxk: fix IPsec IPv6 tunnel address byte swap
event/cnxk: fix Tx adapter data pointer
event/cnxk: fix mempool cookies check
Invalid patch(es) found - checked 5 patches
check-git-log failed
### [PATCH] common/cnxk: fix IPsec IPv6 tunnel address byte swap
WARNING:BAD_FIXES_TAG: Please use correct Fixes: style 'Fixes: <12
chars of sha1> ("<title line>")' - ie: 'Fixes: 78d03027f2cc
("common/cnxk: add IPsec common code")'
#9:
Fixes: 78d03027f2c ("common/cnxk: add IPsec common code")
total: 0 errors, 1 warnings, 34 lines checked
### [PATCH] event/cnxk: fix Tx adapter data pointer
WARNING:BAD_FIXES_TAG: Please use correct Fixes: style 'Fixes: <12
chars of sha1> ("<title line>")' - ie: 'Fixes: 6a24c7c4bcd1
("event/cnxk: add Tx adapter freeing")'
#12:
Fixes: 6a24c7c4bcd ("event/cnxk: add Tx adapter freeing")
total: 0 errors, 1 warnings, 7 lines checked
### [PATCH] event/cnxk: fix mempool cookies check
WARNING:BAD_FIXES_TAG: Please use correct Fixes: style 'Fixes: <12
chars of sha1> ("<title line>")' - ie: 'Fixes: 7a709964d9bb
("net/cnxk: use NPA batch burst free for meta buffers")'
#9:
Fixes: 7a709964d9b ("net/cnxk: use NPA batch burst free for meta buffers")
total: 0 errors, 1 warnings, 19 lines checked
2/5 valid patches
checkpatch failed
>
> Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
> ---
> drivers/common/cnxk/cnxk_security.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/drivers/common/cnxk/cnxk_security.c b/drivers/common/cnxk/cnxk_security.c
> index 79427d48fe..13ca2c7791 100644
> --- a/drivers/common/cnxk/cnxk_security.c
> +++ b/drivers/common/cnxk/cnxk_security.c
> @@ -274,6 +274,14 @@ ot_ipsec_inb_ctx_size(struct roc_ot_ipsec_inb_sa *sa)
> return size;
> }
>
> +static void
> +ot_ipsec_update_ipv6_addr_endianness(uint64_t *addr)
> +{
> + *addr = rte_be_to_cpu_64(*addr);
> + addr++;
> + *addr = rte_be_to_cpu_64(*addr);
> +}
> +
> static int
> ot_ipsec_inb_tunnel_hdr_fill(struct roc_ot_ipsec_inb_sa *sa,
> struct rte_security_ipsec_xform *ipsec_xfrm)
> @@ -310,6 +318,10 @@ ot_ipsec_inb_tunnel_hdr_fill(struct roc_ot_ipsec_inb_sa *sa,
> memcpy(&sa->outer_hdr.ipv6.dst_addr, &tunnel->ipv6.dst_addr,
> sizeof(struct in6_addr));
>
> + /* IP Source and Dest are in LE/CPU endian */
> + ot_ipsec_update_ipv6_addr_endianness((uint64_t *)&sa->outer_hdr.ipv6.src_addr);
> + ot_ipsec_update_ipv6_addr_endianness((uint64_t *)&sa->outer_hdr.ipv6.dst_addr);
> +
> break;
> default:
> return -EINVAL;
> @@ -499,6 +511,10 @@ cnxk_ot_ipsec_outb_sa_fill(struct roc_ot_ipsec_outb_sa *sa,
> memcpy(&sa->outer_hdr.ipv6.dst_addr, &tunnel->ipv6.dst_addr,
> sizeof(struct in6_addr));
>
> + /* IP Source and Dest are in LE/CPU endian */
> + ot_ipsec_update_ipv6_addr_endianness((uint64_t *)&sa->outer_hdr.ipv6.src_addr);
> + ot_ipsec_update_ipv6_addr_endianness((uint64_t *)&sa->outer_hdr.ipv6.dst_addr);
> +
> /* Outer header flow label source */
> if (!ipsec_xfrm->options.copy_flabel) {
> sa->w2.s.ipv4_df_src_or_ipv6_flw_lbl_src =
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 1/5] common/cnxk: fix IPsec IPv6 tunnel address byte swap
2023-04-25 10:40 [PATCH 1/5] common/cnxk: fix IPsec IPv6 tunnel address byte swap Rahul Bhansali
` (4 preceding siblings ...)
2023-05-18 6:31 ` [PATCH 1/5] common/cnxk: fix IPsec IPv6 tunnel address byte swap Jerin Jacob
@ 2023-05-18 15:48 ` Rahul Bhansali
2023-05-18 15:48 ` [PATCH v2 2/5] event/cnxk: set Rx offload flags Rahul Bhansali
` (3 more replies)
5 siblings, 4 replies; 12+ messages in thread
From: Rahul Bhansali @ 2023-05-18 15:48 UTC (permalink / raw)
To: dev, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori,
Satha Rao, Akhil Goyal, Srujana Challa, Tejasree Kondoj
Cc: jerinj, Rahul Bhansali, stable
Fix the IPsec IPv6 tunnel address bytes swap during SA
configurations in session create/update.
Fixes: 78d03027f2cc ("common/cnxk: add IPsec common code")
Cc: stable@dpdk.org
Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
Changes in v2: update in commit message for fixes and cc tag
drivers/common/cnxk/cnxk_security.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/common/cnxk/cnxk_security.c b/drivers/common/cnxk/cnxk_security.c
index 79427d48fe..13ca2c7791 100644
--- a/drivers/common/cnxk/cnxk_security.c
+++ b/drivers/common/cnxk/cnxk_security.c
@@ -274,6 +274,14 @@ ot_ipsec_inb_ctx_size(struct roc_ot_ipsec_inb_sa *sa)
return size;
}
+static void
+ot_ipsec_update_ipv6_addr_endianness(uint64_t *addr)
+{
+ *addr = rte_be_to_cpu_64(*addr);
+ addr++;
+ *addr = rte_be_to_cpu_64(*addr);
+}
+
static int
ot_ipsec_inb_tunnel_hdr_fill(struct roc_ot_ipsec_inb_sa *sa,
struct rte_security_ipsec_xform *ipsec_xfrm)
@@ -310,6 +318,10 @@ ot_ipsec_inb_tunnel_hdr_fill(struct roc_ot_ipsec_inb_sa *sa,
memcpy(&sa->outer_hdr.ipv6.dst_addr, &tunnel->ipv6.dst_addr,
sizeof(struct in6_addr));
+ /* IP Source and Dest are in LE/CPU endian */
+ ot_ipsec_update_ipv6_addr_endianness((uint64_t *)&sa->outer_hdr.ipv6.src_addr);
+ ot_ipsec_update_ipv6_addr_endianness((uint64_t *)&sa->outer_hdr.ipv6.dst_addr);
+
break;
default:
return -EINVAL;
@@ -499,6 +511,10 @@ cnxk_ot_ipsec_outb_sa_fill(struct roc_ot_ipsec_outb_sa *sa,
memcpy(&sa->outer_hdr.ipv6.dst_addr, &tunnel->ipv6.dst_addr,
sizeof(struct in6_addr));
+ /* IP Source and Dest are in LE/CPU endian */
+ ot_ipsec_update_ipv6_addr_endianness((uint64_t *)&sa->outer_hdr.ipv6.src_addr);
+ ot_ipsec_update_ipv6_addr_endianness((uint64_t *)&sa->outer_hdr.ipv6.dst_addr);
+
/* Outer header flow label source */
if (!ipsec_xfrm->options.copy_flabel) {
sa->w2.s.ipv4_df_src_or_ipv6_flw_lbl_src =
--
2.25.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 2/5] event/cnxk: set Rx offload flags
2023-05-18 15:48 ` [PATCH v2 " Rahul Bhansali
@ 2023-05-18 15:48 ` Rahul Bhansali
2023-05-18 15:49 ` [PATCH v2 3/5] event/cnxk: fix Tx adapter data pointer Rahul Bhansali
` (2 subsequent siblings)
3 siblings, 0 replies; 12+ messages in thread
From: Rahul Bhansali @ 2023-05-18 15:48 UTC (permalink / raw)
To: dev, Pavan Nikhilesh, Shijith Thotton; +Cc: jerinj, Rahul Bhansali
Configure event dev Rx offload flags with rx adapter
start/stop callbacks.
Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
Changes in v2: No change
drivers/event/cnxk/cnxk_eventdev_adptr.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/event/cnxk/cnxk_eventdev_adptr.c b/drivers/event/cnxk/cnxk_eventdev_adptr.c
index 5ec436382c..6d975362e8 100644
--- a/drivers/event/cnxk/cnxk_eventdev_adptr.c
+++ b/drivers/event/cnxk/cnxk_eventdev_adptr.c
@@ -331,9 +331,9 @@ int
cnxk_sso_rx_adapter_start(const struct rte_eventdev *event_dev,
const struct rte_eth_dev *eth_dev)
{
- RTE_SET_USED(event_dev);
- RTE_SET_USED(eth_dev);
-
+ struct cnxk_eth_dev *cnxk_eth_dev = eth_dev->data->dev_private;
+ struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
+ dev->rx_offloads |= cnxk_eth_dev->rx_offload_flags;
return 0;
}
@@ -341,9 +341,9 @@ int
cnxk_sso_rx_adapter_stop(const struct rte_eventdev *event_dev,
const struct rte_eth_dev *eth_dev)
{
- RTE_SET_USED(event_dev);
RTE_SET_USED(eth_dev);
-
+ struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
+ dev->rx_offloads = 0;
return 0;
}
--
2.25.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 3/5] event/cnxk: fix Tx adapter data pointer
2023-05-18 15:48 ` [PATCH v2 " Rahul Bhansali
2023-05-18 15:48 ` [PATCH v2 2/5] event/cnxk: set Rx offload flags Rahul Bhansali
@ 2023-05-18 15:49 ` Rahul Bhansali
2023-05-18 15:49 ` [PATCH v2 4/5] event/cnxk: fix mempool cookies check Rahul Bhansali
2023-05-18 15:49 ` [PATCH v2 5/5] net/cnxk: add mempool check for frag attach Rahul Bhansali
3 siblings, 0 replies; 12+ messages in thread
From: Rahul Bhansali @ 2023-05-18 15:49 UTC (permalink / raw)
To: dev, Pavan Nikhilesh, Shijith Thotton, Volodymyr Fialko
Cc: jerinj, Rahul Bhansali, stable
Dpdk test application crashes when event inline IPsec test ran for
second time onwards.
In case of event device cleanup, Tx adapter data pointer is free
but not set back to NULL, which causes incomplete
initialization on next run.
Fixes: 6a24c7c4bcd1 ("event/cnxk: add Tx adapter freeing")
Cc: stable@dpdk.org
Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
Changes in v2: update in commit message for fixes and cc tag
drivers/event/cnxk/cnxk_eventdev_adptr.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/event/cnxk/cnxk_eventdev_adptr.c b/drivers/event/cnxk/cnxk_eventdev_adptr.c
index 6d975362e8..9a02026ea6 100644
--- a/drivers/event/cnxk/cnxk_eventdev_adptr.c
+++ b/drivers/event/cnxk/cnxk_eventdev_adptr.c
@@ -635,6 +635,7 @@ cnxk_sso_tx_adapter_free(uint8_t id __rte_unused,
if (dev->tx_adptr_data_sz && dev->tx_adptr_active_mask == 0) {
dev->tx_adptr_data_sz = 0;
free(dev->tx_adptr_data);
+ dev->tx_adptr_data = NULL;
}
return 0;
--
2.25.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 4/5] event/cnxk: fix mempool cookies check
2023-05-18 15:48 ` [PATCH v2 " Rahul Bhansali
2023-05-18 15:48 ` [PATCH v2 2/5] event/cnxk: set Rx offload flags Rahul Bhansali
2023-05-18 15:49 ` [PATCH v2 3/5] event/cnxk: fix Tx adapter data pointer Rahul Bhansali
@ 2023-05-18 15:49 ` Rahul Bhansali
2023-05-18 15:49 ` [PATCH v2 5/5] net/cnxk: add mempool check for frag attach Rahul Bhansali
3 siblings, 0 replies; 12+ messages in thread
From: Rahul Bhansali @ 2023-05-18 15:49 UTC (permalink / raw)
To: dev, Pavan Nikhilesh, Shijith Thotton, Jerin Jacob, Nithin Dabilpuram
Cc: Rahul Bhansali, stable
Fix for mempool cookies get mark to be done before
meta to mbuf processing.
Fixes: 7a709964d9bb ("net/cnxk: use NPA batch burst free for meta buffers")
Cc: stable@dpdk.org
Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
Changes in v2: update in commit message for fixes and cc tag
drivers/event/cnxk/cn10k_worker.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/event/cnxk/cn10k_worker.h b/drivers/event/cnxk/cn10k_worker.h
index 06c71c6092..1e519d8156 100644
--- a/drivers/event/cnxk/cn10k_worker.h
+++ b/drivers/event/cnxk/cn10k_worker.h
@@ -22,9 +22,6 @@ cn10k_wqe_to_mbuf(uint64_t wqe, const uint64_t __mbuf, uint8_t port_id,
(flags & NIX_RX_OFFLOAD_TSTAMP_F ? 8 : 0);
struct rte_mbuf *mbuf = (struct rte_mbuf *)__mbuf;
- /* Mark mempool obj as "get" as it is alloc'ed by NIX */
- RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1);
-
cn10k_nix_cqe_to_mbuf((struct nix_cqe_hdr_s *)wqe, tag,
(struct rte_mbuf *)mbuf, lookup_mem,
mbuf_init | ((uint64_t)port_id) << 48, flags);
@@ -166,6 +163,10 @@ cn10k_sso_hws_post_process(struct cn10k_sso_hws *ws, uint64_t *u64,
mbuf = u64[1] - sizeof(struct rte_mbuf);
rte_prefetch0((void *)mbuf);
+
+ /* Mark mempool obj as "get" as it is alloc'ed by NIX */
+ RTE_MEMPOOL_CHECK_COOKIES(((struct rte_mbuf *)mbuf)->pool, (void **)&mbuf, 1, 1);
+
if (flags & NIX_RX_OFFLOAD_SECURITY_F) {
const uint64_t mbuf_init =
0x100010000ULL | RTE_PKTMBUF_HEADROOM |
--
2.25.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 5/5] net/cnxk: add mempool check for frag attach
2023-05-18 15:48 ` [PATCH v2 " Rahul Bhansali
` (2 preceding siblings ...)
2023-05-18 15:49 ` [PATCH v2 4/5] event/cnxk: fix mempool cookies check Rahul Bhansali
@ 2023-05-18 15:49 ` Rahul Bhansali
2023-05-22 13:14 ` Jerin Jacob
3 siblings, 1 reply; 12+ messages in thread
From: Rahul Bhansali @ 2023-05-18 15:49 UTC (permalink / raw)
To: dev, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
Cc: jerinj, Rahul Bhansali
Add mempool cookies get mark to all frags in case of
reassembly failure.
Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
Changes in v2: No change
drivers/net/cnxk/cn10k_rx.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/cnxk/cn10k_rx.h b/drivers/net/cnxk/cn10k_rx.h
index 9fdb5565e9..cbaf994aa2 100644
--- a/drivers/net/cnxk/cn10k_rx.h
+++ b/drivers/net/cnxk/cn10k_rx.h
@@ -211,6 +211,9 @@ nix_sec_attach_frags(const struct cpt_parse_hdr_s *hdr,
/* Update dynamic field with userdata */
*rte_security_dynfield(mbuf) = (uint64_t)inb_priv->userdata;
+ /* Mark frag as get */
+ RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1);
+
cnxk_ip_reassembly_dynfield(mbuf, off)->nb_frags =
hdr->w0.num_frags - 2;
cnxk_ip_reassembly_dynfield(mbuf, off)->next_frag = NULL;
@@ -239,6 +242,9 @@ nix_sec_attach_frags(const struct cpt_parse_hdr_s *hdr,
/* Update dynamic field with userdata */
*rte_security_dynfield(mbuf) = (uint64_t)inb_priv->userdata;
+ /* Mark frag as get */
+ RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1);
+
cnxk_ip_reassembly_dynfield(mbuf, off)->nb_frags =
hdr->w0.num_frags - 3;
cnxk_ip_reassembly_dynfield(mbuf, off)->next_frag = NULL;
@@ -263,6 +269,9 @@ nix_sec_attach_frags(const struct cpt_parse_hdr_s *hdr,
mbuf->ol_flags = ol_flags;
mbuf->next = NULL;
+ /* Mark frag as get */
+ RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1);
+
/* Update dynamic field with userdata */
*rte_security_dynfield(mbuf) = (uint64_t)inb_priv->userdata;
--
2.25.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 5/5] net/cnxk: add mempool check for frag attach
2023-05-18 15:49 ` [PATCH v2 5/5] net/cnxk: add mempool check for frag attach Rahul Bhansali
@ 2023-05-22 13:14 ` Jerin Jacob
0 siblings, 0 replies; 12+ messages in thread
From: Jerin Jacob @ 2023-05-22 13:14 UTC (permalink / raw)
To: Rahul Bhansali
Cc: dev, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori,
Satha Rao, jerinj
On Thu, May 18, 2023 at 9:19 PM Rahul Bhansali <rbhansali@marvell.com> wrote:
>
> Add mempool cookies get mark to all frags in case of
> reassembly failure.
>
> Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Series applied to dpdk-next-net-mrvl/for-next-net. Thanks
> ---
> Changes in v2: No change
>
> drivers/net/cnxk/cn10k_rx.h | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/net/cnxk/cn10k_rx.h b/drivers/net/cnxk/cn10k_rx.h
> index 9fdb5565e9..cbaf994aa2 100644
> --- a/drivers/net/cnxk/cn10k_rx.h
> +++ b/drivers/net/cnxk/cn10k_rx.h
> @@ -211,6 +211,9 @@ nix_sec_attach_frags(const struct cpt_parse_hdr_s *hdr,
> /* Update dynamic field with userdata */
> *rte_security_dynfield(mbuf) = (uint64_t)inb_priv->userdata;
>
> + /* Mark frag as get */
> + RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1);
> +
> cnxk_ip_reassembly_dynfield(mbuf, off)->nb_frags =
> hdr->w0.num_frags - 2;
> cnxk_ip_reassembly_dynfield(mbuf, off)->next_frag = NULL;
> @@ -239,6 +242,9 @@ nix_sec_attach_frags(const struct cpt_parse_hdr_s *hdr,
> /* Update dynamic field with userdata */
> *rte_security_dynfield(mbuf) = (uint64_t)inb_priv->userdata;
>
> + /* Mark frag as get */
> + RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1);
> +
> cnxk_ip_reassembly_dynfield(mbuf, off)->nb_frags =
> hdr->w0.num_frags - 3;
> cnxk_ip_reassembly_dynfield(mbuf, off)->next_frag = NULL;
> @@ -263,6 +269,9 @@ nix_sec_attach_frags(const struct cpt_parse_hdr_s *hdr,
> mbuf->ol_flags = ol_flags;
> mbuf->next = NULL;
>
> + /* Mark frag as get */
> + RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1);
> +
> /* Update dynamic field with userdata */
> *rte_security_dynfield(mbuf) = (uint64_t)inb_priv->userdata;
>
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 12+ messages in thread