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 44C4645610 for ; Fri, 12 Jul 2024 12:53:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3EE12402E5; Fri, 12 Jul 2024 12:53:18 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2047.outbound.protection.outlook.com [40.107.237.47]) by mails.dpdk.org (Postfix) with ESMTP id 81722402E5 for ; Fri, 12 Jul 2024 12:53:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jikxDZ4GIce9uSo+6GffcqOgvy36eI6tj9/epvWq9ea2F8Uc0murWJiEMSMUg8N9zYxS0kqkJx8ouj2T+e+/MZOsi4z6zz5vyttSVmECj5BTYG7qvB7wib20VxSMI8YmPQla8BvVLJ2JZdV9JQJhKu2/lPEM2dwysOSrGVaM+KVbAhPiRVdjimwdEJ8dSMmGwsfdJabcC3BTMCLcYzWqsJTS1ESd5Dq+s4m5RMBkYzJHQNbtVwt6Jh21vHWeexKnXTY6i0TyQswThcXw4mgZ/HVAI5CSiIsfh1TW3bG5/PxNjs6hwkocOYXMoY1ygviaydnAlfs8Pxhofrz25/ftGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wynjDERzi0K6miFlS418B4TDIlW48ZT8+vy4Ux4wVR8=; b=p7mxwji4+bM35Xoaa5yqqx6oWqLuV74eO2UwuVuLxJXrvriHqfYePN6vydx5x+n9UyAm69/S+txAKcvnJZ9hSl8dw4fBei+McARZTxnbVUWwLalHVSiiy6pGRNUZxpIClLUqXYIR5+QEyLQHnNlmzjEAWVgr7+pqDFV5J+FQNqeCY8U5Tdbglkv2eARcsppY+fBADPwq/7ItfgcnTezKM7Es2LX2PwCEelvxkNhWQrfqdUB19nvayyz/lOyMRoGMFNhR1wIFGOztx3M9C2SKlkK77bIM1619KCdhAc1ztbIPvtHoqDPmGpOc95CHTLwv5zWW4VNgXpRLUGkTnHvOEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=marvell.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wynjDERzi0K6miFlS418B4TDIlW48ZT8+vy4Ux4wVR8=; b=BNrJSmTMLMXpNPlzTb/STfFnAs4o3i7IwN6gf4xjmT6E7movA324H7EHtq88PmXvWvVNO5Bm4lNaIO4eSP2FRvyHh6ScovKxcIfuDNiIlhjD5FN8ZDR91G6lCOEgH1wUFQYLZHgrGKEmwCyH0T4sjN2f5o7hK6pWeR+LvlD9jdWhaFN0HQy3l/DGbVyGsUoS1r1rTEqJ+3YoRBbLZm3Weijh66ch9GHTpG+GOMm2PZfxfmbZ3nJRkQohYwleLFRJtfUItkvK5NeFHM1A4ZjCP8fk/nSQ5j44uQjpkWAZUd1IrMfJhcrpPy9sg9LWw8k8g22zfzm9VOaqkPaVGdNgLw== Received: from BN9PR03CA0552.namprd03.prod.outlook.com (2603:10b6:408:138::17) by SA0PR12MB7004.namprd12.prod.outlook.com (2603:10b6:806:2c0::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.23; Fri, 12 Jul 2024 10:53:13 +0000 Received: from BN2PEPF000055DB.namprd21.prod.outlook.com (2603:10b6:408:138:cafe::c3) by BN9PR03CA0552.outlook.office365.com (2603:10b6:408:138::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.23 via Frontend Transport; Fri, 12 Jul 2024 10:53:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BN2PEPF000055DB.mail.protection.outlook.com (10.167.245.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.5 via Frontend Transport; Fri, 12 Jul 2024 10:53:13 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Fri, 12 Jul 2024 03:52:59 -0700 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Fri, 12 Jul 2024 03:52:57 -0700 From: Xueming Li To: Nithin Dabilpuram CC: dpdk stable Subject: patch 'net/cnxk: update SA userdata and keep original cookie' has been queued to stable release 23.11.2 Date: Fri, 12 Jul 2024 18:44:59 +0800 Message-ID: <20240712104528.308638-74-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240712104528.308638-1-xuemingl@nvidia.com> References: <20240712104528.308638-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000055DB:EE_|SA0PR12MB7004:EE_ X-MS-Office365-Filtering-Correlation-Id: 11e6a601-9bbb-4eb7-0b46-08dca260d421 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?ab67uuwI7Jgnx//lr4bsWgPDRes/0PYsPjFtNVBqXMucUgN0MIOt8HtE/grJ?= =?us-ascii?Q?WP9wgo53EM6HQKq20WWAy2K6WPYzlPUkvf21FAwHrz8OLVoQoL+tuehB1mMk?= =?us-ascii?Q?uwiwqF/1m387zeI3a+aNE4UJtIp8ssG2AXF1Gm0EE/WWWHUK0OUrx1eEV/7b?= =?us-ascii?Q?TJ2F50fouF31iNF4HmX5DSRMXNReXdfHa8KzXSUSZH/+TIGSDIRN1hNd/yjm?= =?us-ascii?Q?2AaEPqbyO45kkOqGZSIBsnoH0b417/LhzXbTBTfp5yVMpdWBwIejgEODBI5K?= =?us-ascii?Q?Ez2sbQeEKJkxnpELAPToj8LdpUskVMW3/sjjEK2syB8in9Nf8hltP2tmrzf6?= =?us-ascii?Q?Al+PW/AaKUwZLQEg/94ZpgcecaFeVwypSQBYGq5IXvl0yiSiALFI2kqFmiSd?= =?us-ascii?Q?0KHQs7ETELxVzXOZKSaOCSBeiMO/mv03KV+9K1MiaXD16jpjzb4pUtWTdHbz?= =?us-ascii?Q?j/pEtK4jd+YFZS9EcGnL58wqhDK82IyIsmkEBsHA0EQ7z7o43z9ZX9xkDb5a?= =?us-ascii?Q?uIE5KH5uzr+0V59vslQtfxZUwoEicc7JIscHHasS4JLvSMYj20aP6w5yCMd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Ox?= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2024 10:53:13.7232 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 11e6a601-9bbb-4eb7-0b46-08dca260d421 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000055DB.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB7004 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 23.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/14/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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=49dc3e454e807a9f05c1d7470e6d76a493fc6a0c Thanks. Xueming Li --- >From 49dc3e454e807a9f05c1d7470e6d76a493fc6a0c Mon Sep 17 00:00:00 2001 From: Nithin Dabilpuram Date: Tue, 28 May 2024 12:35:17 +0530 Subject: [PATCH] net/cnxk: update SA userdata and keep original cookie Cc: Xueming Li [ upstream commit 590ee5cd95b7161b36608fcfb8c76574f6cd1459 ] Update SA userdata as part of session_update() and keep the original cookie that is used to identify SA. Fixes: 8efa348e8160 ("net/cnxk: support custom SA index") Signed-off-by: Nithin Dabilpuram --- drivers/net/cnxk/cn10k_ethdev_sec.c | 57 ++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/drivers/net/cnxk/cn10k_ethdev_sec.c b/drivers/net/cnxk/cn10k_ethdev_sec.c index 575d0fabd5..4719f6b863 100644 --- a/drivers/net/cnxk/cn10k_ethdev_sec.c +++ b/drivers/net/cnxk/cn10k_ethdev_sec.c @@ -1087,8 +1087,8 @@ cn10k_eth_sec_session_update(void *device, struct rte_security_session *sess, { struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)device; struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev); - struct roc_ot_ipsec_inb_sa *inb_sa_dptr; struct rte_security_ipsec_xform *ipsec; + struct cn10k_sec_sess_priv sess_priv; struct rte_crypto_sym_xform *crypto; struct cnxk_eth_sec_sess *eth_sec; bool inbound; @@ -1109,6 +1109,11 @@ cn10k_eth_sec_session_update(void *device, struct rte_security_session *sess, eth_sec->spi = conf->ipsec.spi; if (inbound) { + struct roc_ot_ipsec_inb_sa *inb_sa_dptr, *inb_sa; + struct cn10k_inb_priv_data *inb_priv; + + inb_sa = eth_sec->sa; + inb_priv = roc_nix_inl_ot_ipsec_inb_sa_sw_rsvd(inb_sa); inb_sa_dptr = (struct roc_ot_ipsec_inb_sa *)dev->inb.sa_dptr; memset(inb_sa_dptr, 0, sizeof(struct roc_ot_ipsec_inb_sa)); @@ -1116,26 +1121,74 @@ cn10k_eth_sec_session_update(void *device, struct rte_security_session *sess, true); if (rc) return -EINVAL; + /* Use cookie for original data */ + inb_sa_dptr->w1.s.cookie = inb_sa->w1.s.cookie; + + if (ipsec->options.stats == 1) { + /* Enable mib counters */ + inb_sa_dptr->w0.s.count_mib_bytes = 1; + inb_sa_dptr->w0.s.count_mib_pkts = 1; + } + + /* Enable out-of-place processing */ + if (ipsec->options.ingress_oop) + inb_sa_dptr->w0.s.pkt_format = ROC_IE_OT_SA_PKT_FMT_FULL; rc = roc_nix_inl_ctx_write(&dev->nix, inb_sa_dptr, eth_sec->sa, eth_sec->inb, sizeof(struct roc_ot_ipsec_inb_sa)); if (rc) return -EINVAL; + + /* Save userdata in inb private area */ + inb_priv->userdata = conf->userdata; } else { - struct roc_ot_ipsec_outb_sa *outb_sa_dptr; + struct roc_ot_ipsec_outb_sa *outb_sa_dptr, *outb_sa; + struct cn10k_outb_priv_data *outb_priv; + struct cnxk_ipsec_outb_rlens *rlens; + outb_sa = eth_sec->sa; + outb_priv = roc_nix_inl_ot_ipsec_outb_sa_sw_rsvd(outb_sa); + rlens = &outb_priv->rlens; outb_sa_dptr = (struct roc_ot_ipsec_outb_sa *)dev->outb.sa_dptr; memset(outb_sa_dptr, 0, sizeof(struct roc_ot_ipsec_outb_sa)); rc = cnxk_ot_ipsec_outb_sa_fill(outb_sa_dptr, ipsec, crypto); if (rc) return -EINVAL; + + /* Save rlen info */ + cnxk_ipsec_outb_rlens_get(rlens, ipsec, crypto); + + if (ipsec->options.stats == 1) { + /* Enable mib counters */ + outb_sa_dptr->w0.s.count_mib_bytes = 1; + outb_sa_dptr->w0.s.count_mib_pkts = 1; + } + + sess_priv.u64 = 0; + sess_priv.sa_idx = outb_priv->sa_idx; + sess_priv.roundup_byte = rlens->roundup_byte; + sess_priv.roundup_len = rlens->roundup_len; + sess_priv.partial_len = rlens->partial_len; + sess_priv.mode = outb_sa_dptr->w2.s.ipsec_mode; + sess_priv.outer_ip_ver = outb_sa_dptr->w2.s.outer_ip_ver; + /* Propagate inner checksum enable from SA to fast path */ + sess_priv.chksum = + (!ipsec->options.ip_csum_enable << 1 | !ipsec->options.l4_csum_enable); + sess_priv.dec_ttl = ipsec->options.dec_ttl; + if (roc_feature_nix_has_inl_ipsec_mseg() && dev->outb.cpt_eng_caps & BIT_ULL(35)) + sess_priv.nixtx_off = 1; + rc = roc_nix_inl_ctx_write(&dev->nix, outb_sa_dptr, eth_sec->sa, eth_sec->inb, sizeof(struct roc_ot_ipsec_outb_sa)); if (rc) return -EINVAL; + + /* Save userdata */ + outb_priv->userdata = conf->userdata; + sess->fast_mdata = sess_priv.u64; } return 0; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-07-12 18:40:17.458461024 +0800 +++ 0073-net-cnxk-update-SA-userdata-and-keep-original-cookie.patch 2024-07-12 18:40:14.196594216 +0800 @@ -1 +1 @@ -From 590ee5cd95b7161b36608fcfb8c76574f6cd1459 Mon Sep 17 00:00:00 2001 +From 49dc3e454e807a9f05c1d7470e6d76a493fc6a0c Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 590ee5cd95b7161b36608fcfb8c76574f6cd1459 ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org @@ -19 +21 @@ -index af27d3bbc1..eed4c29218 100644 +index 575d0fabd5..4719f6b863 100644 @@ -22 +24 @@ -@@ -1101,8 +1101,8 @@ cn10k_eth_sec_session_update(void *device, struct rte_security_session *sess, +@@ -1087,8 +1087,8 @@ cn10k_eth_sec_session_update(void *device, struct rte_security_session *sess, @@ -32 +34 @@ -@@ -1123,6 +1123,11 @@ cn10k_eth_sec_session_update(void *device, struct rte_security_session *sess, +@@ -1109,6 +1109,11 @@ cn10k_eth_sec_session_update(void *device, struct rte_security_session *sess, @@ -44 +46 @@ -@@ -1130,26 +1135,74 @@ cn10k_eth_sec_session_update(void *device, struct rte_security_session *sess, +@@ -1116,26 +1121,74 @@ cn10k_eth_sec_session_update(void *device, struct rte_security_session *sess,