From: Jerin Jacob <jerinjacobk@gmail.com>
To: Rahul Bhansali <rbhansali@marvell.com>
Cc: dev@dpdk.org, Nithin Dabilpuram <ndabilpuram@marvell.com>,
Kiran Kumar K <kirankumark@marvell.com>,
Sunil Kumar Kori <skori@marvell.com>,
Satha Rao <skoteshwar@marvell.com>,
Harman Kalra <hkalra@marvell.com>,
jerinj@marvell.com
Subject: Re: [PATCH 2/2] net/cnxk: avoid NPC Rx and MCAM entries disable
Date: Tue, 2 Jul 2024 19:27:45 +0530 [thread overview]
Message-ID: <CALBAE1M4RrcfOHCnBSO1zcM+xoJW7g6uK=nJ_1ZWLEP6GUa1qw@mail.gmail.com> (raw)
In-Reply-To: <20240627090859.2860207-2-rbhansali@marvell.com>
On Thu, Jun 27, 2024 at 2:47 PM Rahul Bhansali <rbhansali@marvell.com> wrote:
>
> For inline IPsec, Rx misses are observed during dev stop process.
> There can be a situation of 2nd pass packets are being dropped and
> can cause a buffer leak.
> To handle such case, will avoid NPC Rx and MCAM entries disable in
> dev stop. These will be handled in dev close routine.
>
> Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Since it is a fix, Please send the next version with Fixes: tag and
update git commit to make as fix.
> ---
> drivers/net/cnxk/cnxk_ethdev.c | 27 ++++++++++++++++++++-------
> 1 file changed, 20 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c
> index db8feca620..38746c81c5 100644
> --- a/drivers/net/cnxk/cnxk_ethdev.c
> +++ b/drivers/net/cnxk/cnxk_ethdev.c
> @@ -1625,18 +1625,26 @@ cnxk_nix_dev_stop(struct rte_eth_dev *eth_dev)
> int count, i, j, rc;
> void *rxq;
>
> - /* Disable all the NPC entries */
> - rc = roc_npc_mcam_enable_all_entries(&dev->npc, 0);
> - if (rc)
> - return rc;
> + /* In case of Inline IPSec, will need to avoid disabling the MCAM rules and NPC Rx
> + * in this routine to continue processing of second pass inflight packets if any.
> + * Drop of second pass packets will leak first pass buffers on some platforms
> + * due to hardware limitations.
> + */
> + if (roc_feature_nix_has_second_pass_drop() ||
> + !(dev->rx_offloads & RTE_ETH_RX_OFFLOAD_SECURITY)) {
> + /* Disable all the NPC entries */
> + rc = roc_npc_mcam_enable_all_entries(&dev->npc, 0);
> + if (rc)
> + return rc;
> +
> + /* Disable Rx via NPC */
> + roc_nix_npc_rx_ena_dis(&dev->nix, false);
> + }
>
> /* Stop link change events */
> if (!roc_nix_is_vf_or_sdp(&dev->nix))
> roc_nix_mac_link_event_start_stop(&dev->nix, false);
>
> - /* Disable Rx via NPC */
> - roc_nix_npc_rx_ena_dis(&dev->nix, false);
> -
> roc_nix_inl_outb_soft_exp_poll_switch(&dev->nix, false);
>
> /* Stop inline device RQ first */
> @@ -2047,6 +2055,11 @@ cnxk_eth_dev_uninit(struct rte_eth_dev *eth_dev, bool reset)
> /* Clear the flag since we are closing down */
> dev->configured = 0;
>
> + /* Disable all the NPC entries */
> + rc = roc_npc_mcam_enable_all_entries(&dev->npc, 0);
> + if (rc)
> + return rc;
> +
> roc_nix_npc_rx_ena_dis(nix, false);
>
> /* Restore 802.3 Flow control configuration */
> --
> 2.25.1
>
next prev parent reply other threads:[~2024-07-02 13:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-27 9:08 [PATCH 1/2] common/cnxk: enable second pass RQ in mask config Rahul Bhansali
2024-06-27 9:08 ` [PATCH 2/2] net/cnxk: avoid NPC Rx and MCAM entries disable Rahul Bhansali
2024-07-02 13:57 ` Jerin Jacob [this message]
2024-07-02 14:40 ` [PATCH v2 1/2] common/cnxk: enable second pass RQ in mask config Rahul Bhansali
2024-07-02 14:40 ` [PATCH v2 2/2] net/cnxk: fix to avoid NPC Rx and MCAM disable Rahul Bhansali
2024-07-03 7:49 ` Jerin Jacob
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALBAE1M4RrcfOHCnBSO1zcM+xoJW7g6uK=nJ_1ZWLEP6GUa1qw@mail.gmail.com' \
--to=jerinjacobk@gmail.com \
--cc=dev@dpdk.org \
--cc=hkalra@marvell.com \
--cc=jerinj@marvell.com \
--cc=kirankumark@marvell.com \
--cc=ndabilpuram@marvell.com \
--cc=rbhansali@marvell.com \
--cc=skori@marvell.com \
--cc=skoteshwar@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).