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 949A3428F8 for ; Sun, 9 Apr 2023 17:29:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F1B2427F2; Sun, 9 Apr 2023 17:29:50 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by mails.dpdk.org (Postfix) with ESMTP id 8754940141 for ; Sun, 9 Apr 2023 17:29:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LfsESJAej46ZHKi66iSfjURK94Vhehw5TIse5KuFyM6PiYCtE53NFjr6FQu1W212WYl0Z4L2hTCj312tYFf0xWHSWwwtn64aW/SR/ltYYIsjuqzPUEfxybNfoSWUv6goKjFgGQOev/awlpWXjQCNVVmew4F0NJrlk4ywAy9+P3cHXdFH+KAtkXAPguAklJJGlDof16kvQhqI6GjvP/L4bpr6FuKDfQ768bygOIZzPoGItTBr1A94ar3Pvlrr+3oLGD1XRnKFtp4jdiz5SQtoU5CpNiLLMcEQijWBwPaaW99SNhMsKwfh5btZ00yppIa7/uccVKE8osbMnIdiUx2yYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=uaPePppaaHuiC0DpTbK3rYilXBODzIHdlsUDN+dcc2c=; b=EQ8BfS/Ya6jEeB3X6cbJLXJFD5+/rrO+85CQahZcGyMOfJhRH8WcRMnwiiO/IDDB8zljXPzXVsLSB+O32rfwhrd4syEtSCuBEogZffYrYa0uZ7sHABtPsH8ylRnRFkxOkJng5hcpQ4qa1x/P+O3xSjKUtDIcQXkEvREULEDEYecHQ4DW44uLToFfj9KsUcjNI9kYtCGmD2spZJxTZfcAiYskvi55B733TISrzi8ahQjRXcEYbXvprFv4uRbW2nK3enzdZOm4zM9U0ItayIEaLCQm/BV1hLmP92jLgpDuqjZTCAVA6TN++2qeZoaykGVzLYp1KBx2wyiz7T8dwmJGng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=corigine.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 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=uaPePppaaHuiC0DpTbK3rYilXBODzIHdlsUDN+dcc2c=; b=b094NdIyok+kroAkwgwwBhM8ln/9ww/LGLkgcyIDsL9irPuiWuGTq96uFobIRmoGH2zVt+a72KcD7BX6SgCDjGt0JFHLzDc/s1j4GT4KlmIWkRorFADJd/FqpkpKWBWE3x9ZWxL3s4GFpcWOMqlUshal13zyVVShkXC222IBcfov1c3Zgwetw4o36vCRTmJXJKZ53a2lx/qlKhMMzjX/IqMGVhvVtcYYV5em8QJsA3sxnGocfuleF4QSj9E3pN1IRQZQUK30ol0UId6KecmKARItcOTtnJPcCdSiMAL6q02hvC/1Btmqlz3yR7qnpxCUjSqtdaSxvp4HpLyCjFP0vw== Received: from BN9PR03CA0708.namprd03.prod.outlook.com (2603:10b6:408:ef::23) by CH2PR12MB4279.namprd12.prod.outlook.com (2603:10b6:610:af::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.33; Sun, 9 Apr 2023 15:29:46 +0000 Received: from BN8NAM11FT065.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ef:cafe::17) by BN9PR03CA0708.outlook.office365.com (2603:10b6:408:ef::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38 via Frontend Transport; Sun, 9 Apr 2023 15:29:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN8NAM11FT065.mail.protection.outlook.com (10.13.177.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.25 via Frontend Transport; Sun, 9 Apr 2023 15:29:45 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Sun, 9 Apr 2023 08:29:36 -0700 Received: from nvidia.com (10.126.231.37) 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.986.37; Sun, 9 Apr 2023 08:29:34 -0700 From: Xueming Li To: Chaoyong He CC: =?UTF-8?q?Niklas=20S=C3=B6derlund?= , "dpdk stable" Subject: patch 'net/nfp: fix offload of multiple output actions' has been queued to stable release 22.11.2 Date: Sun, 9 Apr 2023 23:23:53 +0800 Message-ID: <20230409152529.5308-46-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230409152529.5308-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230409152529.5308-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.126.231.37] 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: BN8NAM11FT065:EE_|CH2PR12MB4279:EE_ X-MS-Office365-Filtering-Correlation-Id: a1b8c6ec-8c46-4980-a4b4-08db390f3fda X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uGr32anxFBABcxa1AlCKphrOVFw4oN8B/rZ9bmgWZVgDhsPi8zKP1Hb5ClyDduHfSwszZXqz/ATS5aYTa1sDKii8QJi5LDQrUn+UQRvj4AC8K3j45j6FIxjlSQ4ABiDNtCN7NZpoXUhd3gF9P9ZaczxpVAqKz273DwRnM6e7ZFNWUdL07rw2UacYjjumthvzZx8khAzBmu0gSKMKaaf5mBggZ5Gm8/y7AZXBTzQUVt84xwlA2YaWD5DJAdm+Vgf7D3VJEwWz60/H46FmUyKFS364eDVFr2J/Xwn0LMZGqPaoWjQSQx5R6lon5K1Yc4Z+Al3NWivtHjpm8I7/wmjnzHtFZZycMfsn48iBWpc0PS3GOcePB+yn92nN5/tfMEjvJ4RvO4nE82ngYh8Ur521O90Y9F4TNHpHCvR8YZIPviIU7wfSh4vXDbrr+QsMgdlWbW4KrNsMzOsZfYO8i8jVPh2GMTajoiICuDqsLZJq5UUu7WxnAM0lE+b6WgGEcBEG1zW2nS/CXYjkVRH5KFFmqhc6GDue6XGeJExos5mKnlYuj9zATOPqvnW5mmOHKx5sXI3rsnUIzCENnhnyOnIQVkJt9n8IyABtdXEpA1SttQKW6JL1H2WMqjH7qoP5HqCrbPxSAaXkmyabSaBJwnYM0rm9z/PJsTgpNYN+tq3rb2XDrqSWsPO2QAtbshCWEnSNssL4JP97ZsYHdBs4Tzi2cWc0/18cU6Ay6RPg50v/KWZWkgY/L3Qot8bqI7A5Cpoqu7vZ8tR3XyTdC+OIQ/Cb3ijUC6Hxy9q5RjBNwfaicw2f6EWcScKzZZVlrlxVdv8ik6+OvGzVy08elSSNxFMa1g== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(396003)(376002)(346002)(136003)(451199021)(40470700004)(36840700001)(46966006)(54906003)(8676002)(70586007)(6916009)(316002)(70206006)(4326008)(966005)(41300700001)(82310400005)(8936002)(7696005)(5660300002)(66574015)(47076005)(1076003)(26005)(2906002)(83380400001)(186003)(53546011)(6666004)(426003)(478600001)(336012)(2616005)(36860700001)(356005)(7636003)(82740400003)(86362001)(36756003)(40460700003)(16526019)(55016003)(6286002)(40480700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2023 15:29:45.9612 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a1b8c6ec-8c46-4980-a4b4-08db390f3fda 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT065.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4279 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.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 04/11/23. 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=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/17637f9c0f2ae5434e363b9ae79d1338b0ec48c9 Thanks. Xueming Li --- >From 17637f9c0f2ae5434e363b9ae79d1338b0ec48c9 Mon Sep 17 00:00:00 2001 From: Chaoyong He Date: Tue, 28 Feb 2023 17:03:05 +0800 Subject: [PATCH] net/nfp: fix offload of multiple output actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Xueming Li [ upstream commit 6a49f38c30eccc2e9040e7c5d78e4cbadbe04937 ] When offload the flow with multiple output actions, the original logic add a flag to every output action wrongly, and this cause only the first output action can take effect. Fix it by only add the flag to the last output action. Fixes: 4d946034bf9c ("net/nfp: support basic flow actions") Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- drivers/net/nfp/nfp_flow.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index 49305a4152..50b166786a 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -2022,7 +2022,8 @@ nfp_flow_compile_items(struct nfp_flower_representor *representor, static int nfp_flow_action_output(char *act_data, const struct rte_flow_action *action, - struct nfp_fl_rule_metadata *nfp_flow_meta) + struct nfp_fl_rule_metadata *nfp_flow_meta, + uint32_t output_cnt) { size_t act_size; struct rte_eth_dev *ethdev; @@ -2041,8 +2042,9 @@ nfp_flow_action_output(char *act_data, output = (struct nfp_fl_act_output *)act_data; output->head.jump_id = NFP_FL_ACTION_OPCODE_OUTPUT; output->head.len_lw = act_size >> NFP_FL_LW_SIZ; - output->flags = rte_cpu_to_be_16(NFP_FL_OUT_FLAGS_LAST); output->port = rte_cpu_to_be_32(representor->port_id); + if (output_cnt == 0) + output->flags = rte_cpu_to_be_16(NFP_FL_OUT_FLAGS_LAST); nfp_flow_meta->shortcut = rte_cpu_to_be_32(representor->port_id); @@ -3254,12 +3256,27 @@ nfp_flow_action_raw_encap(struct nfp_app_fw_flower *app_fw_flower, return ret; } +static uint32_t +nfp_flow_count_output(const struct rte_flow_action actions[]) +{ + uint32_t count = 0; + const struct rte_flow_action *action; + + for (action = actions; action->type != RTE_FLOW_ACTION_TYPE_END; ++action) { + if (action->type == RTE_FLOW_ACTION_TYPE_PORT_ID) + count++; + } + + return count; +} + static int nfp_flow_compile_action(struct nfp_flower_representor *representor, const struct rte_flow_action actions[], struct rte_flow *nfp_flow) { int ret = 0; + uint32_t count; char *position; char *action_data; bool ttl_tos_flag = false; @@ -3278,6 +3295,8 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor, position = action_data; meta_tci = (struct nfp_flower_meta_tci *)nfp_flow->payload.unmasked_data; + count = nfp_flow_count_output(actions); + for (action = actions; action->type != RTE_FLOW_ACTION_TYPE_END; ++action) { switch (action->type) { case RTE_FLOW_ACTION_TYPE_VOID: @@ -3294,7 +3313,8 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor, break; case RTE_FLOW_ACTION_TYPE_PORT_ID: PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_PORT_ID"); - ret = nfp_flow_action_output(position, action, nfp_flow_meta); + count--; + ret = nfp_flow_action_output(position, action, nfp_flow_meta, count); if (ret != 0) { PMD_DRV_LOG(ERR, "Failed when process" " RTE_FLOW_ACTION_TYPE_PORT_ID"); -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-04-09 21:45:39.939259000 +0800 +++ 0045-net-nfp-fix-offload-of-multiple-output-actions.patch 2023-04-09 21:45:38.639042200 +0800 @@ -1 +1 @@ -From 6a49f38c30eccc2e9040e7c5d78e4cbadbe04937 Mon Sep 17 00:00:00 2001 +From 17637f9c0f2ae5434e363b9ae79d1338b0ec48c9 Mon Sep 17 00:00:00 2001 @@ -7,0 +8,3 @@ +Cc: Xueming Li + +[ upstream commit 6a49f38c30eccc2e9040e7c5d78e4cbadbe04937 ] @@ -15 +17,0 @@ -Cc: stable@dpdk.org @@ -24 +26 @@ -index 53029d00c9..41b722f4d8 100644 +index 49305a4152..50b166786a 100644 @@ -27 +29 @@ -@@ -2033,7 +2033,8 @@ nfp_flow_compile_items(struct nfp_flower_representor *representor, +@@ -2022,7 +2022,8 @@ nfp_flow_compile_items(struct nfp_flower_representor *representor, @@ -37 +39 @@ -@@ -2052,8 +2053,9 @@ nfp_flow_action_output(char *act_data, +@@ -2041,8 +2042,9 @@ nfp_flow_action_output(char *act_data, @@ -48,2 +50,2 @@ -@@ -3307,12 +3309,27 @@ nfp_flow_action_meter(struct nfp_flower_representor *representor, - return 0; +@@ -3254,12 +3256,27 @@ nfp_flow_action_raw_encap(struct nfp_app_fw_flower *app_fw_flower, + return ret; @@ -76 +78 @@ -@@ -3331,6 +3348,8 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor, +@@ -3278,6 +3295,8 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor, @@ -85 +87 @@ -@@ -3347,7 +3366,8 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor, +@@ -3294,7 +3313,8 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor,