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 7B34CA0C47; Wed, 11 Aug 2021 16:06:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B22A41230; Wed, 11 Aug 2021 16:05:04 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2081.outbound.protection.outlook.com [40.107.243.81]) by mails.dpdk.org (Postfix) with ESMTP id 1CEE741227 for ; Wed, 11 Aug 2021 16:05:02 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WTpL/HtMjezNNsNxhT5ppyM5rCZ66mCJLapwzomgjiZ8l/F7/ZSIeItJGK5UKfoGzgQ/Wwg+KIDPEpI5HnwBeiTTYqTjuYgM7hi4pGNkPRg7/CtUkB/wXuvi1V4j2Brem7Y7+LwIKqXMXE859FaTqHFppQm8RcYCKJhTBYMigvtZMxtasKagniZMjd3WP85sUWrAWG3WTIToTqpFbY61bRIPts3jFwkgsiPiLIUG8GgfyG00UHPB5Tdy+hZqSbqr4PUn4MN7pre4wANaJEZfY/0h1PsHM0VUETsX7+99NU+ZmoVhGKbeYaWaSc9cpV3RmND7vFGH8iV6qmr5fohsZg== 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=DM1wGAMKBJmRHire59yji3klC07g/7KVivRKdCrqnW0=; b=mvpnVGOTYxy2H/a33/e021Ib+NXNvW2fcUpHUKOocnfyOtycu6En5m7HGrPoxLjDKsnDHHEXNRGd5M7rTe0kvFc0/XSxbwC/+ULKQ1D7ZYhbaNWODnCs0GAPvOzyb7D3nHnOtmR02LHyJ2ZGx8UJSWypoJHKMK5X4Dt+kJh/gZwlL/3en23PmgvzzaESNVvGipnHRM3K027lmljCbFuNGOlSHBBFBaF0rruNOePeNXgPdTfPDvArJ8ms9iW/c1/xNLPoafT/Kon1zNJOZr+q7iMMDMj4WCBBVMYuOPjhS5p5eHrDGbewX3AgwyLm6RpX0QOIv+yHd1ouqCwgMeoWiw== 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=DM1wGAMKBJmRHire59yji3klC07g/7KVivRKdCrqnW0=; b=IopAzgmxERdFjj3FlxX2XvFMYOJ1i6FCKA0MyJkr5+vReo/W8TvDERDebA9YnAXSbkTYzNt7BcLNW7F89sAtiJCFH8MDken5chD0WjVzda+/I2zyLvRGt9Tqvi+2LPjs7SVzqgaDKYf/Q2pFgItlOlyAkwbvPxf/0zbggBX3qhsVxPWLtcGmuzz6dRpewo7rCLv057zBZ0X0yJyqqGbsIY5jFvIqABEe+maB+6+xK/8UvyGYPEzr1ZE8lZj/T8D8t+Ig/rdTj+zyK1yzd9qyHki7zli360q8xoIYDtBKZV+csAPwe0Ycl3LxsZ/tnLD/YMJ7/PuEq/sLIBhgO7CNwQ== Received: from DS7PR03CA0142.namprd03.prod.outlook.com (2603:10b6:5:3b4::27) by BY5PR12MB3939.namprd12.prod.outlook.com (2603:10b6:a03:1a5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Wed, 11 Aug 2021 14:05:00 +0000 Received: from DM6NAM11FT042.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b4:cafe::d9) by DS7PR03CA0142.outlook.office365.com (2603:10b6:5:3b4::27) 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:00 +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 DM6NAM11FT042.mail.protection.outlook.com (10.13.173.165) 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:00 +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:57 +0000 From: Xueming Li To: CC: Xiaoyu Min , , , Xiaoyun Li Date: Wed, 11 Aug 2021 17:04:12 +0300 Message-ID: <20210811140418.393264-10-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: b08b6ebf-4e97-4e99-37e5-08d95cd10213 X-MS-TrafficTypeDiagnostic: BY5PR12MB3939: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LKe5wdXPmPfnIQItkX+UG/RiS0hwF1MQbnNBWgRqJZ1i6w5JBnnKYRRuIZXhL6aaM+cPqMpkhBHj6bHW3Th0j+sikOKQzfgeiNof42ur2Hdht7tk20CI0iWrzdvl5vS+uEgVkrq2oNrxWPUjgjjvEr/jV8TWSrMuUO8S8Hc93a4jCNQqU6Pn5yW3oa8mwkbrvy7Y3Jw19RzzvOKn9rwz1wHSTfvhV2bL5Z8AnwScePC1pdqf8XfcEN1a1SZytUAnr1MGYMuAa+66yxJQenOOVzPBVnusN5Jt5qHQcpQbmHBd677JuUe5GVwzavL7dLEUAsdc4cmvRyW/rNEbgx9Ffwm2PEyqUvag3HOvyXkbxjKLVtvDi3iq8UdKm1ZeH/MzQTqwA1UB0LC6VeZpX4X663Xgvli/Lk5eBV5Lnbp7QdxWm6qeI7irl0Tl5lua8yCvlfU1jstQyU1QPU+DZrL6MSTasU0Hw5/gt4sRsg97Luj8FAnj3y0nb49MKOVM6UaBau+gf8xzLbTgZXmslQQZclhu24VyToHMfRLKwEk/2y2vgFGez6pYvSVo+Q+I1SqXIKErBf0hn75mLIsjpjHz8VKRDsa8i4PiRK3PSZOWEgb4u/hGiIbXQNr3GQzwNOtWqidJDI3Wj58wSnkh1VUCpsK1CH6WEj6uSP6bIi0LMgfFt8jClVwv1ujvwebPgTqv+4HQikHcQXEvV6tUAgtjW4aiO99AE+0XSLK6VYHNe2w= 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)(186003)(26005)(16526019)(1076003)(2906002)(7696005)(316002)(70586007)(70206006)(4326008)(54906003)(5660300002)(508600001)(83380400001)(7636003)(356005)(8936002)(36906005)(82310400003)(6666004)(36860700001)(2616005)(47076005)(6286002)(86362001)(426003)(8676002)(55016002)(36756003)(109986005)(336012)(266003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 14:05:00.1250 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b08b6ebf-4e97-4e99-37e5-08d95cd10213 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: DM6NAM11FT042.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB3939 Subject: [dpdk-dev] [PATCH v2 10/15] app/testpmd: support shared Rx queue for csum 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/csumonly.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index 607c889359..3b7fb35843 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -763,7 +763,7 @@ pkt_copy_split(const struct rte_mbuf *pkt) } /* - * Receive a burst of packets, and for each packet: + * For each packet in received mbuf: * - parse packet, and try to recognize a supported packet type (1) * - if it's not a supported packet type, don't touch the packet, else: * - reprocess the checksum of all supported layers. This is done in SW @@ -792,9 +792,9 @@ pkt_copy_split(const struct rte_mbuf *pkt) * OUTER_IP is only useful for tunnel packets. */ static void -pkt_burst_checksum_forward(struct fwd_stream *fs) +checksum_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_mbuf *gso_segments[GSO_MAX_PKT_BURST]; struct rte_gso_ctx *gso_ctx; struct rte_mbuf **tx_pkts_burst; @@ -805,7 +805,6 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) void **gro_ctx; uint16_t gro_pkts_num; uint8_t gro_enable; - uint16_t nb_rx; uint16_t nb_tx; uint16_t nb_prep; uint16_t i; @@ -820,18 +819,6 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) uint16_t nb_segments = 0; int ret; - uint64_t start_tsc = 0; - - get_start_cycles(&start_tsc); - - /* receive a burst of packet */ - 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; rx_bad_ip_csum = 0; rx_bad_l4_csum = 0; rx_bad_outer_l4_csum = 0; @@ -1139,8 +1126,15 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) rte_pktmbuf_free(tx_pkts_burst[nb_tx]); } while (++nb_tx < nb_rx); } +} - get_end_cycles(fs, start_tsc); +/* + * Wrapper of real fwd engine. + */ +static void +pkt_burst_checksum_forward(struct fwd_stream *fs) +{ + return do_burst_fwd(fs, checksum_forward_stream); } struct fwd_engine csum_fwd_engine = { -- 2.25.1