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 2C88042D46 for ; Sun, 25 Jun 2023 08:44:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1D61340ED8; Sun, 25 Jun 2023 08:44:36 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2068.outbound.protection.outlook.com [40.107.244.68]) by mails.dpdk.org (Postfix) with ESMTP id C083240A7F for ; Sun, 25 Jun 2023 08:44:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nVG2mWyS8qRrSsA3nsTIQng90uxe0NpF84+Gf1WgB5d9T51YYX14pzeyrMqP/oDP+SFrYzFci3GzNtpBBELC+25+vHJ0qQfkFrckPZ5/P4mxgUmAmb8Zd+CPSlr5bskPr2DW1iwYcZdcgfkZvqIIWLJPu/CVx5q8VyuRUxpPwrXwKrxvmhs/g3DekSlhIoMO16gJTKobcUtlH281EaCfMvNt5HWJnjHl1nLQSdMG70KLIdtemOLYPDgsfYouTteCZl2ITnrBIcIwVckdRRCszb7OoNg4plzfN7scqSOw7gk3f7GZ65T/3IF5KGV2WAcxHCNEljImSo0tWKcRriF5Sg== 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=p4YF5aRuz9xQyXExpd02dtyw6y/lFKBJHqqYNTlUsqU=; b=aI0EXqCuE5AHjf3JJ32yvS0J0MTk0qxXPQzmwEE51Frmpl0SnySC50oHC9ujDP1CVE+SLHZuNSTTLVTLA4bDo1GrErqYVkdNZJcEznNTCK4lPg83xXwUMtUTOaPcM2kH0+0LujEqBPg+ls9HOYddJLGq9XmDfTVn7DTscm1eqqGitZSBfBIXT1zOLFIofqbNCGrkDRlykDmJd6A+uo4fg6LLySCOymIgz+2R8IEbqIe9Dsrx2TUXVgN31VDy6FEUPkGXq/ViIjK8RwYV9M5jX+WhKPW58MjNdPUL0wvs+gtRT4MbWc/iP5RRTlJVj3Qmmpq3UfM1D6KU+LYOsWDpCQ== 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 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=p4YF5aRuz9xQyXExpd02dtyw6y/lFKBJHqqYNTlUsqU=; b=HwoBGgjI02yv1/D+9B2Nle74quKe/zAfqD46W3EoGYoDypecrL1Oxv4YJcul9jl6/IAUazI2PWpGEYs9uWokYA8IsMtr7jb2mZz06vkeVVVtiCk5w1/+6F+ewi1ZniJuv+75u3S6Kthu6nXUCYna73I8FvOrMqq7HpA9JxWPJtkgtlJoDvAndW92sH6bGBia9SHDk2NR8ZEWplNqbnaExI/BadrlmHciiLq0uzOI+wdf5f3QdY1+9PYIkll1+CRd5dq2vN81/F2MB13wq4LiNpVZ/FCGwZUEjzfR/3MvmKINvvGa633X+yje11DqAq6EbYgGY+oovQXjS5qSuZcdOg== Received: from BN8PR15CA0057.namprd15.prod.outlook.com (2603:10b6:408:80::34) by SA0PR12MB7464.namprd12.prod.outlook.com (2603:10b6:806:24b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Sun, 25 Jun 2023 06:44:31 +0000 Received: from BN8NAM11FT081.eop-nam11.prod.protection.outlook.com (2603:10b6:408:80:cafe::36) by BN8PR15CA0057.outlook.office365.com (2603:10b6:408:80::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.33 via Frontend Transport; Sun, 25 Jun 2023 06:44:30 +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 BN8NAM11FT081.mail.protection.outlook.com (10.13.177.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.45 via Frontend Transport; Sun, 25 Jun 2023 06:44:30 +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.986.5; Sat, 24 Jun 2023 23:44:16 -0700 Received: from nvidia.com (10.126.230.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.986.37; Sat, 24 Jun 2023 23:44:14 -0700 From: Xueming Li To: Satheesh Paul CC: Kiran Kumar K , dpdk stable Subject: patch 'common/cnxk: fix setting channel mask for SDP interfaces' has been queued to stable release 22.11.3 Date: Sun, 25 Jun 2023 14:35:15 +0800 Message-ID: <20230625063544.11183-98-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230625063544.11183-1-xuemingl@nvidia.com> References: <20230625063544.11183-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT081:EE_|SA0PR12MB7464:EE_ X-MS-Office365-Filtering-Correlation-Id: d21d774a-d2cd-4dc1-0b70-08db7547a0ce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eJ29jGzHgJl8eImYKdAKR9vfPr3whTMC5KUlxLVxcaHHAHFEurRt6aqDq9cdv+G9TfQo0HZpBKmC4oLc7Ocmylno02/sn1mnS73WwwR4654uO/lVmRb+iQ1QeSpKUdWtWMHoPET5M/zi2cIp+Za6ijHIfUdfvjqCPUSHVToZL6mGT2Yxm4VdcPOH2IAThclYLS6B5i/wBnZyWMG+B88qs7sYcWPUvbLTOKT52YN/FqhAelSEdOloXxHZGb9gC1JI112m4iJ7w5HwsQwb0VWtDNHD3U75zYmox7aMFz5bNKsmrAztp+/GyfZQ95+b18NwNXYxUG5DqF5pE9r7CtOshzzhwkml+I1JYSu6P53XtX/3mbpW6MYH3K5ywoDLxviLTuuVQ21HEAX6IAt8R8+VVenQ/Q6TKXRlti8PngcIL7fTD1YwHiohCdlKnNrYRHpdXPFlSdjV2EWF1UkaPUUDi+uaMIvxlzl8lgdL3a9CjqF7LRdy2thcda5uQtLx1WvCSIGZvSMKydu00tUlsLFsVhazVAKnqUoRdfvETPSRVvI6dp02jStKXxUwCOHICUOB6q26YP4WGnzFn5qQHVJpmkeGww0Wo3cge4Q9cFM5asPrlhSTjGZRsTv3cvfdeZf88HhDzLmJ9oGS9e6JGoxtcG+NZvuCLEkglzg9halREVCtidjf51+E/p94lfrTmxJGS7zWUL6pSh7JFDuSsdSTpn6tHAQQ8iHxOy+R2xMNl772/zDJNTZ5+Q2bsIhhKCoqbpwKRbcFyw/AMoPPuLWULQ== 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:(13230028)(4636009)(346002)(39860400002)(396003)(376002)(136003)(451199021)(36840700001)(40470700004)(46966006)(82310400005)(356005)(7636003)(82740400003)(55016003)(40480700001)(86362001)(1076003)(53546011)(5660300002)(2616005)(26005)(6286002)(16526019)(186003)(2906002)(478600001)(70586007)(70206006)(6916009)(54906003)(4326008)(8676002)(8936002)(316002)(966005)(7696005)(41300700001)(336012)(426003)(47076005)(83380400001)(36860700001)(36756003)(40460700003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2023 06:44:30.1855 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d21d774a-d2cd-4dc1-0b70-08db7547a0ce 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: BN8NAM11FT081.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB7464 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.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/27/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/commit/?h=22.11-staging&id=103a33d02dfc71fe09d0feca85d8005b3b457466 Thanks. Xueming Li --- >From 103a33d02dfc71fe09d0feca85d8005b3b457466 Mon Sep 17 00:00:00 2001 From: Satheesh Paul Date: Thu, 18 May 2023 15:34:51 +0530 Subject: [PATCH] common/cnxk: fix setting channel mask for SDP interfaces Cc: Xueming Li [ upstream commit 2703f1fa3200d9855686e2cb451bf95e10838ec0 ] Channel mask for SDP interfaces are by default set to a constant value. Fix this by setting mask calculated from the channel base and channel count configured in NIX LF. Fixes: f13756633330 ("common/cnxk: support setting channel mask for SDP interfaces") Signed-off-by: Satheesh Paul Reviewed-by: Kiran Kumar K --- drivers/common/cnxk/roc_npc.c | 40 ++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c index bf7fb90f17..5e1ca6bc03 100644 --- a/drivers/common/cnxk/roc_npc.c +++ b/drivers/common/cnxk/roc_npc.c @@ -1242,12 +1242,39 @@ npc_vtag_action_program(struct roc_npc *roc_npc, return 0; } +static void +roc_npc_sdp_channel_get(struct roc_npc *roc_npc, uint16_t *chan_base, uint16_t *chan_mask) +{ + struct roc_nix *roc_nix = roc_npc->roc_nix; + struct nix *nix = roc_nix_to_nix_priv(roc_nix); + uint16_t num_chan, range, num_bits = 0; + uint16_t mask = 0; + + *chan_base = nix->rx_chan_base; + num_chan = nix->rx_chan_cnt - 1; + if (num_chan) { + range = *chan_base ^ (*chan_base + num_chan); + num_bits = (sizeof(uint32_t) * 8) - __builtin_clz(range) - 1; + /* Set mask for (15 - numbits) MSB bits */ + *chan_mask = (uint16_t)~GENMASK(num_bits, 0); + } else { + *chan_mask = (uint16_t)GENMASK(15, 0); + } + + mask = (uint16_t)GENMASK(num_bits, 0); + if (mask > num_chan + 1) + plt_warn( + "npc: SDP channel base:%x, channel count:%x. channel mask:%x covers more than channel count", + *chan_base, nix->rx_chan_cnt, *chan_mask); +} + struct roc_npc_flow * roc_npc_flow_create(struct roc_npc *roc_npc, const struct roc_npc_attr *attr, const struct roc_npc_item_info pattern[], const struct roc_npc_action actions[], int *errcode) { struct npc *npc = roc_npc_to_npc_priv(roc_npc); + uint16_t sdp_chan_base = 0, sdp_chan_mask = 0; struct roc_npc_flow *flow, *flow_iter; struct npc_parse_state parse_state; struct npc_flow_list *list; @@ -1260,16 +1287,9 @@ roc_npc_flow_create(struct roc_npc *roc_npc, const struct roc_npc_attr *attr, npc->sdp_channel = roc_npc->sdp_channel; npc->sdp_channel_mask = roc_npc->sdp_channel_mask; } else { - /* By default set the channel and mask to cover - * the whole SDP channel range. - */ - if (roc_model_is_cn10k()) { - npc->sdp_channel = (uint16_t)CN10K_SDP_CH_START; - npc->sdp_channel_mask = (uint16_t)CN10K_SDP_CH_MASK; - } else { - npc->sdp_channel = (uint16_t)NIX_CHAN_SDP_CH_START; - npc->sdp_channel_mask = (uint16_t)NIX_CHAN_SDP_CH_START; - } + roc_npc_sdp_channel_get(roc_npc, &sdp_chan_base, &sdp_chan_mask); + npc->sdp_channel = sdp_chan_base; + npc->sdp_channel_mask = sdp_chan_mask; } } -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-06-25 14:32:01.114329300 +0800 +++ 0097-common-cnxk-fix-setting-channel-mask-for-SDP-interfa.patch 2023-06-25 14:31:58.545773900 +0800 @@ -1 +1 @@ -From 2703f1fa3200d9855686e2cb451bf95e10838ec0 Mon Sep 17 00:00:00 2001 +From 103a33d02dfc71fe09d0feca85d8005b3b457466 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 2703f1fa3200d9855686e2cb451bf95e10838ec0 ] @@ -12 +14,0 @@ -Cc: stable@dpdk.org @@ -21 +23 @@ -index ba75207955..d556b4c3a5 100644 +index bf7fb90f17..5e1ca6bc03 100644 @@ -24,2 +26,2 @@ -@@ -1388,12 +1388,39 @@ npc_inline_dev_ipsec_action_free(struct npc *npc, struct roc_npc_flow *flow) - return 1; +@@ -1242,12 +1242,39 @@ npc_vtag_action_program(struct roc_npc *roc_npc, + return 0; @@ -64 +66 @@ -@@ -1406,16 +1433,9 @@ roc_npc_flow_create(struct roc_npc *roc_npc, const struct roc_npc_attr *attr, +@@ -1260,16 +1287,9 @@ roc_npc_flow_create(struct roc_npc *roc_npc, const struct roc_npc_attr *attr,