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 4F087429D0; Mon, 24 Apr 2023 04:19:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BFBDB410EC; Mon, 24 Apr 2023 04:19:56 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 7FA41410DE for ; Mon, 24 Apr 2023 04:19:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682302795; x=1713838795; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=m7sW5GsJsv4s6Jd/nURXGSc/+A5/QggCWmXs8nAtb2g=; b=n3SjpS5/OfUneaau3qKSNlTF9tBUiTIk/tBQjYja4L1yanYhW0qq53XJ 8CCiWEfnJNwNi3FxC61x/KwT5/yGr+HIK65va69YFL5s25KUiV4EDaA+q MT7ZT95FsT0kDXpbPBCD3SPbVYsJqb0xqdH962ErwMogh05KnwAsTp9Sc y633oDETN22tsxAJLYZVlE+lq6qjYpp70vuKf0nGzkZ0V8TVfRCY61KRA app1MWRwHO9gfCfbMAvLTjiUJAf3rozrfY62t/Cmj7ChCjEKMT8Ssjl0G 4JC775tI6HMUMIKCj5kseF15k03coAba3uJM/oobKl9d3ZHnQVz4rpFZI w==; X-IronPort-AV: E=McAfee;i="6600,9927,10689"; a="346361668" X-IronPort-AV: E=Sophos;i="5.99,221,1677571200"; d="scan'208";a="346361668" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2023 19:19:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10689"; a="804437394" X-IronPort-AV: E=Sophos;i="5.99,221,1677571200"; d="scan'208";a="804437394" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga002.fm.intel.com with ESMTP; 23 Apr 2023 19:19:54 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sun, 23 Apr 2023 19:19:54 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Sun, 23 Apr 2023 19:19:54 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.168) 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.23; Sun, 23 Apr 2023 19:19:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HCQUfuvPu4pFwqGJ34Vjz6wudacOSZ4zfBHLGDVRH7nqZrJq0rp/M06ojUlh4/69d5gd77nuBitnWHfm46EFpuizDmq0PW+Mxb9Q0IKhudtpsJWVIO9NuaPIgyJsPEKdJqU8hcqoSK6WI+w9Ga2ba/NEjVrI327r8rG9dsYxZIzk4FZQSiZ5FkdrPRDe+LoTlK8z16J0MAgiRqy0KM8Nl0BZTrSHXP5euKrqSZk2YVyHtJfUT0Fx7R2AoiJ5sz/FuIHnzF+pENmpsZwZaP17vt9ycm3MR1NOmGMLJut7HPMRfcWUjCRLGEeiMLB7HCrUWXZXJTbzZHvW8Fu/8ZpKOQ== 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=gw9Rxa7dca0C3pousYWUtxSgRKTtMNn7Cy0IqXV3aEA=; b=nWfZdxYbqHnaOC1sXV503iRL6hwzfwADs5KN2vbb20FVJXrNKjoq7LJcDxfCmhtRSyCfUUhy26Yy0+yZ+YzgiujBsjtM7YStiBbu2+PKpZB7W2xV3yT8YsAbrddbNHdJ5mygKTaZ5dm8MISTfi9Ytpa1yoh0LPSK+qFred7C1Rkuz2OKIsmlJIThOa/6La0D64qUbdbVAk9zHoWVcjIH8gpFMofi2vkU3/ReT3eckIlFY16Nc6SKUbIaR2aetuXDKqqRcvj8/4HWgbzdS1bgbiif2fmViHG+zLLNBOxxBKiRCQUmYFnpK22AyzAqcr58Y5oXNBI9coAgCSKpmRkjWQ== 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 PH0PR11MB5877.namprd11.prod.outlook.com (2603:10b6:510:141::12) by SA0PR11MB4654.namprd11.prod.outlook.com (2603:10b6:806:98::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Mon, 24 Apr 2023 02:19:52 +0000 Received: from PH0PR11MB5877.namprd11.prod.outlook.com ([fe80::da1b:ee87:709:3174]) by PH0PR11MB5877.namprd11.prod.outlook.com ([fe80::da1b:ee87:709:3174%2]) with mapi id 15.20.6319.022; Mon, 24 Apr 2023 02:19:52 +0000 From: "Liu, Mingxia" To: "Wu, Jingjing" , "dev@dpdk.org" CC: "Xing, Beilei" Subject: RE: [PATCH] net/idpf: refine devargs parse functions Thread-Topic: [PATCH] net/idpf: refine devargs parse functions Thread-Index: AQHZdCkv8EJaViHeHE2NTQD3PkrFN684mn0AgAEje0A= Date: Mon, 24 Apr 2023 02:19:52 +0000 Message-ID: References: <20230421071456.297774-1-mingxia.liu@intel.com> In-Reply-To: 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: PH0PR11MB5877:EE_|SA0PR11MB4654:EE_ x-ms-office365-filtering-correlation-id: e0e4499e-f8aa-4aaf-1ee1-08db446a6303 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rLKw/cXIBiMiNpGVk+1+i44rozXdzHFsGzDBc1bUxoBCafkCPFZPjAX03QpCCxwoX9GjBKYvKjdct7BgxyEdZBzxFFItZ1GkLEnRyLmFnS5ZqmUodx5MxUiZ2dqzK53woJYAoYYUUM17yS65HdTk2jimaKzVaGvDCNhFWIAeIVt9lGFqyvG1j+4T8Q5kkIpkur1A81sEwoc4MMzkdutjk2e8sv6vF8Zm6FFiKfrpJQFXrMX8jci7gFpSxqAsHQJNOh1WiWm4+dm0HKVTHHLjAkbVrojMbJpsIdIRaozgPg/J/zEr0yUqLOqvCLh2BNQm3+xkMnODcujtx53itM2idYN1uYWZDX7WsB500HFcsduJcG//Dw7YtQlzH/SPrikRPFSURZqy9DFxkkPni+hl66x0/ErAfu6XC0bmn5R1JCnsLQYiuLZN8OwFNWaptau2t4Vb77sTsf5VcbGK+yOmbCosoGcbzaUJ6kmH6d2Y0P8fC+vS4pSjlmk1YBb89Dkt9JKRAWeN5uqSBQEIGE824wOZskY/3XkIeaNXGpaB8fxsSX8jAVUts7FV6mQbDh5ySbmnGxTIYo87waf0O8Hu96F5ic1UMd3ayTwbtuZzPFTGU86XGLldDVBRFswtsWtA x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5877.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(366004)(376002)(346002)(39860400002)(136003)(396003)(451199021)(478600001)(110136005)(86362001)(107886003)(186003)(53546011)(7696005)(26005)(9686003)(6506007)(55016003)(33656002)(71200400001)(4326008)(64756008)(66446008)(66476007)(66556008)(316002)(82960400001)(83380400001)(66946007)(76116006)(2906002)(38100700002)(122000001)(41300700001)(8676002)(8936002)(38070700005)(5660300002)(52536014); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?6weXBkUech0Sd2QrNJ6HZKmGJhrkSgBVflvt1kTBN+oUaGKyBhyyjuj4OgKj?= =?us-ascii?Q?9FBGhHEhN7U3TrzPNRcqUMVrMOui2ZTv6o22wQPXB34OmFyWV5Cx1o4qdxyK?= =?us-ascii?Q?ODWG57O1SaozTKXTXXppsJZ6+XSXHM7Sh38BIn3dqwU2TqOA1Rw4obLlOZiu?= =?us-ascii?Q?wODM780fjby1Fe/+xqEdeZkp8U1lQOrpm7nfUKrubG731tRsPUAykL0nYdEv?= =?us-ascii?Q?zukIFowq0+WuoByozH5U2+LSqZbR7/49AzuNMTEj+9rtLH16hzIbB+IlTYsZ?= =?us-ascii?Q?PWWjfl7Hy9mNyG6axa2/flmfVK6Gtr+SIPy3/+DfS/bNhBfhphZU8hg4dlBw?= =?us-ascii?Q?oJX3Y3mUJ+rC0m7N7u0dvYYYoP+MBmr+xW9g8LZIfSDGObpBmoZJApieGWtR?= =?us-ascii?Q?5RamFPfsxERqWB8mERt15Qpz6wlc/WE77Axo7cEwOkLWJEi0mZyyMD4hc/Sd?= =?us-ascii?Q?1CBtNfNtz+dbUzfSJi7dkAjESczO0K8bZ6QSJNHT/gYwFrj22YAXR15FyRzz?= =?us-ascii?Q?uIPuDcQqxNB5zz2NwEflcdXwj6MuLRD1sEyCOqm7XiqKwSf5lU1bRcs97YWc?= =?us-ascii?Q?D2im90h5DBEiQYIbETowAX+9vUuCh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-ascii?Q?2VJ8VibVPzAcnRfYqaiDKFn6Xkmy/b8KEkj7hMx+XJcGd+prjwA8kzyxOnvr?= =?us-ascii?Q?ajgrwlOETGne7FQ8H3JLGetgT5uxQ8Bh9EW5Uk4d?= 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: PH0PR11MB5877.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0e4499e-f8aa-4aaf-1ee1-08db446a6303 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Apr 2023 02:19:52.0945 (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: uWmF1Cmtt5aHLIsg2W1+6k2EA5JXh2GVklxQJUXG2rMi1uZl4uy7Sw1jZJwzOFhG8LU177GAUiqiBfSmT7UxvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR11MB4654 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: Wu, Jingjing > Sent: Sunday, April 23, 2023 4:56 PM > To: Liu, Mingxia ; dev@dpdk.org > Cc: Xing, Beilei > Subject: RE: [PATCH] net/idpf: refine devargs parse functions >=20 >=20 >=20 > > -----Original Message----- > > From: Liu, Mingxia > > Sent: Friday, April 21, 2023 3:15 PM > > To: dev@dpdk.org > > Cc: Wu, Jingjing ; Xing, Beilei > > ; Liu, Mingxia > > Subject: [PATCH] net/idpf: refine devargs parse functions > > > > This patch refines devargs parsing functions and use valid variable > > max_vport_nb to replace IDPF_MAX_VPORT_NUM. > > > > Signed-off-by: Mingxia Liu > > --- > > drivers/net/idpf/idpf_ethdev.c | 61 > > +++++++++++++++++----------------- > > 1 file changed, 30 insertions(+), 31 deletions(-) > > > > diff --git a/drivers/net/idpf/idpf_ethdev.c > > b/drivers/net/idpf/idpf_ethdev.c index e02ec2ec5a..a8dd5a0a80 100644 > > --- a/drivers/net/idpf/idpf_ethdev.c > > +++ b/drivers/net/idpf/idpf_ethdev.c > > @@ -857,12 +857,6 @@ insert_value(struct idpf_devargs *devargs, uint16_= t > id) > > return 0; > > } > > > > - if (devargs->req_vport_nb >=3D RTE_DIM(devargs->req_vports)) { > > - PMD_INIT_LOG(ERR, "Total vport number can't be > %d", > > - IDPF_MAX_VPORT_NUM); > > - return -EINVAL; > > - } > > - > > devargs->req_vports[devargs->req_vport_nb] =3D id; > > devargs->req_vport_nb++; > > > > @@ -879,12 +873,10 @@ parse_range(const char *value, struct > > idpf_devargs *devargs) > > > > result =3D sscanf(value, "%hu%n-%hu%n", &lo, &n, &hi, &n); > > if (result =3D=3D 1) { > > - if (lo >=3D IDPF_MAX_VPORT_NUM) > > - return NULL; > > if (insert_value(devargs, lo) !=3D 0) > > return NULL; > > } else if (result =3D=3D 2) { > > - if (lo > hi || hi >=3D IDPF_MAX_VPORT_NUM) > > + if (lo > hi) > > return NULL; > > for (i =3D lo; i <=3D hi; i++) { > > if (insert_value(devargs, i) !=3D 0) @@ -969,40 +961,46 > @@ > > idpf_parse_devargs(struct rte_pci_device *pci_dev, struct > > idpf_adapter_ext *adap > > return -EINVAL; > > } > > > > + ret =3D rte_kvargs_process(kvlist, IDPF_VPORT, &parse_vport, > > + idpf_args); > > + if (ret !=3D 0) > > + goto fail; > > + > > + ret =3D rte_kvargs_process(kvlist, IDPF_TX_SINGLE_Q, &parse_bool, > > + &adapter->base.is_tx_singleq); > > + if (ret !=3D 0) > > + goto fail; > > + > > + ret =3D rte_kvargs_process(kvlist, IDPF_RX_SINGLE_Q, &parse_bool, > > + &adapter->base.is_rx_singleq); > > + if (ret !=3D 0) > > + goto fail; > > + > > /* check parsed devargs */ > > if (adapter->cur_vport_nb + idpf_args->req_vport_nb > > > - IDPF_MAX_VPORT_NUM) { > > + adapter->max_vport_nb) { > > PMD_INIT_LOG(ERR, "Total vport number can't be > %d", > > - IDPF_MAX_VPORT_NUM); > > + adapter->max_vport_nb); > > ret =3D -EINVAL; > > - goto bail; > > + goto fail; > > } > > > > for (i =3D 0; i < idpf_args->req_vport_nb; i++) { > > + if (idpf_args->req_vports[i] > adapter->max_vport_nb - 1) { > > + PMD_INIT_LOG(ERR, "Invalid vport id %d, it should be > 0 ~ %d", > > + idpf_args->req_vports[i], adapter- > >max_vport_nb - 1); > > + ret =3D -EINVAL; > This verify is not necessary, because we don't limit the vport id specifi= ed in args > need to be less than the number it supports. [Liu, Mingxia] Yes, I'll delete this limits, and test ok.