patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] common/cnxk: fix channel number setting in MCAM entries
@ 2022-05-02  8:47 psatheesh
  2022-06-13  7:26 ` Jerin Jacob
  0 siblings, 1 reply; 2+ messages in thread
From: psatheesh @ 2022-05-02  8:47 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: dev, Satheesh Paul, stable

From: Satheesh Paul <psatheesh@marvell.com>

Adding changes to accommodate the following requirements
while masking the channel number.
1. For CN10K device, channel number should not be masked
   for first pass rules with RTE_FLOW_ACTION_TYPE_SECURITY
   action. And channel number should be masked for all
   other flow rules.
2. For CN9K device channel number should not be masked.

Fixes: 29dcc20985 ("common/cnxk: support for CPT second pass flow rules")
Cc: stable@dpdk.org

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar Kokkilagadda <kirankumark@marvell.com>
---
 drivers/common/cnxk/roc_npc_mcam.c | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/drivers/common/cnxk/roc_npc_mcam.c b/drivers/common/cnxk/roc_npc_mcam.c
index bccbaaa51f..0ae58da0ba 100644
--- a/drivers/common/cnxk/roc_npc_mcam.c
+++ b/drivers/common/cnxk/roc_npc_mcam.c
@@ -508,19 +508,25 @@ npc_mcam_set_channel(struct roc_npc_flow *flow,
 	req->entry_data.kw_mask[0] &= ~(GENMASK(11, 0));
 	flow->mcam_data[0] &= ~(GENMASK(11, 0));
 	flow->mcam_mask[0] &= ~(GENMASK(11, 0));
+	chan = channel;
+	mask = chan_mask;
 
-	if (is_second_pass) {
-		chan = (channel | NIX_CHAN_CPT_CH_START);
-		mask = (chan_mask | NIX_CHAN_CPT_CH_START);
-	} else {
-		/*
-		 * Clear bits 10 & 11 corresponding to CPT
-		 * channel. By default, rules should match
-		 * both first pass packets and second pass
-		 * packets from CPT.
-		 */
-		chan = (channel & NIX_CHAN_CPT_X2P_MASK);
-		mask = (chan_mask & NIX_CHAN_CPT_X2P_MASK);
+	if (roc_model_runtime_is_cn10k()) {
+		if (is_second_pass) {
+			chan = (channel | NIX_CHAN_CPT_CH_START);
+			mask = (chan_mask | NIX_CHAN_CPT_CH_START);
+		} else {
+			if (!(flow->npc_action & NIX_RX_ACTIONOP_UCAST_IPSEC)) {
+				/*
+				 * Clear bits 10 & 11 corresponding to CPT
+				 * channel. By default, rules should match
+				 * both first pass packets and second pass
+				 * packets from CPT.
+				 */
+				chan = (channel & NIX_CHAN_CPT_X2P_MASK);
+				mask = (chan_mask & NIX_CHAN_CPT_X2P_MASK);
+			}
+		}
 	}
 
 	req->entry_data.kw[0] |= (uint64_t)chan;
-- 
2.25.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] common/cnxk: fix channel number setting in MCAM entries
  2022-05-02  8:47 [dpdk-dev] [PATCH] common/cnxk: fix channel number setting in MCAM entries psatheesh
@ 2022-06-13  7:26 ` Jerin Jacob
  0 siblings, 0 replies; 2+ messages in thread
From: Jerin Jacob @ 2022-06-13  7:26 UTC (permalink / raw)
  To: Satheesh Paul
  Cc: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
	dpdk-dev, dpdk stable

On Mon, May 2, 2022 at 2:17 PM <psatheesh@marvell.com> wrote:
>
> From: Satheesh Paul <psatheesh@marvell.com>
>
> Adding changes to accommodate the following requirements
> while masking the channel number.
> 1. For CN10K device, channel number should not be masked
>    for first pass rules with RTE_FLOW_ACTION_TYPE_SECURITY
>    action. And channel number should be masked for all
>    other flow rules.
> 2. For CN9K device channel number should not be masked.
>
> Fixes: 29dcc20985 ("common/cnxk: support for CPT second pass flow rules")

Not correct. Updated as
Fixes: 4968b362b639 ("common/cnxk: support CPT second pass flow rules")

> Cc: stable@dpdk.org
>
> Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
> Reviewed-by: Kiran Kumar Kokkilagadda <kirankumark@marvell.com>

Updated as Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
Please check this in future patches,

Applied to dpdk-next-net-mrvl/for-next-net. Thanks



> ---
>  drivers/common/cnxk/roc_npc_mcam.c | 30 ++++++++++++++++++------------
>  1 file changed, 18 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/common/cnxk/roc_npc_mcam.c b/drivers/common/cnxk/roc_npc_mcam.c
> index bccbaaa51f..0ae58da0ba 100644
> --- a/drivers/common/cnxk/roc_npc_mcam.c
> +++ b/drivers/common/cnxk/roc_npc_mcam.c
> @@ -508,19 +508,25 @@ npc_mcam_set_channel(struct roc_npc_flow *flow,
>         req->entry_data.kw_mask[0] &= ~(GENMASK(11, 0));
>         flow->mcam_data[0] &= ~(GENMASK(11, 0));
>         flow->mcam_mask[0] &= ~(GENMASK(11, 0));
> +       chan = channel;
> +       mask = chan_mask;
>
> -       if (is_second_pass) {
> -               chan = (channel | NIX_CHAN_CPT_CH_START);
> -               mask = (chan_mask | NIX_CHAN_CPT_CH_START);
> -       } else {
> -               /*
> -                * Clear bits 10 & 11 corresponding to CPT
> -                * channel. By default, rules should match
> -                * both first pass packets and second pass
> -                * packets from CPT.
> -                */
> -               chan = (channel & NIX_CHAN_CPT_X2P_MASK);
> -               mask = (chan_mask & NIX_CHAN_CPT_X2P_MASK);
> +       if (roc_model_runtime_is_cn10k()) {
> +               if (is_second_pass) {
> +                       chan = (channel | NIX_CHAN_CPT_CH_START);
> +                       mask = (chan_mask | NIX_CHAN_CPT_CH_START);
> +               } else {
> +                       if (!(flow->npc_action & NIX_RX_ACTIONOP_UCAST_IPSEC)) {
> +                               /*
> +                                * Clear bits 10 & 11 corresponding to CPT
> +                                * channel. By default, rules should match
> +                                * both first pass packets and second pass
> +                                * packets from CPT.
> +                                */
> +                               chan = (channel & NIX_CHAN_CPT_X2P_MASK);
> +                               mask = (chan_mask & NIX_CHAN_CPT_X2P_MASK);
> +                       }
> +               }
>         }
>
>         req->entry_data.kw[0] |= (uint64_t)chan;
> --
> 2.25.4
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-13  7:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-02  8:47 [dpdk-dev] [PATCH] common/cnxk: fix channel number setting in MCAM entries psatheesh
2022-06-13  7:26 ` 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).