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 CE54543B31; Wed, 21 Feb 2024 07:51:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B8AF4402ED; Wed, 21 Feb 2024 07:51:11 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by mails.dpdk.org (Postfix) with ESMTP id 1C81E402B9 for ; Wed, 21 Feb 2024 07:51:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708498270; x=1740034270; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=AW8z7yUR0vqYpLw/8Tj8TWIrF2zYPov6L1P2zHuQ/SA=; b=cO++ZMQsGoMzFXxPT155Sfv3mO4HntAoseD/+RmxueN+N1nuyprSyQse 2E5EFPALiLtEHqp74CoQ253sFIstXv3Xq7XFd3UxHrTixTtxf8bDzPtcn Ary3EEC/vtsWX49WQQ2YGp5U0uiKtu1eHMNmHa97pg4eG5LyxWG4qy5My Vbecb3oLeBtvQVD6vqtUCFdXkVAvxWvS5srQE6sP/u1auDjfvXuPRgISO rXKP5rBzqnfI6WeyD8c1wjM5suMDMLtTBrPWQMgA839wwSFndvJecy9z1 QIJExVAt464HCWe8KP+fRsUy1Jkjx83PGZ9HAd/pHr6GS1K/LnMjPxY9r g==; X-IronPort-AV: E=McAfee;i="6600,9927,10990"; a="28083567" X-IronPort-AV: E=Sophos;i="6.06,174,1705392000"; d="scan'208";a="28083567" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2024 22:51:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,174,1705392000"; d="scan'208";a="35805446" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orviesa002.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 20 Feb 2024 22:51:07 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 20 Feb 2024 22:51:06 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 20 Feb 2024 22:51:06 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Tue, 20 Feb 2024 22:51:06 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.41) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 20 Feb 2024 22:51:05 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oYHsNBUOYJ8qNX41Zjv2E42Qa0Um1ClxSzswy+hQbRHQurT+4txV4KIt47xPFv1lPqQTVXr7kjANDH7ruwFm4eQKiaVtOGcyB/QJB4bY2vvvyzJrL/PULNU1quK/4W3lRNIwHfUbWUB7iQ6sUm7FpGaSkVkwlnomoIydXNS9Lnm7C8rPRJMZWAc1GIesRmFmgMUkXtT4NWwa175BW1XDR3+iIBZUCv44MKH5z5sO77N9uxHm4Ngydfkw6qy6ncd2iOtdQPe+5IoQGLgLBYYX32yKaNlvZ9Ytm/Lc12VxQxh5tgSQziQLiaW0rYIFW40lkYyTLiiOjW3/yW4jeOWbGw== 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=9+qCrfWY5RPgX+cXgrgL7razUvLLMjNGvF8UeaSod28=; b=MmyUfyGe+jO7p/KB3gBNuuae2+acCWfKMXLy6qElpqpNJjUYwbRoei6+QYjYgASOQItA/xVOsn42Tn2plGeslUBk6bTkbTc2NkrrbaNL0UMgJHbcfSgl3vxWZfd8g2j4iTRMWeHm3fPyxCGUGaYsd0XBklEQQUxOoMJcFeJaR2hC1hzRc/66vTuqY3fvkIlSIA5oT4IJb6DrudEBhcH7v7fIyJxLzv34aEsnScvNW8PzXuE/9Riyr06cVL4DuKS8nEDwS9OBYGHCAJhRajzljOOdl1BFeHqDOqoSle0/e+Vm+vqdVLPJZRqWA/el9EIuzJa3Va6QW8JvMIlr4uuGaQ== 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 Received: from IA0PR11MB8336.namprd11.prod.outlook.com (2603:10b6:208:490::22) by IA0PR11MB8400.namprd11.prod.outlook.com (2603:10b6:208:482::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.21; Wed, 21 Feb 2024 06:51:04 +0000 Received: from IA0PR11MB8336.namprd11.prod.outlook.com ([fe80::30c5:1f5:b921:e954]) by IA0PR11MB8336.namprd11.prod.outlook.com ([fe80::30c5:1f5:b921:e954%4]) with mapi id 15.20.7292.036; Wed, 21 Feb 2024 06:51:04 +0000 From: "Jiang, YuX" To: Chengwen Feng , "thomas@monjalon.net" , "dev@dpdk.org" , "Richardson, Bruce" , "Laatz, Kevin" Subject: RE: [PATCH] examples/dma: fix max-frame-size cannot be zero Thread-Topic: [PATCH] examples/dma: fix max-frame-size cannot be zero Thread-Index: AQHaY6U1h3u/XF93VUaxNfi48jrqD7ES9Cyw Date: Wed, 21 Feb 2024 06:51:04 +0000 Message-ID: References: <20240220023153.29793-1-fengchengwen@huawei.com> In-Reply-To: <20240220023153.29793-1-fengchengwen@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: IA0PR11MB8336:EE_|IA0PR11MB8400:EE_ x-ms-office365-filtering-correlation-id: 4e468bb4-bc2b-4200-f9c1-08dc32a97939 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LN9haXWXJl5Q6s7FbDeDPnoB1YxbmxA7rVqdkvsB7DZ1o+IvuWohUuPSXlKRcJmzVy2R5LjawvdJ1A1ceY4bN9pUf5SHowIeBQ3bmmONlm4QwwJWZDaFQ8Ph0JFhH6jERBZ4c67uHOuJwlbZC8vXa3hhyWgsGCRs/XDRezfua/2C4luQQ0L4AFaY+iI0xYFNvrLwqxVpj2SzlrsQmSq1k8wWL70k8IEhrg/k66OjwerAcXGE9FGbIKgh99N+2b2n2uF2BaQFhXmdSkLEzFmwsY/yFU51Ni/lHPTwHpsduVZewo1LTNwBT8PCAeHOKsFLLuK5riVst1hNFczmkPHNpAydJFRGedTUYGL4ys7daOEMGH1+jISKsyYaOVW/VHty/ru3lpEQ7Rfms6IzRsEhvytGeZM2lsIEPl+4yo0j5MEwS08Nw6IxNkt6F724nob51s1nvYBTrrnWBOZ/s81ctIac5K5eOTIlZwR9dUCVxWTBMzSypLiMgRvkapIRlBZXLAcvaX8euacyF+x4eawqPmEIGAsCzJGwUACxIlOnN1kAqBaiyQtvD7UVFhiPGOLrGRna59k7K9HL/5vtu6DpxHaKWnLguNePgnUQNhqh++iJ9v1AK7WaTE1D/flAg/dd x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:IA0PR11MB8336.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Ozm6aimtAfJExcoDinMaa35eLAkF7wCDesBTmKcmBxhq6xfkraxX9eT9wicN?= =?us-ascii?Q?4oHC0MWkfPb8UTuiuYAlAZWMiWX4HsvCOj9GVNaGstpA3kM+YEW2RyPIqTYW?= =?us-ascii?Q?//zRt8zfypcBpQ0K1CdcEBroljbcpaUEjkzzC1AK4aRggVOBhvu2n8rWYE/z?= =?us-ascii?Q?coY+0slh70xvkcu3OnkFGJLs1m/gn/mig3opa3YJ7AIGkTougWG3zLpSgSnR?= =?us-ascii?Q?3uEHJKKTkDTEOic49lDenTEpLa09Utpa2WHeKELP8RdupqI3MDqU2Ow0qjnp?= =?us-ascii?Q?RieqUdntkP+BUqG5zzn+V310caweBYy6Kd455MYjAZcb7b3D6UMoh+tSv6CK?= =?us-ascii?Q?1QpFvFRAG0mc8BHiAfUGhwStol64lFXw82jsKCxCHppVBw/iPET22uNERgtU?= =?us-ascii?Q?gvzO/WRE9e4YQhJohoYmByxYWTOA3TAui7ogF0lf3YdtIFNSHY5rLnJKNEJO?= =?us-ascii?Q?2qX5h962L5twxWCbk8MVH6S8R1A4sZHJN7vJN8MxqE4ce7xX+z992KyH/yU+?= =?us-ascii?Q?EUMvDbcJk68plaAN/0s8uRh0BQb/hhrdHjKxVix66fybvFYakrR5JutUqjAg?= =?us-ascii?Q?RUTqTMRSptFgKO1fA3RaJ9+aqwcYqkedBCJ7RclwB6S9+1l4+8uioN1SMqp3?=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twzoO4EtrMcqmpYdFJEw+yK2fjzE?= =?us-ascii?Q?XBGpaXPlRA7boFhhpten5Dafhj1uLD6rq/xlI0SQ?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: IA0PR11MB8336.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e468bb4-bc2b-4200-f9c1-08dc32a97939 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Feb 2024 06:51:04.4236 (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: TK0/JywY915/lnJAhLNQiSz68TXQ9SPW4H8QCExZLsGcw+3+NNJFW9BPf2YlZF0K9WAiBbUXrl7hu00sPdCb0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR11MB8400 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Chengwen Feng > Sent: Tuesday, February 20, 2024 10:32 AM > To: thomas@monjalon.net; dev@dpdk.org; Jiang, YuX ; > Richardson, Bruce ; Laatz, Kevin > > Subject: [PATCH] examples/dma: fix max-frame-size cannot be zero >=20 > In the original implementation, the max_frame_size could be zero, but com= mit > ("examples/dma: replace getopt with argparse") treat zero as an error. Th= is > commit fixes it. >=20 > Also, since unsigned doesn't < 0, adjust "<=3D 0" judgement to "=3D=3D 0"= . >=20 > Fixes: 8d85afb19af7 ("examples/dma: replace getopt with argparse") >=20 > Reported-by: Jiang, YuX > Signed-off-by: Chengwen Feng > --- > examples/dma/dmafwd.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) >=20 > diff --git a/examples/dma/dmafwd.c b/examples/dma/dmafwd.c index > f4a0bff06e..acceae6b7b 100644 > --- a/examples/dma/dmafwd.c > +++ b/examples/dma/dmafwd.c > @@ -695,23 +695,23 @@ dma_parse_args(int argc, char **argv, unsigned int > nb_ports) > return ret; >=20 > /* check argument's value which parsing by autosave. */ > - if (dma_batch_sz <=3D 0 || dma_batch_sz > MAX_PKT_BURST) { > + if (dma_batch_sz =3D=3D 0 || dma_batch_sz > MAX_PKT_BURST) { > printf("Invalid dma batch size, %d.\n", dma_batch_sz); > return -1; > } >=20 > - if (max_frame_size <=3D 0 || max_frame_size > > RTE_ETHER_MAX_JUMBO_FRAME_LEN) { > + if (max_frame_size > RTE_ETHER_MAX_JUMBO_FRAME_LEN) { > printf("Invalid max frame size, %d.\n", max_frame_size); > return -1; > } >=20 > - if (nb_queues <=3D 0 || nb_queues > MAX_RX_QUEUES_COUNT) { > + if (nb_queues =3D=3D 0 || nb_queues > MAX_RX_QUEUES_COUNT) { > printf("Invalid RX queues number %d. Max %u\n", > nb_queues, MAX_RX_QUEUES_COUNT); > return -1; > } >=20 > - if (ring_size <=3D 0) { > + if (ring_size =3D=3D 0) { > printf("Invalid ring size, %d.\n", ring_size); > return -1; > } > @@ -721,7 +721,7 @@ dma_parse_args(int argc, char **argv, unsigned int > nb_ports) > ring_size =3D MBUF_RING_SIZE; > } >=20 > - if (stats_interval <=3D 0) { > + if (stats_interval =3D=3D 0) { > printf("Invalid stats interval, setting to 1\n"); > stats_interval =3D 1; /* set to default */ > } > -- > 2.17.1 Tested-by: Yu Jiang Best regards, Yu Jiang