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 C6EA0A0C47; Wed, 11 Aug 2021 16:06:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7463E4124F; Wed, 11 Aug 2021 16:05:11 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2064.outbound.protection.outlook.com [40.107.243.64]) by mails.dpdk.org (Postfix) with ESMTP id 263E941244 for ; Wed, 11 Aug 2021 16:05:08 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eExJ+Jd0QmsRxaCRkZx8eBszPououX3tiTn23qIepZ5zfu3U6AqOOi5MLeoeTQ/hTNHNUUXm+HqK6WFvzDZlrPQwICrTAWXxheYfyX+X+AmEDdu/u3NHqXFQvCtW0TM8VjCB0NTMP/biTnGvRt2hKPgZv33Dn6bK24Wvyn79WWNpEDsdQ8THOMQfDuB9ZLrPJgb52aGeXPB2bd6KD7QSxXxqnhONsjOzH8lo/jbXY4YrCXLJOy9mH4JRLU9S9p8amldaGRjrH0yDE5B0uAb9DQiwHeSLGROF07KZe2/MEXloHThr+G3SKS9VTkQF0ZIMthKn78vsB6xVTySPfH3MRg== 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=va5h1MU3J2gfr1eDMZVMU59UoscHUe9f39UCdsyKrbs=; b=Mk5h9SJG6eWB0fz50FrpV0lswh8OjIlDzvecKn4l7xDUeYvabhl3xBlG6Nq4+kzs/oWam3aJGPL+tYAX3eIvBeNSogfNjCyLEJuJvKJoi3toyP4eWtAyrwU3DqagkMTJJ4uVt7ZTfWZep2ip5+zTLXbEXgFnxvGhmA/bjqYEopMC6/Fx6v3gHxHLcZbuZc89fv6uHCVkau7F6qDinKY/Lh4E7O8Tn6PKtpc0MDsCcMGynIGxMsbm8g8hc22n8U518YhgZ8zrsxmFKiJpoU2t3aVz7lOBal1MidcVSC3Tk9nCI8XWCdL3Kmt7QpADd8FObheEDWcsWsO531+NFuNmIw== 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=va5h1MU3J2gfr1eDMZVMU59UoscHUe9f39UCdsyKrbs=; b=fMcFKlFtCdPFEqyzsYQCuebIctwXXR/PEBEDlnhEK625Un7Vf/MRP61iA+jBqECWJUn4nmVfPJBsWQSuI0kYXKaD7kCJg4hpc3B2t1URzZQ3UwYs9hvFffk7ZTGhGlJJ6frDnWGDG2AD8Gxw5HDOnBCtY17Lz3CC107CrAIrGNlACmr4cuOm6CfyeUuLiRjgRa1OVKSbEi9mfoHdO0d7RlIM9bywXMo9uHUnouDT1p7KDw8RihGS33VtygSQRjS6TiMo/MbeFmfKEd93sBzUkQJRcs4Nk/nReuRfi0lv+Sy3XbcFPGeqmWM+i9CGjuY0p/1R5fW6xDMR7bMD6Iju8g== Received: from DM5PR20CA0029.namprd20.prod.outlook.com (2603:10b6:3:13d::15) by CH2PR12MB4167.namprd12.prod.outlook.com (2603:10b6:610:7a::7) 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:07 +0000 Received: from DM6NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:3:13d:cafe::fe) by DM5PR20CA0029.outlook.office365.com (2603:10b6:3:13d::15) 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:07 +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:06 +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:05 +0000 From: Xueming Li To: CC: Xiaoyu Min , , , Xiaoyun Li Date: Wed, 11 Aug 2021 17:04:17 +0300 Message-ID: <20210811140418.393264-15-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: 94723b73-6fb1-417d-e404-08d95cd10618 X-MS-TrafficTypeDiagnostic: CH2PR12MB4167: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1+E0JhzmVutZF6v2/UWENS/WkbO1BwF3XEnsdTeIHDWhhzGNmhCHxxWSTXYg68pJVthI6Gf8p7mIEhBzb8jWrE7JqhE5X1v/fjcfoa9eZRuFxF+fRC5LAOAvn/p2BrcykxZWlKXLQK5cjB/5ZC0w3dqPsOZEozOJuYpifNH4d7akSFO8/i7RcJ0h9vMEKTvO7E+BYDAjAvLCSyu2PlKI0FpzVFtWbacxTpm9mI9V5rEznC09UpvzpEYf5sIojuBoutzTwqOoBh1Iv1jxagrCsSYpNFLnDjyO2xaImvdQFGryOkZJkc8tgNVGNae5HnLzAgrpyXFec7cvDhYKqKEY0DdZD8ut10EViiQ4dT9gRe+r2rSM6u4HiOi+IM/J/kRjoCK374N+R23dcwgACJORqh0JtsuMCmDfOieTgo9sHQBc2Vc5zI4b9647VmbIVEP6FSbfL1JRukyDbdw3Xb3FgV6YI9WLhXZYyR8lkdwAVddmfTNHmQwjN/M2x2Kb6dKFc8IicbUGeWkSYfLMAFwzgTMPPiftdH3JA3qINxZYt9XkNkC0X033zWM1cwHEjzRPcAoz6hQphJr61BRjMJsJjPkVLeLrcCA06FLO+4PAdQN5yRdEyRl2Zeut73KVPi2x6FD1BBPkIb75tQErdO+ZyzYeq5tzr81/BYPJQYqSuZsv5DkcBMIHB9aKZRW2e9QA7dg9Q9EwooyxaaY1/uo6Pue0F5LiHf4odtwZf6d7DMw= 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)(376002)(396003)(136003)(39860400002)(346002)(36840700001)(46966006)(82740400003)(55016002)(54906003)(7636003)(2616005)(7696005)(8676002)(8936002)(426003)(4326008)(70206006)(36860700001)(109986005)(70586007)(316002)(6286002)(5660300002)(356005)(36906005)(6666004)(1076003)(47076005)(82310400003)(36756003)(83380400001)(478600001)(336012)(186003)(16526019)(26005)(86362001)(2906002)(266003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 14:05:06.8591 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 94723b73-6fb1-417d-e404-08d95cd10618 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: CH2PR12MB4167 Subject: [dpdk-dev] [PATCH v2 15/15] app/testpmd: support shared Rx queue for ieee1588 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/ieee1588fwd.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c index 034f238c34..dc6bf0e39d 100644 --- a/app/test-pmd/ieee1588fwd.c +++ b/app/test-pmd/ieee1588fwd.c @@ -90,23 +90,17 @@ port_ieee1588_tx_timestamp_check(portid_t pi) } static void -ieee1588_packet_fwd(struct fwd_stream *fs) +ieee1588_fwd_stream(struct fwd_stream *fs, uint16_t nb_rx, + struct rte_mbuf **pkt) { - struct rte_mbuf *mb; + struct rte_mbuf *mb = (*pkt); struct rte_ether_hdr *eth_hdr; struct rte_ether_addr addr; struct ptpv2_msg *ptp_hdr; uint16_t eth_type; uint32_t timesync_index; - /* - * Receive 1 packet at a time. - */ - if (rte_eth_rx_burst(fs->rx_port, fs->rx_queue, &mb, 1) == 0) - return; - - fs->rx_packets += 1; - + RTE_SET_USED(nb_rx); /* * Check that the received packet is a PTP packet that was detected * by the hardware. @@ -198,6 +192,22 @@ ieee1588_packet_fwd(struct fwd_stream *fs) port_ieee1588_tx_timestamp_check(fs->rx_port); } +/* + * Wrapper of real fwd ingine. + */ +static void +ieee1588_packet_fwd(struct fwd_stream *fs) +{ + struct rte_mbuf *mb; + + if (rte_eth_rx_burst(fs->rx_port, fs->rx_queue, &mb, 1) == 0) + return; + if (unlikely(rxq_share > 0)) + forward_shared_rxq(fs, 1, &mb, ieee1588_fwd_stream); + else + ieee1588_fwd_stream(fs, 1, &mb); +} + static void port_ieee1588_fwd_begin(portid_t pi) { -- 2.25.1