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 2827EA0C46; Fri, 17 Sep 2021 10:02:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4BB99410EF; Fri, 17 Sep 2021 10:02:25 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2055.outbound.protection.outlook.com [40.107.92.55]) by mails.dpdk.org (Postfix) with ESMTP id D00EC410EF for ; Fri, 17 Sep 2021 10:02:23 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PleNdwkSFmtEWhDQDhlAX896LOjL0FrmcBxWNysyMU+/RnVaXH2SptbPez1f+LrppCLkuvbqmtueSt1SWThvPE1dA2qQ0CaPkjA9dxTX54uba1AoBJfGqybSWHP0GuTIiSVKfDOTAolMXUUF9ic1xXbhiTZbW0J+noWaN2zCh3y+0Es8+SP6Si07rC+glAaYj3U2Ol0m9ApWGMN4WwIwh8Y9MwqirkHtHi1e1THm4EnwaFt4LIkh1y0/sEOx43+cH9agzYhzDjgbvLDGFjV0tadlmmJPGtOcwbSgsOiY0Y6+NnU66Rwis8cIm2Cb7Y+/RGAhAFfw1fYxPqJYVI6D1Q== 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; bh=xg48E+3Qh/QwdCB6CztKLzLgSNKkqjn6KF0f3OMVECs=; b=IJ+FBmR1rc5kVRfdDh+pmM5gklAuAdGFEDg5yDQa/9sUlaFWJ4WGBE+aOdnWe20sF0l8TQMs7Fj7cxOu/WNdjzueZqdwJRy81MJOF+jtZrfjU/WlMVqNWhzOklqUwjNrY9YLGqqiH02ZXFQlDOkMKoLzaa99EqHwsB7ADL0T+S+DaT1sR8iRmc3ewyXmsb7hLh0FtA4LEMq7WFgkURJgCWMV53o9luDwvHySe6+xXIUZDHi7cqOVhoe3BV0ISWhX4MZaW+KoXojqStv5UyH5FJsIhPFLw+kFyVdcbll2cVGtIM9YajSQ7P0anHOGLn+JyZDNZvDgTNBjv1g40K1paA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.35) 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=xg48E+3Qh/QwdCB6CztKLzLgSNKkqjn6KF0f3OMVECs=; b=j8APpc62CsPtStlA6VOqtqO5XaNu/WU7krQT2+eInS020dcEosZCYV1C+b2s/MGYD2gwkPBxRvQiS7pJUHrmM0iIP+6ajXhNVXF1vgUqKX/2msC+Ux7QG0DqK4yyzkLUqjt7bvY9ieZR+jcnrt9kEENiFW0oNtoMiwmQI6Z1RTVBLxG0BdiQAALg1zeESGJOHk52UJiddO1hvwT5bqC5obL/mKkFgDPUHSJ3sR50yN7Dae4JByKfpsaTzIw7rC6xhwWovJA9mYLiz59UUHZ6v/3a5sAWVFvZRc+pTcldmP355mo8XX7eRw41aaYTgkLBK84H7uCi9Iu5Dsyqr1Q9pA== Received: from BN9PR03CA0214.namprd03.prod.outlook.com (2603:10b6:408:f8::9) by BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Fri, 17 Sep 2021 08:02:22 +0000 Received: from BN8NAM11FT030.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f8:cafe::32) by BN9PR03CA0214.outlook.office365.com (2603:10b6:408:f8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.16 via Frontend Transport; Fri, 17 Sep 2021 08:02:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.35) 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.35 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.35; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.35) by BN8NAM11FT030.mail.protection.outlook.com (10.13.177.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4523.14 via Frontend Transport; Fri, 17 Sep 2021 08:02:22 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 17 Sep 2021 08:02:21 +0000 Received: from nvidia.com (172.20.187.5) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 17 Sep 2021 08:02:18 +0000 From: Xueming Li To: CC: , Jerin Jacob , Ferruh Yigit , Andrew Rybchenko , Viacheslav Ovsiienko , Thomas Monjalon , Lior Margalit , Ray Kinsella Date: Fri, 17 Sep 2021 16:01:15 +0800 Message-ID: <20210917080121.329373-3-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210917080121.329373-1-xuemingl@nvidia.com> References: <20210727034204.20649-1-xuemingl@nvidia.com> <20210917080121.329373-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e9081bf4-39d9-46fc-f18b-08d979b17a97 X-MS-TrafficTypeDiagnostic: BYAPR12MB2743: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SBD3wArXffL48Th7nZUV+VKZmxgdz+IBG/IPhq7gKy2V3ixFDGtzL49WwpwrqGBvWSlMUg0c0HAm0Rt/rKodDg7YADuw+v2z8y/Exg4DVR605VBQuewV3Kgy+Gt1IjpL7+7xUkJcEwZVsOOlm7hJMhZH+0wHmpsjexTIN0evJTMBgqONvNLXqPkdIwCzgBdD8v8m8TuamZXsKQ1efHgQ/lVWf+nYGOjP4nvAd0vT7qnJRjkbitgvzN35fAFIp4Z58qM62y7lZ5Adm2i2VEIhGw3CdfD3VD6/cnikeBoWg8tvldVVeYuVXjtageAEyadGgyk2FIm/UJCroFWtjU5xiao2Uon4wU+DKC9H5xZPqETWz8dxl5ZFm8gjVDDmWk031EiTgQPlKl6iYkTmaieEhcAqvKE81RWfNwvRzQaMV3LVLMH3S6M/77H0zh4ZCTIcs9WtLRrSF/vrtLEiCLqBJzENHOVP+jfavPqvG/cZJlCbAlb4UPr3dGGurpKHmPBpAIwbIEhDRo9v27SAO/nrYhtibClW6J/Lsnv9u0BdD3oCYFgdT+aYNi1KfVmpfo3m22wpeKrXzW3kzAFITpBU8cwDliofE4W9kS4dxumgjrdyEQO4OqOS3zLxW8mOx1O7PqgUnDYwYsUHVzaRKyYOtC563SVRSLmQDXeyKOheT6KGCjlpEACi9Muk9BFviAL5Y4UkLS2vIxPeMuEQIZRp0w== X-Forefront-Antispam-Report: CIP:216.228.112.35; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid04.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(6286002)(7696005)(4326008)(508600001)(83380400001)(47076005)(36906005)(1076003)(8676002)(54906003)(5660300002)(356005)(336012)(2906002)(186003)(16526019)(2616005)(36860700001)(26005)(70206006)(70586007)(36756003)(82310400003)(8936002)(86362001)(6916009)(426003)(316002)(6666004)(55016002)(7636003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2021 08:02:22.0677 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e9081bf4-39d9-46fc-f18b-08d979b17a97 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.35]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT030.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2743 Subject: [dpdk-dev] [PATCH v3 2/8] ethdev: new API to aggregate shared Rx queue group 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" This patch introduces new api to aggreated ports among same shared Rx queue group. Only queues with specified share group is aggregated. Rx burst and device close are expected to be supported by new device. Signed-off-by: Xueming Li --- lib/ethdev/ethdev_driver.h | 23 ++++++++++++++++++++++- lib/ethdev/rte_ethdev.c | 22 ++++++++++++++++++++++ lib/ethdev/rte_ethdev.h | 16 ++++++++++++++++ lib/ethdev/version.map | 3 +++ 4 files changed, 63 insertions(+), 1 deletion(-) diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h index 524757cf6f..72156a4153 100644 --- a/lib/ethdev/ethdev_driver.h +++ b/lib/ethdev/ethdev_driver.h @@ -786,10 +786,28 @@ typedef int (*eth_get_monitor_addr_t)(void *rxq, * @return * Negative errno value on error, number of info entries otherwise. */ - typedef int (*eth_representor_info_get_t)(struct rte_eth_dev *dev, struct rte_eth_representor_info *info); +/** + * @internal + * Aggregate shared Rx queue. + * + * Create a new port used for shared Rx queue polling. + * + * Only queues with specified share group are aggregated. + * At least Rx burst and device close should be supported. + * + * @param dev + * Ethdev handle of port. + * @param group + * Shared Rx queue group to aggregate. + * @return + * UINT16_MAX if failed, otherwise aggregated port number. + */ +typedef int (*eth_shared_rxq_aggregate_t)(struct rte_eth_dev *dev, + uint32_t group); + /** * @internal A structure containing the functions exported by an Ethernet driver. */ @@ -950,6 +968,9 @@ struct eth_dev_ops { eth_representor_info_get_t representor_info_get; /**< Get representor info. */ + + eth_shared_rxq_aggregate_t shared_rxq_aggregate; + /**< Aggregate shared Rx queue. */ }; /** diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index b3a58d5e65..9f2ef58309 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -6301,6 +6301,28 @@ rte_eth_representor_info_get(uint16_t port_id, return eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); } +uint16_t +rte_eth_shared_rxq_aggregate(uint16_t port_id, uint32_t group) +{ + struct rte_eth_dev *dev; + uint64_t offloads; + + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); + dev = &rte_eth_devices[port_id]; + + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->shared_rxq_aggregate, + UINT16_MAX); + + offloads = dev->data->dev_conf.rxmode.offloads; + if ((offloads & RTE_ETH_RX_OFFLOAD_SHARED_RXQ) == 0) { + RTE_ETHDEV_LOG(ERR, "port_id=%u doesn't support Rx offload\n", + port_id); + return UINT16_MAX; + } + + return (*dev->dev_ops->shared_rxq_aggregate)(dev, group); +} + RTE_LOG_REGISTER_DEFAULT(rte_eth_dev_logtype, INFO); RTE_INIT(ethdev_init_telemetry) diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index a578c9db9d..f15d2142b2 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -4895,6 +4895,22 @@ __rte_experimental int rte_eth_representor_info_get(uint16_t port_id, struct rte_eth_representor_info *info); +/** + * Aggregate shared Rx queue ports to one port for polling. + * + * Only queues with specified share group is aggregated. + * Any operation besides Rx burst and device close is unexpected. + * + * @param port_id + * The port identifier of the device from shared Rx queue group. + * @param group + * Shared Rx queue group to aggregate. + * @return + * UINT16_MAX if failed, otherwise aggregated port number. + */ +__rte_experimental +uint16_t rte_eth_shared_rxq_aggregate(uint16_t port_id, uint32_t group); + #include /** diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 3eece75b72..97a2233508 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -249,6 +249,9 @@ EXPERIMENTAL { rte_mtr_meter_policy_delete; rte_mtr_meter_policy_update; rte_mtr_meter_policy_validate; + + # added in 21.11 + rte_eth_shared_rxq_aggregate; }; INTERNAL { -- 2.33.0