From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 33B614554D; Tue, 2 Jul 2024 15:58:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 21300402D8; Tue, 2 Jul 2024 15:58:13 +0200 (CEST) Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) by mails.dpdk.org (Postfix) with ESMTP id 0551B402D2 for ; Tue, 2 Jul 2024 15:58:12 +0200 (CEST) Received: by mail-qt1-f178.google.com with SMTP id d75a77b69052e-446449e5df5so20538181cf.0 for ; Tue, 02 Jul 2024 06:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719928691; x=1720533491; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DFhCND+/qVv0DV67AcDC8Yv1OjoiwxcRwMH5tgFIyUo=; b=XFlF6Hyo88mywqVKkujETgn5ZCcW9v5ZScWWPa+CdP5toHe2Z/LXQoqWLWEaku6x3a ZqnisorROY+JCFp7fHHqCKoZaUZ17E3oDipN5Fb+0wihuUiKys0vU6iNsrtMPoec+WIp yj4eWh6sX80RKcb3Md0BawVUTycRyFsTXaN78gniGvkDK6IdtFxhzsKp8EJQAzcsC5p7 ruizgyX0ADBIs1tIfuvZ8kvwvtPPdF8aJ0bxsJ7QrCHut9hqBmObKwIWZC/Bg7x9i8wt AVgT3DUm2EigxU+PjnH4W3qqVt9u1nGqOJlsUC63J7Qtv8c04S5xm4MrTt5MRgwBi0KV njFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719928691; x=1720533491; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DFhCND+/qVv0DV67AcDC8Yv1OjoiwxcRwMH5tgFIyUo=; b=qfInT0TGbxVG5PbDeWmPQ2sNAdxdhkQX8rjQD+Imf4YEf/5p6ewLZnMaBMxYk2UraN Qhh77mlNH3cXSgpKEMIF46Fz+UrX/scHx8RJaUYeT6gbYYMftzkQmY4FjuC7hgfxRGuU 3YL3XgXVbIT0n9eD1j69yezypQ6Hvmi7tAcLo2l3mJujiuRtq77N4rvnDWzgP3JPPPUy LJdQjJCttlusZ4Yh8ztHpcr2bw0Gj6GQKXdCXSJdxR2U0eEBnN9INTUv1ebS9sovqvUs O8GlYRfyw0yvuhhW4qiCHmiKxL/29ZaEQRoqoHizzJQ3cTYOal16IAJS1F7Dt+a4Curv 6Xhg== X-Gm-Message-State: AOJu0Yx8gnC6aYNESyfDUhjlU6nsu02p51uzuEgLfFNhIbLSaSN/Bnso IazhIvypV1B8h9bTNXwm5rm24EMYkil2LN215cICg9Ps6E93JpNFETHYy6Wlrs+qyTNgfJfIJ10 6wtfNzu5At8psxVcF6oXlmf8QMfzzxxMlJbM= X-Google-Smtp-Source: AGHT+IF3/n3vqbgScQmVlaW0bqu7y8E4qzbdH+Qvjt7lS5J3NAmm4paYQqxmr6902u7HWeWeohnZNnB/rZgM1kq3xh0= X-Received: by 2002:a05:622a:146:b0:444:ef14:e427 with SMTP id d75a77b69052e-44662e414b0mr88476721cf.52.1719928691312; Tue, 02 Jul 2024 06:58:11 -0700 (PDT) MIME-Version: 1.0 References: <20240627090859.2860207-1-rbhansali@marvell.com> <20240627090859.2860207-2-rbhansali@marvell.com> In-Reply-To: <20240627090859.2860207-2-rbhansali@marvell.com> From: Jerin Jacob Date: Tue, 2 Jul 2024 19:27:45 +0530 Message-ID: Subject: Re: [PATCH 2/2] net/cnxk: avoid NPC Rx and MCAM entries disable To: Rahul Bhansali Cc: dev@dpdk.org, Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Harman Kalra , jerinj@marvell.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, Jun 27, 2024 at 2:47=E2=80=AFPM Rahul Bhansali 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 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_ethde= v.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 =3D 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 so= me 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 =3D 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, b= ool reset) > /* Clear the flag since we are closing down */ > dev->configured =3D 0; > > + /* Disable all the NPC entries */ > + rc =3D 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 >