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 A33E641C97; Tue, 14 Feb 2023 19:17:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 89F7342F88; Tue, 14 Feb 2023 19:17:46 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2049.outbound.protection.outlook.com [40.107.92.49]) by mails.dpdk.org (Postfix) with ESMTP id 3764F40EE4 for ; Tue, 14 Feb 2023 19:17:45 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PcLwmA5BVBVsKzWm5PPOMYq7qfdf6ihBIp1Gy9k8uJ2JoDlfNIv0C6DJvDLY5fbEyP0qUjz2jUOe3m1yqxhi1I3VOXZlsL9IXh8iW+qOZSkRBUKfVjPAJuwFdobPZScdmpezE12UZztQWRPEPagXrmMEUYnPiUwZNMzR8OM8HsDmwK1FO+yclaDkBnOjMhSglHHYAHJoaFic6Ew8vIjEFg/54S1NoKgigK92ZKdYmRHryb4mfBdEYpRPVTpsCvgpqEofOADl06s7HSqjsS++bWy0Rn16/LW/e+AXM1iS8KlkA0RzKkcLcUFPyL4KeImau2a9I6LR3xmxRYgEhDtF3g== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8mN5nn0NOaevREwYTMmDORi4ievhu8UC1Tcvm+bF+Jo=; b=MJeaDb65AkgOJpAX5eMnrRX5dOv41en6A42OXYEvKKCeM+ulUB7XyZAGtFOMGo73QHZS7lzkOWl48KOXwiDGMXsGOaoFAW5rSxrW2q1Nm4aVQ5yyIOoPKSEHJ2DNFl6EoX1jusN5b0FFplMPcVGE6rRWxY6BiJbjSRCixC5hNNI6q1XOYWBJ8EKdJ/W6lvcRCWTmnbVovzgGJ8gsHH72o7+Wo+JzG9cYWz1pUWSGe0FP/rcd8lX4LTlvIFObCLQib4NJGhMM9MAog1p9BENYCHCXLHX1T2zFo3oKg5MlYBNqKvXZ/JHMZ8PKDJvchluXqWFWYGT2Y7irhIALGgCvag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8mN5nn0NOaevREwYTMmDORi4ievhu8UC1Tcvm+bF+Jo=; b=yhwGaGTjy2AF3+7J3APpou8Ohdp3UESpFSuPhtBd8teaSAaK0e6tv1hi7Ib0ez6XrfyWgSlLo2Hi9Ng+5n/sLPL4+3uYrVcK7F38oSQaJ7ExGrrYUcShM7yCJZh5rHhg6iaGiaJ1MJ1N9IKTFUIahvLR4eMeYjWC+RjB4YAFKlk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by LV2PR12MB5917.namprd12.prod.outlook.com (2603:10b6:408:175::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.24; Tue, 14 Feb 2023 18:17:43 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48%8]) with mapi id 15.20.6086.026; Tue, 14 Feb 2023 18:17:43 +0000 Message-ID: <05073ac4-9188-0887-c39c-0d5f215df947@amd.com> Date: Tue, 14 Feb 2023 18:17:38 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: [PATCH 6/6] app/testpmd: factorize fwd engine Tx Content-Language: en-US To: "Singh, Aman Deep" , David Marchand , dev@dpdk.org Cc: Yuying Zhang , Robin Jarry References: <20230124104742.1265439-1-david.marchand@redhat.com> <20230124104742.1265439-7-david.marchand@redhat.com> <033b5750-827d-02aa-0031-d2d3834a41fd@intel.com> From: Ferruh Yigit In-Reply-To: <033b5750-827d-02aa-0031-d2d3834a41fd@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P265CA0259.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:37c::9) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|LV2PR12MB5917:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f15042b-ab5c-4d35-b62a-08db0eb7c3ed X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QSOphbAwpBDJDkgG+qmc+IpxKHjwOAIDWY/msG5dHmBEslsX2Irq7dA7nEny5K3molT/mIU1UrEgsovr88vEnD81mzwR7i6AI2rhqspYuLkl8BXHnr9y3QBzQ236TDpP1T3aY8Xm/w+MhZwuJevzpODF+TFofTnZaWB6NSk6jV+BThqLHW9ve0DWKGNB+W0rCJhzQ57k6RyS8acWYNs9towatudHtTc4JlawUayoBfEIkOiBcZ0PQzFe68QkCecgaHZmq08czjpRWYAL47RJ5asiSuQVbVhnsCFDUEgi4ACSR/sioRzZeiNYCJDstaYFrju2lromna3VmXjenoj+BAaLjkUywtWnUsUGqmxxQAfKL0x7QNW0t99zUCa/qfiVJzBIFaPfPI8xX7vhQg6wn0vYT+9yAR6JsbaKuj/k1Frn/1N1VoKP6md1+0xcTMHBnW9A8yf5j9wUr3fUDZe379jaXjtN0ZjEcVMb2a/sDQo+KX2M4/J+gKWkcWOFKqOEsZusEgwUs8Rr8gYfffXRxDsPakoC6zkOlVNSt0/HlCnrkglFuMHWOO2FzS3Va+oszUk3c8deN5NiQJ5iCgoup3yqq7wJH+3wu0nMjXxERSYaghfJubqUmYNA3RFagM4qXCCJZfMY8pbybRpEkMBH1LS9Dp/QehLcMX0TtB9GBSRLfZWxPKfvx7/4CNM/7TrbceBfPl6r55csaZDR6laoF/Siab4Tcis3fON5VzHGID8= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(136003)(396003)(366004)(346002)(376002)(39860400002)(451199018)(31686004)(31696002)(54906003)(110136005)(8676002)(66556008)(41300700001)(5660300002)(8936002)(4326008)(66476007)(66946007)(38100700002)(86362001)(36756003)(316002)(53546011)(6506007)(26005)(186003)(6512007)(6666004)(44832011)(2616005)(2906002)(478600001)(6486002)(83380400001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?L3k4RUI3di9FcGdTeXNoSk1wMXFkcS9qbHNCekFjRGJYUm5kYlpYOXd1Tldn?= =?utf-8?B?M2cyRWQxbFArQXhLUXZrUTB0NTVjSi91WHZOb2FLU0ZjV0V5L1BuS1RjaVdk?= =?utf-8?B?dldkWUc5cjFMc3VXQWdoSHpsNk5BaTBnVUxQODU2L1l5Q0pia0RKdXJVU3kz?= =?utf-8?B?clF0bjdrRmlUNlFObDlqUFBLZ0RaRitqRkl6S0MyL3ZNWWQrSE9qcGo5a21m?= =?utf-8?B?V3RGODhOMHMvb3RWdkpQYzJJLzZY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f-8?B?WGMzZ0R6UWJBaW9tK3lkbEc1bkZ4VGQ5VWpYWDVKMGFHRGRqb0Nuc3hlUXRZ?= =?utf-8?Q?dT4UWzodKYbDgsM2WYMPFEf1g?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f15042b-ab5c-4d35-b62a-08db0eb7c3ed X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2023 18:17:43.3871 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gZ0H+lmxNop5z8G0xCp74zZZ/fNs/5LketopDeTWTdWS1BLke4r6oTDCdyqz54mO X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5917 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 On 2/14/2023 11:03 AM, Singh, Aman Deep wrote: > > On 1/24/2023 4:17 PM, David Marchand wrote: >> Reduce code duplication by introducing a helper that takes care of >> transmitting, retrying if enabled and incrementing tx counter. >> >> Signed-off-by: David Marchand <...> >> diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c >> index b80ab6f5df..7144b3d5eb 100644 >> --- a/app/test-pmd/txonly.c >> +++ b/app/test-pmd/txonly.c >> @@ -331,10 +331,9 @@ pkt_burst_transmit(struct fwd_stream *fs) >>       struct rte_mbuf *pkt; >>       struct rte_mempool *mbp; >>       struct rte_ether_hdr eth_hdr; >> -    uint16_t nb_tx; >> +    uint16_t nb_dropped; >>       uint16_t nb_pkt; >>       uint16_t vlan_tci, vlan_tci_outer; >> -    uint32_t retry; >>       uint64_t ol_flags = 0; >>       uint64_t tx_offloads; >>   @@ -391,34 +390,18 @@ pkt_burst_transmit(struct fwd_stream *fs) >>       if (nb_pkt == 0) >>           return false; >>   -    nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, >> nb_pkt); >> - >> -    /* >> -     * Retry if necessary >> -     */ >> -    if (unlikely(nb_tx < nb_pkt) && fs->retry_enabled) { >> -        retry = 0; >> -        while (nb_tx < nb_pkt && retry++ < burst_tx_retry_num) { >> -            rte_delay_us(burst_tx_delay_time); >> -            nb_tx += rte_eth_tx_burst(fs->tx_port, fs->tx_queue, >> -                    &pkts_burst[nb_tx], nb_pkt - nb_tx); >> -        } >> -    } >> -    fs->tx_packets += nb_tx; >> +    nb_dropped = common_fwd_stream_transmit(fs, pkts_burst, nb_pkt); >>         if (txonly_multi_flow) >> -        RTE_PER_LCORE(_ip_var) -= nb_pkt - nb_tx; >> +        RTE_PER_LCORE(_ip_var) -= nb_dropped; >>   -    inc_tx_burst_stats(fs, nb_tx); >> -    if (unlikely(nb_tx < nb_pkt)) { >> +    if (unlikely(nb_dropped > 0)) { >>           if (verbose_level > 0 && fs->fwd_dropped == 0) >>               printf("port %d tx_queue %d - drop " >> -                   "(nb_pkt:%u - nb_tx:%u)=%u packets\n", >> -                   fs->tx_port, fs->tx_queue, >> -                   (unsigned) nb_pkt, (unsigned) nb_tx, >> -                   (unsigned) (nb_pkt - nb_tx)); >> -        fs->fwd_dropped += (nb_pkt - nb_tx); >> -        rte_pktmbuf_free_bulk(&pkts_burst[nb_tx], nb_pkt - nb_tx); >> +                "(nb_pkt:%"PRIu16" - nb_tx:%"PRIu16")=" >> +                "%"PRIu16" packets\n", >> +                fs->tx_port, fs->tx_queue, nb_pkt, >> +                nb_pkt - nb_dropped, nb_dropped); > > Build error reported in this file here- > ../app/test-pmd/txonly.c:404:5: error: format specifies type 'unsigned > short' but the argument has type 'int' [-Werror,-Wformat] > both 'nb_pkt' & 'nb_dropped' are 'uint16_t' (unsigned short), I wonder which argument is causing this warning?