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 94791A0C47; Wed, 11 Aug 2021 16:06:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C3A141237; Wed, 11 Aug 2021 16:05:09 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2078.outbound.protection.outlook.com [40.107.243.78]) by mails.dpdk.org (Postfix) with ESMTP id E6C9D4123F for ; Wed, 11 Aug 2021 16:05:05 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SmqUru+yHZZKlNeJua/JQIAdEG2sj/LXm6+78st5ve1jfSdtJZGJV3Z3tGARIID9Ud5bhnqNgb3bUtHgmR0epefZZmX264/PiXHHEJVjQojthIILcweG8O8mD9YXwmhnM4vnecyNMVV7PTct5YwAm/eF2Co+FIaIq/xwNZp2nGGDNcbGTy8OERvbkv597QCEQtra+T/JOnq5UxByF/3+8xF0eQLSRFDtEYi9lnKf9xFa7x4z9efOu/18hUAvbQXwz6BXEcDY7+zC2RLYKPdNCRsd/09AI/LWdzHnRun/H0Hqt8qgPe8pF7pjBOcTlttneorJKOmHfOCjrQUj4IlsRQ== 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=aYZYwI3iMHUhLNd32q+D4TVcAbjC83WJefa93bpupdE=; b=C5KmxsWcW8gJtuyz+w+wSmey6HWjCUkKVLsVKFMzqb8euJtm1OoeOwJdV+8hscH/nEE4JjpD2kowHWHIdcxQmSqdf8eSsx7CLZ5nEnNYd1G0uthu9W7N5uoh1o/oqmWf7aWV1TYDvglowmrgzwlae3nJXgxn3CmPxVaOAsTdnvooCjwaYOQ+jAcHu0MsFoo09U6N9NDJXPXDiGdZwsW9Wnq9dkah+pvBpNQQ4R+2YsbPWCely0GNjowww/X23IfCuQswEBDE/QNcum4r0a7HuzY6NyqpWus99qbl41ik1Fk0sTd5gC3efq9dal8k5ZxgvC0LwoZTXFwiy6c/dE/UIQ== 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=aYZYwI3iMHUhLNd32q+D4TVcAbjC83WJefa93bpupdE=; b=HY0c/R194Fea1ogZWAvXBXrHpNHfd/hgEA1SpyKewwLqwn74MCKytb7DIdSHWbS139+dm4MZngDgIcE3tdEQFZvsYZ7+XOkvhxiB07b7oigq112hCN3vlhngYnbBQ49CQiiKSsxZf2eO8+LL+Y+rcRG+p03y8rGs86E26PUqx41TtZQRk9gMUX1hmUwMhOAbyycsLAoa+g3cDQMfr43zgQv29bvmwqzkZhDu3UiRG/SkOBrhLp9JrXCKmJAskLZ4TbCAsY11Nh71emgWyJDuqp/736TeCThAop81H3pGequL5qwNltUFbieYXT9f2PsBL0M0xtjzrXv2H85vREAFSA== Received: from DM5PR20CA0033.namprd20.prod.outlook.com (2603:10b6:3:13d::19) by CY4PR1201MB2551.namprd12.prod.outlook.com (2603:10b6:903:d9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 14:05:04 +0000 Received: from DM6NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:3:13d:cafe::af) by DM5PR20CA0033.outlook.office365.com (2603:10b6:3:13d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 14:05:04 +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:04 +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:02 +0000 From: Xueming Li To: CC: Xiaoyu Min , , , Xiaoyun Li Date: Wed, 11 Aug 2021 17:04:15 +0300 Message-ID: <20210811140418.393264-13-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: 915c37e2-9fbc-4d68-dd44-08d95cd1048a X-MS-TrafficTypeDiagnostic: CY4PR1201MB2551: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5BZzHHsbr5Wc8jPTKqGPoSBZxbCLuhgQY9N/fyKAKM4JmYEIUe4JuHO1jS3MLjWuNRSmhE8MVkEu/zNMB6idujf+lqG/GXCewSrkv4NX7PWeGxtj+DEK6yItrP/T3F6SKQYBzfxtmIEBcuLwZnbMOUEoJMEhZJM9TvH6R5rTxuorNeFJwrfrJatsuZbRAey0shSBUgxKWaME4pd1AMCrC8myId5tj9bB28gv8dQxMzezyHyTSVQvUqAL0zTXCrh+lo3nYiQwS/l1ZY+Cqo0UE0Bo/r1cL8JaPr4evxypCyPBc8p4U8Ejxj+vkWhk9fm9O+gMpVkocTLUfQLMxRo87SilKmDgr79zFIY6WAgvA5b1mUhp8/aFyxKOl6ikINoBopfec0/omtAYdANqAvzVbu2pD3BagEisFH8cwv7gDw/7yTaVR/4knIlc4d0hYUttDeyBM4KcoSZIaIiVOhCmHGXPx/PHq1BSK8nvXKy4hCu9ro9VjDYcLW+ulqZADcDvq7vUA/FUyMKdzkPg8dcrStVhFh8qpLgxWX7yGonitrEh5hFJaUrEp/i5r4ogEq5Und4yyz5MfDaoTIJbb1Zlo9mG135hP5kLFszoLAVjS0yHMOMeqJdtemW1KYYJWodPYCgrUEQqgtGaLmSdyO7GJbpgB2Ev6JSY3FyvEhEIfP9COOjrXhSD8KP0UzJEVY+vlrRVxa46ochc8oMRJ42tzcsETvRqF3QqVTX6NP1jWhE= 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)(396003)(346002)(376002)(39860400002)(36840700001)(46966006)(36756003)(86362001)(36860700001)(356005)(82310400003)(54906003)(478600001)(55016002)(6286002)(7696005)(83380400001)(2906002)(8676002)(47076005)(8936002)(316002)(109986005)(6666004)(36906005)(4326008)(26005)(1076003)(7636003)(2616005)(70586007)(82740400003)(70206006)(336012)(186003)(5660300002)(426003)(16526019)(266003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 14:05:04.2696 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 915c37e2-9fbc-4d68-dd44-08d95cd1048a 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: CY4PR1201MB2551 Subject: [dpdk-dev] [PATCH v2 13/15] app/testpmd: support shared Rx queue for macswap 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/macswap.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/app/test-pmd/macswap.c b/app/test-pmd/macswap.c index 310bca06af..daf7170092 100644 --- a/app/test-pmd/macswap.c +++ b/app/test-pmd/macswap.c @@ -50,27 +50,13 @@ * addresses of packets before forwarding them. */ static void -pkt_burst_mac_swap(struct fwd_stream *fs) +mac_swap_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; - 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; txp = &ports[fs->tx_port]; do_macswap(pkts_burst, nb_rx, txp); @@ -95,7 +81,15 @@ pkt_burst_mac_swap(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_swap(struct fwd_stream *fs) +{ + return do_burst_fwd(fs, mac_swap_stream); } struct fwd_engine mac_swap_engine = { -- 2.25.1