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 D9679A0C41; Thu, 30 Sep 2021 16:56:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2888D41143; Thu, 30 Sep 2021 16:56:51 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam08on2067.outbound.protection.outlook.com [40.107.101.67]) by mails.dpdk.org (Postfix) with ESMTP id C8FBD4113F for ; Thu, 30 Sep 2021 16:56:49 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WBee5/ZFX+ajYLrOi5vpQkYAA37B5HiszeqVyl2gyc6DPyuvI7G23d1zmGcMQCodAC6pDenlOFxYPTap6wSGxatM+F4rhGuVzbH79CV5C4ElkKkalWgSOFkgpJHACbE/apN3sDGCTvILPVaRoAzcoBskW91jFq00RN1bdNeKAEg/+xTgFqvkgHwdSdTbqne7moNqLjd+P07aHrzchcED4IHRotKT5jGJO6bZrcAteOwINh+SxrV4hprlGc0DTi6P1A4pnx0Xe3rLXoxyfBynVUzg8SROtJkpZbcuggjIUajLGxDrgqbLni3ut7uGRadOQe1gXHwXEOc9HYpl3mXLiA== 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=3OhYUn5WctKk0TMKHae38iZkJXg1j2vW9DA38clRI98=; b=Jx86yXlkJBkYRcQ3K9mbgrnbidkUcgMH0tSyTp6qLogeFFlpJ5DxxRcPD2SzbCL6sf4Ldw0114Jfdx9xGtAlxx8PCJf2pFplalGktdkWBJKy79FPbNvuy1Lsy+xEvqJyXNv73PKEUmKft0VH8TDj80TPYP2bmLDeLQhHGgf/zmRm1sc5YXkZ4rQqscuCSiXYvwv8APYTCFNBnR8upnEGGY0K3W1+Ccva+uIAEzNxqxVq6YseFK7ih1OauoHHwZuAAIIPKhyP0jr8yLjRQBUOb4IqUkK4QEvXNUCXJ2Yc6AmoRxYbpSa7FBbhiQgEdUNQ9+fcOKqr06aoIBpmXHDuUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=monjalon.net 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=3OhYUn5WctKk0TMKHae38iZkJXg1j2vW9DA38clRI98=; b=btLzArL8B84uVQJlfcHH1GmbSRKpIAoqKunHwke/xBIrLWmy5dhhVXJdrbSuggUFDGEM7jy9IUPNdMAMdgi/JNdnhaDFTrX7uWk6lSyjQJCaoXgq4sn0GHfU3XgKvRmI6TZIkV3IgFLAVMrCb0ZLz4M/RAeAL3NjT5XQTdimBJVjJmJWdKoFxLASqo4UuppNl0AFhoU4szG+OC5gFus7Bpei+1x/PWeF+E7FpjsLZir08cEWjEm8iH/nZkPo3/CB5rLBplbPPPZprPFNpzYlto7aDC8sIR2+hhU0uW9QY1ee/h8fc0Y1CdNjcTVr97EQlc+Vn228DA+7Slt/o87aRA== Received: from MWHPR15CA0060.namprd15.prod.outlook.com (2603:10b6:301:4c::22) by DM5PR12MB1195.namprd12.prod.outlook.com (2603:10b6:3:7a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.16; Thu, 30 Sep 2021 14:56:48 +0000 Received: from CO1NAM11FT066.eop-nam11.prod.protection.outlook.com (2603:10b6:301:4c:cafe::71) by MWHPR15CA0060.outlook.office365.com (2603:10b6:301:4c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Thu, 30 Sep 2021 14:56:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; 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 CO1NAM11FT066.mail.protection.outlook.com (10.13.175.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4566.14 via Frontend Transport; Thu, 30 Sep 2021 14:56:47 +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.18; Thu, 30 Sep 2021 14:56:44 +0000 From: Xueming Li To: CC: , Jerin Jacob , Ferruh Yigit , Andrew Rybchenko , Viacheslav Ovsiienko , Thomas Monjalon , Lior Margalit , "Ananyev Konstantin" , Ray Kinsella Date: Thu, 30 Sep 2021 22:55:58 +0800 Message-ID: <20210930145602.763969-3-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210930145602.763969-1-xuemingl@nvidia.com> References: <20210727034204.20649-1-xuemingl@nvidia.com> <20210930145602.763969-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 HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b524adb6-419c-43cb-7294-08d9842286e8 X-MS-TrafficTypeDiagnostic: DM5PR12MB1195: 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: a9nepMT/aGAspOvBamoCMieiLi9Opizm92k+u5X4juSlyfEyIjElAKDo8mvUAMdN5jY+BUDs97mE1oL+wAJ579LwuhVMp/yHoZrJL9NoJ6SeV4zvoQA61Zwtt7wyH4/xzLjyfa4snfdMzOSOcqHL5gO5N4NvL98XDi8LRKIit/VTy/nxewQm7ZgD7hZ08WChHqNT2NsdBhkb+jZPTIl7nxobXRnjq6oPa99wAKhwtwDcX8sJ59V4lgZH0bxFELrrBANWDoMKGFhG9ySgm0Q/wLzXWyMGAcU7QmdacQU7Q/J48gpZ99kbI+AgzFUPoUXPpVtgg2SYL9m5FMVbtS6G9tVHuyGT5UCHUzwv53t42CI8bp4syqLAR1Vz8I54q+v8QKoJJW+dBn76okmGo8AgWOagvfk24H3ozdJhfpkobVXs8NvnkxldK9qv3P9+MEzDjkxb5AoKYB5LiPA/ev82Zvz9yvKtbOqE2MIruDxZPPXUCQPMmWba460A9oKjNtkEVTjgaWmWNat7siG6s+GjXLumg4thohNC+/qZy4Q7nxzXlQzceK1yODHXbGKzf/MXatNXHnb43L2h4eroXcO0qWwPOBNk4pakek83B5cxU2RRFFEMqPheBFUkTsk+vPk3W1NGFy1ZX2hyNrEVdPE3QtjxX6rpXKkdsT7wd7TLVWrx18iRjgGBW/2EpsNgA+LCJiKRWDs0jlFGj5YAUPlGdw== 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)(8936002)(86362001)(7636003)(55016002)(6286002)(8676002)(36756003)(508600001)(5660300002)(2906002)(36906005)(83380400001)(356005)(47076005)(70586007)(70206006)(316002)(6666004)(7696005)(1076003)(16526019)(6916009)(336012)(2616005)(426003)(26005)(186003)(82310400003)(4326008)(54906003)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2021 14:56:47.5641 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b524adb6-419c-43cb-7294-08d9842286e8 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: CO1NAM11FT066.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1195 Subject: [dpdk-dev] [PATCH v4 2/6] 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 aggreate ports among same shared Rx queue group. Only queues with specified share group are 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 2f0fd3516d8..88c7bd3f698 100644 --- a/lib/ethdev/ethdev_driver.h +++ b/lib/ethdev/ethdev_driver.h @@ -782,10 +782,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 uint16_t (*eth_shared_rxq_aggregate_t)(struct rte_eth_dev *dev, + uint32_t group); + /** * @internal A structure containing the functions exported by an Ethernet driver. */ @@ -946,6 +964,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 73270c10492..d78b50e1fa7 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -6297,6 +6297,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 d7ac625ee74..b94f7ba5a3f 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -4909,6 +4909,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 are 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 904bce6ea14..6f261bb923a 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -247,6 +247,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