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 65D6CA0C47; Wed, 11 Aug 2021 16:05:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8E8ED4121F; Wed, 11 Aug 2021 16:05:00 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam08on2055.outbound.protection.outlook.com [40.107.101.55]) by mails.dpdk.org (Postfix) with ESMTP id 2256B41212 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=Er2iG/w5idOuETWOeMNSf2E2r5CGqvmC/KIgeGhMfCXw4XwuVEtWBeXH5gDjMV7qFzgqKPDiJ71o/vOKo+GA350pW3w7GKTW1t8frXr38uvhxd4tkF4CO8mAQETp9LA6wuCkxo1QCuvPy219PbWHoyVz+TSIr75Ba9aw/dPL/NPeIfJF13PBwYSIvsfjiTmcuPt4Ubv+vZgl+CcBv6rZeoKNtFVSqkr6IP2ob2t2747ZrDwjgWfwOCj2B44RV376oDE3zvZBAM12aOvx9Xm7/wAjOQL/eKBTpmHUPBN3j2qBZyAsBPyj3JA+Z3iN1pp/wQwSHHdAkYSbXsyza53VCQ== 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=lG0+gFgASHKu4/xOgmiO0Ejyn3390quxGiNlnXxFIjQ=; b=S8HDSYXly98HYa38bfjjJxVhlMedxGZEd4prpZRA/f2BdICrS63S4rvxZKX/qDJOtYyESscMSINqwSfZk6CvMFJ2B64YGoBjzC74bV6Vq8/rCOMh037Cnsu+V9x8cqNMjQ0oL7u+kRI6CaOwaDD7BE1AjJTMnr89zDEcLEXN4c/mqNMeQbT7s9BqZ/icRI1Ba6fNs6bkg4TnGcn8CJE9YXuIAWmwOM4JvFG7em7bWmX9O+jGN61StNCPGtT/gbau4sDnMzbDKUmlI+530oilVa9pvuW7Fwk6vzlCL5mkeAeV/ywOxcUOuKtiZKcdmqeFypZQd9ZyzVskoCo3rU0YzA== 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=lG0+gFgASHKu4/xOgmiO0Ejyn3390quxGiNlnXxFIjQ=; b=gKOYm80vhGzOLICLUg3M3xiyG2/yXu+6j5WwaNIBhuL48DnfHs1DkHTxtj1aaq8kP8XoRIxdzKuurA9CI41TsY2UNuPBord3MVtFtDM6uH53YzLoPGnX0J4II6osxynTfxhmobJO+G3pfv6J/ErKE7655DJzXGFPq1nU/nlySBdD4eiiq1uw/ToeEWTzJ8nSpv66MeaQtoMpXUiyJTtdl3SUUE03o9uyaRab6FCNSZPX1zzj4H0lk3FKXmULqFQ7F9UpjZgarCnuZ/ANU+OYJVLu2jr+5x1xy3YrmCjng6gvK6c1HI1e8263GN8n0MBU3nURvo2dh/UiaV/cpnPSlA== Received: from DS7PR03CA0223.namprd03.prod.outlook.com (2603:10b6:5:3ba::18) by BL1PR12MB5238.namprd12.prod.outlook.com (2603:10b6:208:31e::12) 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:56 +0000 Received: from DM6NAM11FT034.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3ba:cafe::e1) by DS7PR03CA0223.outlook.office365.com (2603:10b6:5:3ba::18) 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:56 +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 DM6NAM11FT034.mail.protection.outlook.com (10.13.173.47) 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:56 +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:54 +0000 From: Xueming Li To: CC: , , Xiaoyun Li Date: Wed, 11 Aug 2021 17:04:10 +0300 Message-ID: <20210811140418.393264-8-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: 213d6992-089f-4718-a92a-08d95cd0ffe3 X-MS-TrafficTypeDiagnostic: BL1PR12MB5238: 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: 0848oZte1xTmqJkfbJ+xA8FTYYp0E890GOieAYVSit/tWuBh3UeWgIoRq3p1Yp7befBv3Ac9tGkYiipfn8N9im+TRb7nLsOUvY7JbgRqI9ukjLXOf/QNqF4C2uBsm8LueV8/uSecwfHeBvFy1hYbVrXiUcPK1fRcfSGu4dWcLwH6RZrMdETTh+P1A8K82cKFJwdkQdq6PWEZN3vD9nW/CwQKuLJYCcDy12dVfUBKJa13WidrGRuiX7miSzyLXLAyZCAXqc+0sNYMkQXCGcfQhIS/74ea+VWAIaSUAez3/VhMEtDbFbtmzVto/nPToRRawAIXQF+LzkhJ+9YRupozvDnyLlDLizZcekKPNUT02D3c5s9A1U2/rjUAWcY4nYelGT+5cbtKk80zxzdHY46pOZi383mH7sHCj4rSkqa9x1aJkHgndwG8iJA78O78dyvaRzSh+SXGebHiUggBlSH8Fc1HmHY1J243OT7xTeLnt5fk294eLcCe5/IPXlKGzA8nIn/9gj1AUB1zqH9ErUrI12/e73N86R1a4b741VCC+95wZyWpggbpxGsN3oRzq5NnzE08567fXmC8acXkfbBWxEkIK118ikWLJSr0RA/lnVcH9RLqLyp7I6aUEu3+skTYbiqc5gM80vsf0UzCqtZNdxebR2Np/X9kavvU2t0a53UpiQ/5b3NyFg4dcz/2gTlFpOO1uX/9NL6doptC/ba+40EOed3kCcCdbyB6PG42FLU= 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)(186003)(7696005)(4326008)(26005)(70586007)(5660300002)(36906005)(508600001)(70206006)(54906003)(109986005)(7636003)(316002)(8676002)(8936002)(16526019)(36756003)(2616005)(83380400001)(47076005)(1076003)(426003)(336012)(6666004)(6286002)(55016002)(356005)(82310400003)(36860700001)(86362001)(2906002)(266003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 14:04:56.4639 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 213d6992-089f-4718-a92a-08d95cd0ffe3 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: DM6NAM11FT034.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5238 Subject: [dpdk-dev] [PATCH v2 08/15] app/testpmd: support shared Rx queue for rxonly 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/rxonly.c | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c index c78fc4609a..80ae0ecf93 100644 --- a/app/test-pmd/rxonly.c +++ b/app/test-pmd/rxonly.c @@ -41,32 +41,24 @@ #include "testpmd.h" /* - * Received a burst of packets. + * Process a burst of received packets from same stream. */ static void -pkt_burst_receive(struct fwd_stream *fs) +rxonly_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 i; - uint64_t start_tsc = 0; - - get_start_cycles(&start_tsc); - - /* - * Receive a burst of packets. - */ - 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; + RTE_SET_USED(fs); + rte_pktmbuf_free_bulk(pkts_burst, nb_rx); +} - fs->rx_packets += nb_rx; - for (i = 0; i < nb_rx; i++) - rte_pktmbuf_free(pkts_burst[i]); - get_end_cycles(fs, start_tsc); +/* + * Wrapper of real fwd engine. + */ +static void +pkt_burst_receive(struct fwd_stream *fs) +{ + return do_burst_fwd(fs, rxonly_forward_stream); } struct fwd_engine rx_only_engine = { -- 2.25.1