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 1FB4DA034F for ; Wed, 10 Nov 2021 07:40:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1991240142; Wed, 10 Nov 2021 07:40:20 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2080.outbound.protection.outlook.com [40.107.237.80]) by mails.dpdk.org (Postfix) with ESMTP id 3440040142 for ; Wed, 10 Nov 2021 07:40:19 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L14qk+vUXVf9K9MOhwna6XDKjz9kZPQx9Cn0EuEBMBRnD1yrG47UufU52OkB2BKvPvcmTtNERzunx0xChdQqU0ERsge55OQ8XlI0WpxRscNPn6x5u5Hp4BgZOaebp5GjHR3wLZnwrg23nSaUOl5mxXhmzvvuYFREPbZocXDa3MiLHUFTqKs2dGnkf9fBj1k/YqDno96/LZpgtPK9Iry9t0palNXY+JVUe/2JXAlgePhYXmkl6nMSNCoTWPqWnZ8hIhYB2mNenCLAf02ezQFgHaf770zFb8TIwCRnBMT92vYU/OyNGAyzYEpLeVSXPDdTB7TinNGqWoOlr10KdggBog== 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=qDrV0CH80m/3Cym84PmeF0IJ1bnGNga5H6kxw7Ra6FQ=; b=GbyppimL9IwD+DGgOh1zj7VvZDT9IcjxkhQhLOYmKm9XaGWjNy+zIMyyRMClL4siXqRmuibp6vqG4qP67rDjXKidhF8AJDnCJL/ZviavoxWgeHZS9/KaZf8ky7evwmTxqrxsUsSY+zUzZ6xCefpFNgRu0BxkQ27H6j1hcmVtH/qirldTIK5cKKL5T/8jd7lMBsFYLmuRn4qsy5EBm7tFgHtFy0Wf+9Q6Pp3tu+tUc6hqzZLGrXS+wfB7m6i5BbeZqinKneAFAL1ZTnQna2OczLlZTcpMJhReKBmGpcHz1qlxnR//z7d+r55fw7K8uh0SoFHZom/y7RcY/D3AlA1iLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=qDrV0CH80m/3Cym84PmeF0IJ1bnGNga5H6kxw7Ra6FQ=; b=iNp2eYJG4UBtSR5FFnJ6di4VvC1fKPRd7F6xAtW59bGJNhRv7XqRkI51HRfgIZp9XZjiiJoLn5Sx5Xj2xnYETHH1ZckJk8yfogI2WH5hTJpH0s562/3ehwmXa6qoZHL5RVeYj/OyzEVc2XQ0iPgvuJulqcJeviQPvc8LTYip56d1/rbQ+NBNBBdIDm2/YczKuF1JTj94YLVaJCIPPbg+wV/t1AGz5FN2TkE8ISnFfyeEAtPyhaYTvG5M8IxlPVl4DEmgaGRMuJG7rowMMJkYJYTfdrAUga9VzcX4ogIuoFowyyoKHzEoX7rzFrOFej1FW5XkoyP87+poK4wWUgVufA== Received: from DM6PR03CA0077.namprd03.prod.outlook.com (2603:10b6:5:333::10) by CH2PR12MB4311.namprd12.prod.outlook.com (2603:10b6:610:a8::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Wed, 10 Nov 2021 06:40:16 +0000 Received: from DM6NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:5:333:cafe::89) by DM6PR03CA0077.outlook.office365.com (2603:10b6:5:333::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Wed, 10 Nov 2021 06:40:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT024.mail.protection.outlook.com (10.13.172.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:40:15 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:40:13 +0000 From: Xueming Li To: Qi Zhang CC: Luca Boccassi , Dan Nowlin , Junfeng Guo , dpdk stable Date: Wed, 10 Nov 2021 14:29:16 +0800 Message-ID: <20211110063216.2744012-73-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3863c94d-f513-47e3-b180-08d9a414f4b5 X-MS-TrafficTypeDiagnostic: CH2PR12MB4311: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pk6EDklJFyHNQOW9MrK/QttEsHYbxsjkQzAai1Ldi5IVuqZdsvBwy71/B8KjTJNpvviugvMCLpaT4T4+t0bl25WQU4Ut7qi8Ce0WHUoW+h5SqG0nuOmAjcJs3ge9hulzmf6XcssipKYaff9jBQCs17VAxQsjnZueBuUVsccDEMo1tsVh02C5s598wqF5GJrB5aegOAXZosjXT4Subc201lnfsTLe40+PGZYoXgtnzjCoHmUw6xsEvMt3OQhXezUynNKewzlBCufuusl3VeClZLTuUXXbU+MLuW5JES5yAePqn2qyY7xi42FwrVxaxXMFsvZQl4N+KxmS7I/7WFzBi+yL6SCffF2hiDCXM5+PV+NPeYzzSejJ4wFjWlk2SwAO1GOXD0VLEibyjhluKN0mEfsEm/BENRzktUZYJdCz8hKZv1Il+uPyrDdq8BKrpT3W0nAdhJbi/IOkOGsJSeDmDE+fjG0mJm+cE5SaZHRz5Zi2MUIUO/bSe9Awj9RxLPMu2I+Iv6TxBqI92EMx/gJHGi+6YMxxlytcEK+5n6ILwNO3Z7KeU7tjGfDzSSlKzGi1ZTtOFd3yeIyktFKcXJMo1zh0WMIwbACAyLymgvoSIQgRPJ70/NgVKuDUi1YyZmtF5lAZ5+aRB2CXKliAIK6z2SIOq/b/5PGsWGOJxT6CORLorXJYZZxw+n/3jWFZvx3O3wm05pZNk8TLzUoMxMX/sSzjoHorb2LDWEKZUpfaHUqICaN4m7RJFkEqg6//leq0dga+Knzsa1lcR+YEB4XRofLeJ6ssmCyfH+QQ0ZTJwcKYLoH/DYe5mUyTzxcbwsJiqtUdluZy0+LFggv9HcYQhg== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(508600001)(5660300002)(55016002)(36906005)(54906003)(36756003)(426003)(70586007)(316002)(356005)(6286002)(966005)(82310400003)(83380400001)(36860700001)(70206006)(47076005)(2906002)(53546011)(1076003)(8936002)(6916009)(26005)(8676002)(4326008)(7696005)(86362001)(4001150100001)(2616005)(336012)(16526019)(186003)(7636003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:40:15.9526 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3863c94d-f513-47e3-b180-08d9a414f4b5 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4311 Subject: [dpdk-stable] patch 'net/ice/base: calculate logical PF ID' has been queued to stable release 20.11.4 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. 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/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/60974c7c2c2e6b18c0dccd7a8e235718ac55e5e2 Thanks. Xueming Li --- >From 60974c7c2c2e6b18c0dccd7a8e235718ac55e5e2 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Thu, 16 Sep 2021 17:52:53 +0800 Subject: [PATCH] net/ice/base: calculate logical PF ID Cc: Xueming Li [ upstream commit 3affa0ef2d4b229d69eb3dc50cf0540b33fbebe2 ] In some devices, the function numbers used are non-contiguous. For example, some two port devices will report as functions 0 and 2. When distributing RSS and FDIR masks, which are global resources across the active devices, it is required to have a contiguous PF id, which can be described as a logical PF id. In the case above, function 0 would have a logical PF id of 0, and function 2 would have a logical PF id of 1. Using logical PF id can properly describe which slice of resources can be used by a particular PF. Signed-off-by: Dan Nowlin Signed-off-by: Qi Zhang Acked-by: Junfeng Guo --- drivers/net/ice/base/ice_common.c | 19 +++++++++++++++++++ drivers/net/ice/base/ice_flex_pipe.c | 2 +- drivers/net/ice/base/ice_type.h | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index be33ee252d..2b53f78512 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -2017,6 +2017,23 @@ ice_parse_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p, ice_recalc_port_limited_caps(hw, &func_p->common_cap); } +/** + * ice_func_id_to_logical_id - map from function id to logical pf id + * @active_function_bitmap: active function bitmap + * @pf_id: function number of device + */ +static int ice_func_id_to_logical_id(u32 active_function_bitmap, u8 pf_id) +{ + u8 logical_id = 0; + u8 i; + + for (i = 0; i < pf_id; i++) + if (active_function_bitmap & BIT(i)) + logical_id++; + + return logical_id; +} + /** * ice_parse_valid_functions_cap - Parse ICE_AQC_CAPS_VALID_FUNCTIONS caps * @hw: pointer to the HW struct @@ -2034,6 +2051,8 @@ ice_parse_valid_functions_cap(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p, dev_p->num_funcs = ice_hweight32(number); ice_debug(hw, ICE_DBG_INIT, "dev caps: num_funcs = %d\n", dev_p->num_funcs); + + hw->logical_pf_id = ice_func_id_to_logical_id(number, hw->pf_id); } /** diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c index d74fecbf5b..42eda0b4b4 100644 --- a/drivers/net/ice/base/ice_flex_pipe.c +++ b/drivers/net/ice/base/ice_flex_pipe.c @@ -3125,7 +3125,7 @@ static void ice_init_prof_masks(struct ice_hw *hw, enum ice_block blk) per_pf = ICE_PROF_MASK_COUNT / hw->dev_caps.num_funcs; hw->blk[blk].masks.count = per_pf; - hw->blk[blk].masks.first = hw->pf_id * per_pf; + hw->blk[blk].masks.first = hw->logical_pf_id * per_pf; ice_memset(hw->blk[blk].masks.masks, 0, sizeof(hw->blk[blk].masks.masks), ICE_NONDMA_MEM); diff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h index 6b8d44f0b4..1aae9fe721 100644 --- a/drivers/net/ice/base/ice_type.h +++ b/drivers/net/ice/base/ice_type.h @@ -864,6 +864,7 @@ struct ice_hw { u8 revision_id; u8 pf_id; /* device profile info */ + u8 logical_pf_id; u16 max_burst_size; /* driver sets this value */ -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:05.270966334 +0800 +++ 0072-net-ice-base-calculate-logical-PF-ID.patch 2021-11-10 14:17:01.834079724 +0800 @@ -1 +1 @@ -From 3affa0ef2d4b229d69eb3dc50cf0540b33fbebe2 Mon Sep 17 00:00:00 2001 +From 60974c7c2c2e6b18c0dccd7a8e235718ac55e5e2 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 3affa0ef2d4b229d69eb3dc50cf0540b33fbebe2 ] @@ -18,2 +20,0 @@ -Cc: stable@dpdk.org - @@ -30 +31 @@ -index 641859f752..6004c95625 100644 +index be33ee252d..2b53f78512 100644 @@ -33 +34 @@ -@@ -2535,6 +2535,23 @@ ice_parse_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p, +@@ -2017,6 +2017,23 @@ ice_parse_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p, @@ -57 +58 @@ -@@ -2552,6 +2569,8 @@ ice_parse_valid_functions_cap(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p, +@@ -2034,6 +2051,8 @@ ice_parse_valid_functions_cap(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p, @@ -67 +68 @@ -index fd98b3837d..8a6fc8a9a5 100644 +index d74fecbf5b..42eda0b4b4 100644 @@ -70 +71 @@ -@@ -3432,7 +3432,7 @@ static void ice_init_prof_masks(struct ice_hw *hw, enum ice_block blk) +@@ -3125,7 +3125,7 @@ static void ice_init_prof_masks(struct ice_hw *hw, enum ice_block blk) @@ -80 +81 @@ -index 56ee628f10..b1e03b10ff 100644 +index 6b8d44f0b4..1aae9fe721 100644 @@ -83 +84 @@ -@@ -1132,6 +1132,7 @@ struct ice_hw { +@@ -864,6 +864,7 @@ struct ice_hw {