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 D1E34A034F; Mon, 11 Oct 2021 21:50:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6E009410FA; Mon, 11 Oct 2021 21:50:37 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 4AC3940E0F for ; Mon, 11 Oct 2021 21:50:36 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10134"; a="213904124" X-IronPort-AV: E=Sophos;i="5.85,365,1624345200"; d="scan'208";a="213904124" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2021 12:50:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,365,1624345200"; d="scan'208";a="570089418" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by fmsmga002.fm.intel.com with ESMTP; 11 Oct 2021 12:50:24 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 11 Oct 2021 12:50:23 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 11 Oct 2021 12:50:23 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 11 Oct 2021 12:50:23 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.48) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 11 Oct 2021 12:50:23 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ONAGotOTLYElXSFOKmp9xkmugXAxlRUu3nOyp2+eSWE6h78yT2GOgZSOluCDGznrsr3ggu5rORRLxIHOYgq/QZU7WfdIPa7KKa2TcmaMFtibjI08OkWMrzKXo+aiE67RkynNWUGKDMY0CGWUtVJF9mCN+XCtpmZLcn1FWU91OXVLPmZBMXBnyvlpLytWlxBxPy8C//2DXjQiFhFLK1oK0ME2EC/jV7HUnk1zOYqvNDCcRSjhVVgGMZTrqKNkF7MtUeTjfle+lHggwHZWOcpDB5F5KuhkP2G7l9NJvpQm3FIGRicyVnF50Wt3dToDBCAne5A19L00vq6aHPVXD6th8A== 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=EIw3btARO75N+LTtLMneosBmsnK+AQRautxWB4rvM5M=; b=C3FztZjXMSrt+7QIqbNjd8KGY+evhL2/kwDVcvIZednGMKHL05SOW3zg6Bg8YczyA+MbFt/ss9bptf1c1gX0ljxSmBxdgklV9CKn4SBfe6SiTAcCTgjlm2gqlqV8cVaRiOvwrXAfLyyqXmPjDX1CsBTUG3Grgn+N70sVAfEowxX7i/6D6qhI/+uEtFbb0NbXbrm1JtMOrwOqwtS1E+obK5A0NOT12X/tPixer/WKv8ZptuHNmaQ2mklA4mQXdezGPxrgNI1Rak62EKkppBHgbmmHBawaeEBi/DeS9Gt+DuHufHQoWLzX0l+IjuvKrBak5BaFw2zQGxdiJya6qcPlsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EIw3btARO75N+LTtLMneosBmsnK+AQRautxWB4rvM5M=; b=RtT+IHLegH/aAK2ydyC2ikgGMr9Ne0p5akIBbapuDYRt2UCxTfoi9GGT/HGJvvmuMmXmgcKONB5DTEmbfhVmGPF7bF5TCgh007vRRrvcVZKHhugHIEO+IQDF/PZanJHSrkiy7TD//7uYip6GI5Wvlgcw5YL4y3bSqYALD79yLUU= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB5901.namprd11.prod.outlook.com (2603:10b6:510:143::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Mon, 11 Oct 2021 19:50:22 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c%5]) with mapi id 15.20.4587.026; Mon, 11 Oct 2021 19:50:22 +0000 Message-ID: Date: Mon, 11 Oct 2021 20:50:16 +0100 Content-Language: en-US To: "Ananyev, Konstantin" , Thomas Monjalon , Andrew Rybchenko CC: "dev@dpdk.org" , Huisong Li References: <20211001143624.3744505-1-ferruh.yigit@intel.com> <20211007165626.2941995-1-ferruh.yigit@intel.com> <20211007165626.2941995-5-ferruh.yigit@intel.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB6PR1001CA0038.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::24) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 Received: from [192.168.0.206] (37.228.236.146) by DB6PR1001CA0038.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.21 via Frontend Transport; Mon, 11 Oct 2021 19:50:21 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 37b6f3a4-ff09-41b6-22a3-08d98cf05c7f X-MS-TrafficTypeDiagnostic: PH0PR11MB5901: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W5Be2hm+hLA6KixM7aY730u4mSDiG1Oqsu+awraJNOQmt5zmIlx2yMKb1+n7gPm1AVNL/8r3mY7EjjEJuih8U2QZTaRlcA0+lX94IL1E/tf1WyDjIq5IfkU5RYg83VoZNpnj0NSUWY6aJNyBkk9zJ0EQaNJ9+7AqRUDwestIdd6vDMgZmB6zBEJXmr3EjPHxyHM4C0LpY5ziUFqDvrNk8qSDd0SKphPlyM4hX/JgZIxAkOxTLXE6A1s2MaW9jh05fGtcsCZqa2W4HMZFAT9hl3Xr/m/axpGEbvmEb+XPwOzji1Y8UlGqKk1GIVKAZYgZCpe7YhyYyUGPiI+SQZRKeU9fgTp+n6C7r7eTZ01jxbDi4M0mv5ZUk9K6q6VjeGbBMTMlGAHCR5NKFIj1oNCcj39SCgWsha6lAW4u2BC6C1iy0Vn/e0vRwxfKvGcmhEmkYBQdF8D7ZijoPCw9PK54QZwVGuoXtyMWEVnE0HGyrDxchXgMy70oh6pBGZ/A3L4DXbRhZ2nLiVBRItiQj3w+HxwL37xtyM6vI/YCYh5i2Az7d7AKFO/z19/CNzhzUJ1Z+IoriZn9vFx7gRDot+aKOa2w/Lkh0byOQGcm2H0jhh3h9QDptJyuZEUhB5mSMLNArVvIk68L3ovXIQAiFEL0iPlZ3L8oJC8Xa2rau9pgyzmJvx+CB0Xf2WfMNlhJe7DMPVtZWn1g/9kwAGr/h1NRdQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(36756003)(6486002)(2906002)(38100700002)(44832011)(5660300002)(16576012)(54906003)(110136005)(316002)(8936002)(31686004)(83380400001)(31696002)(508600001)(86362001)(4326008)(186003)(8676002)(26005)(53546011)(6666004)(66946007)(66556008)(956004)(2616005)(66476007)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ODIwK3J0aHorcGhMd1VsOUNWa2JoTmFvd0gzSWY2a3VPbEZGaEFqWlptVEZo?= =?utf-8?B?RHRNMlB5cjk4bnVxMUNnVXZvRWlZM2RvUExZdTRhMU5Kc1Y1d1BvdmVJSnBP?= =?utf-8?B?OE5ZcXhIVnBmL3ZiY0QrVmZTUjZBZVNsaCtUUFR0UTNrVUhDdlpWNGp3RUM4?= =?utf-8?B?Mm43WXdUUk0zRXRaUUFHeHhrWjdEUTA2ME1kYlZvUWhQSW84R1ByY3gxMjJo?= =?utf-8?B?MEpWQW9qTSs5NHJWOGE4RkQwK3N6dUpYV0FpVXNsbmViVVd0Q0hhTTJLeERo?= =?utf-8?B?WGUvNDdDVzByYTB4OWhqYTJxdDk2QXM4a0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lDa0J1T1BKc1ZCckNjZS8zTXdJekxhc0hDMDM5cnFmemwzeEhFK3loTFRP?= =?utf-8?B?eFdWN2hGSlhZZ3E5SDRHK09uVWN3dFhNMGtQdHJvNjZSMWlJNFdwZGdpUklI?= =?utf-8?B?U08wVEhLT3VFM2J2Zmp4dFZxWDhlQmt5L0thb1dSYzZJUUhqQS9LY2lERnlW?= =?utf-8?B?NDRuNGJXTlFKc0dIbUFKeDJWM0oxNGFOU1prazd5ZHM2OUNnNGc4d2xlbk5j?= =?utf-8?B?ZkpjdGZwWFNxUXJDNDVrYTRpUUVQaGRhSjBuM0dsMmE5QU9kM2ZOUXJqS3p3?= =?utf-8?B?Z3RWWVlUOVU3TWY5OERIckF0ZVN5SGpJRVpsUzBOc0tneEFCL1NSNWpoZUpX?= =?utf-8?B?Q2ZxQndmVzNUQUd6TTBhRE1jWDViS05rNnNMMkYwUDhqbmEyWDNMTTdBeDdN?= =?utf-8?B?b203VnN2bG9kaFF5NEFGbUoxN04wb1JnMXRZOVlJcml4dFV3QXUyOTRRdFc4?= =?utf-8?B?bkZraStPb2VjSW1UZnpib0lWZWh0YjNMSGh3cGdaNXQ1V2VWYzE1N2w2cmFj?= =?utf-8?Q?C1Uazu6ENyfhrQ0aN9EOUQpl0lozREO3ogR/B9t?= X-MS-Exchange-CrossTenant-Network-Message-Id: 37b6f3a4-ff09-41b6-22a3-08d98cf05c7f X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 19:50:22.3880 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ghzlulqLtyXmxxCgjpJSnuCLrR8kkdpa2mATHyiH6mparpByZiTCY9gkkn4ZwgLtGUrrxRYaQiEb4XtbV/4uoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5901 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v5 5/6] ethdev: unify MTU checks X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 10/8/2021 5:51 PM, Ananyev, Konstantin wrote: > > >> Both 'rte_eth_dev_configure()' & 'rte_eth_dev_set_mtu()' sets MTU but >> have slightly different checks. Like one checks min MTU against >> RTE_ETHER_MIN_MTU and other RTE_ETHER_MIN_LEN. >> >> Checks moved into common function to unify the checks. Also this has >> benefit to have common error logs. >> >> Suggested-by: Huisong Li >> Signed-off-by: Ferruh Yigit >> --- >> lib/ethdev/rte_ethdev.c | 82 ++++++++++++++++++++++++++--------------- >> lib/ethdev/rte_ethdev.h | 2 +- >> 2 files changed, 54 insertions(+), 30 deletions(-) >> >> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c >> index c2b624aba1a0..0a6e952722ae 100644 >> --- a/lib/ethdev/rte_ethdev.c >> +++ b/lib/ethdev/rte_ethdev.c >> @@ -1336,6 +1336,47 @@ eth_dev_get_overhead_len(uint32_t max_rx_pktlen, uint16_t max_mtu) >> return overhead_len; >> } >> >> +/* rte_eth_dev_info_get() should be called prior to this function */ >> +static int >> +eth_dev_validate_mtu(uint16_t port_id, struct rte_eth_dev_info *dev_info, >> + uint16_t mtu) >> +{ >> + uint16_t overhead_len; > > Again, I would just always use 32-bit arithmetic - safe and easy. ack > Apart from that: > Acked-by: Konstantin Ananyev > <...>