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 B083BA0501; Fri, 8 Apr 2022 11:28:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5ED374067E; Fri, 8 Apr 2022 11:28:29 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam08on2118.outbound.protection.outlook.com [40.107.101.118]) by mails.dpdk.org (Postfix) with ESMTP id 11F874003F for ; Fri, 8 Apr 2022 11:28:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bJOlSLLjiQ4RIQD1yNCb9P0ht8ONOhvV5EwFfd+LZf6WWwJliMUijnCYZ0A2ST6vXLLEb9LL2j+ehYjOg/KFeR/c5fit0S4wq388vSo+Y9foQ+d1INrvQ0l0eKJ08eEe4oPamLDWVuAi7KoTbG2NY10TZ+baudYVNiIFc/bNuETB02qoWHa85spqRfw4bYqlcNkbJRs1umMHCC6+/ZnrFnaz9KCqJVoq337QiYeWNVowQss7pB93a+ph2951cpx+X4704aGzz3VNck16oeVVKCFzt+sQ9T/biyEJQS+YWGyDiOG11O+iyuI1t1sI/Hopixi9injqQOdxV/2lL6gJ9A== 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=gr/gUN+ilY96New3QdgbxnDUXq4RlskdiDBnqWr54XY=; b=HPFF2nxyUIc2gLeLqYfUZ2BLH/qWhGs8mPNpoaOQTcFuWWSCkLo7z6GTr/ivZeygyM/ZR/oppsZtWp5C3hA/bkog8PJxHK1ntsfx974BT13IYVBuuMzmQYEQwdGuVz+3XQkJcogFhbMLjbN9jJDVHTxgi2nc5VpIRq1APvooq1VE8giod+iTFqzxDFBFw9VzJs1PhUITckrTrNHhSqRMhBlS/5VUHJpBiFz87tVhGeXDL/gvteIem07hnEv9mPofMucmVcJhmL2PePJZpYjSVdnQNZyddvttIZT9YGHk+GmJdQq0uitmlwlLu/hBsJosMocNrEmDXS3Ig7fszw6Zjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gr/gUN+ilY96New3QdgbxnDUXq4RlskdiDBnqWr54XY=; b=sSV3/MH23oUoDOLIStsgClW/w3VUPUdRtGzGICVDa4ybsDr0TS0t5FcYHDoY2f2WfUyM+V1MoObDiGXJHcjJ1gMzbpsNc+7/EFNtfCSEuvPEDLtRN6x2ydEWh7gub0dU1JU1olDH35qr01Hy6NpG7GUUNNL/upbNsKkN+3E+Aas= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from MW4PR13MB5434.namprd13.prod.outlook.com (2603:10b6:303:180::9) by CH2PR13MB4476.namprd13.prod.outlook.com (2603:10b6:610:6c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.12; Fri, 8 Apr 2022 09:28:23 +0000 Received: from MW4PR13MB5434.namprd13.prod.outlook.com ([fe80::3c1f:1ba5:80e4:df61]) by MW4PR13MB5434.namprd13.prod.outlook.com ([fe80::3c1f:1ba5:80e4:df61%9]) with mapi id 15.20.5164.008; Fri, 8 Apr 2022 09:28:23 +0000 From: Walter Heymans To: dev@dpdk.org Cc: niklas.soderlund@corigine.com, Walter Heymans , Louis Peens , Chaoyong He , Richard Donkin Subject: [PATCH] net/nfp: update how MAX MTU is read Date: Fri, 8 Apr 2022 11:27:29 +0200 Message-Id: <20220408092729.16522-1-walter.heymans@corigine.com> X-Mailer: git-send-email 2.25.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0236.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a7::7) To MW4PR13MB5434.namprd13.prod.outlook.com (2603:10b6:303:180::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b846d16e-b51a-4905-c626-08da1942209b X-MS-TrafficTypeDiagnostic: CH2PR13MB4476:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mnw6xppLqyyuzWKC5Cy26JjJTu/4tm05scMiV95hc/dZrxGCbf8KSNG0AgwQf4LP3cYAjlkXZ/cyzDPBGisJY+fqilFdtj9hkSkVUm9hUzvJ5RaCgKuQRUl2b9BjPK24AyoHpSVXCaGxUkC+/iCOcsdy4nrREjbVve6bZkQ1bJzc/lsrTxsPlID21kTnPy78bXWAdMEHwfpRW2eBBfwThuUl/oPhM+kSfKQF7IG7B+jD9qZcqkHXuubfZJ1glwemSNNEqIdFl6QyCItBNfFvdPlOuYnHUOjnCAUcryMhQUaOdgdxNFaGl6W15wOfWevyHj23aj/EgABvHd/LVUl3F5uXSK/wUTT/YoKTP819QC1KFuUzAKcaWcAoXmGugvVCyBzzSFRf2y0FoLVQ9EXAWQvLbdLTKJS9WmK/8X1ly7pXQsf5KrEsbuKlwTM1F1sFCmjl8NH7Bo4O7nJRbQND/J/Y83Ibzd4z8pTrGsVvIj0ezzYx9XxqU5t4XVTykG9TbufR22BcyiOVuT12FymanUuJswSrRbn38OZ/bDAv8yzuX7gxet90NNguO/LQczmUJCyTHQRiCbHlRX0P+cJOcfHa39QSbn4Z5gQ7G6YSH1TTw4l1626voTYopWMdrZZ8Chdmij8VrQIKHY6mwerAUBhZjoWyZsQmAb/atYl0KMFupDegdeFnDCaOkqzRVYm7/BsYZq0M+RTDjPH8Gyu7Hg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW4PR13MB5434.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(136003)(376002)(39830400003)(346002)(366004)(396003)(8936002)(26005)(54906003)(6916009)(186003)(316002)(6486002)(83380400001)(86362001)(66574015)(38350700002)(38100700002)(508600001)(4326008)(5660300002)(36756003)(6506007)(66476007)(66556008)(52116002)(2906002)(44832011)(66946007)(8676002)(2616005)(6512007)(1076003)(15650500001)(107886003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aWxnVFVlYkNZbWl5RGl2YnpzM1hJUlRuY0hVcld1bE1nK2o2QzdnY1ZhL3lI?= =?utf-8?B?OFF0dGVUMTh2Zjh4MmwyTnJwazExUjVYcWgxdjNuOHk0UW5Xb2ZpVlpmakhm?= =?utf-8?B?U1EzQjlxMldmTTY1dURXZnB2ekdRamQ1MzFoemphV0hEMVVpajNMM1Z0YWFJ?= =?utf-8?B?SEM4WWVCemV6NktaY0RWclRCNHNzY3FWd2xBblVsbzhiWWZwVHZKUzhodi9O?= =?utf-8?B?MTJ3Y2Z1RzdYYnZETHp4aGJIdnYramk0eFh6NytzWHFZdVI0SFV5eWpodzlw?= =?utf-8?B?aTVuT2YycW1xL2w1c1pEbU1HUmZ1all0cnpSc21Sb2twUHJaREtXVkNLWWJk?= =?utf-8?B?MnR4eXpLMnJKK1YzeUJhMkVBaVJyL2duYk5iWllEMDR2bEZVQVRmTzNmRDZH?= =?utf-8?B?NUtqMzFRRVFUS2ZsKzhEU3Jtc3dTV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Edt?= =?utf-8?B?TGRCQlNMY2EydWppVXZoM3NpSlV0TmhJMXdPOW5IZFZ0TTYzcEQzOEw3RGJB?= =?utf-8?B?ZjhUdG5aNk1kTEFCV3kwemErOUZINko2c0lYNUtOUXJxeWpCcXZON0paaWNa?= =?utf-8?Q?CulOnRiY18CeWArY=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: b846d16e-b51a-4905-c626-08da1942209b X-MS-Exchange-CrossTenant-AuthSource: MW4PR13MB5434.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2022 09:28:23.5086 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jb7JnkrIT62byKNtma2e4w4/0U4fkfjhbax7B6KZOucnPUXto5UVtwG9Ex6LgZMk51MRJs0ax0/VC7dnUdp1DbOBgMQ4aQ2vSqd7yLbwpys= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR13MB4476 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 The 'max_rx_pktlen' value was previously read from hardware, which was set by the running firmware. This caused confusion due to different meanings of 'MAX_MTU'. This patch updates the 'max_rx_pktlen' to the maximum value that the NFP NIC can support. The 'max_mtu' value that is read from hardware, is assigned to the 'dev_info->max_mtu' variable. If more layer 2 metadata must be used, the firmware can be updated to report a smaller 'max_mtu' value. The constant defined for NFP_FRAME_SIZE_MAX is derived for the maximum supported buffer size of 10240, minus 136 bytes that is reserved by the hardware and another 56 bytes reserved for expansion in firmware. This results in a usable maximum packet length of 10048 bytes. Signed-off-by: Walter Heymans Signed-off-by: Niklas Söderlund Reviewed-by: Louis Peens Reviewed-by: Chaoyong He Reviewed-by: Richard Donkin --- drivers/net/nfp/nfp_common.c | 11 ++++++++++- drivers/net/nfp/nfp_common.h | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c index b26770dbfb..52fbda1a79 100644 --- a/drivers/net/nfp/nfp_common.c +++ b/drivers/net/nfp/nfp_common.c @@ -692,7 +692,16 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->max_rx_queues = (uint16_t)hw->max_rx_queues; dev_info->max_tx_queues = (uint16_t)hw->max_tx_queues; dev_info->min_rx_bufsize = RTE_ETHER_MIN_MTU; - dev_info->max_rx_pktlen = hw->max_mtu; + /* + * The maximum rx packet length (max_rx_pktlen) is set to the + * maximum supported frame size that the NFP can handle. This + * includes layer 2 headers, CRC and other metadata that can + * optionally be used. + * The maximum layer 3 MTU (max_mtu) is read from hardware, + * which was set by the firmware loaded onto the card. + */ + dev_info->max_rx_pktlen = NFP_FRAME_SIZE_MAX; + dev_info->max_mtu = hw->max_mtu; /* Next should change when PF support is implemented */ dev_info->max_mac_addrs = 1; diff --git a/drivers/net/nfp/nfp_common.h b/drivers/net/nfp/nfp_common.h index 8b35fa119c..8db5ec23f8 100644 --- a/drivers/net/nfp/nfp_common.h +++ b/drivers/net/nfp/nfp_common.h @@ -98,6 +98,9 @@ struct nfp_net_adapter; /* Number of supported physical ports */ #define NFP_MAX_PHYPORTS 12 +/* Maximum supported NFP frame size (MTU + layer 2 headers) */ +#define NFP_FRAME_SIZE_MAX 10048 + #include #include -- 2.25.1