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 42F7FA00C3 for ; Wed, 20 Apr 2022 20:54:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 694C641156; Wed, 20 Apr 2022 20:54:46 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2081.outbound.protection.outlook.com [40.107.244.81]) by mails.dpdk.org (Postfix) with ESMTP id 3AEAB40C35; Wed, 20 Apr 2022 20:54:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HW7S0YHHhcpPs/ls3+2ysmEGQVb55vvd46Mo8/pq/KDA9SAxlcaQCTHBFg3lsRvyAceSiEdw0mIGoXl923DhMNimVgV5IBuxzNSEX+7LsyEgOyVWzSfU2Dpz6/uYImhnFMtVxwqQr2NxOKC3CbYJ3lEs2/rc9//akwV5nsrMUGnBBgl1Q744MIud75UtmnAsiyCF4kGycd//tmbZXZpdMiLi8bZbBbNWcQz4qA3LTTKfuIjLNByXfkh2UdajWcobHULzGlFjGC3Htu0AUAeqfj7XghpwtK47gSeH3bDZ2kEylK3xiv9TOU9ZEnpViL/isjIzd2DsQF17+xTXZXhHYA== 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=AuaeCvBgTen4xhW7BvYL64/x2g5DWfni0ST4FUu2OSE=; b=hbzkcOURPfV9aE0QwQgL/oMR66UPw3aDTPwJ0o83oyrnbeg/IuJERTaSJB5BSSigw0T/wiwvZSSHkS0KYQB7H6M7BURkpP8GQq6rE4IYgYBm07mdFnBJUiVHHr+f0tGlSAmpH1LnK8VH6hE5HCHp+ejoC1Q2+5CwGJdZQNgjAxxpdH8wqNsp26VdLeaafJ0yhwXfLMdLq15sJkuyjS710CuvDfSjKDseBUPYs3piPLn9HKGl1fnvR1sfxU+mLSObymljKKXaSaE4SO0uasg4QygDeAMZQtBigq4ha+kBvw08SzbNywyUkhab5vt1jL8GTOY6c9wPErAW+Lg6tFNufw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.80.198) smtp.rcpttodomain=corigine.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AuaeCvBgTen4xhW7BvYL64/x2g5DWfni0ST4FUu2OSE=; b=DTcg57mvUs+ZCO0pHe32qNs7fbF+NPqr5aRTp9wBLt+5jSzAsNbZ2WDNMxYjhOoTDkWdCoqlNQXlr7pAns26VRBqKZOYLxwrnDYVLFp4j3An/nAOE8iYPpfYMegu/bZfn9gJ87LdAp+8cxhiVaHVRlpj+k9pZf4ZeYl9co7bT0s= Received: from BN9P220CA0007.NAMP220.PROD.OUTLOOK.COM (2603:10b6:408:13e::12) by BL0PR02MB3729.namprd02.prod.outlook.com (2603:10b6:207:4d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.13; Wed, 20 Apr 2022 18:54:41 +0000 Received: from BN1NAM02FT048.eop-nam02.prod.protection.outlook.com (2603:10b6:408:13e:cafe::92) by BN9P220CA0007.outlook.office365.com (2603:10b6:408:13e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14 via Frontend Transport; Wed, 20 Apr 2022 18:54:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.80.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.80.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.80.198; helo=xir-pvapexch01.xlnx.xilinx.com; Received: from xir-pvapexch01.xlnx.xilinx.com (149.199.80.198) by BN1NAM02FT048.mail.protection.outlook.com (10.13.2.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5186.14 via Frontend Transport; Wed, 20 Apr 2022 18:54:40 +0000 Received: from xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Wed, 20 Apr 2022 19:54:39 +0100 Received: from smtp.xilinx.com (172.21.105.198) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Wed, 20 Apr 2022 19:54:39 +0100 Envelope-to: peng.zhang@corigine.com, dev@dpdk.org, niklas.soderlund@corigine.com, heinrich.kuhn@corigine.com, stable@dpdk.org, chaoyong.he@corigine.com, louis.peens@corigine.com Received: from [10.71.118.158] (port=63416) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nhFTL-000476-2y; Wed, 20 Apr 2022 19:54:39 +0100 Message-ID: Date: Wed, 20 Apr 2022 19:54:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH v3] net/nfp: fix mtu settings Content-Language: en-US To: Peng Zhang , , Niklas Soderlund CC: , , Chaoyong He , Louis Peens References: <20220318113819.885476-1-peng.zhang@corigine.com> <20220330031751.119830-1-peng.zhang@corigine.com> From: Ferruh Yigit In-Reply-To: <20220330031751.119830-1-peng.zhang@corigine.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ba4a5f58-bf24-4c77-a50a-08da22ff39c3 X-MS-TrafficTypeDiagnostic: BL0PR02MB3729: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: /YvqYcyAc9jc0QbxRbKivQ0fYrQ1YiDw1pSN1A2zjXp2QWp7zunEQvSbEnIi7GVjpu33ebAg7nqlmQ6RQ27yFEmAsD3hVZG5jPJHJOzII4l5tP0+pbGi+E+dDTyKAzEC/6Hy+sCcROEKMlmPnlAu9YxKViPrxMzPxE+TEDeeOTIiWp9iIkGOcZM8iRKSZkYTpjz/3G5y/c+2yr5OfpiqkS5tQVxl0t4Oy41gg2/MeEb8x6NuFlypNEJKgdkOSrgZJul2G8UrpOW3JUaVjfDj2nLe/h48/vb8NfvKlJ3tPCXf/wJqcyq9fzH6cOQHaTvpJlMWAVo79o4SvyZ+DzHHoyZBgJuq6/MX8geAr3k2jHEm9Cqqa700YPi4ZVvdVLjehD++y6c+nebFjbbLKVOmFAY5g0dHlFl2rCtks8TxohBaNaI3SBDv30zkry9TL4UloEQh4l3yJ/ut3m/JrKIuPNbrjfukIPTkklI0NfNiKdhXUpthuM41nhpRbzkvoA0qy7EcvdPVik8KD/G60zu2Y2xX4AlkMOXUKh2bZxsYPPLnbOUpTQIwz7ANKcY0MFXHTH7PSBvnbBsxutcs9wOdEIMK1sJhm7tXk1mab1igUPYRsu/iksdCMH/2rl3hFIH5vwWc6P/OudxMk4nXxQZE9kV5bRphg5MZy54khgAyEa9mlZ0PcswQCVtdyMRnz7SsLys3ZR18TsDRBq51YPDuu5b9XfF0VB8QuuIWCyoMV4Y= X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch01.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(2616005)(426003)(336012)(53546011)(186003)(26005)(2906002)(5660300002)(508600001)(8936002)(44832011)(83380400001)(40460700003)(47076005)(82310400005)(9786002)(70586007)(36756003)(316002)(8676002)(4326008)(7636003)(31686004)(36860700001)(70206006)(356005)(54906003)(110136005)(31696002)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2022 18:54:40.5755 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ba4a5f58-bf24-4c77-a50a-08da22ff39c3 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.80.198]; Helo=[xir-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: BN1NAM02FT048.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR02MB3729 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On 3/30/2022 4:17 AM, Peng Zhang wrote: > 1.When the setting mtu is higher than flbufsz, the mtu doesn't work. > But it doesn't have any notice about this restrict. > 2.add the min_mtu and max_mtu in the nfp_net_infos_get() to avoid > the setting mtu isn't in the range > > This patch will add these restrict of nfp mtu. > +Niklas, as he is the maintainer of the PMD. Can you please prefer uppercase 'MTU' in title/commit log and error log? I assume scattered_rx is not supported by the device, which enables receiving packets bigger than mbuf data size. > Fixes: d4a27a3b092a ("nfp: add basic features") > Cc: stable@dpdk.org > > Signed-off-by: Peng Zhang > Signed-off-by: Chaoyong He > Signed-off-by: Louis Peens > --- > v3: > * git summary > > v2: > * add the min_mtu and max_mtu in the nfp_net_infos_get() > --- > > drivers/net/nfp/nfp_common.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c > index f8978e803a..4e48e33a63 100644 > --- a/drivers/net/nfp/nfp_common.c > +++ b/drivers/net/nfp/nfp_common.c > @@ -693,6 +693,8 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) > > hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); > > + dev_info->max_mtu = (uint16_t)hw->max_mtu; > + dev_info->min_mtu = RTE_ETHER_MIN_MTU; > 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; > @@ -956,6 +958,13 @@ nfp_net_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) > return -EBUSY; > } > > + /* the setting mtu is lower than flbufsz */ > + if (mtu > hw->flbufsz) { > + PMD_DRV_LOG(ERR, "the setting mtu must be lower than current mbufsize of %d", You may want to start log with uppercase as done in other logs, for consistency. Also may want to print the MTU value in the log. > + hw->flbufsz); > + return -ERANGE; > + } Should this be checked in 'nfb_eth_dev_configure()' too, where 'dev->data->mtu' can be set? > + > /* writing to configuration space */ > nn_cfg_writel(hw, NFP_NET_CFG_MTU, mtu); >