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 914ADA0C47; Wed, 11 Aug 2021 16:06:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4540341249; Wed, 11 Aug 2021 16:05:10 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2077.outbound.protection.outlook.com [40.107.93.77]) by mails.dpdk.org (Postfix) with ESMTP id 6C1664123F for ; Wed, 11 Aug 2021 16:05:06 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GPG27pJKGhwOMooeaqda620iLYoj/jTZ0A0RDfcgcFWwyomQj1bMgkInV3WOayhOZJWP0u3nnzb503OaJvylYa4JkBH9TQb55dEg6Ucl1Ks64FmDWCCRheA7zmdBqyyzKyBZ6RB8IjTUdr5yjmNAQ2kMcyYABZt2ljer+bi3OiszzMdQG45UN3JtTf43ZchlNfY++uOQaq4DU0gqsY72H4mKflOJs4ZnSsxrbrW0hjs2sS3zl2XaXQWs9QKzd6yDObY8nUZia0HlP6dFUdwAtdlIMCMOxczRMTKLWgHyxQD9TPuWy5L/y4cmKtSXWzpZKY4KoqR428tE9svSVTvjWQ== 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=mvmXV6iyqjP9ispjqgCSEueLk41DjYYZt8r1Fdf5EtI=; b=iC2HwC/Y9VXR1bfY2Kg4qns/lCKJKwwnLA9B1MGR65MhYOGDpFoT4sNpn/4h8iBWifi1DQJkFuYBZ6I2yJL7XA5XekggLxcWSJJAHnl6/yTsjfj0l1NhCmylJljPlDheFnkdt7rGFCn2s6KVg80LANqRS+gb/cd6fTMzRyITL1WDWC674Bhr1U+ifDXffmVVoAPzUmPVNJ11rkshUJHRaT9unZhZ6+/iGuMuhrBTEaC+uK9/0S2cjl1b7nd9vzfeutcHcceHq/QmaUuykpOP+jPfWAcSOE6VVKe5Js8obfNzKN0PfKmJrSXgON+aRheNMe987jkRzlv0JLITdR3BvQ== 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=mvmXV6iyqjP9ispjqgCSEueLk41DjYYZt8r1Fdf5EtI=; b=HljjHYG2CeB8SUHAQT/HS6W3S+DaT8VgWlQ1LfVaiXHRKCQdzOpkoGg234/VEDFFm/J/kvGPYzl5/sW4lbFMJydqIV3y6LWDd8oQmSPl1KRaDtvLSTXLkLo0mr0vZdH6mcsy3V0upAKM5iFmwR+9auuyWesbfclc6X6ONh+OAEaSG8MlLRbr02qEFBYXZsTOGpSX0FU2MQHTznme/1Du9IysjEQ8SB7B81G1FEXpaXZ6GS3657wWxatFYfzPHmaj3FDeqs35bsbRzyDaowz2vFKY4Uvd3DHSwSoxv/P9BBXuj9vPOYqwA2ghVpONHlDUDIcsS12AwAt2JXS/d3Sv5A== Received: from DM5PR20CA0046.namprd20.prod.outlook.com (2603:10b6:3:13d::32) by MN2PR12MB4437.namprd12.prod.outlook.com (2603:10b6:208:26f::17) 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:05 +0000 Received: from DM6NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:3:13d:cafe::1a) by DM5PR20CA0046.outlook.office365.com (2603:10b6:3:13d::32) 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:05 +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:03 +0000 From: Xueming Li To: CC: Xiaoyu Min , , , Xiaoyun Li Date: Wed, 11 Aug 2021 17:04:16 +0300 Message-ID: <20210811140418.393264-14-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: e547e3b4-67b0-43e0-f3c4-08d95cd104fa X-MS-TrafficTypeDiagnostic: MN2PR12MB4437: 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: mRBv6MQje97jINLcAjyFQ1R3KyDw+QbWvx0s4vJzmKz6NWv0L8T4gNgufNRjpIJ1Z/yFmOo/UitLp4S6ierBzPVAGXeJUApIokDob5jYoqrZDLXpoo4CYsxzWIvwPra1Owgz38MNXJpRcVH+50DbUTn9gzX6ZeaYvdgSMjgznL/6TmcJvS2r3i9HhGYRpBZFOGLPlLjWe8VzJ6Wv4/1FGyN0mdo0PBlM2+9O/x9+8Wyw9aPp3lFDglsDEfLTzzmy3w9fZsisHchVv02FjUXOgg9bPO3XiRprusjbcGaUOCkJ342WRvBAGfWYUihm7+pevOYrXYFUi7uaEw3mZ1xF18odqyqMOIxx2qOjt5M9OlaIB8AQMWpqST1mq6xO45Uq5ugBxtONW/AznvnGSvYzMx2+5d4c7JuvkypBrLDj4mBIKMSw0yK0BgwY9wCCrxorWFbpIf9blPZ61Yesr6UDyon4/H8di3cn5MkdHpQu6ib2vyF8vdN94wl+hO9sf9kUDFcEoQHCh+omg5cMVKB9e5dNd+CCC3RR/jm1foRgtw9PbKs50sYQmrTCh6p15VRfnrZ7BheZCZzrhKIeYChwr4p80l6wfrY7FB20HI6Q04Go+dul0SYZEoZdTrh60xeZ3b/kUsQCaBoUveoE2326iu2naBpqwI2fkWwencXcXz8Ap7AQxSCHzXEPX0rcWFD3uckcyW3YnzAttZoJcXz5YLmVG2I/CohadkNWeTt7gXQ= 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)(36840700001)(46966006)(83380400001)(2906002)(336012)(36906005)(82310400003)(7696005)(36756003)(316002)(6286002)(47076005)(26005)(2616005)(508600001)(1076003)(55016002)(5660300002)(6666004)(7636003)(70206006)(8676002)(4326008)(426003)(356005)(186003)(16526019)(54906003)(70586007)(36860700001)(109986005)(86362001)(8936002)(266003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 14:05:04.9802 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e547e3b4-67b0-43e0-f3c4-08d95cd104fa 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: MN2PR12MB4437 Subject: [dpdk-dev] [PATCH v2 14/15] app/testpmd: support shared Rx queue for 5tuple 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/5tswap.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/app/test-pmd/5tswap.c b/app/test-pmd/5tswap.c index e8cef9623b..236a117ee3 100644 --- a/app/test-pmd/5tswap.c +++ b/app/test-pmd/5tswap.c @@ -82,18 +82,16 @@ swap_udp(struct rte_udp_hdr *udp_hdr) * Parses each layer and swaps it. When the next layer doesn't match it stops. */ static void -pkt_burst_5tuple_swap(struct fwd_stream *fs) +_5tuple_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; struct rte_mbuf *mb; uint16_t next_proto; uint64_t ol_flags; uint16_t proto; - uint16_t nb_rx; uint16_t nb_tx; uint32_t retry; - int i; union { struct rte_ether_hdr *eth; @@ -105,20 +103,6 @@ pkt_burst_5tuple_swap(struct fwd_stream *fs) uint8_t *byte; } h; - 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]; ol_flags = ol_flags_init(txp->dev_conf.txmode.offloads); vlan_qinq_set(pkts_burst, nb_rx, ol_flags, @@ -182,7 +166,15 @@ pkt_burst_5tuple_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_5tuple_swap(struct fwd_stream *fs) +{ + return do_burst_fwd(fs, _5tuple_swap_stream); } struct fwd_engine five_tuple_swap_fwd_engine = { -- 2.25.1