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 17CBAA00BE; Thu, 17 Feb 2022 14:45:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A17B440150; Thu, 17 Feb 2022 14:45:45 +0100 (CET) Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) by mails.dpdk.org (Postfix) with ESMTP id AF23240042; Thu, 17 Feb 2022 14:45:44 +0100 (CET) Received: by mail-io1-f49.google.com with SMTP id c18so1145438ioc.6; Thu, 17 Feb 2022 05:45:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=H5LoQeSW8qiO5a0yWmf4HxcF6cCbXDi458shnhDPHEI=; b=FSCpJu840wowSrsKr2iph43BI0a7ezJTecEjmLWZuSTLk17+OUy6FpCCchyCKZKU/C nzIDqNn/r3DnAHMjP/5f9VAQREaSucBs55NeXYzOVoZLeqdBh0O8HYs/jyC0qdaWNO3T k7rqBSZEdznxAZQx2Ee66uSXBlmLSOgXpKsGMeDr+KfluUIu42iSQsiDbQsRS75NzMfa FvuTNSmhMclkXBrSaFAJtK1fWBncHsdT+Db3INf/u07QVknpwhZFqjZCuhPhnuW+3wdW 7+jyogRCFjiTQWTKiQfJuUBNcRal4ZKW4I5afGPJm2+zNXpcHKzx0E0J6k0j6ed8q5ii 79eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=H5LoQeSW8qiO5a0yWmf4HxcF6cCbXDi458shnhDPHEI=; b=GV9vOYpZiEap565DN/2LX7j8gfM41x13BJMAep8DlWtGjVjLiwkjx9Dy3pPQHXqdQ2 hYlKtyUY9n5qvE26kqAdPDFLuuUpo4cqzyDo/j7nHqxE4iqkropR24GcGn/f2nn1xc4s MTa3qFXyr21WM0WvxTaLld76O0WWKlkCDT2z6uO+mhbz/lnEwhXPOjav6uRvLGFUlxS5 9lsLp2g9vf2mwW9kuFkzXzeYs1chSesyt26XeC+qdloeGsAOm2EWQGyH3lptw6Xlgj4u vI6jObARTiuy/sqJytuoXQ9yCgX/MeF1N+onjlCgZANUoZkn2Uz3le+K+HKiK+5+M1kA a8HQ== X-Gm-Message-State: AOAM531+mxaDSJoGYqWUJzYERqd3Lz+A1a1qrqzKcD5pjCzyc/97tXXH QSHwZafQFXq/mrv/UxzD8epX+cqglpy0IBob4dU= X-Google-Smtp-Source: ABdhPJwi38Owz8HFdYYOtJd04jT5JzhrdTVbdUnYyLp3lYMyE4oSVOuC2C85NQxbbe4vAIcQ2ksdUd4uZVQkKBXfeHA= X-Received: by 2002:a05:6638:2608:b0:313:f4b2:1106 with SMTP id m8-20020a056638260800b00313f4b21106mr1958799jat.79.1645105543574; Thu, 17 Feb 2022 05:45:43 -0800 (PST) MIME-Version: 1.0 References: <20220207072932.22409-1-ndabilpuram@marvell.com> <20220207072932.22409-15-ndabilpuram@marvell.com> In-Reply-To: <20220207072932.22409-15-ndabilpuram@marvell.com> From: Jerin Jacob Date: Thu, 17 Feb 2022 19:15:17 +0530 Message-ID: Subject: Re: [PATCH 15/20] net/cnxk: use raw mbuf free on inline sec err To: Nithin Dabilpuram Cc: Jerin Jacob , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , dpdk-dev , dpdk stable Content-Type: text/plain; charset="UTF-8" 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 Mon, Feb 7, 2022 at 1:01 PM Nithin Dabilpuram wrote: You could change the subject as net/cnxk: fix inline IPsec security error handling > > Use raw mbuf free on inline sec error to simulate sec- > security > HW NPA free instead of doing rte_pktmbuf_free(). This > is needed as the callback will not be called from > DPDK lcore. > > Fixes: 69daa9e5022b ("net/cnxk: support inline security setup for cn10k") > Cc: stable@dpdk.org > > Signed-off-by: Nithin Dabilpuram > --- > drivers/net/cnxk/cn10k_ethdev_sec.c | 37 ++++++++++++++++++++++++++++++++----- > 1 file changed, 32 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/cnxk/cn10k_ethdev_sec.c b/drivers/net/cnxk/cn10k_ethdev_sec.c > index ac45056..044b20c 100644 > --- a/drivers/net/cnxk/cn10k_ethdev_sec.c > +++ b/drivers/net/cnxk/cn10k_ethdev_sec.c > @@ -138,6 +138,20 @@ static const struct rte_security_capability cn10k_eth_sec_capabilities[] = { > } > }; > > +static inline void > +cnxk_pktmbuf_free_no_cache(struct rte_mbuf *mbuf) > +{ > + struct rte_mbuf *next; > + > + if (!mbuf) > + return; > + do { > + next = mbuf->next; > + roc_npa_aura_op_free(mbuf->pool->pool_id, 1, (rte_iova_t)mbuf); > + mbuf = next; > + } while (mbuf != NULL); > +} > + > void > cn10k_eth_sec_sso_work_cb(uint64_t *gw, void *args) > { > @@ -148,6 +162,7 @@ cn10k_eth_sec_sso_work_cb(uint64_t *gw, void *args) > struct cpt_cn10k_res_s *res; > struct rte_eth_dev *eth_dev; > struct cnxk_eth_dev *dev; > + static uint64_t warn_cnt; > uint16_t dlen_adj, rlen; > struct rte_mbuf *mbuf; > uintptr_t sa_base; > @@ -161,7 +176,7 @@ cn10k_eth_sec_sso_work_cb(uint64_t *gw, void *args) > /* Event from inbound inline dev due to IPSEC packet bad L4 */ > mbuf = (struct rte_mbuf *)(gw[1] - sizeof(struct rte_mbuf)); > plt_nix_dbg("Received mbuf %p from inline dev inbound", mbuf); > - rte_pktmbuf_free(mbuf); > + cnxk_pktmbuf_free_no_cache(mbuf); > return; > case RTE_EVENT_TYPE_CPU: > /* Check for subtype */ > @@ -212,17 +227,29 @@ cn10k_eth_sec_sso_work_cb(uint64_t *gw, void *args) > case ROC_IE_OT_UCC_ERR_SA_OVERFLOW: > desc.subtype = RTE_ETH_EVENT_IPSEC_ESN_OVERFLOW; > break; > + case ROC_IE_OT_UCC_ERR_PKT_IP: > + warn_cnt++; > + if (warn_cnt % 10000 == 0) > + plt_warn("Outbound error, bad ip pkt, mbuf %p," > + " sa_index %u (total warnings %" PRIu64 ")", > + mbuf, sess_priv.sa_idx, warn_cnt); > + desc.subtype = RTE_ETH_EVENT_IPSEC_UNKNOWN; > + break; > default: > - plt_warn("Outbound error, mbuf %p, sa_index %u, " > - "compcode %x uc %x", mbuf, sess_priv.sa_idx, > - res->compcode, res->uc_compcode); > + warn_cnt++; > + if (warn_cnt % 10000 == 0) > + plt_warn("Outbound error, mbuf %p, sa_index %u," > + " compcode %x uc %x," > + " (total warnings %" PRIu64 ")", > + mbuf, sess_priv.sa_idx, res->compcode, > + res->uc_compcode, warn_cnt); > desc.subtype = RTE_ETH_EVENT_IPSEC_UNKNOWN; > break; > } > > desc.metadata = (uint64_t)priv->userdata; > rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_IPSEC, &desc); > - rte_pktmbuf_free(mbuf); > + cnxk_pktmbuf_free_no_cache(mbuf); > } > > static int > -- > 2.8.4 >