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 6EBDCA0C41; Tue, 19 Oct 2021 23:22:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2F8DB410F1; Tue, 19 Oct 2021 23:22:31 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id D41D240142 for ; Tue, 19 Oct 2021 23:22:29 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10142"; a="252108779" X-IronPort-AV: E=Sophos;i="5.87,164,1631602800"; d="scan'208";a="252108779" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2021 14:22:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,164,1631602800"; d="scan'208";a="718549424" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga006.fm.intel.com with ESMTP; 19 Oct 2021 14:22:28 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 19 Oct 2021 14:22:28 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 19 Oct 2021 14:22:28 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.46) 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.2242.12; Tue, 19 Oct 2021 14:22:27 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RDjXG5O6Sg6GTu94bK6y4NDSvLgdkehE+jZOUJetywlHI/2MbGvoIPFVcxtv9ZG02PGH9n0jeQPcIYSZfflDKzdYxEjwwLicu6kQlSSy0LQ+sBXK1vPUH/jL+wcl93cZWEuAnhyWGX7wgEI/A6c+XEDeC0o4Na5KZ4CG1EA99VMSX9oBS2CBMRxJf62Tqgxf3dYcBpDs2R8zcq7F3cQh6ZtnaSNfu+xExJbZZLTx/wRMK8RYF0/jrdPhkM82FzA7AePlSDs6z3ElbsGYIMPxUALTNT2bkRNGhRo5GpCypUp7Fil6nVd8TwU4oDCCaL9t1bjNgyHF2PnKhMoWZ6jtew== 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=vj66fu73t5kzKT4ALglaCXlHewI9xwkUD8EzMHXHb7M=; b=C1MQAs6D5lKZYaMV7zhBF6a0YzDAetKfR/BVLBKmyx4nvUGbvpevGebfPzVZhrPz5Icc/nhYj4ezE11T6SFAKPCj7vY+cqX9XBY3FrHN3lQuFX0E84Mx6tcrz0hIcKcZzjFENxQDM8AFtrqqTNxReuwEXldajT0gAVbYiJkXRb3guXmwMSLhDB/dKlB7g5FmTFH3uE5bED8HaKjzRnkTJNGZe9cygSJcgBCmq+mtNaRMhj+B6T6CoEaAY5azNnuCBYIFIJGbxBCCKJR8eRlcv/LXARFIn8zHQ+GspKYniLjFWyeXDZCFfz7RgsBPJIXTjZKl4oZYFzhbmcjtWN2EiQ== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vj66fu73t5kzKT4ALglaCXlHewI9xwkUD8EzMHXHb7M=; b=glymw1N/fhLoI8kNTGkfHd7Pe+mcm4HGQeTRzz1cPnAZz514don1a7W+KA7c55IqZKLdoxhqfrAOceTeZqeK5lcgosMfRDOiwqisbsaRncQPEPgiLkqs8lRBWKpjIoZ5chZ0S87sk9rNyQNRpynyBRzSNKIDqe61GTbsyGHZ/UU= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB4952.namprd11.prod.outlook.com (2603:10b6:510:40::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Tue, 19 Oct 2021 21:22:27 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c%5]) with mapi id 15.20.4608.018; Tue, 19 Oct 2021 21:22:27 +0000 Message-ID: Date: Tue, 19 Oct 2021 22:22:19 +0100 Content-Language: en-US From: Ferruh Yigit To: Rohit Raj CC: "dev@dpdk.org" , Nipun Gupta , "Hemant Agrawal" , Sachin Saxena , Vanshika Shukla References: <79974313-19d2-2d57-636f-669341172b1f@intel.com> X-User: ferruhy In-Reply-To: <79974313-19d2-2d57-636f-669341172b1f@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB9PR06CA0005.eurprd06.prod.outlook.com (2603:10a6:10:1db::10) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 Received: from [192.168.0.206] (37.228.236.146) by DB9PR06CA0005.eurprd06.prod.outlook.com (2603:10a6:10:1db::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.18 via Frontend Transport; Tue, 19 Oct 2021 21:22:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 328b5a95-bea8-4e8d-6ca7-08d993468c75 X-MS-TrafficTypeDiagnostic: PH0PR11MB4952: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2657; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E12WeEXpyvz6yPd3zWD9b6UUNWdLqaFi+yfPVR88ECS0yayS9Y7Y+QDRJRBTbO/ZVXTzwXWi/gzP+8/i0jsXQUElWCM14AJ+U1xO1DQexBuhMerEncP/22aSPm41TMIIKl/F49g75Ug8DhHJHD/blSwUwo6KNHDD7Mm/MhqoJMD9BLSuFUOsaihAdtPizmS8+asrDJ69MZwt1+bNDXR3k4zmEd+xEKsKA2gqe4TbpmB3Ty1nsbcQSOIIzuK7BklEJ357MRSwwkGgklEtsVYYp9/HSQboP22h4PORjxBZU+IyMFqKMdLJVI0Qc6+5PgX5mYrOJrlzxW6o6X3m5Mq3rdbFfAnqE6vNV2iAOq1/1y9UKsgnEpAvXeBWJsD8wnBQ+KX15Ih9XMlhQ/QEKv7xK1vUcb3OiGnfKk+CV0GV4A/WXtTZX/Es5boSN2qK8nF1R6EjPvqF5Xzc/WMLFQqPYz0kKihZChuK0pgvBhm5O5ZF0hsIAWzDQtqEFKK0y7aoFZdfrDM7w/N5Dfdk7CMeDjO+EPaAdTwVllE+EuKvtp4lssOe6xQ2MKYsPwfyspIpWKzdXM1lpWAHwQYGtj/Bti04urLfGuBUEga1GF+rxvr8XDAlqOYgRoof22ziN05G/ERBTBuVbg1tfnsLT+Dw+ajvwVFFxdNwRyNauNdoGZhS8zRRoPHhvDZeUBRdthBAK1D7Dqm5YDlkBo3UgpOj9YR5kjG5++uvjr+6Eu9WHp4vUCAOZrNByiIov7hR519v2gPPmnog6uPkytrKPk0ZyrinRQpnyQutmjSWoQ7pow76NTRA+cn+xaBntazJKAooFv/wMRQE5tRRDsrYxiiooA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(316002)(83380400001)(38100700002)(16576012)(31686004)(5660300002)(36756003)(2616005)(8676002)(6486002)(956004)(31696002)(6916009)(26005)(4326008)(2906002)(508600001)(966005)(66556008)(66476007)(54906003)(66946007)(86362001)(53546011)(82960400001)(8936002)(6666004)(186003)(44832011)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Z1g4M1NKYy90SEV3dlhlQzhFNVRUU01ncHprR2Z3QWtxdWpIcVk1OE04RkE4?= =?utf-8?B?QW9ZVFN5K0l3L3o4ZlJPZXdoNGlkeGNNN2d2Y2dLaEt6Tlh4WDVON3FQZEhZ?= =?utf-8?B?ekRERm1aMFBWTHhzNDJueGdMYS9pMVFJN0x2TU0wWGNvSUdjd2I0bm4vRXFl?= =?utf-8?B?eDNFZkk4L3IzRjZrakVjY1NnamN2eFR0clNIUE8yaDBwU3Uyc2FIWlkxN2xn?= =?utf-8?B?VUJmSDhTdE5lU3ZEZStLTGs2em1IdzdwTkhHazFmZ3JKSkovYkFGZ0YvazI3?= =?utf-8?B?OVpvaGlQV0FWQ2ZMenVKdXZXcnRPN3JXTTJxZ1oyMGpuU3UzSFowVnErVW1C?= =?utf-8?B?dDQxYTBPSGpOeDFyeSttL1lpVDBia2h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2xCRXBSZ3cxN1pVZittclQ1R2xtWktpV3FRbC9lZk1M?= =?utf-8?B?dnI5OWFUZFpmbE9raGhsRkY4VUlObTcwOGZLM3lKTTNselpBYVp1RjQ0NWUy?= =?utf-8?B?eFNGVnQyNEJhWHlrTkJxTzM5cHFSMGdGOVJqNWp3d0g4Qk1hMUVnRWF6L3Rh?= =?utf-8?B?Tm5vQklpdkR3M3JhbnlwQXRnZTY3WmJkOUZZOXZkSnhJNzBSVy9EMGowWmZY?= =?utf-8?B?RVp0a1NJTXJ3ZUh4T3ZlOUExZXB4WUpxSXU5ZisxV3dvQUhvR3FOS1FRQVF6?= =?utf-8?B?VTZVU3RLWUM4UjdTbVcvNm9XNi9CaTRKcVBWZUNmV1ZGb25sY3VzQjFEM0FF?= =?utf-8?B?K2pyS05MYWFGQU9JU0VBbmxwdDhxSU1EYnFrczAybytkT2ZVeFRBTFV6dktK?= =?utf-8?B?dytXTjlhWUdMeU1QUGlRZ1NoOGV4ZnUzT2hlcVNRR0E4bENJaGVNcXRKd1Ir?= =?utf-8?Q?XRPW2OCp2QT/EJAZvS3hqrwMakGFCTj7qIE7WoO?= X-MS-Exchange-CrossTenant-Network-Message-Id: 328b5a95-bea8-4e8d-6ca7-08d993468c75 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2021 21:22:26.9188 (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: /1u3UbzBe/79hLu3xrzivqSYhgamdvBbgFwkSzM6BgVr7zjofYE12n27bbjk2/yIGf2dVykc1aSvB87xzVmQGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4952 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v1] examples/l3fwd: fix jumbo packet drop issue 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" On 8/13/2021 9:42 AM, Ferruh Yigit wrote: > On 8/13/2021 5:48 AM, Rohit Raj wrote: >> >> >>> -----Original Message----- >>> From: Ferruh Yigit >>> Sent: Wednesday, August 11, 2021 5:01 PM >>> To: Rohit Raj >>> Cc: dev@dpdk.org; Nipun Gupta ; Hemant Agrawal >>> ; Sachin Saxena ; >>> Vanshika Shukla >>> Subject: Re: [dpdk-dev] [PATCH v1] examples/l3fwd: fix jumbo packet drop >>> issue >>> >>> On 7/27/2021 10:25 AM, rohit.raj@nxp.com wrote: >>>> From: Rohit Raj >>>> >>>> l3fwd uses mbufs with 2KB data size. If we enable jumbo packets, it is >>>> not able to store packets with size greater than 2KB, hence these >>>> packets are dropped. >>>> >>>> This patch fixes this issue by enabling scatter for jumbo packet, if >>>> it is supported by NIC. >>>> >>>> If scatter is not supported by NIC and max jumbo packet length is >>>> greater than default mbuf data size, then application exits with >>>> proper error message. >>>> >>>> Fixes: f68aad7904f ("examples/l3fwd: update") >>>> >>>> Signed-off-by: Rohit Raj >>>> Signed-off-by: Sachin Saxena >>>> Signed-off-by: Vanshika Shukla >>>> --- >>>> examples/l3fwd/main.c | 14 ++++++++++++++ >>>> 1 file changed, 14 insertions(+) >>>> >>>> diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index >>>> 4cb800aa15..6aaaa8ecb5 100644 >>>> --- a/examples/l3fwd/main.c >>>> +++ b/examples/l3fwd/main.c >>>> @@ -1035,6 +1035,20 @@ l3fwd_poll_resource_setup(void) >>>> "Error during getting device (port %u) info: %s\n", >>>> portid, strerror(-ret)); >>>> >>>> + /* Enable Receive side SCATTER, if supported by NIC, >>>> + * when jumbo packet is enabled. >>>> + */ >>>> + if (local_port_conf.rxmode.offloads & >>>> + DEV_RX_OFFLOAD_JUMBO_FRAME){ >>>> + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_SCATTER) >>>> + local_port_conf.rxmode.offloads |= >>>> + DEV_RX_OFFLOAD_SCATTER; >>>> + else if (local_port_conf.rxmode.max_rx_pkt_len > >>>> + RTE_MBUF_DEFAULT_DATAROOM) >>>> + rte_exit(EXIT_FAILURE, >>>> + "Max packet length greater than >>>> + default MBUF size\n"); >>> >>> This is a configuration set by application. So application is failing itself because >>> of configuration it sets, seems odd. >>> >>> I guess the jumbo frame can be enabled when user provides '--enable-jumbo' >>> argument. What do you think adding above check where that argument is >>> parsed. >> >> We need to check if hardware supports Rx scatter. To do this, we need to get Rx >> capability. Hence, this is a better place to perform this check. >> > > Got it. > > There is already a patch [1] that I am trying to update the 'max_rx_pkt_len' > usage and remove OFFLOAD_JUMBO_FRAME flag [2] etc.. Those touch to the same > piece of code, can you please check them? > > After those patches, your update can be put into 'config_port_max_pkt_len()' I > think. Can you be OK to wait them to merged first and make you patch on top of it? > > [1] > https://patches.dpdk.org/project/dpdk/patch/20210722172113.3236450-1-ferruh.yigit@intel.com/ > > [2] > https://patches.dpdk.org/project/dpdk/patch/20210722172113.3236450-4-ferruh.yigit@intel.com/ > Hi Rohit, Can you please check this patch on top of latest next-net? Since 'DEV_RX_OFFLOAD_JUMBO_FRAME' is removed, only 'DEV_RX_OFFLOAD_SCATTER' capability check can be sufficient. And still same comment on 'RTE_MBUF_DEFAULT_DATAROOM' check, it is application's responsibility to allocate the mempool for mbufs, so instead of checking the mbuf buffer size and fail, application can allocate mempool size based on user provided frame size value if driver doesn't support scattered Rx. Thanks, ferruh >>> >>> Btw, no need to enable scattered Rx if the packets fits into buffer, so above >>> check can be done slightly different: >>> >>> if (max_rx_pkt_len > buffer_size) >>> if (OFFLOAD_SCATTER supported) >>> enable OFFLOAD_SCATTER >>> else >>> fail >> >> Agreed. I will do this in next version of the patch. >> >>> >>> >>>> + } >>>> + >>>> if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) >>>> local_port_conf.txmode.offloads |= >>>> DEV_TX_OFFLOAD_MBUF_FAST_FREE; >>>> >> >