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 70298A00BE; Fri, 11 Feb 2022 05:08:02 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE668410E5; Fri, 11 Feb 2022 05:08:01 +0100 (CET) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150044.outbound.protection.outlook.com [40.107.15.44]) by mails.dpdk.org (Postfix) with ESMTP id 006F240DF5 for ; Fri, 11 Feb 2022 05:08:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=23amasi9+gZbuNrsqsPAuomqZMThWOeNnQKRPlNEuqg=; b=DLCptMvqfwJfRx/0CyxXsQhU91ylH0NU++HFrvMu+qiRNFnxSgObqSZjjV6m7vUSLMmbek/cid9i21T/CdClbuiqCJRq7bUA9/8TL2AYSLAvrs7pCjWFiWT991/dAjFuHZ0+zTkwopsQNwDSe0VRYWE0XGwvOH/TPwr+WQUXILk= Received: from AM5PR1001CA0060.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:15::37) by VE1PR08MB4736.eurprd08.prod.outlook.com (2603:10a6:802:a6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Fri, 11 Feb 2022 04:07:57 +0000 Received: from AM5EUR03FT062.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:15:cafe::c1) by AM5PR1001CA0060.outlook.office365.com (2603:10a6:206:15::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Fri, 11 Feb 2022 04:07:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT062.mail.protection.outlook.com (10.152.17.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.14 via Frontend Transport; Fri, 11 Feb 2022 04:07:57 +0000 Received: ("Tessian outbound 2877e54fe176:v113"); Fri, 11 Feb 2022 04:07:57 +0000 X-CR-MTA-TID: 64aa7808 Received: from 0f4d7ed1ab68.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 50468B80-6532-42A5-B1CF-8FDD210CDB61.1; Fri, 11 Feb 2022 04:07:51 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0f4d7ed1ab68.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 11 Feb 2022 04:07:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H8I7Z7/ZxXJdrPnewXHLvqrwa1gmaNCWqlIjvUKHLg8g1gfqs+EmuZVn9rbR+uUCEJ2zwUToqqP9De908Kf979xyYCvvEd9up1CgLgv+n0x7m1VxE1fUXECvHnM6duMwmBHZnQXDaMBWf4iCuZSmb1zDLFxn63a3js9ARdxQp5E8UpXkeB9EE11tohrSVVlRVEKHsbns3VC+rZo3H/BdI48LifvxQf2/CcF5BUmkhfHRiG8Xi5r/Pq0PwybQzYx5aNkav0e92lv2tiNTl6uDsapgmAczQTPOA4sRq1b9qPPuW6vlQXXCh++1//FiAnixE3HgXB3y60oH7G/vGklo2w== 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=23amasi9+gZbuNrsqsPAuomqZMThWOeNnQKRPlNEuqg=; b=oEOct/cN9rtpPyX5S+n7NCx5mBXbd2xoidPnZSUJ0fENhdjb1RW3cbYkI/bBUCug86cj1G/c5wmBnlpxyMaTJQzXggpV2qYxDDfIuhwpewuaMwwsTq1FUmQGyLvVAiCd6O+q8uKnMnk4hkVBmj9LP2EOAlZMhw6ef+qPKGd5LNpY3fWJvqjGM1X+JJgoxahLknPBVXRMyt7z5a4wYuu5XZ7Sw33pvHIGdxYgjnT3hLEz1VsDF9BaBRxYCEyPAwho+rk15kspJ9K0TWFs/YRZXYoza7ClUjnrOU0rO0pKtxMb7/hYcLLS/8kDvn9g/gWvTKsDh9Uv1vStHYKYlrT33A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=23amasi9+gZbuNrsqsPAuomqZMThWOeNnQKRPlNEuqg=; b=DLCptMvqfwJfRx/0CyxXsQhU91ylH0NU++HFrvMu+qiRNFnxSgObqSZjjV6m7vUSLMmbek/cid9i21T/CdClbuiqCJRq7bUA9/8TL2AYSLAvrs7pCjWFiWT991/dAjFuHZ0+zTkwopsQNwDSe0VRYWE0XGwvOH/TPwr+WQUXILk= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by AM9PR08MB6867.eurprd08.prod.outlook.com (2603:10a6:20b:305::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Fri, 11 Feb 2022 04:07:50 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::6d04:5964:7813:4891]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::6d04:5964:7813:4891%4]) with mapi id 15.20.4951.018; Fri, 11 Feb 2022 04:07:50 +0000 From: Honnappa Nagarahalli To: "Xing, Beilei" , "dev@dpdk.org" CC: Feifei Wang , Ruifeng Wang , "Yigit, Ferruh" , "Richardson, Bruce" , nd , nd Subject: RE: Questions on i40e TX path Thread-Topic: Questions on i40e TX path Thread-Index: AdgdbGSND9JeH63pReG8SPoILQbVuQAGlTqgACAk5lAAOdATkAADdCKw Date: Fri, 11 Feb 2022 04:07:50 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 8A552EC2B9DE1A49B42F6B62EC68DC26.0 x-checkrecipientchecked: true Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-MS-Office365-Filtering-Correlation-Id: 4ac0e9a1-3155-42ef-da2b-08d9ed141628 x-ms-traffictypediagnostic: AM9PR08MB6867:EE_|AM5EUR03FT062:EE_|VE1PR08MB4736:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:10000;OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: aLkh/FYY8IFUfjxCow4ohwPYLyZc0jeeO8ulW7hpMyg3KQgcx0yyH1JA3cKyADai6mm2OEa1o5GsYlMFhXG25sy2MRtEvHVRy8x8WMcdJjq5gNaaXh3M9X8cNiJ+97+GcV+KpbbDtShh4lyWWcMIqHA26k1FxL56KDNXuH0EpEZFUbCHXixvHA4Wg2tDxtlaqEYgQkKIUbjn4sPG9mFZ/WTdUkOyuI3QbMu/K3ud2Tdt7mNKoKy8xfrKeZWqyX50CVmAlVwTXdDOIinmhUnpf2zvGO841xuZIo7M7aOreoovRfQVnhnx3yi1Wois/6RMna1rZKOR3UzJ9Znu71dO/6X3COhby+W7oUkskp8IWeQtK1a1gvAlzs6NwXQNksl7LakHWTEG5b8SrKLX8iwLkWnOZfHbkMByWKAtKe8EHP5wR0X77kwmICuNo0fGGDkmsPvT3SBFxZy50kGIR/Z7MY+vYL8WF6AQ4M92LJG52f3nRLX/uLRaJakIAv6MdYCVUPyP+Bt0BRLy0cRePRkhP8pk03vpyNzk5CgV3K+CqBtYuofWVz0NtKaxmg6z8c5t57j70ZogzeC0ZLxKN/vNMDxZURrDsBrSN3K0RgRDjUSBuam6yOYi/XmK3Y6I5gLLYsv6U2uDpT+be5nhYdFihHIRJI6rGJU77w2Nh6akABnrf5frQmrtENTGzehonvfUJqbtuXSgb1fink94rbN31A== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR08MB5814.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(316002)(55016003)(71200400001)(508600001)(33656002)(186003)(86362001)(66946007)(66556008)(66476007)(110136005)(26005)(76116006)(4326008)(66446008)(64756008)(54906003)(8676002)(52536014)(5660300002)(38100700002)(8936002)(2906002)(122000001)(9686003)(38070700005)(7696005)(6506007); DIR:OUT; SFP:1101; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6867 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 993d9351-b30e-400b-5061-08d9ed141200 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Dhgf0y5LtxY2DI1u4vGqxVw2nea8qVxyss6NRGgLf8AZYjk52o1vCbBg+Qg0YPfAbLdYlG+izTKrr8utfiMyrUNQ7d/LhsxhUVz591stJyDvFgyIo7NAP1LFI4ur6H1c9UucNKqcUm5RNH+uK/3A2j+Vfy3UwJcGcLHt2WDDisEy/Pn59iWP2qcT6fGglrN+C4hppd4oNM5pwwIj+6rG9L+O49mMeRslIIP1HCZc/EcPTOYFt0TxHJo2LFlBkkHLyZs+vkaeufhbvZKkWEqdd6iO98dTAcp7LCLZ7r1SqKRDTYRxLy6oxMvNpcXT73eC4sN7X6FCXTNJZccejYFIfT2h+JOGE/hgNobRpy97cGIDy0jSo6YfPGjJjUepqkQK+BamPhUVObSrBqvThOPeViOw7IAH35vfnVpG/nEZw7N4xu6bucaiX3guhnQ4seTpnGJ/0iOf3BhNo+G6US+zHFLLC5GCgLN2+gWXFVfGk6OsciO3kL2AIMkAkT21JbMQkxDb3I4ce5yi9K/kghKPf9D2vKSJay8TmneZHYvBNXzQH78sdMVeMUO9w2lfXN25uHW114szQT5rNfd0s2TDHUQ9AcSTePURRjAGpMvkfyaj7Kg3kx09T0GZPuK4GqISTBnZ0lDbff2h3iuECF9KzNvXI9vvg6I2aQW5r+OKphi8QhHxBeKz3gq4Efl/xHOE X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(186003)(81166007)(26005)(356005)(336012)(55016003)(40460700003)(47076005)(33656002)(8936002)(5660300002)(52536014)(2906002)(36860700001)(70206006)(6506007)(70586007)(8676002)(4326008)(9686003)(508600001)(7696005)(54906003)(316002)(82310400004)(86362001)(110136005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2022 04:07:57.5971 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4ac0e9a1-3155-42ef-da2b-08d9ed141628 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4736 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 > > > > Thank you for your input. Please see few comments inline. > > > > > > Subject: Questions on i40e TX path > > > > > > > > Hi Beilei, > > > > I want to make sure my understanding of the TX path is correct. > > > > Following is my understanding. > > > > > > > > 1) The RS bit must be set in the TX descriptors to ask the NIC to > > > > report back the send status. > > > Not for each Tx descriptor. > > > According to the datasheet, " The RS flag can be set only on a last > > > Transmit Data Descriptor of a packet or last Transmit Data > > > Descriptor of a TSO or last Transmit Data Descriptor of a filter." > > Yes, understood. > > When combined with #2 below, we are asking the NIC to report back the > > send/completion status for a set of packets. This allows for > > amortization of cost of reporting over the set of packets. > > > > > > > > > 2) The NIC reports the send completion by setting the DTYPE field > > > > to 0xf. This also indicates that all the earlier descriptors are > > > > also done sending > > > the packets. > > > Yes. > > > > > > > 3) The check "if (txq->nb_tx_free < txq->tx_free_thresh)" is > > > > mainly to ensure that we do not check the "descriptor done" status = too > often. > > > This condition is to ensure there're enough free descriptors for Tx, > > > avoid Tx ring full. > > Ok. I think this check has another purpose as well, though I am not > > sure if it is intentional. I see that the descriptors are initialized > > with DTYPE set to 0xF (in function i40e_reset_tx_queue). So, in the > > very first call to transmit function (for > > ex: i40e_xmit_fixed_burst_vec), the 'i40e_tx_free_bufs' function would > > end up checking the DTYPE field, if the above check was not there. > > > > In the data sheet, in section 8.4.2.1.1 (transmit data descriptor > > format), the RS field is described as follows: > > > > " Report Status. When set, the hardware reports the DMA completion of > > the transmit descriptor and its data buffer. Completion is reported by > > descriptor write back or by head write back as configured by the > > HEAD_WBEN flag in the transmit context. When it is reported by > > descriptor write back, the DTYP field is set to 0xF and the RS flag is = set." > > > > Considering the last sentence, should the code check for both DTYP > > field and RS field for completion? Currently, the code checks for just > > the DTYP field (in the function i40e_tx_free_bufs). >=20 > In my understanding, RS bit is set by SW to indicate HW needs to write ba= ck. So > I don't think PMD needs to check RS bit. > Besides, PMD should have ensured PMD checks DTYPE of the descriptor with = RS > bit only. This is not ensured for the very first call to the transmit API. All the de= scriptors are initialized with DTYPE set to 0xF and the RS bit is set to 0.= But the check "if (txq->nb_tx_free < txq->tx_free_thresh)" ensures we do n= ot free these descriptors.=20 >=20 > > > > > > > > > > > > > Is my understanding correct? > > > > > > > > Thank you, > > > > Honnappa