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 CE7C2A00BE; Wed, 20 Apr 2022 15:49:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A66AD40C35; Wed, 20 Apr 2022 15:49:16 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2096.outbound.protection.outlook.com [40.107.100.96]) by mails.dpdk.org (Postfix) with ESMTP id 893B1406A2 for ; Wed, 20 Apr 2022 15:49:15 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YSs9nzznhcv8s3hNW7+xo07EI5JjEcZLm/YTRJUhr8qJjy1ytEnhfcnQw7JLq/IFUuWdwVPZzgJs8uYEs4avcW9nBPtbhLAcj43HaGvVHBw01LR2QVueBVW8GxX6btMGWXHxsbKnqlC248g9COvsni4XUsNwnu3agppNARh24RJvXQl5S1SRGxupIXi9MRxc7CTkrvlvR4zYv4BGXzVGpPfqozGvvg14be9eI4K7d3PkSmBIu69ep4/1Y6SIaH5xs0EDePSlKv/e4oi360x52/QHB6ooWI2i+H6QfSmloIOZuBux2yKhn9wedTbqJKk6vadiM1tmXz6FX42eRjx3bw== 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=PFF1CmhlMf1yAqfUxqOFRzpEbm3Vya57169paF9SJoLt5hjvTAhcETUjvOYzjiY2Ib/fOyWmaLPFCejVZKGiq6gnCow7pcTZkxssNheqsC6S7m9yjibmMWSZnmli+24uHgBwVUPrSnvO28cT11p9A18D5Gr6iFqZ+yQre9kGqDHp3yTIjybPMHIqm60NRSZWz9W5QY9B5uyMgdFkhb1YumJSsd1nXQwixwKRdp2NQ4CEVJKFWyyVsn6vvs7y4bVtu/pgpM0wSDhOQD98h2vhUslJf3PbpM2Ie9INfDUvhxQJ4iK9ksr0dhOyaxE82Q7pf+bzKYx4Pk+rCoNhiY7aBw== 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=KTFO1378dcgQkJk3UgZ3maUkHocTwm4/wH/BuW5SUGcvJgKstIywy4+k8G3kYSYthx/We9CrmfC/1THgizmWkvha3UGCKMR012TsXLupIuS34pmqwWQ49C0tse3lqXyaBW/T+OSHdkEmqkn6pE6iPsX6NNiqAOQA9aTfgihylhE= 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 SA1PR13MB4862.namprd13.prod.outlook.com (2603:10b6:806:1a8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.6; Wed, 20 Apr 2022 13:49:12 +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.5186.012; Wed, 20 Apr 2022 13:49:12 +0000 From: Walter Heymans To: dev@dpdk.org Cc: Walter Heymans , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Louis Peens , Chaoyong He , Richard Donkin Subject: [PATCH v2] net/nfp: update how MAX MTU is read Date: Wed, 20 Apr 2022 15:46:39 +0200 Message-Id: <20220420134638.24010-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: LO2P265CA0264.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8a::36) 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: 8317ecc0-7d98-41b6-89d9-08da22d48ca8 X-MS-TrafficTypeDiagnostic: SA1PR13MB4862: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: ufBbjs1ha8Hc8V95Q/GKkue3f47UyizRSqYbuzvcyJln3yvP9nGeGu6unbnpjeIYx9GgxGHukAs2UeaNygcuR5L9dfIRGR1g5ALInte8GbYx+2lmT6lCsIn6SJFQQleg9vKaGUGO1UdOII+QzDDcW6/zNIgioqXUzXtsHpvvurX4yRe93wXZSdZnJEYZQepg15WjxZw0aSJDqBLfLXzVnkoCfcQwkTJh1ZNX37GVxKf2eMo5ofJ/9UrMeailn0MlIKm1GrdzN3ssRXMD4T4A7hXuGDyy0MRaC9ZJYNfGmyyrqOTcxGIbqy6gLFcXY1sv9tg9240AXohODdm7jOhzGDNZV6gAoksR09+D6UNGiaz8a7T5+hhmT0CxjRDAckvlr4MtZv88YMj7SHCJDXv1xXQMvgJXa9ePzKmMb8/wWv0QBzwcu7rxkkCxQpZVT4uAGq2izec4mPuoXgP+PwULSN998ysNzU/moiZ4B0FH76TwJhZ3aUKTjtm77oEJpWbkt/fXks/PB4M5DW1DfBqUo5TYnqHzEyImS9oIk+TCIBhJh1Oky6PYp/kScj9bwF3uzxnn0fmW9Qm154FKWNX3ePSR83rMm8qnxCdZzLwsZjqLcgGy7pheik8vCVGpRBhZ1A0KOfTaZqYhS5whQh48pY+XOJJJ7gZoY9RV2wlr4DAuJr3I5GM4CurGNLSESc6YoUQxIWIflqixuhYfeL+vuw== 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)(396003)(346002)(39830400003)(366004)(136003)(376002)(6512007)(66556008)(66574015)(8676002)(66476007)(8936002)(4326008)(36756003)(54906003)(2906002)(316002)(6486002)(66946007)(44832011)(5660300002)(15650500001)(508600001)(6916009)(52116002)(1076003)(6666004)(107886003)(86362001)(2616005)(6506007)(186003)(38350700002)(83380400001)(26005)(38100700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?THhMSjRXb285d3BtZVgvb2pJNGFvKytVWXFyZTI3c1dseFFGODMxcDNPMEEr?= =?utf-8?B?NzRjZFdVZ1dWWWwyYWdXWjlTdVRDWi94R1Z3Wm1IWjZYcXBlaFlvVkd5Ulg5?= =?utf-8?B?MWhzbkpGckRRYVhlZ1R4VTlEdHZZUHM0RWp2dnhRcFU5MS9ObnFjMTMvZmdl?= =?utf-8?B?Z0JuY0FmdW9oeVpZR0cwTHFOdFR1b1VXMXlEdVlVS2JUQUsrRlg1emZWT1lB?= =?utf-8?B?dllBcDVlMUVYa05tMzJsSWs2dmxKcXhaaFBNR2NUTWhWMXNlOUh4SDAvYVF4?= =?utf-8?B?RE8wZHhnMHk0L2F6b2EyUkpMc3pUVU51TnhqbnVRQ0hxNHVyNjB5UytXSHFH?= =?utf-8?B?citvc3pYOWhMQUd4TGlhWDJiRVpuaVF0SnVadDI5dWNqZ1AvUUtwMW9JR3dM?= =?utf-8?B?K0V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jN1eU9B?= =?utf-8?B?NzhwTUNTMmMwcnlXUGQ0VjZ6YmJ2OHlLUkVVdFNmbldhUnhjaDVvWnltZTNP?= =?utf-8?B?UzlIQTMreDltSEJHNzEvTkxjLys0Y1pVOXZGN0JKZDNPMGRhd0w3RFNOVDRN?= =?utf-8?Q?iXfmlHUlzs5ttpz8=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8317ecc0-7d98-41b6-89d9-08da22d48ca8 X-MS-Exchange-CrossTenant-AuthSource: MW4PR13MB5434.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2022 13:49:11.8674 (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: ed+QTfsm7mnIRgKCp35o+czdW/j0YWBHMHyzemtar5sqy6GZE9Sr0J8Wrxi9J8hjcqHes7JR1AVhSUmMU3bYZGSQWgxfdS8MMthv0vb1fns= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR13MB4862 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