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 85351A0C46; Tue, 28 Sep 2021 04:22:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D9D740E3C; Tue, 28 Sep 2021 04:22:14 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 9999E40DF6 for ; Tue, 28 Sep 2021 04:22:12 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10120"; a="204752280" X-IronPort-AV: E=Sophos;i="5.85,328,1624345200"; d="scan'208";a="204752280" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2021 19:22:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,328,1624345200"; d="scan'208";a="654953472" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga005.jf.intel.com with ESMTP; 27 Sep 2021 19:22:11 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 27 Sep 2021 19:22:10 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) 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.2242.12; Mon, 27 Sep 2021 19:22:10 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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.2242.12 via Frontend Transport; Mon, 27 Sep 2021 19:22:10 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.45) 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, 27 Sep 2021 19:22:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SxXicx3bcXKk2xQGwQQh9yGBbJk1TTulPBPvl9UOvQhPZslPw1Jb7WsoQ6NQUvgkjQ10+t5X4VoqejS1wMLHkxc/pDbVsYBikEjoJ+IUM2SrBV+w6DESroo0HLxRJPfCa7yaFvDC7EKHP4R8B+j/9dIAaF1YvgvMZUdsfvF6oOfBolTi6vy60Rbg7dH6taqTTuwiJ2rRlQHVq+p2nSNPsTl2UzAc/hQd55lO3jTuZ+L1JRd7nvGIJElAS8rQhO8XrXYlKByN2PyFLkoPKjXZJ0GPR0VvAtsWYTARdMwptfBA/Tn/+RgRMfduAn3dX0bquQQtVc2xR001re37W4GDMw== 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; bh=PYex5Zf5RNMi3lmRaZEKe5EuNjzHsF7eUlvn6r4R0YM=; b=G8MnSeczNP+LXQt2dBWrdWLqxslPfubBEAVn3sS5AjBJ5Z0hzM+0N025CIpIPLs9ALDFktNwGZUFCLlEKJGYPNJ3qoiOD8dU0xL2cxfk/pt7hahTqix5c3C3V//iMOgTnOtKQ3xO/2WsTO6ABv/8qwxEvR0aITcCB9Cks84cqLEQ8VVQou/8u6ezzRVkzBlylSCduVFoalLeAmKIeyR4N49aroQXqKtidj9lnLcg+ZcyQv1J2ahe1f7GHhqBxAsiOdcudQ3CNwgqly/DQPEQiElIV+MZUi9m0FHyNgo70FN8j9DW5pjZpJxbGT61QOTKOG3lZkACu75sTzjP4fe2rg== 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=PYex5Zf5RNMi3lmRaZEKe5EuNjzHsF7eUlvn6r4R0YM=; b=opLl0uZQ/DO7iENCUJYFUkNknms5/H9S8J6wp9rdNDafE9Ocz2tXa1yCpzM0ki7bqHkK88A5TulrO1wik1txDyT8c5PLURbYcBpKxEiJwc69UUBzIJw7gSzsxgyi+++S3yr42iBlBRKIVdQbO6AbAIgmEkW4MMFE0oh6lOKsius= Received: from DM8PR11MB5751.namprd11.prod.outlook.com (2603:10b6:8:12::16) by DM6PR11MB3321.namprd11.prod.outlook.com (2603:10b6:5:8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Tue, 28 Sep 2021 02:22:08 +0000 Received: from DM8PR11MB5751.namprd11.prod.outlook.com ([fe80::7d53:9d3b:b91f:9c09]) by DM8PR11MB5751.namprd11.prod.outlook.com ([fe80::7d53:9d3b:b91f:9c09%7]) with mapi id 15.20.4544.021; Tue, 28 Sep 2021 02:22:08 +0000 From: "Wang, Xiao W" To: jilei chen CC: "dev@dpdk.org" Thread-Topic: [PATCH] [v3] vdpa/ifc: increase readability in function Thread-Index: AQHXs4fWHbkKcvOB0U6vxGyI/5auiqu4t9sw Date: Tue, 28 Sep 2021 02:22:07 +0000 Message-ID: References: <20210927051737.18505-1-chenjilei@cmss.chinamobile.com> <20210927101755.21957-1-chenjilei@cmss.chinamobile.com> In-Reply-To: <20210927101755.21957-1-chenjilei@cmss.chinamobile.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.200.16 dlp-product: dlpe-windows authentication-results: cmss.chinamobile.com; dkim=none (message not signed) header.d=none;cmss.chinamobile.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ebfb612b-b9c7-46fc-8b87-08d98226c55b x-ms-traffictypediagnostic: DM6PR11MB3321: 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: LCPi9B3WUy1/ewCMe3GDzzE+q208HVqJjRZ/CbnLNiYO/YK2B5+gmK315R2Lkz0d1AMWx8IRFld0ppjC3cEEWLFOIMAzFP/kFJOI+bpIr6FmfWF1zES8S6XVYQUGAdvOpSfORvPHX2Xe4h/fM5JgmmwyY33UpLeVmPuSHUDKJgH7C+HHkuGhp7fMq7Lcd5xjrrRQvXygR/vaFwA7sKhuOQ4EgTh2XFSNfGEE1P2DLS/cLQnqjFO5FwIf1QNqSCmY0bT8hwkoFs0U/yzuJnVXf5lJJb1j/uv0MS4pBZlSO0oKQLQCzbjLFOjESQU8x1NHWVkBIpxVsDjTaG/soMFfIdM4Vu9T6EfIYy2C/kbXq3elFFFTNGeS6+4H14eQCj+kY/AgK+QrwODGSjytiNnu6Ka3GDRzbyVVdTuovtPBkEjYy3uDkQSntsIgudxkbSvJZXzXE6gRqdjp7kgtdBy5vYo/Tt5OLdc5E7etmyAkHJ9qP2qbHJaWKwtQ6o/wKcOfwxVbIfclPxi9yftUJQiEPYKhMeFuyabJFMxonwwnYO6o2GaAZbbgVP/NvEmXSO6fw32YjT174eU9O59d7YyWrIG1nlpyRysF/drH4ymo5hmBL7hmIF539klKDmU45rEr3Mk5i40DVwYOCvTLyyb6/vkW+WUgneE2mxyrCY2OpNa1AcmJ0zVJKbZT/NHe4vIO7GSfep3IAxYouXkPBH9BjA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM8PR11MB5751.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(4326008)(76116006)(55016002)(9686003)(38070700005)(5660300002)(53546011)(2906002)(33656002)(71200400001)(186003)(8676002)(26005)(6506007)(66946007)(66556008)(66476007)(64756008)(83380400001)(66446008)(8936002)(122000001)(7696005)(38100700002)(6916009)(86362001)(508600001)(52536014)(316002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?1QGpcCEPcJ0a5BIMUtaQk6JbwHKdkx/RLEACZbfueeBWXLAQ6vWooFYq?= =?Windows-1252?Q?zIwMGARLbE5B1L0iVpyVi6htKXN34ZShZ7hQho6IWShGM2z7GklFhXMW?= =?Windows-1252?Q?c2ltz/63K5r2XN6vw8hLca4ncAZrH9KU/piviZECwbrDYKlu1D0L/PXH?= =?Windows-1252?Q?Q3Q4vIK4nJqLpKgSeoaBvxzC372Xs0Ls4BY+dskQgvGGKMThCGSKRCw9?= =?Windows-1252?Q?xe8bq3qKi6I3ALTFHqgbwHbsuHIGPyVNY4f3HA2RBjegXtwnhNtBBI3o?= =?Windows-1252?Q?HEZzMGAMIeYKSClu2Ci48SPn5Zi3lNhlTMTn4S653CE9jvdCBZfbplZr?= =?Windows-1252?Q?FXJESZ0Ng8Eu9BTqn2AmGjxcZBTtckOs5YF/PH/6b7Xk6T/aJcUTZVxn?= =?Windows-1252?Q?Q6B7cNj3VxRbLvHYla225qWWL74wN62Yc9MRKtrOXIze8k09GWD/AKP7?= =?Windows-1252?Q?zhvH0Go8cRW+jn49d3fyFYVEYnn0fBDKCwCM+mj6hpNtMka03KYWHF9x?= =?Windows-1252?Q?Cd29RA5S8MFRvlkuvTn5ZnrW+c+7IiyXyBg7TI/1TSJL002RPDxwAy8r?= =?Windows-1252?Q?Z+HLvt1rtgzdMSqk5kXQ10Z2dgd+ZiJHSD1gb/FgScxldmLPDdnfNTWU?= =?Windows-1252?Q?n7hsERTvNn6boGTvByxwiVNO1BMP1a5G8MVxnKwP531QfFa4WVkTo7Xv?= =?Windows-1252?Q?KaJ2vS87TnwEVQsawtNuEkUkQ/xv9JHSwk1LYLbmuNe8LcBdOYSZJWr+?= =?Windows-1252?Q?ZEm6JaV/hiKRE/X2zYxNoTejjuZk5F35cKZkwCbE2+iImQpKKEsZUOu6?= =?Windows-1252?Q?5I42ipmYasPIORojBYtMMnP2ZzwwsrJdTPjBzC01DcpsmPRdx+p1JTkn?= =?Windows-1252?Q?GxPRgRdGj1niOHframtr28eAIAo1P6D4Aus6+qDXRIjCWRXgUBHjqIez?= =?Windows-1252?Q?YeTYwS8Mi0uo4tq/Su6fBfL28cTIHfgnBCKvMeUXoS/sd89W5BGdeFQs?= =?Windows-1252?Q?oN7K8Qn01VAYNXQ7mJVjqajzx0bd0qPKgzoVbqR36xGZrJ22Rn2gqPO0?= =?Windows-1252?Q?J32v+cG/h9i0GL+qrR9bt7dhq2qPfKKUmKzMdbq7Ekw2+Ia1bKYmEsmw?= =?Windows-1252?Q?vDKoxnHzstj0/KH0uvNZhVm8cJorEcPlKn4j3eV+XyAAjBrOdD7wI86U?= =?Windows-1252?Q?FHwK99MMRluyNj0pjFBMuNYp+yxqRhqJywSuXX0UKEVDUt/H92q58tmX?= =?Windows-1252?Q?KpsS+1LsYz1kPycKO9feXa6NDRyDxayaRkjUSA4nSMYqkVlt5+RBbsKf?= =?Windows-1252?Q?IWf+ugpopXOcSFWs3w2mMFYT4adbmLA3emma1TlgULCdGoXle20svWBW?= =?Windows-1252?Q?f1MJNO331VGiUwQcfZ62FaYpP9ppfB6s8ro=3D?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8PR11MB5751.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ebfb612b-b9c7-46fc-8b87-08d98226c55b X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Sep 2021 02:22:07.9790 (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: zT5HQh6Hjtkn4u+fQCoerfVrv0BduyIwtpn6IjcK/f3x2Y9o+hmPyNrY6f4A6j/o+nHw8Hxno2VTqTecrNmTRw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3321 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] [v3] vdpa/ifc: increase readability in function 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" Hi, > -----Original Message----- > From: jilei chen > Sent: Monday, September 27, 2021 6:18 PM > To: Wang, Xiao W > Cc: dev@dpdk.org > Subject: [PATCH] [v3] vdpa/ifc: increase readability in function >=20 > Use bool type for function's switch parameter, > this could avoid passing "1" or "0" which is not reader friendly. >=20 > Signed-off-by: jilei chen > --- > v3: > * Update inappropriate description >=20 > v2: > * Concise subject of the patch > * Optimize function parameters > --- > drivers/vdpa/ifc/ifcvf_vdpa.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) >=20 > diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.= c > index 1dc813d0a3..365da2a8b9 100644 > --- a/drivers/vdpa/ifc/ifcvf_vdpa.c > +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c > @@ -182,7 +182,7 @@ ifcvf_vfio_setup(struct ifcvf_internal *internal) > } >=20 > static int > -ifcvf_dma_map(struct ifcvf_internal *internal, int do_map) > +ifcvf_dma_map(struct ifcvf_internal *internal, bool do_map) > { > uint32_t i; > int ret; > @@ -538,11 +538,11 @@ update_datapath(struct ifcvf_internal *internal) > if (!rte_atomic32_read(&internal->running) && > (rte_atomic32_read(&internal->started) && > rte_atomic32_read(&internal->dev_attached))) { > - ret =3D ifcvf_dma_map(internal, 1); > + ret =3D ifcvf_dma_map(internal, true); > if (ret) > goto err; >=20 > - ret =3D vdpa_enable_vfio_intr(internal, 0); > + ret =3D vdpa_enable_vfio_intr(internal, false); > if (ret) > goto err; >=20 > @@ -568,7 +568,7 @@ update_datapath(struct ifcvf_internal *internal) > if (ret) > goto err; >=20 > - ret =3D ifcvf_dma_map(internal, 0); > + ret =3D ifcvf_dma_map(internal, false); > if (ret) > goto err; >=20 > @@ -850,7 +850,7 @@ ifcvf_sw_fallback_switchover(struct ifcvf_internal > *internal) > goto error; >=20 > /* set up interrupt for interrupt relay */ > - ret =3D vdpa_enable_vfio_intr(internal, 1); > + ret =3D vdpa_enable_vfio_intr(internal, true); > if (ret) > goto unmap; >=20 > @@ -875,7 +875,7 @@ ifcvf_sw_fallback_switchover(struct ifcvf_internal > *internal) > unset_intr: > vdpa_disable_vfio_intr(internal); > unmap: > - ifcvf_dma_map(internal, 0); > + ifcvf_dma_map(internal, false); > error: > return -1; > } > @@ -934,7 +934,7 @@ ifcvf_dev_close(int vid) > vdpa_disable_vfio_intr(internal); >=20 > /* unset DMA map for guest memory */ > - ifcvf_dma_map(internal, 0); > + ifcvf_dma_map(internal, false); >=20 > internal->sw_fallback_running =3D false; > } else { > @@ -1130,7 +1130,7 @@ ifcvf_set_vring_state(int vid, int vring, int state= ) > } >=20 > if (state && !hw->vring[vring].enable) { > - ret =3D vdpa_enable_vfio_intr(internal, 0); > + ret =3D vdpa_enable_vfio_intr(internal, false); > if (ret) > return ret; > } > -- > 2.12.2 >=20 >=20 Acked-by: Xiao Wang BRs, Xiao