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 99F98A0C4E; Thu, 22 Jul 2021 08:59:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 28A734014D; Thu, 22 Jul 2021 08:59:59 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2041.outbound.protection.outlook.com [40.107.92.41]) by mails.dpdk.org (Postfix) with ESMTP id E5C8340040 for ; Thu, 22 Jul 2021 08:59:57 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cC/qiSvsOvlTNA4lxYeGv+okaQbrzDYN/d21cCOMIegvj3hQ6u0IlSmMIkbKJkv4Y3fBdnkUbLCc8RPxkCg38RPTha13htOiOL4z/uA5J6/rDsWsx8HnllI+H7uYugmpNn+vHxXuIrW8FGsMXSo4FUTMkTiOEquSem74TIUHzY+lTp/c/0Ydp1Pt5AOKZanNwTaXG+rhFpBdKRiPLefdrZH1LYbrgJcNR6a7aW9a8ydmv1BRHvHi+vFWTWs8THny2S7XHoykNrsxzvp9JCCdnXX+49H3nvqGEaafIqZszFpy7zII6rnSLah7lbu5exsSiC1rPhK3dXSBp6Zs3ua1sw== 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-SenderADCheck; bh=ThUIK3uep7fFoXd0CoK57tvrEz4LA4y/AtV4u6HI4/E=; b=O/GviPH/a2Kq/TpVKg4E+tOrSlOX3lwYIK9LmdCLlqibeNhYvOuIHjojXAO4e/FqPIgyGzkVhp/tjlAYsQTtQECJoaqw3MdUH2SXD+GiwsSFhd51I8+aZd7lxhwGesGnwnkcXF0USNLfU1LXt7+WRDy9JI/QlrNzc8L8ULAE/brNCHPz15NBesRhfb8qGjpwIHklVElC66+XPNT/IvfvQ4GB6NgBj+05HZuYIFUFIrf2atM3PNZ0UemN1ru5kMSpDCiO0VCKUYt3pXEwMa/nLcr7RvF1JURuX5PGFIEPK9+ciJ/JB6IUh2LY165//EHkc/5uJcr2gotE8m+g4Mq9qA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none 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=ThUIK3uep7fFoXd0CoK57tvrEz4LA4y/AtV4u6HI4/E=; b=F/Wkcl3vdCyrIcinsIm3wHCXBL0QwjdunXM6/y4HZ2lHfqSNn5hIiD9jief1kbLHYH4wNu6fjijg6hGERX9CXCKw5MmQCTL/U5NtV/OlfTwnNr9hKrxEX2Ivnhlmjrv6ExdO/AIS2ee6ewFvZgllOO5QD1h4vbZUi5h66+gXOzIYqzuW7xwUnoZuuOe6zmtZaIAej6KM727KQOe97nWYC9+h5fkVOOxX00H7+lPeOMmcvBFi8XKEIn7UzFsXywmIYQzy23aBm0vh8XfHMzYbYA3ASARjS2WeVilOfbmiRb3uucCKN4/7qBeslzCPjSnn5FBhh55rPPx8Hza+M8ZRMQ== Received: from BN9PR03CA0555.namprd03.prod.outlook.com (2603:10b6:408:138::20) by DM6PR12MB4499.namprd12.prod.outlook.com (2603:10b6:5:2ab::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24; Thu, 22 Jul 2021 06:59:56 +0000 Received: from BN8NAM11FT019.eop-nam11.prod.protection.outlook.com (2603:10b6:408:138:cafe::cd) by BN9PR03CA0555.outlook.office365.com (2603:10b6:408:138::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24 via Frontend Transport; Thu, 22 Jul 2021 06:59:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; 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 BN8NAM11FT019.mail.protection.outlook.com (10.13.176.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4352.24 via Frontend Transport; Thu, 22 Jul 2021 06:59:56 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 22 Jul 2021 06:59:53 +0000 From: Suanming Mou To: , CC: , , Date: Thu, 22 Jul 2021 09:59:40 +0300 Message-ID: <20210722065940.593-1-suanmingm@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20210721083448.14598-1-suanmingm@nvidia.com> References: <20210721083448.14598-1-suanmingm@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.5] 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: cde85bbb-1950-4b1f-d89b-08d94cde5047 X-MS-TrafficTypeDiagnostic: DM6PR12MB4499: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:283; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZQMwiY+iIf038Y3ygWB5quMNpju/fCQNfpntLlQ0YcQT36bJjZVcBdflMd613E3aB64hJiB9Kl4EWkVw8Zkm9KNuSAOgFI+AjvtNjo3JTkAcmBIOe7g8Q8iEKL82Bp+iSZIw9Dwdu7zjbNzHufy62o5dhOCWnOPtVFOct7LthCASUvqLNCMF9nKgfNsWveZuuDSoXBoRHBmWek2tlHYnvTJS/o8yeGQUhfzxMZNfTOsAd8GP8IR51Af/U1uEMEBBGv27FCAR2tDIvqrTPpEYioGe6XVI/aPQknam4MGGPs2AF5G4Os22h/rlsCuy5uYXLEUHpekVAM+2FWXuljZPDjN7fTbFSdfM+8qFwB+4GC7KijKTrxOeCcehbxqf/Iy40Gz88Os8Hl2nq8pQ7+NPFqLCCl8qJttH97sFi+8PWl0aV6407HE4tYMm8l69K8E1G6d8AA0DpCNhSAAko6m/W6TJpvCCvio4b1aghglwWLrx1zLEk3xLqJTtyoN8nAHvic8ACRBlGk9G7Vpup49DYJxO31jxWZs8hCoXjkIXjhVIZMZ0mpuXjIsrKIN5AcY55XyD1tnT3vS3i7WNHRjwpUOk10CtAobZxnxQPLJyNkqjwUJNNWWCL881DZbBdKmu1G+c3D12RB/XlLA6vohtuVzFLSEs6kuodTszmToA3X8FmMc2P9kFmV9TVqmUophxZzWoE/3xfp0ZPZFT7Eri+raYv9YTvcMvHBOtUrn+Yac= 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)(346002)(376002)(396003)(39860400002)(136003)(36840700001)(46966006)(70206006)(70586007)(4326008)(47076005)(82310400003)(6286002)(1076003)(478600001)(7696005)(2616005)(316002)(426003)(86362001)(83380400001)(2906002)(356005)(6666004)(54906003)(26005)(6636002)(55016002)(8936002)(36906005)(8676002)(336012)(186003)(110136005)(5660300002)(82740400003)(107886003)(36860700001)(7636003)(16526019)(36756003)(309714004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2021 06:59:56.1333 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cde85bbb-1950-4b1f-d89b-08d94cde5047 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: BN8NAM11FT019.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4499 Subject: [dpdk-dev] [PATCH v2] net/mlx5: fix indexed pools allocation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Currently, the flow indexed pools are allocated per port, the allocation was missing in Windows code. Allocate indexed pool for the Windows case too. Fixes: b4edeaf3efd5 ("net/mlx5: replace flow list with indexed pool") Signed-off-by: Suanming Mou Acked-by: Tal Shnaiderman Acked-by: Matan Azrad Tested-by: Odi Assli --- v2: commit message updated. --- drivers/net/mlx5/windows/mlx5_os.c | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c index 5da362a9d5..a31fafc90d 100644 --- a/drivers/net/mlx5/windows/mlx5_os.c +++ b/drivers/net/mlx5/windows/mlx5_os.c @@ -35,6 +35,44 @@ static const char *MZ_MLX5_PMD_SHARED_DATA = "mlx5_pmd_shared_data"; /* Spinlock for mlx5_shared_data allocation. */ static rte_spinlock_t mlx5_shared_data_lock = RTE_SPINLOCK_INITIALIZER; +/* rte flow indexed pool configuration. */ +static struct mlx5_indexed_pool_config icfg[] = { + { + .size = sizeof(struct rte_flow), + .trunk_size = 64, + .need_lock = 1, + .release_mem_en = 0, + .malloc = mlx5_malloc, + .free = mlx5_free, + .per_core_cache = 0, + .type = "ctl_flow_ipool", + }, + { + .size = sizeof(struct rte_flow), + .trunk_size = 64, + .grow_trunk = 3, + .grow_shift = 2, + .need_lock = 1, + .release_mem_en = 0, + .malloc = mlx5_malloc, + .free = mlx5_free, + .per_core_cache = 1 << 14, + .type = "rte_flow_ipool", + }, + { + .size = sizeof(struct rte_flow), + .trunk_size = 64, + .grow_trunk = 3, + .grow_shift = 2, + .need_lock = 1, + .release_mem_en = 0, + .malloc = mlx5_malloc, + .free = mlx5_free, + .per_core_cache = 0, + .type = "mcp_flow_ipool", + }, +}; + /** * Initialize shared data between primary and secondary process. * @@ -317,6 +355,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, char name[RTE_ETH_NAME_MAX_LEN]; int own_domain_id = 0; uint16_t port_id; + int i; /* Build device name. */ strlcpy(name, dpdk_dev->name, sizeof(name)); @@ -584,6 +623,14 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, mlx5_set_min_inline(spawn, config); /* Store device configuration on private structure. */ priv->config = *config; + for (i = 0; i < MLX5_FLOW_TYPE_MAXI; i++) { + icfg[i].release_mem_en = !!config->reclaim_mode; + if (config->reclaim_mode) + icfg[i].per_core_cache = 0; + priv->flows[i] = mlx5_ipool_create(&icfg[i]); + if (!priv->flows[i]) + goto error; + } /* Create context for virtual machine VLAN workaround. */ priv->vmwa_context = NULL; if (config->dv_flow_en) { -- 2.25.1