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 2DDDB424A4 for ; Fri, 27 Jan 2023 16:36:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 26EF9406B4; Fri, 27 Jan 2023 16:36:33 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2042.outbound.protection.outlook.com [40.107.223.42]) by mails.dpdk.org (Postfix) with ESMTP id 9820440146; Fri, 27 Jan 2023 16:36:31 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UY9K8EZ/43LWVPK0Z8ig+zZqWlkF6pBz7+pVYQaO9iEZGUUHtOr/9R2IQPLjj1maAUo68X0K/5zkdcPamEYXUUb9aoaI9S6O25h9xm01dW28HbX3MNHQgb5kAydoVIz94JTkFPVhMgw/MXjEyjd7hM91pljnoRdSqk07ob8BRgSVZn/RcrdIajYYJexpOoiG2FpwtvxpouBsO3Q6gPHgJQEA/RdY27gmymTJ87+6QigcgOzBv8Qb9ikneW4rwEi46uLQvVp9v9oTvojpm01r2+dqTHwVratd9hfhzLHXXHBlgfwTP2aznj9F5Nax6hI5/NQ+PsAkYxgeGj5aEi3WDg== 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=f4jX8K5QST1rszmO5J1irQHIFnZjg9vv3J621OfBXIo=; b=Y7NmHoVJbR4G+IKcF2nl18pj8MxTwIBFT82HR1xE4Oakj8gkAZFf3ezPyZ36W7mibprlphJ0/b8GV5zaYb+DVOJIa36Qx22r/jelkV3gb01+1GW4BZoM/3PlaBQ3XqICGq7vuuxTgeQQy21uIQ8trq4QkMTH6LTT8vFjjj+FYz+Xatws1Q831LH2Q6Mgq/JldhrQiSHPuQucO/A7wRnFrb9tIfW3Q2eP5Vg3UBb7E9wFu84BYo/I87v9xp48kbN7mg6/aJAwhIIa2qCTx5bzPrVhxOk3Al0DJH74aTEaXoVh1uY2cAstzHo7cwnW8FqVWCg6xz226qJMN948g1EqUA== 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=f4jX8K5QST1rszmO5J1irQHIFnZjg9vv3J621OfBXIo=; b=sJyetiB7/KuSeGcAv2SfEU8K2FHqTVOXD4T/QHiNSWEQIR9+OsggXr89rAirGicoVrHk3gwIjJQWaCsdVRIh6E6DGvzmUNMgkok85QHnMW3o3o5CvBwe9T5nnQKgyoMnOZ+VPFMleQXD6yV2w9cyl5GU+kw0u2D4oy8mJdYegSU= 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 MN2PR12MB4125.namprd12.prod.outlook.com (2603:10b6:208:1d9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.23; Fri, 27 Jan 2023 15:36:27 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a%8]) with mapi id 15.20.6043.022; Fri, 27 Jan 2023 15:36:27 +0000 Message-ID: Date: Fri, 27 Jan 2023 15:36:22 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Content-Language: en-US To: Jiawen Wu , dev@dpdk.org Cc: stable@dpdk.org References: <20230118060039.3074016-1-jiawenwu@trustnetic.com> <20230118060039.3074016-2-jiawenwu@trustnetic.com> From: Ferruh Yigit Subject: Re: [PATCH 1/8] net/txgbe: fix Rx buffer size in configure register In-Reply-To: <20230118060039.3074016-2-jiawenwu@trustnetic.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0420.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a0::24) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|MN2PR12MB4125:EE_ X-MS-Office365-Filtering-Correlation-Id: d3262781-f3be-4dc9-3985-08db007c410f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5WxmO6BdwlDkDjLJRZJjtwYxYWo5kq8ioY8Av737i5VH2me7pBfHh6yYgbDrSIbJwb46tlNr5trsnQSMmq0tdsthVbGenMM1VENn95Oip+R0Kg82CICq16ZsfB4UkNEChZt8yuC+ZO0JD6P8SW/SiDjULXRKPcjOBlwfz+lf4hEy8EtJEU2GyBSOPNrpYR4N/IDVlPItyOM4fVsCsz7Uxxz7jHfH4xDHwBJmVY0lm9eFQCU0WdZUh7EUzNjP6KXXSq+084Cvf+HdkuylY84aw3qrzb4jVtwkKtk4zolxhmW06njvNKVcJmGgCu799bYuZJdnop8dsjaBb1k+miLeTVl/HPXfSNB0pP8Cx7FvmOB1dtEGU05dnv7PIBf2s5fynrtaZmYgQZ1MkU/6KajtJtPJk2tg3EyZwsmA2C1xaJshH1nPmneui+gvlLouJz/NcUCb8M3kaEHZK3i1AYuWy7EXch0ZHimS6EtMJPhsXHCtteemI8PU1RRsYrBCqDf+nj4JYj7atgRm27Vv3M2nM2cvDe43WD6Vnnew4YPKxc4GiU3gWhD00y+xXg/8pEeU1ulcYKKSPrjFRYV78Q3o/ubGl+cxLwYGUZ/8MvJz7/l4q+Ln58K0kbIGGIyGpwNobSefFiT5/3SXjw6yBKMdPYdzWK/2wIjCmj2G11XwiB4ryyGrGFxN7kpBIGe8CWumUIwC69nkI25XBN5cCh9ZTFaiivxbUKTMR8TfpCyTZV4= 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)(136003)(396003)(366004)(376002)(346002)(39860400002)(451199018)(41300700001)(8936002)(6666004)(5660300002)(83380400001)(38100700002)(86362001)(31696002)(316002)(36756003)(66556008)(66476007)(66946007)(6512007)(8676002)(4326008)(26005)(186003)(2616005)(6486002)(478600001)(53546011)(6506007)(31686004)(44832011)(2906002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Z2ZmQWxlUHpBM2E1dGFaL1RnNDNJMGlDOHZ1L0d0T3IvMkdoZW9pR3M5NEhP?= =?utf-8?B?S3RqRE4zNVZLM1ludDV4WDNSOVF4MHV2V3pqQjI1akFLVGJUT0w0SkNTR2VU?= =?utf-8?B?VHdHcUpIbmJ0TGNNNXhyWWlnS3JLb0pCb2tYTEo1dU55ZWcxWk5BamdyRnkr?= =?utf-8?B?WTJDbVNGSDAyVzVYOTBVU1ZSVmRXVnFXYW1qM0FMaWhrbGVHbEVmQmRBclZ6?= =?utf-8?B?b1BjSDI4STRKb1hPbGtWZERZUU9ZczlNVnhIUU80RFFKYjN0K1lFUUNJL0tZ?= =?utf-8?B?WHoxZ3MzbGR1djRrZG5oK1ZxdTNIamo4WUF2cElrOVhrcz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C1FKK7c/93BhkWlTbC2JvM1?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3262781-f3be-4dc9-3985-08db007c410f X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2023 15:36:27.3643 (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: 8T3ozOWO1XWoM0YHO62HtMmGbTTfeSkTzs7OQG8Pkp/XfoS6wJhMU8qJq9RY3uEo X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4125 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 1/18/2023 6:00 AM, Jiawen Wu wrote: > When round up buffer size to 1K, to configure the register, hardware will > receive packets exceeding the buffer size in LRO mode. It will cause a > segment fault in the receive function. > > Fixes: be797cbf4582 ("net/txgbe: add Rx and Tx init") > Cc: stable@dpdk.org > > Signed-off-by: Jiawen Wu > --- > drivers/net/txgbe/txgbe_rxtx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/txgbe/txgbe_rxtx.c b/drivers/net/txgbe/txgbe_rxtx.c > index ac1bba08a3..ae70ca3beb 100644 > --- a/drivers/net/txgbe/txgbe_rxtx.c > +++ b/drivers/net/txgbe/txgbe_rxtx.c > @@ -4382,7 +4382,7 @@ txgbe_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_UP(buf_size, 0x1 << 10); > + buf_size = ROUND_DOWN(buf_size, 0x1 << 10); > srrctl |= TXGBE_RXCFG_PKTLEN(buf_size); > What if 'buf_size' is less than 1K, won't 'ROUND_DOWN' make it 0, and I assume setting 0 to register may cause problem. And according to the code comment for 'buf_size' [1], buffer size can't be more than 16K, but technically 'buf_size' can be more than 16K. Does the HW constrain values larger than 16K? If not the 'buf_size' value needs to be checked against the 16K limit. [1] /* * Configure the RX buffer size in the PKTLEN field of * the RXCFG register of the queue. * The value is in 1 KB resolution. Valid values can be from * 1 KB to 16 KB. */