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 22FD7A0C47; Wed, 11 Aug 2021 16:06:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D0B3241241; Wed, 11 Aug 2021 16:05:06 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2068.outbound.protection.outlook.com [40.107.243.68]) by mails.dpdk.org (Postfix) with ESMTP id 5E4A141233 for ; Wed, 11 Aug 2021 16:05:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HRnMFXKlSeMls2nHNFXp3iUbnbJvYerSheYxH/u480qQBOXuOymrXYMQTpuLhDPepoLlMgFMuvUHttOydmhJQtk8KNk1rd+B0x5U/zNtlr0eRLQGizymKNd8eHTX8cB0m54c1wmHFAT4ieao9XtfYr84mcVNU3fgN9NnKts6EMThOXuRJXYTW/pNC8KDcJcDcJb6w40VblBOuAvVuz2602vG9mG2nL3EpGPB0xZ/W5EzNo7a5PqqYKpjzho1iaNQvizMl0oPx/NGoW6SZV9Ig3WrLIp7z9ZsdKntnqu/uhSHC0qL+M2GqZtpp3/1cVFqRPiFRvp8+VUhfAgmAoX1wg== 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=WPiYwGNYbWPNrctaSOAbN7mgLD03YIg2G6XeuYPvKCQ=; b=C/+yycTN4iWHgO5LiXuxBiEjMMUhudhFd9KpeMg3EAGj4v+ywceescanSV5ecge0ByNMnuwn/lB/1dzJb+5BM6eZQ7vozeQym0yaLsf4UlkGjGP2Rv58MWIC+THddgEQAGk+c1AX10kz+YEbnsts6TLYhJsUH27NIhQAwi3Bv7Vznrj+I1USzyxylCIVZJ2e53vlmmZtcTClMNdFMDlZ+PU6A3iLYFserMRzdeZAkWck4+wFPQrl4FUu1xFh7Vj6BHV9ahoEP8iZxCjOxXQID/hv7zseiLK0SKvdZgN4sPOaznb81xpZAseOGWkQb4tWETB1Pa65X5pDcxpHrQK3YA== 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=WPiYwGNYbWPNrctaSOAbN7mgLD03YIg2G6XeuYPvKCQ=; b=Zlzp5fBy85x2acmLBSQMs5G7KjzxikrAAS0NS/4PjTEEPI12k/oNTcXHVkagtiwbSzWzAmNPDPQ3iwDgH7WvrLJkGj5VcAjzB7OV/QYhnan6bcQc90wITK5ZV0jxf/QUt6+EabjnwSCTMmnBk42rGJja6Lz3vEDhpzcZJqJLmrmlT8eRy9e2io+doUDqvdCMPCn3KyW/JIeIT0XddvKOAmPUYQatlY7Ojvm4/U4KCL2oOwwXXEcm21m89xDXfmPCRxxze8gKMFHrLoiy4KmQB54jH+o+95KqB954PIKzQKoHVcU+EMCCPr8KUAoqTSHXLWyO09Ho9Y6sGMeuHqECBA== Received: from DM5PR20CA0037.namprd20.prod.outlook.com (2603:10b6:3:13d::23) by DM6PR12MB3721.namprd12.prod.outlook.com (2603:10b6:5:1c2::18) 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:05:03 +0000 Received: from DM6NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:3:13d:cafe::89) by DM5PR20CA0037.outlook.office365.com (2603:10b6:3:13d::23) 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:05:03 +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 DM6NAM11FT010.mail.protection.outlook.com (10.13.172.222) 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:05:02 +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:05:00 +0000 From: Xueming Li To: CC: Xiaoyu Min , , , Xiaoyun Li Date: Wed, 11 Aug 2021 17:04:14 +0300 Message-ID: <20210811140418.393264-12-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: c80f5cff-ad4a-4702-30eb-08d95cd103c0 X-MS-TrafficTypeDiagnostic: DM6PR12MB3721: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kuxrCX20m4rfqLRl7SR9i9qyXRSGRHpNxglq34FT5FuxiSNFyRDi05bWY5hn3gU3LtMEv16l4kOuhkysdXfkB3hdYtsa5mHZJB4UeV+94fp75J/3ZCtrAok99Jl0qwpxz5HQp85B/xtgF2Sk/8CSxGF8CjqOqOAefz1xmvnEwr0/CEuuSw3Ff0lNVa5waZXMSU/n+qa6TN6PUJ4PWxNH+Okc6HAzISMad9r7GOtN4HPxHXAhQo2fxsfI2rlGrkFE9wtww1Q/LI6Z5FvaGxmxxen3hcLceCHPJzvmQ38d1mxiAcwSpJ1Ald1kKtw3vJpeErJ5uB7Z8JQXrE4sn/Hyl5d49yuBayztiWlCC7nyZJnVqMUL3Ov2gSNOhheIv/s0ml3aIyevpInqf49XpNKfXgzJBcA7NJJe/Y9wAEjpJdYTyY6JFvGY5nrRCsvFqZobOklqoTak7E/FCVlQyX51XQ3o4iLHH8IBdm4vg6HphNCeVJw9XESssq+2h7xAiS1/k2J51SEG6RNrw4plyvWUKvVkhGgHbgYovUu+JGbP2Df+8lX9fOiZte5kfJFJFpq15MXA2QJkGrB7l68CoqsWWOVkomIc8Vic5uoGTX5YLaFZU3/t+D/JjZ8kKE1t2u5HX1ChS8ex8fqk/WCR81852gWr8T8bgy3axBHygLIdzW1zLyJeQ22kMAor4GU+jM5e65mEkI1FRXY8FEzSP3UUS8se/F6N3jhGnNgLcTXfRFk= 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)(136003)(39860400002)(396003)(376002)(346002)(46966006)(36840700001)(336012)(1076003)(26005)(7696005)(478600001)(6286002)(54906003)(83380400001)(86362001)(2906002)(426003)(356005)(8936002)(36756003)(36906005)(47076005)(109986005)(8676002)(316002)(7636003)(82310400003)(55016002)(82740400003)(186003)(36860700001)(16526019)(70586007)(2616005)(6666004)(4326008)(70206006)(5660300002)(266003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 14:05:02.8084 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c80f5cff-ad4a-4702-30eb-08d95cd103c0 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: DM6NAM11FT010.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3721 Subject: [dpdk-dev] [PATCH v2 12/15] app/testpmd: support shared Rx queue for MAC fwd 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" From: Xiaoyu Min Add support of shared rxq. If shared rxq is enabled, filter packet by stream according to mbuf->port value and then fwd it in stream basis (as before). If shared rxq is not enabled, just fwd it as usual in stream basis. Signed-off-by: Xiaoyu Min --- app/test-pmd/macfwd.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/app/test-pmd/macfwd.c b/app/test-pmd/macfwd.c index 0568ea794d..75fbea16d4 100644 --- a/app/test-pmd/macfwd.c +++ b/app/test-pmd/macfwd.c @@ -44,32 +44,18 @@ * before forwarding them. */ static void -pkt_burst_mac_forward(struct fwd_stream *fs) +mac_forward_stream(struct fwd_stream *fs, uint16_t nb_rx, + struct rte_mbuf **pkts_burst) { - struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; struct rte_port *txp; struct rte_mbuf *mb; struct rte_ether_hdr *eth_hdr; uint32_t retry; - uint16_t nb_rx; uint16_t nb_tx; uint16_t i; uint64_t ol_flags = 0; uint64_t tx_offloads; - 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; txp = &ports[fs->tx_port]; tx_offloads = txp->dev_conf.txmode.offloads; if (tx_offloads & DEV_TX_OFFLOAD_VLAN_INSERT) @@ -116,8 +102,15 @@ pkt_burst_mac_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_mac_forward(struct fwd_stream *fs) +{ + return do_burst_fwd(fs, mac_forward_stream); } struct fwd_engine mac_fwd_engine = { -- 2.25.1