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 1122CA0C47; Wed, 11 Aug 2021 16:05:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C8E2C41224; Wed, 11 Aug 2021 16:05:01 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2075.outbound.protection.outlook.com [40.107.236.75]) by mails.dpdk.org (Postfix) with ESMTP id 7E70041214 for ; Wed, 11 Aug 2021 16:04:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hfZl3ltTljyinHl8wIPc9tjaZVSWk+ef3/m8bivK1ADxj8u7cqhBzxh6Hhs+H0Gq14IyTR0RekZ+bhfKJLtLpQrhW0ybbo+uSYzXz3PZyZZf+xUPZSofJV7Y7+zVVnRxDgQ3Ln8/IIaA3+mH6BFmO8+nDKLRLvm/qrymZ1Lt6IVmA+l95y+v9LEOBmTrYmOCsKtgrFRhwoPONjH4GpFoBPUv0JxXc+x2jBV9p+E6wIuf61042aiZ/VjCNb75w5ywZaurb1WL6bEu1YIyRroBe/9/pINmGPfqTOIZmm6gEGriqk5opcsnVfPDqsK2yF4Vgkz1UM9yDD4RBk0Znxe54g== 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=nNiaUUpHTHsqctVvgt1y/xkReyQZB3VMQamRuRZhHs4=; b=HsiMCVzmfTG65uG1Rw53/6xITTkiUMptpTpIj+1a/Q8wjHxJG18i+SLHd1fwxCBSb/Y/Zc5XMXPNZXTX8E+WUd8U1lbSGTpSrc9m68Ud5HzQb6xoJXb+kU8sFq+o/Qj8iS0oj39pNm3pZp4Rr8TzBJrpRP4SR0ntXOTALlNbzqouSA5Zw1MNgwnz8aw4AMqNLIuZ40ZBinjJwT7ZQOSG39RCw0JKJXeD3o1yfQnpK35ok0/EMF+WNe+LC2p/6tZNLWB1FH55kmMADdHLI3yFndiT3Iy8kUoeMLohmv4TqVlsf1EMyJSl8kdPYmBqsD1Bu4QuvjA/mgEkyy1DKVJuqQ== 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=nNiaUUpHTHsqctVvgt1y/xkReyQZB3VMQamRuRZhHs4=; b=AnvoFpgehSWoWxzv7oclUGl3mXB+PydaT5fRd+ZxAllXfvMtlPiZnrDZ0PgWyvAgqvgFk6j/VBBe4ajEPZOQpGEkPZyq302FQKBL9aJvD6paRiqiJPUK3jFJidA189mM/vy8gIuvUX66kL1EdjPVpyjjK/NKvb/Vyrc5xnxbVXi89/wQWxdFc7iaOpy5lFRDRjRvxEobJGm8DA2RRsSP8nDNxT3bTJHqgRK6K61jHt1lAG2gv9EYud1vjqsDtr0tRf8QSKkSN8kma9quWdoxfevDCAO23nScO1SVo9YZ7dfQ98+4SfaoCNmA9EwSANMkIXF4wTmdiEAcXkvkFkIIVQ== Received: from DM5PR19CA0022.namprd19.prod.outlook.com (2603:10b6:3:151::32) by BY5PR12MB4131.namprd12.prod.outlook.com (2603:10b6:a03:212::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.21; Wed, 11 Aug 2021 14:04:55 +0000 Received: from DM6NAM11FT064.eop-nam11.prod.protection.outlook.com (2603:10b6:3:151:cafe::c1) by DM5PR19CA0022.outlook.office365.com (2603:10b6:3:151::32) 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:55 +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 DM6NAM11FT064.mail.protection.outlook.com (10.13.172.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 14:04:55 +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:53 +0000 From: Xueming Li To: CC: , , Xiaoyun Li Date: Wed, 11 Aug 2021 17:04:09 +0300 Message-ID: <20210811140418.393264-7-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: 0b09c400-62d5-4574-79cb-08d95cd0ff37 X-MS-TrafficTypeDiagnostic: BY5PR12MB4131: 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: OQZ2ZNrIWi6aKIDJWGSgEJfro77PCFPSKnYakNHpi6an0dKRKIhAhOfkVNoIlojznH/uZR89WdFInFHUDQplLIG3kfd6wixir3/Xvhn2FcWYsbGHX6sqxwXS58m37GrX979XA2dxaCevpkdFQm8eORpnrKSgYGWCFcDESTKdNU3MSpln8QdsAScvveHjr5HmR317lyD3rB12/5ufhC3Rajkafsizo+uyIXSsNseHq7RiewLNKQSqPdbQ+BE94cb20jinhuUjMtyPEg1pyPt8/PDQaNpPdRxAtqEwjvn3lEHpZ+bQNqF8ciwvayk+95zWMLNXARCRaXuM/DMknGeqnJpOVe4uTNQP2o+cssoZ9IbRFJunh6khIh3csgMPbfnRfcYdNqtv6CiJLLLOBZIjJoM2ZUtBjRx9j1Tquchg8Ow7Q5CdVu/66detIzf1op313pq7bE3b81E6jy+UNxHFGtwKBSgn6TDJgO4VxY1O1fXug1L7ParlGcI/Ro9J+y/uxuha6MQ9t0NQFTOGYns7ebXbMqVXBzx5h7p8QaMTk4F3TqGaEzvxzhw0yvYxbmSOtg3a2FZb+bX1BUxcmjpj9WpP+EiKnKw+hC7/3PaSFbLmcO3bE261KeFznDwbzIC5p0vt/lwQgFQg4GPxhjv1eSXe144opBth4u4kb0Uluv10YIySOegruptl0LwPk5Ca9277NYDnLP3ZqesuQj/QH8P99peNq9SyQqgBnCMhnck= 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)(346002)(376002)(136003)(39860400002)(46966006)(36840700001)(70586007)(7696005)(478600001)(6286002)(70206006)(86362001)(82310400003)(83380400001)(36860700001)(8936002)(5660300002)(36906005)(1076003)(6666004)(4326008)(54906003)(36756003)(2906002)(316002)(55016002)(109986005)(8676002)(82740400003)(2616005)(7636003)(47076005)(426003)(186003)(356005)(26005)(16526019)(336012)(266003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 14:04:55.1995 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b09c400-62d5-4574-79cb-08d95cd0ff37 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: DM6NAM11FT064.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4131 Subject: [dpdk-dev] [PATCH v2 07/15] app/testpmd: support shared Rx queues for IO forwarding 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" Supports shared Rx queue. If shared Rx queue is enabled, group received packets by stream according to mbuf->port value and then and forward in stream basis as before. If shared Rx queue is not enabled, just forward in stream basis. Signed-off-by: Xueming Li --- app/test-pmd/iofwd.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/app/test-pmd/iofwd.c b/app/test-pmd/iofwd.c index 83d098adcb..316a80d65c 100644 --- a/app/test-pmd/iofwd.c +++ b/app/test-pmd/iofwd.c @@ -44,25 +44,11 @@ * to packets data. */ static void -pkt_burst_io_forward(struct fwd_stream *fs) +io_forward_stream(struct fwd_stream *fs, uint16_t nb_rx, + struct rte_mbuf **pkts_burst) { - struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; - uint16_t nb_rx; uint16_t nb_tx; uint32_t retry; - uint64_t start_tsc = 0; - - get_start_cycles(&start_tsc); - - /* - * Receive a burst of packets and forward them. - */ - nb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, - pkts_burst, nb_pkt_per_burst); - inc_rx_burst_stats(fs, nb_rx); - if (unlikely(nb_rx == 0)) - return; - fs->rx_packets += nb_rx; nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, nb_rx); @@ -85,8 +71,15 @@ pkt_burst_io_forward(struct fwd_stream *fs) rte_pktmbuf_free(pkts_burst[nb_tx]); } while (++nb_tx < nb_rx); } +} - get_end_cycles(fs, start_tsc); +/* + * Wrapper of real fwd engine. + */ +static void +pkt_burst_io_forward(struct fwd_stream *fs) +{ + return do_burst_fwd(fs, io_forward_stream); } struct fwd_engine io_fwd_engine = { -- 2.25.1