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 0FCF541C3D for ; Wed, 8 Feb 2023 11:28:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05E124014F; Wed, 8 Feb 2023 11:28:21 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2054.outbound.protection.outlook.com [40.107.101.54]) by mails.dpdk.org (Postfix) with ESMTP id C73A540141; Wed, 8 Feb 2023 11:28:19 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mxcm8CQVAJHPt7uc6HiMl4j+QEQu/sUHHlmSaD0ILIPQ3MDqGovacVOOzLeaouGb1ywk/NPRGMtcs1fIGUm8XAXuA9H/tMmSi8yhDrUp1zIiMd5c3RmIeM0S4pQmA3QdjH7faLHzILU/OoIUdP+wm8j4udXap0evgyvJx+ENHh3xyVJvIsZ8JYplrPBA6iiXy8wtJ+N49a8CICF/v/8CaMkhhrt8uT9GFIAqPehRmj2jrrxKmVQgvg+sNYQ3/bnppDkrYvXh8gD7AAicuRtv4cJMl37uv9Qy4uA3zDGq9qcsImYZUV1f/UWxPhRgePc/aONFHZ21g2FUMzSbSL4T+A== 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=BJlJEengmWKf9lHNa/bxm6eMZ+7O4KmfyUcl9qAJnvY=; b=FfjVXeuxP+A1/wyTXwn/6rGnXkhI6PmGOviO2HjtYp+y+gkj8QN+ZczOp6my9hdGA8jccCq7T9beOMGIlk/b5NWshMQ4Q8MoIyiEQ2ruim+oKb9KFtOBapNhEvfYW5XjbEd1BQAG+CWlFLsq2WfuPLnCh+0srYe+MML7CZkSNindhnnjgXa0b2PFTIHbTtX8f7kDJfAHMnQyXpJdZZXPuNzJ8g0qi8eCNbd8koTseiay+CpcVvS+i4FjBR3Raqo1mi6gD8NmBYExaEK7slnM3Bix0osLsfESmSOosnRsrddkS+OKNtEqe/R09S87hfxUnw1EA77wiaR7ou9eNMuGaA== 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=BJlJEengmWKf9lHNa/bxm6eMZ+7O4KmfyUcl9qAJnvY=; b=x7c84GvCjQ2MFErTUpFIsYVaJYCdPaoROAKnH2K3T4DGJNa9t4rmDBii4NWfhnXRkBLwmim1JLZk1L/muRk/FYjRkP9O7hiI2zymp878MMpZMEgJTVihf2uQrNn9G0byeVgUQHVzDEQdlKOtc8kJUSWMiVmJyh97PI/iXDXbrrw= 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 MN0PR12MB6342.namprd12.prod.outlook.com (2603:10b6:208:3c1::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34; Wed, 8 Feb 2023 10:28:13 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48%6]) with mapi id 15.20.6086.017; Wed, 8 Feb 2023 10:28:13 +0000 Message-ID: Date: Wed, 8 Feb 2023 10:28:07 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 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> From: Ferruh Yigit Subject: Re: [PATCH v2 01/10] net/ngbe: fix Rx buffer size in configure register In-Reply-To: <20230202092132.3271910-2-jiawenwu@trustnetic.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LNXP123CA0005.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:d2::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_|MN0PR12MB6342:EE_ X-MS-Office365-Filtering-Correlation-Id: a18c90de-4d30-4ea5-ebde-08db09bf2e85 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NYHOMtbMZUqbCG5gr1UfulEDyU3AvTnN01WRUXqptptQnIsmTfTgjCKcvl8Mt0atPGA/mrDe5hL7/7WnG/gTDSGlM/+q6bJRE2twdPt3UKKGRvRs+Ez0XUrgyYrc1rG/eyKB8PNc1Q1FftEOW3bFd/3WUHscAuCJNVgABcS3YJnjfZJQCCvJ4BRY8/KkyFQ0L6fynl2/dVEQVxVOcVvh/CVQVfcSG/BlQR80v26ICQY7rvjohG1eY3hHyPUQVzTm9c8NOsrdYm645u2fcnicSpfkDQjOxMjVxxVIYmi/aVgooEFqV7xL6Q0KyLMkjfvR8XguIaoK+d+FrDyIeb4xrzS/PSFeYYPJyh2ZSOSQMlBHl3aPvLvU2VWQQohIwvriEdFRuZ5ziTIEGnknn/jjEAcKTEwrW1bJHDXT6/XzVEblzczUEBbSguNzbu2y+KlMGjG8nfJHuic0OxAWDDaPtcpve7ivEUVcrTDCru1Sugq5vGd7ony9AwX2uB2+9v0pN4WMs3yZr9X3qRJfpLH8PfKt59Qp33IhezZJO7Ww0BFLLu/FIEw67sn6VvpW2vroaqkPgduH+C8va0VFEBUH6sC7eEQNpJJpMLQfvkzdj49aVoeM7Ca5S33/izd/oi1KtzNowUsGgN4wd0YU1O3XSxiJvMV2R/xNqk4NAamZXjml6kK7vjAYbgC168GxFE1llO48JldBImgJCppPnOXuhj5I6Z3v/kt0frujWPRO6hE= 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)(396003)(39860400002)(136003)(346002)(451199018)(5660300002)(36756003)(44832011)(2906002)(83380400001)(2616005)(38100700002)(8676002)(66946007)(4326008)(66476007)(316002)(8936002)(41300700001)(66556008)(6666004)(186003)(6506007)(53546011)(31696002)(6512007)(26005)(478600001)(86362001)(6486002)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VHRPTnU0K0l6VkQxOFZmSWN3bnkxYlhtcndndzc4YU1aNW1UVEUwUHRnV1gv?= =?utf-8?B?c1p1bG81YkdtcmxUcmxEMEVSWTRweWVRY1prUGdZMjZsTTVGY09yMFlUZS9I?= =?utf-8?B?RUlxc1kwRFdpNmNVZndSVW1BYll4Z3VsMG04UUl2MFdRbm9KY3dIMFg5Mm9O?= =?utf-8?B?bXFadk1PZHc2T040Q1FRODdJY3d4TTNrQzRTL0FQcnB2M3J3RTFONWVnSFFn?= =?utf-8?B?TXNGZGF2amlYUVp0ZzBaT3gzMzRNcFFSWUl6cnRCN1pJSm1oMWxFSUVaWHA2?= =?utf-8?B?VTFoT2FCb2doejV4R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bEVWb2RJcGRL?= =?utf-8?Q?/EnjYVapCzSFtCQbn7dMbaqgy?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a18c90de-4d30-4ea5-ebde-08db09bf2e85 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2023 10:28:12.9645 (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: 5c+E+olxwWwmBC/hrB7q5X5lD3U6HQoAHth1larXjEwURRyzS6/5IBRoNUmXNq56 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6342 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/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? > + else > + buf_size = ROUND_DOWN(buf_size, 0x1 << 10); > srrctl |= NGBE_RXCFG_PKTLEN(buf_size); > > wr32(hw, NGBE_RXCFG(rxq->reg_idx), srrctl);