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 165B741CA4 for ; Wed, 15 Feb 2023 10:35:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0125442FAC; Wed, 15 Feb 2023 10:35:56 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2078.outbound.protection.outlook.com [40.107.94.78]) by mails.dpdk.org (Postfix) with ESMTP id A937D40A8B; Wed, 15 Feb 2023 10:35:53 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jflCaQlHHtwrv2q4dcyxniaaUiRjPO1JrpQ0m61TFRnK9S8z//PNn10SZPHHW9FedJQuZ005N/yMZK2W37P74G8VAhKBL0FLvr89EwBBsTtLhYWLHST1F+GR4jgurB7q057J4CijgcoSwFwIMB/35j9U+3pCfx6M/Nkda2mtNv58dWu2auh+8RCeka+jQy2iZhADFg96es5FRqA73NaKqZFHO7Pgwyakvbj7ed2TBbmRQccCxhhJPTJM5T9XHr1xwauLISXKfW3XSq488qAod+4p9+srNPimqmvEpLRK3dG/PgG0e/D+xOlzTDePy/GM3oeWS2r3s2d632AUeylFZA== 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=kchXlhcZJkhyVW3dYBKdf9vpaJb4RXh4PZuaWnqRQvw=; b=G1LH86phnudQInJiu+Ly28zpp5vuUhPm9DTXSne6E8Sy3Xg7taIWZvANmCdU2pIYqrW4k2YBMIBZtZgnbURDoVFSaxPEly7ppKOYk14wnepTA2Z4eMItkkaC0CCqzfIcZdRSSJYnF2TRQeb5QXS9ijAtY8VSl28rCb0oNnkuGOfovn0ZNPNSoF1Zc+Xfx128ZdZuLP+5HD2FPxj5MwGAf7GOHl5LFZ87eddtc+apuf5OKJwXKY47wIHgmdBBov13n61hB1u6SPMj8sxtp5z/GGHWc0Pgld+zvUcnk5yL88MZbIPkZIF8GPJpPMB2m4ecfxT3wLAeu650pzR4Qv3qIQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kchXlhcZJkhyVW3dYBKdf9vpaJb4RXh4PZuaWnqRQvw=; b=DyeLlXq2kkh5wZsmFewFOfbZxPb0koZKAlkL1jHJW9bZR1wQY4sLJOoLxcavi8CZRmlqlvWqnG3rlT9v2OmT89UemuhCOaFLKsBYGVwsyl3u29aA2S8fn1GrFEA7cLIaQ1jBobws0M0pWeCeLf68DYm5k0Vu+D2OJ/LF0jgvdO8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by SN7PR12MB7323.namprd12.prod.outlook.com (2603:10b6:806:29a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.24; Wed, 15 Feb 2023 09:35:51 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48%8]) with mapi id 15.20.6086.026; Wed, 15 Feb 2023 09:35:51 +0000 Message-ID: Date: Wed, 15 Feb 2023 09:35:44 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: [PATCH v2 01/10] net/ngbe: fix Rx buffer size in configure register Content-Language: en-US From: Ferruh Yigit To: Jiawen Wu , dev@dpdk.org Cc: stable@dpdk.org References: <20230118060039.3074016-1-jiawenwu@trustnetic.com> <20230202092132.3271910-1-jiawenwu@trustnetic.com> <20230202092132.3271910-2-jiawenwu@trustnetic.com> <057601d93c64$ebb69d30$c323d790$@trustnetic.com> <06ef01d9404c$83820a10$8a861e30$@trustnetic.com> <3053d862-ba1d-b064-1b59-f39cad9ab89a@amd.com> In-Reply-To: <3053d862-ba1d-b064-1b59-f39cad9ab89a@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LNXP265CA0046.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5c::34) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SN7PR12MB7323:EE_ X-MS-Office365-Filtering-Correlation-Id: 22ca3a8e-ca39-4a52-a8f1-08db0f380693 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R8fpU4EMdajLnXMzKAfafbbGVuk/a/j4fzZ3Nkzoss195VQO6RquS3eRjX9g8AC3hXZ6pFVPqaL4W5RaZ5mfDDqOjDrJDom91+977ibTx3K/AfBtwcyfT5Jkv0RGjJIeOgtbG9C5XlrKhRnAC6PPLZjI9F3Hc09rz6/0Cu9Mvx3o4+rtl70HDPnx80vcY6UxDd26uyC5ht3aCcYCC1PI53pMQnog8TWaJW4AFcHEidSrvJaa7elHopcB0lqF3PMG0lZ6iDQga97h6gdVvfZPlb/kkRFMO0hL9n8QC2CvSw6eqOXxHQFRhMZv80gRLEr3ckE+ljHMy/Wu7bjnzNfX9AOsEIH+cgolcVddgWFUaOZzM7Zhp+4tR+IdTrkninpruBQZjDlGJDUsNsXh9zT/LzqAA+JCE+W/zCk2c2AjMPn/d5eSgG0TPHXs1HryZRKz329SNJS04ifhPkFY/FnIBEj1+FP2xwirJrzxRIGy9/1jyBbkfSFVgxhBk5P6YupUUHvwwk2PdFv5AdPKHe4l8RFf9t34QaYk65pPLHuLY/EVIm7Ijih9IWWJuZsxOUx5gTpPkTSiF6xqBrIdE7pZSdBdD7v9bOQlXQ2S+AG/wWkO6oPNXMbXslQ2YY3vmnPG6MA3K0vZEOoWQVLCVnEWIN0Hk4bJmq/5vwg7GXd1gwJRKVuQQN+51rfQS56jGAJerx6vY6wvf27Z+1RDc5YC1aBQ5kVnIvBwUhbyxLtWP7k= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(396003)(136003)(366004)(346002)(39860400002)(451199018)(6486002)(31686004)(38100700002)(5660300002)(44832011)(2906002)(86362001)(6666004)(478600001)(53546011)(36756003)(26005)(186003)(6512007)(31696002)(2616005)(66476007)(4326008)(66556008)(316002)(66946007)(8676002)(8936002)(83380400001)(41300700001)(6506007)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MFNyL3NpUm1mYWNLd29wWndaWGh0SEZ0am5EZDhjeU0xZlV3QjVDcmFBcGJY?= =?utf-8?B?OU9EaDk3dlZ6WEh5aGNXVU1aSG4xSVpkQ1g2d1FNbW1ocGM0dlFvVG1QcXN2?= =?utf-8?B?WDN6cFFkNG1FMTUyQ2h0azh1TmdsN0VCWGVJb29iNlFvQmxlYkI4bEp6d01l?= =?utf-8?B?aHJ0Q3orMXNBZC9jZDBGUkJOaXdaK2l0R25jVkpoY0dNWFVEK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ZmeGJTZDh6ZXFYd1dSZFlVUmdvK294Wmc3Um8wTUppUjhk?= =?utf-8?B?ckVoek00b3kvOUZhaGV3ckhxWWVlZzNzL08vYVc2bDZZbE5PRXhrNkhLSXpY?= =?utf-8?Q?PeBhcUX8WqM6Px5tYoajGcypI?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 22ca3a8e-ca39-4a52-a8f1-08db0f380693 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2023 09:35:50.9575 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /ksSI+4v9H3/aVTd0cCXTbdB/Jeyga13DnMQX5ETKObztH8UQPivG3HZZenvCEL+ X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7323 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 2/14/2023 9:55 AM, Ferruh Yigit wrote: > On 2/14/2023 8:15 AM, Jiawen Wu wrote: >> On Thursday, February 9, 2023 5:00 PM, Jiawen Wu wrote: >>> On Wednesday, February 8, 2023 6:28 PM, Ferruh Yigit wrote: >>>> On 2/2/2023 9:21 AM, Jiawen Wu wrote: >>>>> When buffer size is less than 1K, round down makes it 0, which is an >>>>> error value. >>>>> >>>>> Fixes: 62fc35e63d0e ("net/ngbe: support Rx queue start/stop") >>>>> Cc: stable@dpdk.org >>>>> >>>>> Signed-off-by: Jiawen Wu >>>>> --- >>>>> drivers/net/ngbe/ngbe_rxtx.c | 5 ++++- >>>>> 1 file changed, 4 insertions(+), 1 deletion(-) >>>>> >>>>> diff --git a/drivers/net/ngbe/ngbe_rxtx.c >>>>> b/drivers/net/ngbe/ngbe_rxtx.c index 9fd24fa444..9a646cb6a7 100644 >>>>> --- a/drivers/net/ngbe/ngbe_rxtx.c >>>>> +++ b/drivers/net/ngbe/ngbe_rxtx.c >>>>> @@ -2944,7 +2944,10 @@ ngbe_dev_rx_init(struct rte_eth_dev *dev) >>>>> */ >>>>> buf_size = (uint16_t)(rte_pktmbuf_data_room_size(rxq->mb_pool) - >>>>> RTE_PKTMBUF_HEADROOM); >>>>> - buf_size = ROUND_DOWN(buf_size, 0x1 << 10); >>>>> + if (buf_size < 1024) >>>>> + buf_size = ROUND_UP(buf_size, 0x1 << 10); >>>> >>>> Back to original problem statement in previous version, can't this >>>> cause HW to receive packets exceeding the buffer size? >>>> >>>> If HW accepts buffer size in multiple of 1K, does this mean any buffer >>>> size less than 1K is an error condition for this HW? >>>> >>> >>> After rechecking the code, the minimum buffer size is limited to 1K by the >>> txgbe/ngbe [1]. >>> I think v1 patch for txgbe is enough. >>> >>> [1] >>> static int >>> txgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { >>> struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); >>> struct txgbe_hw *hw = TXGBE_DEV_HW(dev); >>> >>> dev_info->min_rx_bufsize = 1024; >>> >>> >>>>> + else >>>>> + buf_size = ROUND_DOWN(buf_size, 0x1 << 10); >>>>> srrctl |= NGBE_RXCFG_PKTLEN(buf_size); >>>>> >>>>> wr32(hw, NGBE_RXCFG(rxq->reg_idx), srrctl); >>>> >>>> >>> >> >> Hi Ferruh, >> >> Is my proposal feasible or do I need to send v3 patch for it? >> >> > > Sorry Jiawen, I missed your response. > > Yes, you are right, 'dev_info->min_rx_bufsize' prevents user to set > buffer size less than 1K, so change in V1 is good. > > There were some other changes too, instead of getting this patch from > v1, can you please send a new version with latest updates? We can drop 1/10 and you have sent a v3 for 2/10, right?