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 3BED2A0093; Sun, 2 Jan 2022 08:07:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F415741158; Sun, 2 Jan 2022 08:07:07 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2081.outbound.protection.outlook.com [40.107.220.81]) by mails.dpdk.org (Postfix) with ESMTP id 1EE3B41148 for ; Sun, 2 Jan 2022 08:07:06 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gzDu+3yES6CBhqp1Zf8q4Pp/YhLb0h3/97JLRwSF4m29XwOaM/ekHi9ptYqALK6PP8cILSZD4/iCunZoYlaBBXaDVJsVImTJddjZlrp6MdbBbVr3mQbUm143dSASocGd9AJdUn+a2pueoTaD4OHQGWJTER9ifJaXLalcMPPtqU3qkGC6tNdXaFk0OOqOzEBBjlxrmgbdxX7pxjeb5Dz26lUeX8Noc0U7NBAUkkuzK2W2Wnu6WiAIb3l2fpK1oljFyEyQBCnhc1Uw8wbKveGUmX08V8jbfAMmORw/D0z01o4aoHc2V4VBvXFn73ZrerrP/hEFGFnVLQTgLeLPAHiF2Q== 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=PasilrtK3r6slqZK1hFDDo7A2ZZII/8lNi23Gi198Rw=; b=OG0X2/f83wYaGM43gyQqq13JmO1cHSwUI+o9Os8e29WHext5/fcDyVpW46osEpCIDiRPy2yv1lfhulT53OGWRirnpthQMMFQ3D5EHiQ8JBNUMn30hqQDrgbRzcmuaEURR6Ta8iYtH4pJqpfYt3sXMjnw2+rdaH9QVXJSrtvLOZZw75sorcqAibrZYDOuuE+Q+PZG1eLNk/H369y6FLQRphehGrvdw7mgrmPfpjZJ93/Qi2ilEvAEoFk0SKHGJ9gbKTxGwGXo4TpI6oTp+uzSM8LTKWk7FygjlPQpEITF96w2FNUZRPROph7YXJTSwIGaoc4Zk61ur9QTtuyP5XA4+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) smtp.rcpttodomain=dpdk.org 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=PasilrtK3r6slqZK1hFDDo7A2ZZII/8lNi23Gi198Rw=; b=OVVj9az6AWK464BYrFge7J9CJdOFcPkdROWljbVtgqgUDouVkyXSXOPpIuLngzBcSYXnHY7CsQKEvyc4/xvVi3791YuZwUvLojGmY5vENr7EfFhVMtid6Lb9YA4gI5qPI48eFPCZ5Cwww4bRcxTR0WGL2g3NQHmLtIgkPUfYohRNecKXRqfXRCh3rcA/XhSG7LN26UZRkoFWq31IX9VrB/nCTsXd9XAePPUFDBgXEZ4E2e09wx7Z4AR6GxgvuxePwHC7iy9anxaDZSG4sqDeGqKJ7uX/ThuNnxFxcU5g1zRgix8LuNrEC/okQV4G8ItuVpuXMFbC2V7NyYqqg41+pA== Received: from DM6PR14CA0062.namprd14.prod.outlook.com (2603:10b6:5:18f::39) by BYAPR12MB4613.namprd12.prod.outlook.com (2603:10b6:a03:a4::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.15; Sun, 2 Jan 2022 07:07:04 +0000 Received: from DM6NAM11FT062.eop-nam11.prod.protection.outlook.com (2603:10b6:5:18f:cafe::fa) by DM6PR14CA0062.outlook.office365.com (2603:10b6:5:18f::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.14 via Frontend Transport; Sun, 2 Jan 2022 07:07:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) 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 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.236) by DM6NAM11FT062.mail.protection.outlook.com (10.13.173.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4844.14 via Frontend Transport; Sun, 2 Jan 2022 07:07:03 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 2 Jan 2022 07:07:03 +0000 Received: from nvidia.com (172.20.187.6) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.986.9; Sat, 1 Jan 2022 23:07:01 -0800 From: To: CC: Matan Azrad , Raslan Darawsheh , Viacheslav Ovsiienko , Michael Baum Subject: [RFC 3/3] net/mlx5: add external Rx queue Date: Sun, 2 Jan 2022 09:06:38 +0200 Message-ID: <20220102070638.2211160-4-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220102070638.2211160-1-michaelba@nvidia.com> References: <20220102070638.2211160-1-michaelba@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 36e4bca8-9448-4c09-0029-08d9cdbe7ad6 X-MS-TrafficTypeDiagnostic: BYAPR12MB4613:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YXObsifOS52oLlmzPp5j6TTgILyv+K+aS7VtvzGZO4XNJy+/Ap3FD8qatb0q4jTRH2u+wxSySc0x4t9S4K1zNowMxSzYnW+cDDUMmpIE12rOo2+7Qmr6RkWNmC3rKkQlNQrtVfrHNf2BMwkShvI/IKAxRL4CBaVc7/joNURrJkOaO1RfOlHGa6Lk+fbcHQnTUMNHs3X0Lk9WR4/RsYLlAO+X7e6NUvzoKxOjGkR7w5hVlbK7Cv2jltdNzB0rHZWwdAojfjKsO6XpJSUYEwxXOky3KVlj/oFZDmpULTOw3t7GEDPBoL/gKNuugWvT246/O8SQUIF/Y/94Lk6igru0ndlQPLwEvOYeZukZCe13qZ+hRPF4oecaYvPJb0QkGyesvyuCgJ7e7vuIjWV1wPXf3xh2766spt8XmGN08dK0hSfei9V4zpFWDpjFGV7ggH6l5n7CNsU2GDp9OABWjijKf8kWNP3WFv7jtp9uoNwgKbL1ARG2P2JItBm5NOJI8d/DteYaopscwTNWodYRvHew0bhgVtMq7eBc7tha+AB1MVwbyvEGGFFoQ82AKeJP5FmbNjnvsKKUTuy3eHYXpbnb9ZFhKEBbzF6JE3QdOdoJYdlnFZV+4EGEACVSZu8ZMNEWAD5euA4cLK4yoNttY8bXVxbwEMUmKLFPZV/3zDf6w6Do6hhDrK9p8V2Tug/Am/zihNBVrTUqeY5v59drveF9XNuOC8UbrrPsqzDQvS9nwk0WPtxGV+WSN3nxmlNOs2gVn0B8HRUj6/NaOvDW1yiIK+4KbMKWOP+K4FYZtCGWmm8= X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(4636009)(40470700002)(46966006)(36840700001)(508600001)(83380400001)(7696005)(6666004)(1076003)(2906002)(81166007)(5660300002)(54906003)(2876002)(356005)(40460700001)(16526019)(316002)(26005)(70206006)(8676002)(426003)(6286002)(82310400004)(86362001)(336012)(186003)(107886003)(70586007)(36860700001)(2616005)(55016003)(8936002)(47076005)(6916009)(36756003)(4326008)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jan 2022 07:07:03.6711 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36e4bca8-9448-4c09-0029-08d9cdbe7ad6 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT062.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB4613 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 From: Michael Baum Add API to map and unmap HW queue id to rte_flow queue id. Signed-off-by: Michael Baum --- drivers/net/mlx5/mlx5_rx.h | 6 +++++ drivers/net/mlx5/rte_pmd_mlx5.h | 45 +++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/drivers/net/mlx5/mlx5_rx.h b/drivers/net/mlx5/mlx5_rx.h index adb759c235..832f66004a 100644 --- a/drivers/net/mlx5/mlx5_rx.h +++ b/drivers/net/mlx5/mlx5_rx.h @@ -182,6 +182,12 @@ struct mlx5_rxq_priv { uint32_t hairpin_status; /* Hairpin binding status. */ }; +/* External RX queue descriptor. */ +struct mlx5_external_rxq { + uint32_t hw_id; /* Queue index in the Hardware. */ + uint32_t refcnt; /* Reference counter. */ +}; + /* mlx5_rxq.c */ extern uint8_t rss_hash_default_key[]; diff --git a/drivers/net/mlx5/rte_pmd_mlx5.h b/drivers/net/mlx5/rte_pmd_mlx5.h index e531e527b6..12e9f8d604 100644 --- a/drivers/net/mlx5/rte_pmd_mlx5.h +++ b/drivers/net/mlx5/rte_pmd_mlx5.h @@ -57,4 +57,49 @@ int rte_pmd_mlx5_get_dyn_flag_names(char *names[], unsigned int n); __rte_experimental int rte_pmd_mlx5_sync_flow(uint16_t port_id, uint32_t domains); +/** + * Minimum of + */ +#define MLX5_EXTERNAL_RX_QUEUE_ID_MIN (UINT16_MAX - 1024) + +/** + * + * + * @param[in] port_id + * The port identifier of the Ethernet device. + * @param[in] dpdk_idx + * Queue index in rte_flow. + * @param[in] hw_idx + * Queue index in hardware. + * + * @return + * 0 on success, a negative errno value otherwise and rte_errno is set. + * Possible values for rte_errno: + * - ENOMEM - allocation failure. + * - EEXIST - a mapping with the same rte_flow index already exists. + * - EINVAL - invalid rte_flow index, out of range. + * - ENODEV - there is no Ethernet device for this port id. + * - ENOTSUP - the port doesn't support external Rx. + */ +int rte_pmd_mlx5_external_rx_queue_id_map(uint16_t port_id, uint16_t dpdk_idx, + uint32_t hw_idx); + +/** + * + * + * @param[in] port_id + * The port identifier of the Ethernet device. + * @param[in] dpdk_idx + * Queue index in rte_flow. + * + * @return + * 0 on success, a negative errno value otherwise and rte_errno is set. + * Possible values for rte_errno: + * - EINVAL - invalid index, out of range or doesn't exist. + * - ENODEV - there is no Ethernet device for this port id. + * - ENOTSUP - the port doesn't support external Rx. + * + */ +int rte_pmd_mlx5_external_rx_queue_id_unmap(uint16_t port_id, uint16_t idx); + #endif -- 2.25.1