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 AA28F41C38 for ; Tue, 14 Feb 2023 10:55:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A1BBF42D49; Tue, 14 Feb 2023 10:55:31 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2076.outbound.protection.outlook.com [40.107.220.76]) by mails.dpdk.org (Postfix) with ESMTP id 6CC1E40E2D; Tue, 14 Feb 2023 10:55:28 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=em7hzy7Tg/RRVnTnCZ0CtM31kui0DPwhS+F3akrYPV92Adgi7i9MHnB9rxKGxDzjNnaO1J26ho0Wj50DD+GKU+2eMsxuTzF78rXMZNXcHN4vOD8ALPP8E+yNSWMoCA/4kB0qr5p5uVWoUdHUctv+fexl+87wXsmsMTf8qJrLM3QDOBUutWKntVHFEUF6F+Csfw8UHyeLrqHsvhEm3poY1pPOUD8OZ9CNeZxnpiTVw7f+flwUECofnjkndYqWRat4yISVApJDGjo+g2kEkZkexaX0Y+GPWzrmB6inKJmcQWcZ89inaDlYj1VMjaJ88H6l0cS1gqw5ReaJPLYRfjQ4RA== 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=G9p07hf2eIXvYxsHunsjej7f/6pywR8/Szv5psZo+wk=; b=jJiirtoK4x7wSxtcK4ImwpBB0H7BDpdY3pOJoKLdSFZyQ2iIQwm/QZ05R6ny0vp/ONf/p/ESqwoNKy297Ay0ShKKpSuoftpzU45Q0idOW+3b7w6MM4xH0NwCM7EnTAybX6wbaeR22WmzGT0WhdNSbh6SGXnHsS+NZo4ySse4SbsPePmqYIL3ISlKs5lT2f6GePbV+P0sO93cIzqBf3u1Tfk0uwpD+gAu7wr6BwjC1+vFGQueOEumY7uNZ/lkgWeYLDbKn7n8m8Fdib1t2VmD6Cu5fKPzXtIhouf1uQLiSA/WNzpjpdoSJiLcDg6wFt8F1zsdg7awinOeY44wI6FCyw== 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=G9p07hf2eIXvYxsHunsjej7f/6pywR8/Szv5psZo+wk=; b=G10sPmpBnI+mkGG39FvyNef4PR5X2bxIF3QFDCNOATNARlVgElufYaa/YNDxYVH4NQrGmrrM1F3VZ/RdTS96nZvEM7VBru0hkPs64dDFDyfyd/d4DwhnaX5fJStoDECHGf2X6dxxCiGcLfqFOT+fMgihWO2CWB9gVdguBAPFaUI= 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 SA3PR12MB7974.namprd12.prod.outlook.com (2603:10b6:806:307::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.24; Tue, 14 Feb 2023 09:55:26 +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; Tue, 14 Feb 2023 09:55:25 +0000 Message-ID: <3053d862-ba1d-b064-1b59-f39cad9ab89a@amd.com> Date: Tue, 14 Feb 2023 09:55:18 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Content-Language: en-US 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> From: Ferruh Yigit Subject: Re: [PATCH v2 01/10] net/ngbe: fix Rx buffer size in configure register In-Reply-To: <06ef01d9404c$83820a10$8a861e30$@trustnetic.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0341.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:d::17) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SA3PR12MB7974:EE_ X-MS-Office365-Filtering-Correlation-Id: 78a89dc5-642d-4838-2c3a-08db0e71980a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WIMEw0EoCUv/PJtZhEeZf+HLZkLd4YIwpyo6xQIa8CO+TVU8NI0hW+eToQ+Ar7lR/UW+RroIzrcx8exx93ty6nMi12XAqZxeJfCLHcQ/JuslMWb6eeVM/y4oSouQASBLhbjPav2esT66CanBMbcY5/Rvy3sM6huZelocKP6YPfNuZRbupB3BSS9gX7iytKb89ZJAU8Yp29ONyomfV7wlXuIg4Rh6yNjneFJmvlfZSsycam3BbHrQGM7uXo0qqwYc1IfT/h5yI+U43Bnajq6ihb4vH/ANED1rB+x4jBgdDrBLg8O2KcqBFCheaEiIQ54Uas13miuxPjj83xwxOc8TP6yDAHdH9FiXt+WDtNvFM28JgAsh2twO5YiJnR5lifCQICuo1HNKOj3O6nKbgeDyc8gssa6/XLpPbRWo0B/GoC1sTMrYWYPXYcO6j/pSqFDhnHUe3/EogHDOIRswY3s1Wtal4DuPG3ZhTio9VW33cgPh3aqsmdOAf8WSYhkGRRMRd800RJ2Pa0z3SGMLvPm+eQaA4XE2vkZV3m70zHyaqHyXrjgFRoys9lV1oZlytgqhwiYO7v6ok9eDGlyajLhCkAF4LIBTroSBOH9bdC0SlUnPg0be+oja88nh9/VJ6mNev78ie1JJHOD304eId3FyTWkvY0meCawY9FToHy6jJ3Jv+k1/LN1bb4MWwVtuEzt2HDYggCflUUv3bbX8/hFsZ+DC1pQC6VFUNU1vC6X+Fyk= 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)(366004)(376002)(346002)(136003)(396003)(39860400002)(451199018)(186003)(26005)(31686004)(83380400001)(86362001)(36756003)(6486002)(316002)(31696002)(6512007)(6506007)(53546011)(6666004)(5660300002)(44832011)(2906002)(478600001)(41300700001)(38100700002)(2616005)(8936002)(66556008)(8676002)(66476007)(66946007)(4326008)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bldWSlBNL3F5WjExNEE1cnNLdGJUcFcwcUNnblhEcFg4dEZCT3hkWkxXTXE5?= =?utf-8?B?QzFwWUJ5R05GR0U2UnNGRzFheEJpbTRzcStjRUgzdFN1aUx2WU5McG9HU0RR?= =?utf-8?B?SFhOWTdHNjNZK0F3ejBRd1ZWaWRURTVvSVVpSG16dHpseE5KTVAvUG1kL0NB?= =?utf-8?B?bG5CVWZoNUkrVFBDVnVZNGZjZTFDR0pPRmRFSFdiT1FJRWNXbGJaeE9lclNE?= =?utf-8?B?aGRj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JicUVrTHZjY2lhaDhVM1UxOTdPVVJCNzJUZUdXZ1p0T3AweU5aMVJF?= =?utf-8?Q?WjJ01LEdWsxr5M5Pt/2TVRfrI?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78a89dc5-642d-4838-2c3a-08db0e71980a X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2023 09:55:25.0935 (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: 9PziQfS3BWBRgr1DwQ2rISriKQ/i1u1WFhzxBxARE1QB1fQf07vv5FFuiiUTnBpg X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7974 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 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?