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 9BA8EA0C47; Wed, 11 Aug 2021 16:05:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 07328411F8; Wed, 11 Aug 2021 16:04:55 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2041.outbound.protection.outlook.com [40.107.220.41]) by mails.dpdk.org (Postfix) with ESMTP id 47036411EA for ; Wed, 11 Aug 2021 16:04:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e4Eim63FUKk8T+uiwaKdEXXq6Fafa2ZJrvsug0j36s8mFd7n2ARa1d9T9AN5XN/uKpsnZqGIKImn93Cr6k6k50m9ieRNurvGb+y7I8KkJx5BKmiAMBq2zGSYChyLDe2z+3o0Q/WcM6f7su7SpbCOd8Y3OyJZhMKVvxNtSo60vONkynqryTUs89MfbWJT0i4hpF50ZzR2PMRDgaMjP0PDonjhRQ3GKKV4RrgEyvM2ZTKrrhTuZEf6iTQI7u93hA9btSnzXKWcP3JEWLaF1COoejHKfOeplt5m2e7s9rTD0KVaqgRXBQqGD+YDC0XqIcqhHICv7Di+x7NN15XKPQ00vg== 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=BtpzuZE0WhK1pM8y/kaXgoSXIMUtHtkaRYGu67sQ7Z4=; b=fQSeAGp5NTMKUW2V3B9QvLTjc8PkPgryUboo+06iagnmfjuJ1BPR/sHEnuhoCINiLW9cApp7K98HpaB6cQmJRei8VUJjyym/l/rRX7o11IsUMlRZXTy7D4roufGQsaj7P7AES/cARea37sEss4mIOq2qEyUwSMmhG15w53laqbKXgCy0xLvcvWFlWBY8gE9Yimb9tWwQhT1eKwSCB/e3osc2DDPfRIMz1B2ohTQke3BWGVrhwdQjGomsM9Buk2536EXol3MDFaw/p0JOKuIImlgOrQGm+xqtAdihfHufvEmE0CPmUyybLOHA1Tp5822k1kiN/dVJu+/Q9b7gOfA3HQ== 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=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=BtpzuZE0WhK1pM8y/kaXgoSXIMUtHtkaRYGu67sQ7Z4=; b=DOVQU6P7sRxXbIwmCL6+0uPxVXOjJoEhYDe+y69WM3TdSCndEaNKP8LF4sF9Z4jZQqC03IFI+JlJufqImTPg1XK80+NayikzAasKWza/u6BId5ajhADI4ksLGbSEf7OHVq9KTJp69KJurNJ59wtIGMQm9HmCYxIiOZ6QwnVXw/rsnCCOeBHFaall4GJ3OBZ67O+NbIT7+2S2vwMjwUfDdiWDs3idw2qnS2ECKHU/6XaR8JLhDRF8pOCItaNxTzxJfDgCHbnA8/AXintmZ61Mu2K/I2JEFPlY29cHU/juzHpdahGjNdNhdDHl5bQflFBNg5s37QRKmcykYFu+PDkFiA== Received: from DM5PR07CA0121.namprd07.prod.outlook.com (2603:10b6:3:13e::11) by BL1PR12MB5095.namprd12.prod.outlook.com (2603:10b6:208:31b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Wed, 11 Aug 2021 14:04:50 +0000 Received: from DM6NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:3:13e:cafe::ed) by DM5PR07CA0121.outlook.office365.com (2603:10b6:3:13e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 14:04:50 +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 DM6NAM11FT015.mail.protection.outlook.com (10.13.172.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 14:04:49 +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.2; Wed, 11 Aug 2021 14:04:48 +0000 From: Xueming Li To: CC: , , Xiaoyun Li Date: Wed, 11 Aug 2021 17:04:05 +0300 Message-ID: <20210811140418.393264-3-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210811140418.393264-1-xuemingl@nvidia.com> References: <20210727034204.20649-1-xuemingl@nvidia.com> <20210811140418.393264-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: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ddd2e9b8-1155-42de-8b9d-08d95cd0fc01 X-MS-TrafficTypeDiagnostic: BL1PR12MB5095: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sZ7TXKWqbYDMZtHNEgDngD7eQtkFFXvGB05fxndfqiBz4JcwHmawSg4igo0iexaSP/vRJI0S9H3o6KnU9bZ+InBpjgMs1klkNiNbaJ9KQLduE7FaPdUGwHIzwfOEhxBXeFgYl8YeZB6aIsJKejAtp8JeEdBaJjVIs8KHO3fskzalAop3Ldt4NTTSfsFHo5pgaGEUyH0ZcygP4q6vLJ3Ujg4ven4p/n5znOrPdC7Yq0lBxFZdu+9OR5pdQffrdEr/DWinroy6cXKqg1aNANVG70pz05jh/M8qGoZ/Zke/dhuQucBNeR3xathDJFwmkYYQpCbek2DbcfCITpCNlUylj71vm1i3nu/oLiDyyTWNvBlG/xFYT4G5SZW6+iX+DD36o+H9wmUTIccRIJFaGpEZhpHgAaO5Fxg9IhlOx5Wwh3lcxZQDfCJm+bh7EeGGvV2+knsZtMP/f/IVufJfuvcBO2b70NXpfbIiiQreqd3jUc+snXyh5KpTwYDIuK/c6XYhY5dwF7SaN6oVzb7IgUG+sgH8vVP0s2MScPe5sWNlhbzPjKnSI6CS1BG/Oe9N/Ptandba13LpJT5djlk8IyRYvuJqTa0/R2FZ2GME0cF8NUKOymXDxxTwkAKU/BiSPzhViEwo3kcbcAz8CB2t9bwgKptuWsHpyS8DB99qHAPZdW4pllPH+kOtS29ibAoo63ySZP/SNHuRFmV+iDgy7RdVc2xJGGELUhrG5vIMLtGHI0A= 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)(396003)(376002)(39860400002)(136003)(346002)(36840700001)(46966006)(2906002)(26005)(7636003)(8936002)(186003)(356005)(4326008)(36756003)(5660300002)(16526019)(2616005)(82310400003)(316002)(6666004)(86362001)(7696005)(426003)(55016002)(1076003)(109986005)(6286002)(82740400003)(70206006)(36906005)(336012)(83380400001)(36860700001)(54906003)(8676002)(478600001)(70586007)(47076005)(266003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 14:04:49.8019 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ddd2e9b8-1155-42de-8b9d-08d95cd0fc01 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: DM6NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5095 Subject: [dpdk-dev] [PATCH v2 03/15] app/testpmd: new parameter to enable shared Rx queue 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" Adds "--rxq-share" parameter to enable shared rxq for each rxq. Default shared rxq group 0 is used, RX queues in same switch domain shares same rxq according to queue index. Shared Rx queue is enabled only if device support offloading flag RTE_ETH_RX_OFFLOAD_SHARED_RXQ. Signed-off-by: Xueming Li --- app/test-pmd/config.c | 6 +++++- app/test-pmd/parameters.c | 4 ++++ app/test-pmd/testpmd.c | 14 ++++++++++++++ app/test-pmd/testpmd.h | 2 ++ doc/guides/testpmd_app_ug/run_app.rst | 5 +++++ 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 31d8ba1b91..bb882a56a4 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2709,7 +2709,11 @@ rxtx_config_display(void) printf(" RX threshold registers: pthresh=%d hthresh=%d " " wthresh=%d\n", pthresh_tmp, hthresh_tmp, wthresh_tmp); - printf(" RX Offloads=0x%"PRIx64"\n", offloads_tmp); + printf(" RX Offloads=0x%"PRIx64, offloads_tmp); + if (rx_conf->offloads & RTE_ETH_RX_OFFLOAD_SHARED_RXQ) + printf(" share group=%u", + rx_conf->shared_group); + printf("\n"); } /* per tx queue config only for first queue to be less verbose */ diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 7c13210f04..a466a20bfb 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -166,6 +166,7 @@ usage(char* progname) printf(" --tx-ip=src,dst: IP addresses in Tx-only mode\n"); printf(" --tx-udp=src[,dst]: UDP ports in Tx-only mode\n"); printf(" --eth-link-speed: force link speed.\n"); + printf(" --rxq-share: share rxq between PF and representors\n"); printf(" --disable-link-check: disable check on link status when " "starting/stopping ports.\n"); printf(" --disable-device-start: do not automatically start port\n"); @@ -602,6 +603,7 @@ launch_args_parse(int argc, char** argv) { "rxpkts", 1, 0, 0 }, { "txpkts", 1, 0, 0 }, { "txonly-multi-flow", 0, 0, 0 }, + { "rxq-share", 0, 0, 0 }, { "eth-link-speed", 1, 0, 0 }, { "disable-link-check", 0, 0, 0 }, { "disable-device-start", 0, 0, 0 }, @@ -1256,6 +1258,8 @@ launch_args_parse(int argc, char** argv) } if (!strcmp(lgopts[opt_idx].name, "txonly-multi-flow")) txonly_multi_flow = 1; + if (!strcmp(lgopts[opt_idx].name, "rxq-share")) + rxq_share = 1; if (!strcmp(lgopts[opt_idx].name, "no-flush-rx")) no_flush_rx = 1; if (!strcmp(lgopts[opt_idx].name, "eth-link-speed")) { diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 6cbe9ba3c8..67fd128862 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -223,6 +223,9 @@ uint8_t rx_pkt_nb_segs; /**< Number of segments to split */ uint16_t rx_pkt_seg_offsets[MAX_SEGS_BUFFER_SPLIT]; uint8_t rx_pkt_nb_offs; /**< Number of specified offsets */ +uint8_t rxq_share; +/**< Create shared rxq for PF and representors. */ + /* * Configuration of packet segments used by the "txonly" processing engine. */ @@ -1441,6 +1444,11 @@ init_config_port_offloads(portid_t pid, uint32_t socket_id) port->dev_conf.txmode.offloads &= ~DEV_TX_OFFLOAD_MBUF_FAST_FREE; + if (rxq_share && + (port->dev_info.rx_offload_capa & RTE_ETH_RX_OFFLOAD_SHARED_RXQ)) + port->dev_conf.rxmode.offloads |= + RTE_ETH_RX_OFFLOAD_SHARED_RXQ; + /* Apply Rx offloads configuration */ for (i = 0; i < port->dev_info.max_rx_queues; i++) port->rx_conf[i].offloads = port->dev_conf.rxmode.offloads; @@ -3334,6 +3342,12 @@ rxtx_port_config(struct rte_port *port) for (qid = 0; qid < nb_rxq; qid++) { offloads = port->rx_conf[qid].offloads; port->rx_conf[qid] = port->dev_info.default_rxconf; + + if (rxq_share > 0 && + (port->dev_info.rx_offload_capa & + RTE_ETH_RX_OFFLOAD_SHARED_RXQ)) + offloads |= RTE_ETH_RX_OFFLOAD_SHARED_RXQ; + if (offloads != 0) port->rx_conf[qid].offloads = offloads; diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 16a3598e48..f3b1d34e28 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -477,6 +477,8 @@ extern enum tx_pkt_split tx_pkt_split; extern uint8_t txonly_multi_flow; +extern uint8_t rxq_share; + extern uint16_t nb_pkt_per_burst; extern uint16_t nb_pkt_flowgen_clones; extern uint16_t mb_mempool_cache; diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst index 6061674239..8a9aeeb11f 100644 --- a/doc/guides/testpmd_app_ug/run_app.rst +++ b/doc/guides/testpmd_app_ug/run_app.rst @@ -384,6 +384,11 @@ The command line options are: Generate multiple flows in txonly mode. +* ``--rxq-share`` + + Create all queues in shared RX queue mode if device supports, queues in + same switch domain are shared according queue ID. + * ``--eth-link-speed`` Set a forced link speed to the ethernet port:: -- 2.25.1