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 23637A034F for ; Tue, 1 Mar 2022 11:46:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1B585426DC; Tue, 1 Mar 2022 11:46:09 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 9A749426DC for ; Tue, 1 Mar 2022 11:46:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646131567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3bjCweNZqxUYrtFnarHRhIjYa1+hEPFSsg14fykdVJo=; b=P/mPhv2BE2x3kcyiOT1iamhlRwGbqmCUhYHr6PhNe6c3sjHuNb2QKlm3pbQwTiY9eMQrUw hWeEIGKhGAemnGU9Fpv9V9/9mUMZBucGR0Q9yfUZo1ffH9dIaWk9wo1SPofLLt/wMmueEF rvmkERvgExi7j1Y4RLFBUARVZtZg5Qk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-178-hQ9oLqcKNWK4GD408u13Qg-1; Tue, 01 Mar 2022 05:46:03 -0500 X-MC-Unique: hQ9oLqcKNWK4GD408u13Qg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 84C481091DA1; Tue, 1 Mar 2022 10:46:02 +0000 (UTC) Received: from rh.Home (unknown [10.39.194.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id 711F1721DF; Tue, 1 Mar 2022 10:46:01 +0000 (UTC) From: Kevin Traynor To: Nithin Dabilpuram Cc: Jerin Jacob , dpdk stable Subject: patch 'net/cnxk: fix inline IPsec security error handling' has been queued to stable release 21.11.1 Date: Tue, 1 Mar 2022 10:42:47 +0000 Message-Id: <20220301104300.334382-91-ktraynor@redhat.com> In-Reply-To: <20220301104300.334382-1-ktraynor@redhat.com> References: <20220301104300.334382-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 21.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/06/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/9e10cdbd2d28c66b036c3c4221ebba553817c5ac Thanks. Kevin --- >From 9e10cdbd2d28c66b036c3c4221ebba553817c5ac Mon Sep 17 00:00:00 2001 From: Nithin Dabilpuram Date: Wed, 23 Feb 2022 01:05:06 +0530 Subject: [PATCH] net/cnxk: fix inline IPsec security error handling [ upstream commit ea695031a73ce0e61b9055860eb967406ef8c004 ] Use raw mbuf free on inline security error to simulate 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") Signed-off-by: Nithin Dabilpuram Acked-by: Jerin Jacob --- 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 a517421b12..f84a0fe80c 100644 --- a/drivers/net/cnxk/cn10k_ethdev_sec.c +++ b/drivers/net/cnxk/cn10k_ethdev_sec.c @@ -139,4 +139,18 @@ 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) @@ -149,4 +163,5 @@ cn10k_eth_sec_sso_work_cb(uint64_t *gw, void *args) 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; @@ -162,5 +177,5 @@ cn10k_eth_sec_sso_work_cb(uint64_t *gw, void *args) 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: @@ -213,8 +228,20 @@ cn10k_eth_sec_sso_work_cb(uint64_t *gw, void *args) 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; @@ -223,5 +250,5 @@ cn10k_eth_sec_sso_work_cb(uint64_t *gw, void *args) 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); } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-03-01 10:41:03.908029567 +0000 +++ 0091-net-cnxk-fix-inline-IPsec-security-error-handling.patch 2022-03-01 10:41:01.459244130 +0000 @@ -1 +1 @@ -From ea695031a73ce0e61b9055860eb967406ef8c004 Mon Sep 17 00:00:00 2001 +From 9e10cdbd2d28c66b036c3c4221ebba553817c5ac Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit ea695031a73ce0e61b9055860eb967406ef8c004 ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index ac45056936..044b20c637 100644 +index a517421b12..f84a0fe80c 100644