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 6ED58A0C47; Wed, 11 Aug 2021 16:06:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AED1E4123C; Wed, 11 Aug 2021 16:05:05 +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 72BAE41229 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=iCsGJdvAXquJp2CCMOK8dJY3m3w+igP/4TVkAXJ6IM8AVghyXwPWq994YcE2zvlEkbM7wDw4Saq+SI3FOXrKPtAmljsATHU3lzazzvzf2vUGV/heNCOzb7AL3x8w9lvk4gh9k7BQjpsk7NWYectgkduZF6QI/HJhUwfrL/GBeTWEKGKtUlZSVdeIx7W+Zp+GTZztIbAdMr4zppLMUxTzE8DI4mTJ3eBbfZQXOKYIMhWonpz6tpQvSRqFyf2qhU80WHohmMpbnPUJRmOH5LIIgG/mSePRludyPqd0FpgN4oCuiLwTiOvakj0ZZN6ijlmclzzknPFd7wAvgyehIhhZNg== 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=aWt0ZZy+XYm0eZkoPN9wbBn+iBPyAqPsRLfsMmQSM1Y=; b=K0KRWiA69EQCVnrkI24AEQGqlEg+arkBOpVY+5RT1JRPP8u6h6xtAr3zASWbbp7cfEsUhYRHtJEFRPMHXnPoy6F92CRXiNmRJUmwT0FZNCDzxJh9gRRivZSINYxIPAZErQirIbWwmiGwucJoGtZABpvIkV79Ki5zsd0zTn2Egq/iCS3+R4eKX44NewxSM6LydwTnBlWfUvrbOcZi5fefhzst/9gSbmHcViI018C0JGHizQwS+4fVOvcPzhww6xdBJcoPygla2q0oIfnLwmZNAn89z3dgTHg3zioMHTHpnhiTX7TQrdeIvDDetOjvoY8otp/iVog8Y1HJEF763Spbyw== 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=aWt0ZZy+XYm0eZkoPN9wbBn+iBPyAqPsRLfsMmQSM1Y=; b=RaIQbG2iq968KOOaF5cWTmPWitdwNw9hdODbaTDATr6VM/3Ky7XXBXJX78YPtodL4tT7qssRfOE5QTVFY/EMToGaz15OYlv0Iz53Piek0wfrtNciTqTBGBREDs+RoHUNXK6LcmZC1mxa93ezc7Ct3fiwX2OsUqIps0IahOEL3UEmjgtHo+28hXJ45XpZhFkVY5lOHq5UjJpvICY3NI1avfWcrSx8KNKObJXbBUCrV2YLGSkDpIJ7HLzvtkhCre5FOFgd38AYLWn7kzUHt8QdWkCP3roN9MVyKqP/YO+LFy+HvQmsyhoBRF/gv6QMGRENDZC7qDMG8pahN08ORPv2NQ== 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:59 +0000 From: Xueming Li To: CC: Xiaoyu Min , , , Xiaoyun Li Date: Wed, 11 Aug 2021 17:04:13 +0300 Message-ID: <20210811140418.393264-11-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: 4a05adc6-5f9d-44fa-1767-08d95cd10270 X-MS-TrafficTypeDiagnostic: BY5PR12MB3939: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rupFu9rhk+bcSBdcT8WMebl+pgIWfVV3NJBHNO7zDfcFjLm9JkjSzVqj2ksOh2I7fQD0u+mepPMgqvKXZMxPLcfNkLvkYFVLkW6wyKQQ+AEPUNLTIoiZl3z6yJBsiThZOge089CRBL+4I8/KbtC1NsWHv+4cASicHx7X3W7nIQ+53q1ftklsdRLcYXpxozZBlPFA7hc2iwummXnje4SdpJAJXqx8zn4mo+l6pANuqD9IQj19zKCQJmbQ6Zn2j5An1AtqSfdLSEwPRB47dwARFU6T95W3GoZ9KocDbJ9oK362i2vmCG8OqTXx9dBRmaFfIBqnBN7Q2bu6cw2g71pBGu2ZTCxiEKbX5HcNPG8E/Qgnp/lKVLzMTiiuzrShQHtEgJDlOFKmoqQRpgUb64tZ3+q9UxfIAMaguLn9Kon3aXnIFnihZLmAJqUF4IzvPqL5c1RFMy+pGOlhfdBpQ+TuCSe8onymJP7adZoQhvIKY9IiEy+6lSQZZOiVPBs42WH+l3/E+aZ3cF/+wV4rb2HuvAZPiIMPT1j25Djle15fPRPIPuqwbmriiR2QGJqLk4pBgPAADZHBdVe1x2kB01qznnGLS2kk785KIDiwKfuChhPc2nmqDbTfpzWgNxYP6H/TKaxX4cYRIq9u00bVYGj6WF5FCrLcn0te1CtC9xp64G0+VJLg2TSa1omGc9YMWvUZ6Opaq9Cmuj/NbsqcDtACmd7i4yV6Tk2mMCdakKkusiY= 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.7397 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4a05adc6-5f9d-44fa-1767-08d95cd10270 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 11/15] app/testpmd: support shared Rx queue for flowgen 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 do stats in stream basis (as before). If shared rxq is not enabled, just as usual in stream basis. Signed-off-by: Xiaoyu Min --- app/test-pmd/flowgen.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c index 3bf6e1ce97..d74c302b1c 100644 --- a/app/test-pmd/flowgen.c +++ b/app/test-pmd/flowgen.c @@ -83,10 +83,10 @@ ip_sum(const alias_int16_t *hdr, int hdr_len) * still do so in order to maintain traffic statistics. */ static void -pkt_burst_flow_gen(struct fwd_stream *fs) +flow_gen_stream(struct fwd_stream *fs, uint16_t nb_rx, + struct rte_mbuf **pkts_burst) { unsigned pkt_size = tx_pkt_length - 4; /* Adjust FCS */ - struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; struct rte_mempool *mbp; struct rte_mbuf *pkt = NULL; struct rte_ether_hdr *eth_hdr; @@ -94,23 +94,14 @@ pkt_burst_flow_gen(struct fwd_stream *fs) struct rte_udp_hdr *udp_hdr; uint16_t vlan_tci, vlan_tci_outer; uint64_t ol_flags = 0; - uint16_t nb_rx; uint16_t nb_tx; uint16_t nb_pkt; uint16_t nb_clones = nb_pkt_flowgen_clones; uint16_t i; uint32_t retry; uint64_t tx_offloads; - uint64_t start_tsc = 0; static int next_flow = 0; - get_start_cycles(&start_tsc); - - /* Receive a burst of packets and discard them. */ - nb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, pkts_burst, - nb_pkt_per_burst); - fs->rx_packets += nb_rx; - for (i = 0; i < nb_rx; i++) rte_pktmbuf_free(pkts_burst[i]); @@ -213,8 +204,15 @@ pkt_burst_flow_gen(struct fwd_stream *fs) rte_pktmbuf_free(pkts_burst[nb_tx]); } while (++nb_tx < nb_pkt); } +} - get_end_cycles(fs, start_tsc); +/* + * Wrapper of real fwd engine + */ +static void +pkt_burst_flow_gen(struct fwd_stream *fs) +{ + return do_burst_fwd(fs, flow_gen_stream); } struct fwd_engine flow_gen_engine = { -- 2.25.1