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 2B27741CAE; Thu, 16 Feb 2023 09:01:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 17B6341141; Thu, 16 Feb 2023 09:01:59 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 75E7740E0F for ; Thu, 16 Feb 2023 09:01:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676534517; x=1708070517; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=v0dmUEjb3ow1NltppMtAMWdSPTDCxRZdxdrvLdiUja8=; b=X2yrvDoawJNgX7KAw94AJCtVc3VUXLzfpc6ImlAMmC6oQvsxvuHMl+/1 NCwhx+VMmEBRa3yxicd6CQEtGJAl3MeUuBRnBdg+ApiL4qI9R0DWvLMFT sMeAXFV26QwhNLYGIHe+lTenQD9zMqS2gsc9Zv+535Zqw9AG3uAkRjbV3 nwlHR7i/nG2ZLD+R8tkOcIiRDYSatu/7Z3uiKCRIrtm+GvNH7lcTD2T0Y bMqo80nzeGbEWgufZMFVN7vjQUnHwXoNOsNWnOzzzU4Lw8dSav5yZS6tB c8lXT9EN+yIOQyOrDEcE0bO+Tqr2+txW8pPx5o6wX4wFGXues1h0B6oRn Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="315329538" X-IronPort-AV: E=Sophos;i="5.97,301,1669104000"; d="scan'208";a="315329538" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2023 00:01:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="793930896" X-IronPort-AV: E=Sophos;i="5.97,301,1669104000"; d="scan'208";a="793930896" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga004.jf.intel.com with ESMTP; 16 Feb 2023 00:01:55 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 16 Feb 2023 00:01:55 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Thu, 16 Feb 2023 00:01:55 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.176) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Thu, 16 Feb 2023 00:01:55 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jWwy9YWYS74xpJ5baWuPDM7uVhO3VRNLqt8BlMGML5EMzDFeVtFYIXvK3zp2yhATOBzlvGFzv40sZi/WixDAa4s4uRMaHfOsFlE2v4e4RHwqzBTRUY1CANmirt8LDBx7wLA3y0tD5tsC+UvpoI16lOcKZtL9fl5BBSGaIIEVViC7uhiqjRU0Y2B0TEsPY1J/1hMpEUmI44Qv+Xnyg5mR4hvggxKmxt37s9D7m/4VObwW3fYcT2SP6flk7ZUIYkezdWol6Q8vBS9k+dxOJ4QeT72bDGTUolrY5pZ7dawh5eDqkfg72Sho5Y4bhdyDC+1X6iTwzzVJzmhi03BQ6krUJA== 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=ysw/1JR4wzEscuXneP//E437gTKqB8pOHg8XcQhUX5o=; b=cv/zWCQ0olUWslZEkv1NNxckQGTifr8u0oqtwmb87a2Tmy318QFWNdClZnFhK+isE+ldErRUMa3OmK9gmLUjENV6ZOSywnPHOwQ0GV6gRg8wkUaGbXu2lHkdxJFFRNFojXGQFCzMc1d395I5pPUL/suySSi62fbcwrdlrkZ+RVBeDX3aBiRDot1TEWRpAHP3BjWo0mK36U5EVwhFl1za6copUWpQDjmTWuBUNg96GoCzdkHbAGjV5U3i0EdcA8AwV8G2rEQwFqC2hXqJh+i9GP/Lg9VnR/mFqWXz3hXkAxHovELVSCfDTTv36gHm71EISsp/iJB/Kr1sb6brnXQaCg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MWHPR11MB0062.namprd11.prod.outlook.com (2603:10b6:301:67::34) by BN9PR11MB5242.namprd11.prod.outlook.com (2603:10b6:408:133::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26; Thu, 16 Feb 2023 08:01:48 +0000 Received: from MWHPR11MB0062.namprd11.prod.outlook.com ([fe80::7b62:475f:32a5:d4]) by MWHPR11MB0062.namprd11.prod.outlook.com ([fe80::7b62:475f:32a5:d4%3]) with mapi id 15.20.6086.026; Thu, 16 Feb 2023 08:01:48 +0000 Message-ID: <4def3139-f828-ffa1-e82c-a88869549f6e@intel.com> Date: Thu, 16 Feb 2023 13:31:36 +0530 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 To: Ferruh Yigit , David Marchand , 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> <05073ac4-9188-0887-c39c-0d5f215df947@amd.com> Content-Language: en-US From: "Singh, Aman Deep" In-Reply-To: <05073ac4-9188-0887-c39c-0d5f215df947@amd.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: PN3PR01CA0082.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:9a::17) To MWHPR11MB0062.namprd11.prod.outlook.com (2603:10b6:301:67::34) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR11MB0062:EE_|BN9PR11MB5242:EE_ X-MS-Office365-Filtering-Correlation-Id: 12146dfe-5f34-4c85-0b4a-08db0ff40d6e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cwkoSK9yHTVnsQ/lpjnx+KX/+jR8ONX3Bo99qE88fYxagfrmS8bwoHvEKguMWtne+W3JgT7QtgACWx3BHAEZNTsJmJ1sqhuxAs/loCF5sQCxV6nYwY6WrVUaaVvhjqdFMXds5WDhkA9C/UzVDjXlhzjfl088TmmG/8LMhjIcv4Zs6ib/xTCX1A1MbVT8+V8shvwi+aZnib/cK/0yHoQV2OHq/yWnpFniNqcoDTV+mSERmOK0+uiAyAj/wnw/wmFnTIBYvOWEe0NEQoiihNC70HmU1rKRT4aKd8NIkLnD42mObsUT+mQuu4Dt+h0WX79RR+k7DzPH9ssvU5K24y3+QZ4CgZ30NuL9fXZ8OBvoikJ5H4gqhVjq4RYPsmQBvthzYyEv3pCYHERJ2OQMVWWdi1S1Z84PdhJfbPMoEsdAjr68xW4o9ysVmH9aPqPlMfNuU7KbaRqUu9Rr8JDcSHvY10piE223YYsRm0bq3Fdlmn6luX81F3JnqXL+XjeFSPgQK7S8yjMagbftiX8RtF+NLM6phTiQp7K+BqxhqmlwIfW1yq7sxDVjJBtZikkp7fxa/6kDM/PT4I4fJXFv+FdfIEM0rIzrgKPtQj0869PzqrNbNhyxuzEzruoJsJBYO6YjHg6zIAwDLsanTcYhPKwp0ay4xLeMjQ6gOeD1/+H8KcXiVIk8/ZKctckOHCmddwWiDQGOq608ki/hZj0eUlcP7uSEN1baY5tjukazsRpXGuM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB0062.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(39860400002)(396003)(136003)(346002)(366004)(376002)(451199018)(38100700002)(2906002)(82960400001)(31686004)(83380400001)(2616005)(66476007)(86362001)(66556008)(478600001)(6666004)(36756003)(5660300002)(53546011)(41300700001)(6506007)(186003)(110136005)(66946007)(4326008)(6486002)(316002)(54906003)(6512007)(26005)(8936002)(31696002)(8676002)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WWtIOWRBdjRpQWwrUzRWNFh5aHQ0THQ2UnBxVldYcm1WMGQwd2pMOXBWN3RF?= =?utf-8?B?bFFWTUhMWDQ5RzVOQ3JPUkMvaW5mdmF6eHAxRVN1cDlvMGtWNGZ5OHNUVWd3?= =?utf-8?B?SU1LalR2VkY0NUdhWkw3WGg2NzFOOGR4b2JKTWFnS000RzBHcjA3NUlGWUlZ?= =?utf-8?B?MGFyQ1BhRHF3Tm5IUXhBY0twcE5sTkgrcm55YmtJb3BDaldmR2NKbmpZZWVl?= =?utf-8?B?ZVNNVEV4TEtUeWNJTmhXZXRweU9IeWtrQkliSkNtdFRjSnIyUTRFSFg5Y01r?= =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RlFKbnBjTmtUdzBqMk5pdithU3NPcUMw?= =?utf-8?B?cmVtVjI5czFnRVFmWXdyQWlKc0RUcmxueTJzSGRwc0xFYTJQbEFuZ3dibTll?= =?utf-8?B?Rmc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 12146dfe-5f34-4c85-0b4a-08db0ff40d6e X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB0062.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2023 08:01:47.9028 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dkuEQsHJzl0jyqbcEmGmUAljO3DMN+qjRrRYbGVowlrDwraWGzhGlfDB0vDYAdc+nZ8IaLESUDuazG7ZB4YEIrq6H44kJWQT231LCpjri8w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR11MB5242 X-OriginatorOrg: intel.com 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:47 PM, Ferruh Yigit wrote: > 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? I think, subtraction of two unsigned numbers promotes the result to int. As 'nb_pkt > nb_dropped', we may explicitly typecast it- '(unsigned)(nb_pkt - nb_dropped)' > >