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 8F36641B9E for ; Wed, 1 Feb 2023 11:41:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 84E0F4282D; Wed, 1 Feb 2023 11:41:04 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id 4E5F040141; Wed, 1 Feb 2023 11:41:02 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NBs1HXgICqafEWjS/6vY0V73UsqrqiCe6jGnFX0cMtZABBb51VOD1BVnrQaL8QGHurh40QR1w+mhrsmuEXKyts3VJaWXEfwibdy5s55G5ufrTBfOBP9/isWnYo2MYWAc+/vKuofcpOU8ysnDal6sA5mVUbKleZm7OVrGQXl0mNjKBkT1dPDDW+G4VGysxjR/O4FVg95BIN6pVsEqFYfwGt2lL/lRGvAgxccaZy3LW77sAdB3SVCvedaPAVDhYr+GdLs7OWLiwUHAqnDzF/rezfDE7M2NQuW/ML7pD55ZhvHQP3Ry5lOo9lKv/HE97QT0BmJ6TT+SMlBlKt5e3cwGVA== 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=9ZFzA077OJmsvH6gU3Aq/q8nxZNPEIMiZoy9hkpg7Uo=; b=ajmXVHdNyWTnCi07T8H3ZQOZDRcSV8ky0341sE3WcEqywboWLgQiBjrIrAlaXu6cA3BqDGrb5wNC9RV6znT2OoFVzMYi6zikSCPjLPAqD1ST9/EPW29Dne3tTUIhbiLGBM3b0psWZHWBPzRwj6iCLnWPmpUenpJdRcumInnC1PhsKcdvgdXfzk5pUVfvdOVVhLKfT9Hz4d6fnZGNe8Nphq102LR8Lm4C68XiZNxtjKbETrQyXF9DaWRi9Q2NiNS3m5AsxDcXS2BvfrILZaDkqKlrxgJ/7ehrRVCR6EU6O6mXjAW3FUmoeoCCmJW/5DmIM0uffwpeyjLxjL24OcHJGQ== 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=9ZFzA077OJmsvH6gU3Aq/q8nxZNPEIMiZoy9hkpg7Uo=; b=ltvQ30GTth1VvjurZva8dZE8uglDbmrLaVyy2zNOcSdTEi9jbba0Qexx7NGHqobQo0CR/+sq+rvKbl4UFw3T44Ui0J+h83ememcscDFAVo2NuPAP2dc+yX2IcA5sHCw92JNrw2LwLLMgjhHIbZzG1ztR+gucGjIMCy8apdWHdds= 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 BL0PR12MB4881.namprd12.prod.outlook.com (2603:10b6:208:1c7::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.24; Wed, 1 Feb 2023 10:41:00 +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.6064.024; Wed, 1 Feb 2023 10:41:00 +0000 Message-ID: <6e9e8ae1-0ebf-db1e-1b2a-b203f6923343@amd.com> Date: Wed, 1 Feb 2023 10:40:55 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH 1/8] net/txgbe: fix Rx buffer size in configure register 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> <026901d935e5$b4d52230$1e7f6690$@trustnetic.com> From: Ferruh Yigit In-Reply-To: <026901d935e5$b4d52230$1e7f6690$@trustnetic.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO6P123CA0005.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:338::10) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|BL0PR12MB4881:EE_ X-MS-Office365-Filtering-Correlation-Id: 1e4a245c-f8bb-4b61-c90d-08db0440cf35 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2zYpZUEnlgZ3roAk/+67KsCceKl44o06eAcFlRg6ajtJwETxOv7f3uonHWb7nF981A8Hd6WHkFBgjF2SysFIKaKl4Q23TK18YqqJ49/2Z2dxAdAKfgw70/Q3Odaj3dqKrjQ4SF4u6rMfkU49mthmX0nnUB94pgCiz4BeACe0WAIctpNWnly0VMLiVGOGP2IMtQGgWdptovqyOlncsu4WseJZSImyoU3VgVGc5NZp6Qg2vfxdvy35NY9fCC7P6VrO1r9et0mt7sPzTSaWqKOR+gp74DBte6hs93DnbrNOccfYlcmeFtGThl/Z6hhadW0YC7XdL7M4JyEqLPVCNwKmNPgZUMlA9gdRx3Q9u2hlbJWs1ztEXDqPmJ4KWzxVePVuvRJcFv81h+LYMiHDZUwjSZ1TTNyw7FO7LHvXCjKsHsC8HQPQCkGKOdB+zN0ga3ciwxDbxpNZv6IpAccNKxF7SGa9m6+AvqNnrmuAZHQ+pW5ZndDj5ohFctZqhS2ZjhahlM+cHs20egpgncd22fqPy+O9DTfCu3KXPl1x37SOz7xxg9ET8DgL1UOE7NaECRcFlEXU3yR5avxJMQU0viOqWYcz+pYmZjKaD7JYrj3tnDjFa5xqwovShEjCqELLE6brD0GqY1/CthdGJVHrHiDXfxhBNdd/UTXwvWLrRrD6isSpBg79klIABE8IB1MkLJAwvjMxJXIJKzzujuFiR5o1P1iykOBln1oTITL7u1Lp+BY= 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)(396003)(346002)(376002)(39860400002)(136003)(366004)(451199018)(31696002)(86362001)(38100700002)(36756003)(66946007)(66556008)(66476007)(316002)(41300700001)(8676002)(8936002)(4326008)(6666004)(44832011)(2906002)(5660300002)(83380400001)(2616005)(478600001)(6486002)(186003)(6506007)(53546011)(6512007)(26005)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bktjZ01Mem94NWRHSlFkdnBqSUFFb3FZSk5USnFURzJhQzdMWnhVUW54UW9O?= =?utf-8?B?bDBDck1UbkhUdC95SGo3ZHlOV3FZUXhxTlFLaVBrQjdCbS9NM1JPa1lrVjFv?= =?utf-8?B?UisrZFVHK2xRNGZjcGRMRDJzSERXOEd3cW5oeGExazFQRUJuYURvK3EybTgz?= =?utf-8?B?OTZLL2xVV0hoVDlNM2RtcFUrSjI4dHNrbVZBZVlxSGd1S2hmdU9xNGQxUVNq?= =?utf-8?B?Z1pNUWk1akNLNDNaUmFZUUZLWkRYUk4wNzNvV1ZiUy9ybVdQK3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YU9INnhKbk5SRml2M2JCODhweFl2dGcv?= =?utf-8?Q?m7679POslDC7UkxhoiTUaXtZf?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e4a245c-f8bb-4b61-c90d-08db0440cf35 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2023 10:41:00.6685 (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: Iaq+L/FJjB5AGJJJ7QCut0zRm3jCjpEO7fJqTDWjciAGForcEFo7zArnJAK9oVbR X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4881 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/1/2023 2:34 AM, Jiawen Wu wrote: > On Friday, January 27, 2023 11:36 PM, Ferruh Yigit wrote: >> 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. >> > > It is indeed a problem, I will fix it. > >> 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. >> > > There is a macro that defines the conversion to limit 16K. > > #define PKTLEN(v) ROUND_OVER(v, 14, 10) > #define ROUND_OVER(x, maxbits, unitbits) \ > ((x) >= 1 << (maxbits) ? 0 : (x) >> (unitbits)) > ack