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 26E7E43CE7 for ; Mon, 18 Mar 2024 16:39:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1F985402B8; Mon, 18 Mar 2024 16:39:35 +0100 (CET) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mails.dpdk.org (Postfix) with ESMTP id 9053A4027F for ; Mon, 18 Mar 2024 16:39:32 +0100 (CET) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4141341f1a8so4927215e9.0 for ; Mon, 18 Mar 2024 08:39:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710776372; x=1711381172; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iaxN9ZDABT7RKlONksmNhkt89zgDOPDTM2aqjvcdjsE=; b=FaxsD3tzrcCVn0FnUZksa2itFgDvix8k073KpWePpmQHpEq+w9sxH2r1B+LoTRHLyo b8hpteuxFwGVzMfRJfymQBbBOuAGeo6h6cSAUen5RyaVPq7wWHs4b7L6ML7gbwahNrHp t0V0KzQRRuR1rv3wb9M1ln2tdwiI1SbvObIRui6aGHHysSVc68aUE1cPvUzk+NyY/d+j vnRDUxUhvwzk8toUjYS2hSCUO7ZwmfOehbtIbuyj6DmJycv2x0lli9G7DaN1Qi9DS370 2qcdoYLUeo7a82HphlRGi930/fU6js3psB3w/wUxZAbIJSqRQGe/eAP81JorCZomwszt j5cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710776372; x=1711381172; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iaxN9ZDABT7RKlONksmNhkt89zgDOPDTM2aqjvcdjsE=; b=W10FDge9rwtT/0c3P5Txemv+K9TwYT/BW2XRJgOV6iqoJ1DwPuEvviLMOW2iepkqe0 aaicgVNIdxuCK0K2bYgobD55ktVajz0Wsns81ie/K50jV/pxKobNYj3UjbdLOhWtTtRw zVBWu9k0TDzHSGuSn1MQ5xUo3NShp6irMRqcEn7Xh+33seajMD9sk1d3Ezf+GEfHumeY jIRUYdc8J2AzI9mcC6Dun8QTVi6+ajwk7nycMbdUfAXWmSpZq7mT4WfjE9vE4m7m3euu buLtx984C8TUkclqaqoRdG8NbYztkUFBLcLERNfK9qjOdfeM/SNjhS53s53qtDTOIpQg C0ww== X-Forwarded-Encrypted: i=1; AJvYcCU5XX1Z33IjAVV5dzmx6eMlTLZCYst7neRE472ELC62H6IUh4kGmzLcEq4P+9fsN/TNmrO6S2mJHUVriNjAKfY= X-Gm-Message-State: AOJu0Yzh7V4Ud4VYsGlgB/iyYwMFs5MrvbU8TV71gBFgDVr0eRTGVl0K KVZI/PmP17gdAzsMmVnmezoWDsN7RyOkanDgJL2ZzCL6e7C659dob7Qf3Zkq/0A= X-Google-Smtp-Source: AGHT+IEw3+jHVwMBt8WK85w/YnZdsxDqDIIAn7TIBf+gR48BIMFyPnYjTXLWM2qDvREj11/ZRFKsUA== X-Received: by 2002:a05:600c:2143:b0:414:10a1:3f7c with SMTP id v3-20020a05600c214300b0041410a13f7cmr2691811wml.11.1710776372164; Mon, 18 Mar 2024 08:39:32 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:7aef:1aaa:3dff:d546]) by smtp.gmail.com with ESMTPSA id v15-20020a05600c470f00b004128fa77216sm18552750wmo.1.2024.03.18.08.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 08:39:31 -0700 (PDT) From: luca.boccassi@gmail.com To: Radu Nicolau Cc: Ting-Kai Ku , Ciara Power , Kai Ji , Anoob Joseph , dpdk stable Subject: patch 'examples/ipsec-secgw: fix cryptodev to SA mapping' has been queued to stable release 22.11.5 Date: Mon, 18 Mar 2024 15:38:52 +0000 Message-Id: <20240318153919.3407921-2-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240318153919.3407921-1-luca.boccassi@gmail.com> References: <20240314000957.2810803-61-luca.boccassi@gmail.com> <20240318153919.3407921-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 22.11.5 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/20/24. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/642fff58620371a9ee6a4ff01a8613dea76f59a5 Thanks. Luca Boccassi --- >From 642fff58620371a9ee6a4ff01a8613dea76f59a5 Mon Sep 17 00:00:00 2001 From: Radu Nicolau Date: Tue, 27 Feb 2024 13:28:46 +0000 Subject: [PATCH] examples/ipsec-secgw: fix cryptodev to SA mapping [ upstream commit f406064ff0988a53f955c74a672d696c595dc0f0 ] There are use cases where a SA should be able to use different cryptodevs on different lcores, for example there can be cryptodevs with just 1 qp per VF. Hence, the check in create lookaside session function is relaxed. Also added a check to verify that a CQP is available for the current lcore. Fixes: a8ade12123c3 ("examples/ipsec-secgw: create lookaside sessions at init") Signed-off-by: Radu Nicolau Tested-by: Ting-Kai Ku Acked-by: Ciara Power Acked-by: Kai Ji Acked-by: Anoob Joseph --- .mailmap | 1 + examples/ipsec-secgw/ipsec.c | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.mailmap b/.mailmap index 23f3d1ddf9..2ad5489046 100644 --- a/.mailmap +++ b/.mailmap @@ -1374,6 +1374,7 @@ Timothy McDaniel Timothy Miskell Timothy Redaelli Tim Shearer +Ting-Kai Ku Ting Xu Tiwei Bie Todd Fujinaka diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c index 9b52d37b81..29cb3c4785 100644 --- a/examples/ipsec-secgw/ipsec.c +++ b/examples/ipsec-secgw/ipsec.c @@ -110,10 +110,21 @@ create_lookaside_session(struct ipsec_ctx *ipsec_ctx_lcore[], if (cdev_id == RTE_CRYPTO_MAX_DEVS) cdev_id = ipsec_ctx->tbl[cdev_id_qp].id; else if (cdev_id != ipsec_ctx->tbl[cdev_id_qp].id) { - RTE_LOG(ERR, IPSEC, - "SA mapping to multiple cryptodevs is " - "not supported!"); - return -EINVAL; + struct rte_cryptodev_info dev_info_1, dev_info_2; + rte_cryptodev_info_get(cdev_id, &dev_info_1); + rte_cryptodev_info_get(ipsec_ctx->tbl[cdev_id_qp].id, + &dev_info_2); + if (dev_info_1.driver_id == dev_info_2.driver_id) { + RTE_LOG(WARNING, IPSEC, + "SA mapped to multiple cryptodevs for SPI %d\n", + sa->spi); + + } else { + RTE_LOG(WARNING, IPSEC, + "SA mapped to multiple cryptodevs of different types for SPI %d\n", + sa->spi); + + } } /* Store per core queue pair information */ @@ -758,6 +769,7 @@ ipsec_enqueue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx, continue; } + RTE_ASSERT(sa->cqp[ipsec_ctx->lcore_id] != NULL); enqueue_cop(sa->cqp[ipsec_ctx->lcore_id], &priv->cop); } } -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-18 12:58:39.358023200 +0000 +++ 0002-examples-ipsec-secgw-fix-cryptodev-to-SA-mapping.patch 2024-03-18 12:58:39.087344007 +0000 @@ -1 +1 @@ -From f406064ff0988a53f955c74a672d696c595dc0f0 Mon Sep 17 00:00:00 2001 +From 642fff58620371a9ee6a4ff01a8613dea76f59a5 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit f406064ff0988a53f955c74a672d696c595dc0f0 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -26 +27 @@ -index 66ebc20666..50726e1232 100644 +index 23f3d1ddf9..2ad5489046 100644 @@ -29 +30 @@ -@@ -1442,6 +1442,7 @@ Timothy McDaniel +@@ -1374,6 +1374,7 @@ Timothy McDaniel @@ -38 +39 @@ -index f5cec4a928..c321108119 100644 +index 9b52d37b81..29cb3c4785 100644 @@ -41 +42 @@ -@@ -288,10 +288,21 @@ create_lookaside_session(struct ipsec_ctx *ipsec_ctx_lcore[], +@@ -110,10 +110,21 @@ create_lookaside_session(struct ipsec_ctx *ipsec_ctx_lcore[], @@ -67 +68 @@ -@@ -908,6 +919,7 @@ ipsec_enqueue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx, +@@ -758,6 +769,7 @@ ipsec_enqueue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx,