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 6B23EA0C47; Wed, 11 Aug 2021 16:05:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 067304122A; Wed, 11 Aug 2021 16:05:03 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2055.outbound.protection.outlook.com [40.107.96.55]) by mails.dpdk.org (Postfix) with ESMTP id E81454120A for ; Wed, 11 Aug 2021 16:04:59 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EYLlY7SF9Jli/CIjodMPlhhvL2RGKxUBWpg/GOZXl9l/9PJvrQm5zg5klKUGUv0xD1BJhSuMyEQqP6jyhP6Es2nklwTr6ZPnZ1MGpm4sm9QedtMsXB7pr9WmKNuXuquR9F4nzuAQ/2Q9a0mkAqmgHzGCMmCiCokZP2V3aJy4XqLdJgpiGFker94r6+zEObW1e8z5ttxyWS6moFCBS5jpj3jLUaHoJOZ/RfY5DCsTh8oacgD/98hkjxzV8sMvycaI+CIKY03nlMkjbZXdSIcSd2C0onkjxwJ1/lPUPuyzq49ymvUVIDtWlBG6q8/Xj1QsGl2LYP2oF2g6nvwc6NEDpg== 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=vtiWh3rEGgdvTw2CueDZuidKATYnKjsdHz+L1tQhK60=; b=larY+Qg+S4EMKKr1Q+v+39v/886TUK5TQQZSZAJ1YpYAsoQk5G8pBH//uTARKF9o3IrAzaTZuFOHjeAkJML9xMLR7GEqcwF5oA+RbZERXtwE+STj1ouRlvR+ZtMsl+3YKGiv6fL+uMPB9AC44Rpbqlj/IuwM1ziDgKZW23zHQ4qWMqU0LlPnA7GASiTFQu+lfAsdhxzdZa/oU5tMMllnbuIeYxNEspnl6ClOY7hG3lZF2CYwmChptuf8OcJoM+OJLDxktW8Ks1iDweqNpIBtJUTVItrSZNpspjLO8hyrm6Ulp4V8S2oBC7kz9fCUxre2PFQshaxLvtPNiNTwh9T1Mg== 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=vtiWh3rEGgdvTw2CueDZuidKATYnKjsdHz+L1tQhK60=; b=EPUzMWVLXmxfOh+Kpy3OjyXTpl1qjnCIQ+zypH4LLzI1pDW562/FwiCcNDPIQaU2dCrPwh0/zsbMTR5mtTCWCk0Tz65dzfarx6Ku1ASuaNh5E81sSkCt/jrQ1nZNEBiQPD3zvquW09kuRn01+Euu9ExfmvtUqJk8aCxZN2Dn5wONlbf+O0Xc+UcXGanIsUxjz7+ukb61q5reAQw3bUvH8azA2HLUy9MxW5Mcif3LYA6Vn65EtmwOKj5GBOpvJvOYfCOvBfm2Xm1p/GxunlHUn6X5TvOihui+QXxfTaa9dsWt7qQMcLMTYyqA4NNfNrP0SYvRKMklj0SNXfLN1psuGw== Received: from DM6PR18CA0005.namprd18.prod.outlook.com (2603:10b6:5:15b::18) by CH2PR12MB3784.namprd12.prod.outlook.com (2603:10b6:610:21::28) 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:04:58 +0000 Received: from DM6NAM11FT014.eop-nam11.prod.protection.outlook.com (2603:10b6:5:15b:cafe::79) by DM6PR18CA0005.outlook.office365.com (2603:10b6:5:15b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 14:04:58 +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 DM6NAM11FT014.mail.protection.outlook.com (10.13.173.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 14:04:57 +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:56 +0000 From: Xueming Li To: CC: Xiaoyu Min , , , Xiaoyun Li Date: Wed, 11 Aug 2021 17:04:11 +0300 Message-ID: <20210811140418.393264-9-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: d4ab47eb-fb93-46c6-4b49-08d95cd100c3 X-MS-TrafficTypeDiagnostic: CH2PR12MB3784: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: swogyNLrjCQAYrxwhupwe8aUJXyIUbB3LYAHXJ4rvNqIfmnoTfkZiqBA0yJ5XC0aIKYYIvxhNf+ajGCFdvxu1d19k2I1mUNNRFC8vkRzlK58Qp3YtM7M9nkYvGh/4Q4pen+MsHJ942QrvnhOQfNkqReB9KC1aAIG8kCcBA3L4VpixgCgohvGCsnShllCLLikHn6aMC7sSVM3mMhafDTNDybOAwg3/PNeqzve4cWa8yhD7IS+27/gtJJ0sp5WD/W0HB3laoIcpqEcSiM5sklaEVXPOYmQeh3eJZzNa5fxp+C0ff8Vu7GoJVRY4mRQEjeW4RdB1dbbKBt9oLVrKp6bVRjEb9ZLqov+lpiKx7U/eJ+0iMZWACSUsNQsBvI0o5wQKlq3SWwe75hkFqKylNta3MWWnxHwNxYc0aYHBi1aRHuw4qnNoRumgSnLsqCjXQrfIbXv2T9OwSQjze5O6lKMVfgSXRZp2Jc/ImcKqhg3z5Bxk+qJtjGm+NgJG8fjg70w1jBHDZ9HxOZFle92+MqnaYFd5bLOaQ2biaizVUvSEk8zc9Qjm5MkBjn+gLbFmtBaA/YNHoTIXgyMH5iVAyf9dEaasBGoShYheShha9Wc8z6oIRLzeOgeKFwH6Wg0Z2OSrXsoMkhS9xjxJ2wNCMOkuOYNQgfPCghf/WRC62ipmA93GZ2+6nMKSIMrZLyhUEnLMer0xlxDxWiTVaPMe/uPZiyi71L/2XAB/4ZhLwrpE7Y= 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)(346002)(376002)(396003)(136003)(39860400002)(46966006)(36840700001)(16526019)(6286002)(7696005)(86362001)(2906002)(186003)(70206006)(4326008)(356005)(82740400003)(70586007)(8936002)(36756003)(8676002)(6666004)(26005)(336012)(55016002)(478600001)(7636003)(83380400001)(426003)(316002)(36906005)(54906003)(109986005)(36860700001)(47076005)(2616005)(5660300002)(82310400003)(1076003)(266003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 14:04:57.9275 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d4ab47eb-fb93-46c6-4b49-08d95cd100c3 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: DM6NAM11FT014.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB3784 Subject: [dpdk-dev] [PATCH v2 09/15] app/testpmd: support shared Rx queue for icmpecho 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 in stream basis. Signed-off-by: Xiaoyu Min --- app/test-pmd/icmpecho.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/app/test-pmd/icmpecho.c b/app/test-pmd/icmpecho.c index 8948f28eb5..d6d11a2efb 100644 --- a/app/test-pmd/icmpecho.c +++ b/app/test-pmd/icmpecho.c @@ -267,13 +267,13 @@ ipv4_hdr_cksum(struct rte_ipv4_hdr *ip_h) (((rte_be_to_cpu_32((ipv4_addr)) >> 24) & 0x000000FF) == 0xE0) /* - * Receive a burst of packets, lookup for ICMP echo requests, and, if any, - * send back ICMP echo replies. + * Lookup for ICMP echo requests in received mbuf and, if any, + * send back ICMP echo replies to corresponding Tx port. */ static void -reply_to_icmp_echo_rqsts(struct fwd_stream *fs) +reply_to_icmp_echo_rqsts_stream(struct fwd_stream *fs, uint16_t nb_rx, + struct rte_mbuf **pkts_burst) { - struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; struct rte_mbuf *pkt; struct rte_ether_hdr *eth_h; struct rte_vlan_hdr *vlan_h; @@ -283,7 +283,6 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) struct rte_ether_addr eth_addr; uint32_t retry; uint32_t ip_addr; - uint16_t nb_rx; uint16_t nb_tx; uint16_t nb_replies; uint16_t eth_type; @@ -291,22 +290,9 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) uint16_t arp_op; uint16_t arp_pro; uint32_t cksum; - uint8_t i; + uint16_t i; int l2_len; - uint64_t start_tsc = 0; - - get_start_cycles(&start_tsc); - - /* - * First, 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; - fs->rx_packets += nb_rx; nb_replies = 0; for (i = 0; i < nb_rx; i++) { if (likely(i < nb_rx - 1)) @@ -509,8 +495,15 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) } while (++nb_tx < nb_replies); } } +} - get_end_cycles(fs, start_tsc); +/* + * Wrapper of real fwd engine. + */ +static void +reply_to_icmp_echo_rqsts(struct fwd_stream *fs) +{ + return do_burst_fwd(fs, reply_to_icmp_echo_rqsts_stream); } struct fwd_engine icmp_echo_engine = { -- 2.25.1