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 6303CA0524; Fri, 19 Mar 2021 16:48:06 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C370140FCD; Fri, 19 Mar 2021 16:48:06 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 5B677140FCD for ; Fri, 19 Mar 2021 16:48:04 +0100 (CET) IronPort-SDR: uLgi5aVghQZumyu7AvVLfyVCHnteA41uNskaqZ9qTEvKMuD36J+pg+1JAZibxL1ML4q/rswTib r46JlLLUx3oQ== X-IronPort-AV: E=McAfee;i="6000,8403,9928"; a="251268140" X-IronPort-AV: E=Sophos;i="5.81,262,1610438400"; d="scan'208";a="251268140" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2021 08:48:02 -0700 IronPort-SDR: j13wxt8qAPxEIAFHJa8An2Pds6KPkhJJnwF5ur3gZ1ID2ExO3MC05nHd36JIZ5Brs9uwieotsf W5R0Ey0Zppqw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,262,1610438400"; d="scan'208";a="441358386" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by FMSMGA003.fm.intel.com with ESMTP; 19 Mar 2021 08:48:02 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Fri, 19 Mar 2021 08:48:02 -0700 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Fri, 19 Mar 2021 08:48:01 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Fri, 19 Mar 2021 08:48:01 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.48) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Fri, 19 Mar 2021 08:47:59 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZgCaQaC38zq+zyI6z2KObHF0GMrCNHqDR7aVYa7ug2HBBh7YnWpurBuLyEo47apFifoQ7Ey+hZGB9ILpb9WprvEPJru5cRiahvVNaqKqbaQyniTBaA/h1tvbIfXoIovESsFvHsQY3kJZJNXJ03Ulxxei+nFgZDI5QU3Nz6kOLRbxBdakWZ37D1iAl/Yz0k/7l4M5VDDNNRvO1IvvpIBhK3B3xqHrTIpFWnK+/iUSWvQAuOQaIBHL9G7tfclc1YQU3IPZpKdqzC6o6CcZzr3U9pEQJCqunE+pGzqGqc7ANaMifqSmyZNJV3QpHoiIuUXypnoEIejpwJ06rKTn+oWbiw== 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-SenderADCheck; bh=KtTCcUgRAuxgWZxpbrE+DSFgFS6/nqmqNeQsQRgbzfg=; b=cPHCuTBlCwFbvMPxLsN6STE2zlPgcHv/VEchtOCACdyDECpJ3b+/0Hy95bjNrZjd1u2tjXaGteiTSc6q/+EsB1mnf4fkqiqHG3tqdcBUzLXb66RilyntUW0IabS6wcwRTNYAhH82XkzhCTTjh0rjI2Z01O3bEu5m3k7XZlliQ3G4w/pfoQDDBtG6d6f0dgcGfgKj7KiNUejskwIALDKHlzRQwYj2AH+ouSV9faLHnDuqQmI/HktvhbTHapxHzh/zIhp2ntXJZc4x3inflihnXHHTfktoZ3I38LslXZ1DgtKvb1vUY0PdPUGHMCQPEulM0jyyojH+g4LyIbWb6NRxCg== 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=KtTCcUgRAuxgWZxpbrE+DSFgFS6/nqmqNeQsQRgbzfg=; b=H8UIAKZHxx3Od00HKpuvM8RyhVb3huwyKqDgtcLq2DvR4YKzXbDTVzIi39UQbYe2/kmJyfNsuAZQsQE9/+t5rPylC/Q+WSA3fjFbHG5SM3/D0p7QpoT2JOte5YBUR8Ztoy+RHDpxkxDIxS+wTzM6zR/m7svIgcFwhGCoUypYqlI= Received: from SN6PR11MB3103.namprd11.prod.outlook.com (2603:10b6:805:d7::13) by SA2PR11MB4794.namprd11.prod.outlook.com (2603:10b6:806:f9::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.23; Fri, 19 Mar 2021 15:47:56 +0000 Received: from SN6PR11MB3103.namprd11.prod.outlook.com ([fe80::c9c2:8157:5bef:9b2]) by SN6PR11MB3103.namprd11.prod.outlook.com ([fe80::c9c2:8157:5bef:9b2%6]) with mapi id 15.20.3933.032; Fri, 19 Mar 2021 15:47:56 +0000 From: "McDaniel, Timothy" To: Thomas Monjalon , "dev@dpdk.org" CC: "ncopa@alpinelinux.org" , Andrew Boyer , Andrew Rybchenko , "David Marchand" , "Burakov, Anatoly" , Stephen Hemminger , "Long Li" , Jay Zhou , Rasesh Mody , Shahed Shaikh , Maxime Coquelin , "Xia, Chenbo" , "Wang, Xiao W" Thread-Topic: [PATCH v7 06/17] drivers: replace page size definitions with function Thread-Index: AQHXHNBSnO77ATIMPEitF3dtvquSAKqLdMkg Date: Fri, 19 Mar 2021 15:47:55 +0000 Message-ID: References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> <20210319145730.3555384-7-thomas@monjalon.net> In-Reply-To: <20210319145730.3555384-7-thomas@monjalon.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=none action=none header.from=intel.com; x-originating-ip: [162.251.9.49] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 06fbf8e3-2d08-4706-84ca-08d8eaee5d3f x-ms-traffictypediagnostic: SA2PR11MB4794: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:173; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 4nMrFlp2JuZ9V4k80buUolu7+O03beNARZCIC5HEqLY78NvMVe+fW7QcPvmvsDsa3ynZWYsW2kgxcW1UcehQXbBhwhtnt5PK7dINTTvABKVbBEDoZu+i3ivguwOOhg81dSOioXAf7TTLYXwe+NhEjK723+wCby6Us96KJJGaSIJ8vDzqS+f/Qj00Oz1wilVYEL6KiPG4jkqlBFYaeDMomaDFCmDnPMh+NbT+XiaP9izGapSeGgNL/e3MF7KAQbmHkky8mTLtrEW1ud2AXOF5iqu9LAsH4Aufyj6cePRphkBQ1Hr4CPmWm58uW7mHaK+lBoDcLmkdXj1ijI4zpLua7pI0GiSL2Or4ABUS9riqbFl/hm9ab3fGO/Y3qEn2ufY2aqZJSfhw63ye4oONvdJZsQyoT2h+FOW0ohTa5pBXe6ePXm7hYZEV510iXrKTV0YCRuFhVT+x/0Vr+mD88cVBjI9ZNMmG+O9vFF6T0tEoygeGMcs6LAZnbuQ3yRER6jHFF5y1XVPyiB9pD20IWQqCK1fSiDb9jyQKsdGAR9LaAYjKx/J3DVk20UEfJ79e8PODC8us/SANGw4s++lw/cawxG8lsW1SBvvEvNH3fNW2uXEaJKofFr21lSTAl2x8MZ7qUpt9NwgsBjWEtRhPi1/NkEaq1Wy7h2hW1mOVZJrEdgKdEHUQcmKSY5uTJMBCTsdR x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3103.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(376002)(396003)(136003)(346002)(39860400002)(366004)(7696005)(478600001)(66946007)(4326008)(66446008)(8676002)(66476007)(6506007)(53546011)(5660300002)(52536014)(83380400001)(55016002)(86362001)(26005)(110136005)(38100700001)(9686003)(107886003)(316002)(76116006)(186003)(71200400001)(8936002)(30864003)(66556008)(54906003)(2906002)(7416002)(33656002)(64756008)(559001)(579004)(6606295002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?kZAeG/SRB2mHX5CxWUrt0yZzMSmBIx1ybaw24tk0d0DVxYGpwhqZqtHo9HBR?= =?us-ascii?Q?JxwGfg+UQr+HmwhUy6av5zb+GZqVOpnkLQuHEu9HmKOYnrNjtg368xExyCXd?= =?us-ascii?Q?/dYc1Vh7mGKVwD59+E9xMhzTABgaydjCn0zzN73uJkrzz0721y2UhbXKNzIX?= =?us-ascii?Q?tz32stZWe2fpXouWVj/kKMLESsbQ+22+namektYYgzh1d0kaxyi2LWOSIv5g?= =?us-ascii?Q?nBX6zIZH0yZOCUy7h/wagC1y5uX2tyS+QyYHyuJDSHSG0FXl78soBHKYCp1D?= =?us-ascii?Q?gqVoUMe5X+N+yfskiQCAwht9ZWUOvzq5qlE/d/6Kjgbmh1Wgq2VRPNyyrexh?= =?us-ascii?Q?4tlDMuTyaASPCVizsNrnZfYHBFk/snqEjQMzbkER6EknICV+eIWUEUXcAQGu?= =?us-ascii?Q?g4fej6O2M947grk3AB2bT1gf1R4VGKmWZj4RPTQxQSXNq/c52PzME+/+0Wkz?= =?us-ascii?Q?dI5P7ffeg4W4mXWPPp5P35wTirtaL1OnULJKvcu/lymJDstN1YUszIrZsDAF?= =?us-ascii?Q?QonU9JvQq7g6DPGaIHR8UGrrgMCwwKcndz/vp3w0NzL5lyf+jNKlsovTYt+F?= =?us-ascii?Q?QoQ8wXvx4r10jsjuNyxVKaB0SxHb8HJLXPsmfizeTkPFxV7dwRjQ+X7eWlII?= =?us-ascii?Q?DTdNU0Z3uktSa3tSbf9yC3bZIWis+QsWJhls5uCBK7fMmRkQ0IsSdECNGwoR?= =?us-ascii?Q?KaZS2wqkgDBWq4T6/Ahsfs1grarn4+BUxpoYkt3VmlBk8BVxtEhD4JsLZFWP?= =?us-ascii?Q?tnY52Ft+FF78wmIAZjcFq6uRGVQ5Gh5oOusMxnS7bJto4DAwxBLEEuahKXpe?= =?us-ascii?Q?s//IWJPRMd9iFxC8wSPCL92aBmkSH4SL+BvwyQLJ/DmsNge9GCuWo569kSjK?= =?us-ascii?Q?2wlb3XZpNvklfvGt43jaAQKDidy3gl6wThdSVl/CyFSy/PI+UyRYY4UvRl7F?= =?us-ascii?Q?ZVP7EV1/XYBhW5glD1RJdWiMhOhCdjM7bBViHi/F9MFozjUyrYeURlBj2wB/?= =?us-ascii?Q?3iO9rcHL6yo571VyY5fcvoE4gOSJ70Kk6cH6q5GcXQmSf5r65yjhdddO5TJe?= =?us-ascii?Q?lWkzkZ8J7H+UYmAOtp6BHlVlvnHRy1O7Xk/cpQa7z2nh8cypXqkFJf15wa0M?= =?us-ascii?Q?mORoESFTBKoBryZpuflj/q5nLIVSznFl5mi9nuZBWD41QGtDzsYvkY1MV0TG?= =?us-ascii?Q?4FbDzZ8UsigtkxvIPbl+HuVTKwJyjxRHWt5TnlTDQ7/Ak8wFucWaLSTntzi7?= =?us-ascii?Q?xY6HgRdmcHlIbzvvWgwi+MJykZ63qXKZ/+VQC/ifGBOgCqUlzSyUvD0Dl1L8?= =?us-ascii?Q?egM=3D?= 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: SN6PR11MB3103.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 06fbf8e3-2d08-4706-84ca-08d8eaee5d3f X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2021 15:47:55.9225 (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: ATo6awfGsERF+RYr2lq+wj38efFDzbS15u7EwiWoCZrtDCNKRbuCBzJU8U5ae4P6Cs52MX+jOdx6AYRuC/+ddCkeHFXrn8+21Ad4P82Nfo4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB4794 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v7 06/17] drivers: replace page size definitions with 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" > -----Original Message----- > From: Thomas Monjalon > Sent: Friday, March 19, 2021 9:57 AM > To: dev@dpdk.org > Cc: ncopa@alpinelinux.org; Andrew Boyer ; Andrew > Rybchenko ; David Marchand > ; Burakov, Anatoly > ; Stephen Hemminger > ; Long Li ; Jay Zhou > ; McDaniel, Timothy > ; Rasesh Mody ; Shahed > Shaikh ; Maxime Coquelin > ; Xia, Chenbo ; Wang, > Xiao W > Subject: [PATCH v7 06/17] drivers: replace page size definitions with fun= ction >=20 > The page size is often retrieved from the macro PAGE_SIZE. > If PAGE_SIZE is not defined, it is either using hard coded default, > or getting the system value from the UNIX-only function sysconf(). >=20 > Such definitions are replaced with the generic function > rte_mem_page_size() defined for each supported OS. >=20 > Removing PAGE_SIZE definitions will fix dlb drivers for musl libc, > because #ifdef checks were missing, causing redefinition errors. >=20 > Signed-off-by: Thomas Monjalon > Acked-by: Andrew Boyer > Acked-by: Andrew Rybchenko > Acked-by: David Marchand > --- > drivers/bus/pci/linux/pci_vfio.c | 9 ++------- > drivers/bus/vmbus/linux/vmbus_uio.c | 4 ++-- > drivers/bus/vmbus/private.h | 5 +---- > drivers/bus/vmbus/rte_vmbus_reg.h | 2 +- > drivers/bus/vmbus/vmbus_common_uio.c | 4 ++-- > drivers/crypto/virtio/virtio_pci.h | 3 ++- > drivers/event/dlb/dlb.c | 7 +++++-- > drivers/event/dlb/dlb_priv.h | 2 -- > drivers/event/dlb/pf/base/dlb_osdep.h | 2 +- > drivers/event/dlb/pf/dlb_main.h | 5 +---- > drivers/event/dlb/pf/dlb_pf.c | 10 +++++---- > drivers/event/dlb2/dlb2_priv.h | 2 -- > drivers/event/dlb2/pf/base/dlb2_osdep.h | 2 +- > drivers/event/dlb2/pf/dlb2_main.h | 5 +---- > drivers/event/dlb2/pf/dlb2_pf.c | 8 ++++---- > drivers/net/bnx2x/ecore_fw_defs.h | 18 +++++++++++------ > drivers/net/ionic/ionic_lif.c | 27 ++++++++++++++----------- > drivers/net/ionic/ionic_main.c | 3 ++- > drivers/net/ionic/ionic_osdep.h | 2 +- > drivers/net/netvsc/hn_rndis.c | 12 +++++------ > drivers/net/netvsc/hn_rxtx.c | 10 +++++---- > drivers/net/netvsc/hn_var.h | 9 +++------ > drivers/net/virtio/virtio.h | 2 +- > drivers/net/virtio/virtio_ethdev.c | 6 +++--- > drivers/net/virtio/virtio_ethdev.h | 4 ---- > drivers/vdpa/ifc/ifcvf_vdpa.c | 17 +++++++--------- > 26 files changed, 85 insertions(+), 95 deletions(-) >=20 > diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci= _vfio.c > index e3f7b6abeb..9d689d6fd9 100644 > --- a/drivers/bus/pci/linux/pci_vfio.c > +++ b/drivers/bus/pci/linux/pci_vfio.c > @@ -38,11 +38,6 @@ >=20 > #ifdef VFIO_PRESENT >=20 > -#ifndef PAGE_SIZE > -#define PAGE_SIZE (sysconf(_SC_PAGESIZE)) > -#endif > -#define PAGE_MASK (~(PAGE_SIZE - 1)) > - > static struct rte_tailq_elem rte_vfio_tailq =3D { > .name =3D "VFIO_RESOURCE_LIST", > }; > @@ -507,8 +502,8 @@ pci_vfio_mmap_bar(int vfio_dev_fd, struct > mapped_pci_resource *vfio_res, > */ > uint32_t table_start =3D msix_table->offset; > uint32_t table_end =3D table_start + msix_table->size; > - table_end =3D RTE_ALIGN(table_end, PAGE_SIZE); > - table_start =3D RTE_ALIGN_FLOOR(table_start, PAGE_SIZE); > + table_end =3D RTE_ALIGN(table_end, rte_mem_page_size()); > + table_start =3D RTE_ALIGN_FLOOR(table_start, > rte_mem_page_size()); >=20 > /* If page-aligned start of MSI-X table is less than the > * actual MSI-X table start address, reassign to the actual > diff --git a/drivers/bus/vmbus/linux/vmbus_uio.c > b/drivers/bus/vmbus/linux/vmbus_uio.c > index 5dc0c47de6..b52ca5bf1d 100644 > --- a/drivers/bus/vmbus/linux/vmbus_uio.c > +++ b/drivers/bus/vmbus/linux/vmbus_uio.c > @@ -154,7 +154,7 @@ vmbus_uio_map_resource_by_index(struct > rte_vmbus_device *dev, int idx, > vmbus_map_addr =3D vmbus_find_max_end_va(); >=20 > /* offset is special in uio it indicates which resource */ > - offset =3D idx * PAGE_SIZE; > + offset =3D idx * rte_mem_page_size(); >=20 > mapaddr =3D vmbus_map_resource(vmbus_map_addr, fd, offset, size, > flags); > close(fd); > @@ -224,7 +224,7 @@ static int vmbus_uio_map_subchan(const struct > rte_vmbus_device *dev, > } > file_size =3D sb.st_size; >=20 > - if (file_size =3D=3D 0 || (file_size & (PAGE_SIZE - 1))) { > + if (file_size =3D=3D 0 || (file_size & (rte_mem_page_size() - 1))) { > VMBUS_LOG(ERR, "incorrect size %s: %zu", > ring_path, file_size); >=20 > diff --git a/drivers/bus/vmbus/private.h b/drivers/bus/vmbus/private.h > index f19b14e4a6..528d60a42f 100644 > --- a/drivers/bus/vmbus/private.h > +++ b/drivers/bus/vmbus/private.h > @@ -9,13 +9,10 @@ > #include > #include > #include > +#include > #include > #include >=20 > -#ifndef PAGE_SIZE > -#define PAGE_SIZE 4096 > -#endif > - > extern struct rte_vmbus_bus rte_vmbus_bus; >=20 > extern int vmbus_logtype_bus; > diff --git a/drivers/bus/vmbus/rte_vmbus_reg.h > b/drivers/bus/vmbus/rte_vmbus_reg.h > index f5a0693dcb..8562672979 100644 > --- a/drivers/bus/vmbus/rte_vmbus_reg.h > +++ b/drivers/bus/vmbus/rte_vmbus_reg.h > @@ -100,7 +100,7 @@ struct vmbus_bufring { > uint32_t value; > } feature_bits; >=20 > - /* Pad it to PAGE_SIZE so that data starts on page boundary */ > + /* Pad it to rte_mem_page_size() so that data starts on page boundary > */ > uint8_t reserved2[4028]; >=20 > /* > diff --git a/drivers/bus/vmbus/vmbus_common_uio.c > b/drivers/bus/vmbus/vmbus_common_uio.c > index a689bf11b3..8582e32c1d 100644 > --- a/drivers/bus/vmbus/vmbus_common_uio.c > +++ b/drivers/bus/vmbus/vmbus_common_uio.c > @@ -63,7 +63,7 @@ vmbus_uio_map_secondary(struct rte_vmbus_device > *dev) >=20 > for (i =3D 0; i !=3D uio_res->nb_maps; i++) { > void *mapaddr; > - off_t offset =3D i * PAGE_SIZE; > + off_t offset =3D i * rte_mem_page_size(); >=20 > mapaddr =3D vmbus_map_resource(uio_res->maps[i].addr, > fd, offset, > @@ -175,7 +175,7 @@ vmbus_uio_map_resource(struct rte_vmbus_device > *dev) > } >=20 > dev->int_page =3D (uint32_t *)((char *)uio_res- > >maps[HV_INT_PAGE_MAP].addr > - + (PAGE_SIZE >> 1)); > + + (rte_mem_page_size() >> 1)); > dev->monitor_page =3D uio_res->maps[HV_MON_PAGE_MAP].addr; > return 0; > } > diff --git a/drivers/crypto/virtio/virtio_pci.h b/drivers/crypto/virtio/v= irtio_pci.h > index d9a214dfd0..0a7ea1bb64 100644 > --- a/drivers/crypto/virtio/virtio_pci.h > +++ b/drivers/crypto/virtio/virtio_pci.h > @@ -7,6 +7,7 @@ >=20 > #include >=20 > +#include > #include > #include > #include > @@ -67,7 +68,7 @@ struct virtqueue; > * > * Note the sizeof(struct vring_desc) is 16 bytes. > */ > -#define VIRTIO_MAX_INDIRECT ((int) (PAGE_SIZE / 16)) > +#define VIRTIO_MAX_INDIRECT ((int) (rte_mem_page_size() / 16)) >=20 > /* Do we get callbacks when the ring is completely used, even if we've > * suppressed them? > diff --git a/drivers/event/dlb/dlb.c b/drivers/event/dlb/dlb.c > index 8b26d1d2d2..1174ab3d2b 100644 > --- a/drivers/event/dlb/dlb.c > +++ b/drivers/event/dlb/dlb.c > @@ -23,6 +23,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -991,7 +992,8 @@ dlb_hw_create_ldb_port(struct dlb_eventdev *dlb, > goto error_exit; > } >=20 > - qm_port->pp_mmio_base =3D DLB_LDB_PP_BASE + PAGE_SIZE * > qm_port_id; > + qm_port->pp_mmio_base =3D DLB_LDB_PP_BASE + > + rte_mem_page_size() * qm_port_id; > qm_port->id =3D qm_port_id; >=20 > /* The credit window is one high water mark of QEs */ > @@ -1181,7 +1183,8 @@ dlb_hw_create_dir_port(struct dlb_eventdev *dlb, > goto error_exit; > } >=20 > - qm_port->pp_mmio_base =3D DLB_DIR_PP_BASE + PAGE_SIZE * > qm_port_id; > + qm_port->pp_mmio_base =3D DLB_DIR_PP_BASE + > + rte_mem_page_size() * qm_port_id; > qm_port->id =3D qm_port_id; >=20 > /* The credit window is one high water mark of QEs */ > diff --git a/drivers/event/dlb/dlb_priv.h b/drivers/event/dlb/dlb_priv.h > index 272e17482f..ca4d6a84cf 100644 > --- a/drivers/event/dlb/dlb_priv.h > +++ b/drivers/event/dlb/dlb_priv.h > @@ -76,8 +76,6 @@ >=20 > #define PP_BASE(is_dir) ((is_dir) ? DLB_DIR_PP_BASE : DLB_LDB_PP_BASE) >=20 > -#define PAGE_SIZE (sysconf(_SC_PAGESIZE)) > - > #define DLB_NUM_QES_PER_CACHE_LINE 4 >=20 > #define DLB_MAX_ENQUEUE_DEPTH 64 > diff --git a/drivers/event/dlb/pf/base/dlb_osdep.h > b/drivers/event/dlb/pf/base/dlb_osdep.h > index 0c119b759a..dee20660ed 100644 > --- a/drivers/event/dlb/pf/base/dlb_osdep.h > +++ b/drivers/event/dlb/pf/base/dlb_osdep.h > @@ -92,7 +92,7 @@ static inline void *os_map_producer_port(struct dlb_hw > *hw, >=20 >=20 > pp_dma_base =3D (uintptr_t)hw->func_kva + DLB_PP_BASE(is_ldb); > - addr =3D (pp_dma_base + (PAGE_SIZE * port_id)); > + addr =3D (pp_dma_base + (rte_mem_page_size() * port_id)); >=20 > return (void *)(uintptr_t)addr; >=20 > diff --git a/drivers/event/dlb/pf/dlb_main.h b/drivers/event/dlb/pf/dlb_m= ain.h > index 22e215223d..e66ba228d1 100644 > --- a/drivers/event/dlb/pf/dlb_main.h > +++ b/drivers/event/dlb/pf/dlb_main.h > @@ -10,10 +10,7 @@ > #include > #include > #include > - > -#ifndef PAGE_SIZE > -#define PAGE_SIZE (sysconf(_SC_PAGESIZE)) > -#endif > +#include >=20 > #include "base/dlb_hw_types.h" > #include "../dlb_user.h" > diff --git a/drivers/event/dlb/pf/dlb_pf.c b/drivers/event/dlb/pf/dlb_pf.= c > index 3aeef6f91d..2f7e30abbd 100644 > --- a/drivers/event/dlb/pf/dlb_pf.c > +++ b/drivers/event/dlb/pf/dlb_pf.c > @@ -303,7 +303,7 @@ dlb_pf_ldb_port_create(struct dlb_hw_dev *handle, > alloc_sz =3D RTE_CACHE_LINE_ROUNDUP(alloc_sz); >=20 > port_base =3D dlb_alloc_coherent_aligned(&mz, &pc_dma_base, > - alloc_sz, PAGE_SIZE); > + alloc_sz, rte_mem_page_size()); > if (port_base =3D=3D NULL) > return -ENOMEM; >=20 > @@ -328,7 +328,8 @@ dlb_pf_ldb_port_create(struct dlb_hw_dev *handle, >=20 > pp_dma_base =3D (uintptr_t)dlb_dev->hw.func_kva + PP_BASE(is_dir); > dlb_port[response.id][DLB_LDB].pp_addr =3D > - (void *)(uintptr_t)(pp_dma_base + (PAGE_SIZE * response.id)); > + (void *)(uintptr_t)(pp_dma_base + > + (rte_mem_page_size() * response.id)); >=20 > dlb_port[response.id][DLB_LDB].cq_base =3D > (void *)(uintptr_t)(port_base + (2 * RTE_CACHE_LINE_SIZE)); > @@ -381,7 +382,7 @@ dlb_pf_dir_port_create(struct dlb_hw_dev *handle, > alloc_sz =3D RTE_CACHE_LINE_ROUNDUP(alloc_sz); >=20 > port_base =3D dlb_alloc_coherent_aligned(&mz, &pc_dma_base, > - alloc_sz, PAGE_SIZE); > + alloc_sz, rte_mem_page_size()); > if (port_base =3D=3D NULL) > return -ENOMEM; >=20 > @@ -406,7 +407,8 @@ dlb_pf_dir_port_create(struct dlb_hw_dev *handle, >=20 > pp_dma_base =3D (uintptr_t)dlb_dev->hw.func_kva + PP_BASE(is_dir); > dlb_port[response.id][DLB_DIR].pp_addr =3D > - (void *)(uintptr_t)(pp_dma_base + (PAGE_SIZE * response.id)); > + (void *)(uintptr_t)(pp_dma_base + > + (rte_mem_page_size() * response.id)); >=20 > dlb_port[response.id][DLB_DIR].cq_base =3D > (void *)(uintptr_t)(port_base + (2 * RTE_CACHE_LINE_SIZE)); > diff --git a/drivers/event/dlb2/dlb2_priv.h b/drivers/event/dlb2/dlb2_pri= v.h > index b73cf3ff14..eb1a932399 100644 > --- a/drivers/event/dlb2/dlb2_priv.h > +++ b/drivers/event/dlb2/dlb2_priv.h > @@ -78,8 +78,6 @@ > DLB2_LDB_CQ_MAX_SIZE) > #define PP_BASE(is_dir) ((is_dir) ? DLB2_DIR_PP_BASE : DLB2_LDB_PP_BASE) >=20 > -#define PAGE_SIZE (sysconf(_SC_PAGESIZE)) > - > #define DLB2_NUM_QES_PER_CACHE_LINE 4 >=20 > #define DLB2_MAX_ENQUEUE_DEPTH 64 > diff --git a/drivers/event/dlb2/pf/base/dlb2_osdep.h > b/drivers/event/dlb2/pf/base/dlb2_osdep.h > index c4c34eba5f..aa101a49a3 100644 > --- a/drivers/event/dlb2/pf/base/dlb2_osdep.h > +++ b/drivers/event/dlb2/pf/base/dlb2_osdep.h > @@ -89,7 +89,7 @@ static inline void *os_map_producer_port(struct dlb2_hw > *hw, > uint64_t pp_dma_base; >=20 > pp_dma_base =3D (uintptr_t)hw->func_kva + DLB2_PP_BASE(is_ldb); > - addr =3D (pp_dma_base + (PAGE_SIZE * port_id)); > + addr =3D (pp_dma_base + (rte_mem_page_size() * port_id)); >=20 > return (void *)(uintptr_t)addr; > } > diff --git a/drivers/event/dlb2/pf/dlb2_main.h > b/drivers/event/dlb2/pf/dlb2_main.h > index f3bee71fb6..9eeda482a3 100644 > --- a/drivers/event/dlb2/pf/dlb2_main.h > +++ b/drivers/event/dlb2/pf/dlb2_main.h > @@ -10,10 +10,7 @@ > #include > #include > #include > - > -#ifndef PAGE_SIZE > -#define PAGE_SIZE (sysconf(_SC_PAGESIZE)) > -#endif > +#include >=20 > #include "base/dlb2_hw_types.h" > #include "../dlb2_user.h" > diff --git a/drivers/event/dlb2/pf/dlb2_pf.c b/drivers/event/dlb2/pf/dlb2= _pf.c > index 1a7d8fc294..1142da5b25 100644 > --- a/drivers/event/dlb2/pf/dlb2_pf.c > +++ b/drivers/event/dlb2/pf/dlb2_pf.c > @@ -284,7 +284,7 @@ dlb2_pf_ldb_port_create(struct dlb2_hw_dev *handle, > alloc_sz =3D RTE_CACHE_LINE_ROUNDUP(alloc_sz); >=20 > port_base =3D dlb2_alloc_coherent_aligned(&mz, &cq_base, alloc_sz, > - PAGE_SIZE); > + rte_mem_page_size()); > if (port_base =3D=3D NULL) > return -ENOMEM; >=20 > @@ -307,7 +307,7 @@ dlb2_pf_ldb_port_create(struct dlb2_hw_dev *handle, >=20 > pp_base =3D (uintptr_t)dlb2_dev->hw.func_kva + PP_BASE(is_dir); > dlb2_port[response.id][DLB2_LDB_PORT].pp_addr =3D > - (void *)(pp_base + (PAGE_SIZE * response.id)); > + (void *)(pp_base + (rte_mem_page_size() * response.id)); >=20 > dlb2_port[response.id][DLB2_LDB_PORT].cq_base =3D (void > *)(port_base); > memset(&port_memory, 0, sizeof(port_memory)); > @@ -359,7 +359,7 @@ dlb2_pf_dir_port_create(struct dlb2_hw_dev *handle, > alloc_sz =3D RTE_CACHE_LINE_ROUNDUP(alloc_sz); >=20 > port_base =3D dlb2_alloc_coherent_aligned(&mz, &cq_base, alloc_sz, > - PAGE_SIZE); > + rte_mem_page_size()); > if (port_base =3D=3D NULL) > return -ENOMEM; >=20 > @@ -382,7 +382,7 @@ dlb2_pf_dir_port_create(struct dlb2_hw_dev *handle, >=20 > pp_base =3D (uintptr_t)dlb2_dev->hw.func_kva + PP_BASE(is_dir); > dlb2_port[response.id][DLB2_DIR_PORT].pp_addr =3D > - (void *)(pp_base + (PAGE_SIZE * response.id)); > + (void *)(pp_base + (rte_mem_page_size() * response.id)); >=20 > dlb2_port[response.id][DLB2_DIR_PORT].cq_base =3D > (void *)(port_base); > diff --git a/drivers/net/bnx2x/ecore_fw_defs.h > b/drivers/net/bnx2x/ecore_fw_defs.h > index 5397a701aa..93bca8ad33 100644 > --- a/drivers/net/bnx2x/ecore_fw_defs.h > +++ b/drivers/net/bnx2x/ecore_fw_defs.h > @@ -13,6 +13,8 @@ > #ifndef ECORE_FW_DEFS_H > #define ECORE_FW_DEFS_H >=20 > +#include > + > #define CSTORM_ASSERT_LIST_INDEX_OFFSET (IRO[152].base) > #define CSTORM_ASSERT_LIST_OFFSET(assertListEntry) \ > (IRO[151].base + ((assertListEntry) * IRO[151].m1)) > @@ -252,7 +254,8 @@ > #define X_ETH_LOCAL_RING_SIZE 13 > #define FIRST_BD_IN_PKT 0 > #define PARSE_BD_INDEX 1 > -#define NUM_OF_ETH_BDS_IN_PAGE > ((PAGE_SIZE)/(STRUCT_SIZE(eth_tx_bd)/8)) > +#define NUM_OF_ETH_BDS_IN_PAGE \ > + (rte_mem_page_size() / (STRUCT_SIZE(eth_tx_bd) / 8)) > #define U_ETH_NUM_OF_SGES_TO_FETCH 8 > #define U_ETH_MAX_SGES_FOR_PACKET 3 >=20 > @@ -265,11 +268,14 @@ > #define IP_HEADER_ALIGNMENT_PADDING 2 >=20 > #define U_ETH_SGES_PER_PAGE_INVERSE_MASK \ > - (0xFFFF - ((PAGE_SIZE/((STRUCT_SIZE(eth_rx_sge))/8))-1)) > + (0xFFFF - ((rte_mem_page_size() / ((STRUCT_SIZE(eth_rx_sge)) / 8)) - 1)= ) >=20 > -#define TU_ETH_CQES_PER_PAGE (PAGE_SIZE/(STRUCT_SIZE(eth_rx_cqe)/8)) > -#define U_ETH_BDS_PER_PAGE (PAGE_SIZE/(STRUCT_SIZE(eth_rx_bd)/8)) > -#define U_ETH_SGES_PER_PAGE (PAGE_SIZE/(STRUCT_SIZE(eth_rx_sge)/8)) > +#define TU_ETH_CQES_PER_PAGE \ > + (rte_mem_page_size() / (STRUCT_SIZE(eth_rx_cqe) / 8)) > +#define U_ETH_BDS_PER_PAGE \ > + (rte_mem_page_size() / (STRUCT_SIZE(eth_rx_bd) / 8)) > +#define U_ETH_SGES_PER_PAGE \ > + (rte_mem_page_size() / (STRUCT_SIZE(eth_rx_sge) / 8)) >=20 > #define U_ETH_BDS_PER_PAGE_MASK (U_ETH_BDS_PER_PAGE-1) > #define U_ETH_CQE_PER_PAGE_MASK (TU_ETH_CQES_PER_PAGE-1) > @@ -396,7 +402,7 @@ >=20 > /* Event Ring definitions */ > #define C_ERES_PER_PAGE \ > - (PAGE_SIZE / BITS_TO_BYTES(STRUCT_SIZE(event_ring_elem))) > + (rte_mem_page_size() / > BITS_TO_BYTES(STRUCT_SIZE(event_ring_elem))) > #define C_ERE_PER_PAGE_MASK (C_ERES_PER_PAGE - 1) >=20 > /* number of statistic command */ > diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.= c > index cd220abee2..431eda777b 100644 > --- a/drivers/net/ionic/ionic_lif.c > +++ b/drivers/net/ionic/ionic_lif.c > @@ -612,18 +612,18 @@ ionic_qcq_alloc(struct ionic_lif *lif, > cq_size =3D num_descs * cq_desc_size; > sg_size =3D num_descs * sg_desc_size; >=20 > - total_size =3D RTE_ALIGN(q_size, PAGE_SIZE) + > - RTE_ALIGN(cq_size, PAGE_SIZE); > + total_size =3D RTE_ALIGN(q_size, rte_mem_page_size()) + > + RTE_ALIGN(cq_size, rte_mem_page_size()); > /* > * Note: aligning q_size/cq_size is not enough due to cq_base address > * aligning as q_base could be not aligned to the page. > - * Adding PAGE_SIZE. > + * Adding rte_mem_page_size(). > */ > - total_size +=3D PAGE_SIZE; > + total_size +=3D rte_mem_page_size(); >=20 > if (flags & IONIC_QCQ_F_SG) { > - total_size +=3D RTE_ALIGN(sg_size, PAGE_SIZE); > - total_size +=3D PAGE_SIZE; > + total_size +=3D RTE_ALIGN(sg_size, rte_mem_page_size()); > + total_size +=3D rte_mem_page_size(); > } >=20 > new =3D rte_zmalloc("ionic", struct_size, 0); > @@ -636,7 +636,7 @@ ionic_qcq_alloc(struct ionic_lif *lif, >=20 > new->q.info =3D rte_calloc_socket("ionic", > num_descs, sizeof(void *), > - PAGE_SIZE, socket_id); > + rte_mem_page_size(), socket_id); > if (!new->q.info) { > IONIC_PRINT(ERR, "Cannot allocate queue info"); > err =3D -ENOMEM; > @@ -673,13 +673,16 @@ ionic_qcq_alloc(struct ionic_lif *lif, > q_base =3D new->base; > q_base_pa =3D new->base_pa; >=20 > - cq_base =3D (void *)RTE_ALIGN((uintptr_t)q_base + q_size, PAGE_SIZE); > - cq_base_pa =3D RTE_ALIGN(q_base_pa + q_size, PAGE_SIZE); > + cq_base =3D (void *)RTE_ALIGN((uintptr_t)q_base + q_size, > + rte_mem_page_size()); > + cq_base_pa =3D RTE_ALIGN(q_base_pa + q_size, > + rte_mem_page_size()); >=20 > if (flags & IONIC_QCQ_F_SG) { > sg_base =3D (void *)RTE_ALIGN((uintptr_t)cq_base + cq_size, > - PAGE_SIZE); > - sg_base_pa =3D RTE_ALIGN(cq_base_pa + cq_size, PAGE_SIZE); > + rte_mem_page_size()); > + sg_base_pa =3D RTE_ALIGN(cq_base_pa + cq_size, > + rte_mem_page_size()); > ionic_q_sg_map(&new->q, sg_base, sg_base_pa); > } >=20 > @@ -1002,7 +1005,7 @@ ionic_lif_alloc(struct ionic_lif *lif) >=20 > IONIC_PRINT(DEBUG, "Allocating Lif Info"); >=20 > - lif->info_sz =3D RTE_ALIGN(sizeof(*lif->info), PAGE_SIZE); > + lif->info_sz =3D RTE_ALIGN(sizeof(*lif->info), rte_mem_page_size()); >=20 > lif->info_z =3D rte_eth_dma_zone_reserve(lif->eth_dev, > "lif_info", 0 /* queue_idx*/, > diff --git a/drivers/net/ionic/ionic_main.c b/drivers/net/ionic/ionic_mai= n.c > index 9aa7b2e96c..7301f53342 100644 > --- a/drivers/net/ionic/ionic_main.c > +++ b/drivers/net/ionic/ionic_main.c > @@ -456,7 +456,8 @@ ionic_port_init(struct ionic_adapter *adapter) > if (idev->port_info) > return 0; >=20 > - idev->port_info_sz =3D RTE_ALIGN(sizeof(*idev->port_info), PAGE_SIZE); > + idev->port_info_sz =3D RTE_ALIGN(sizeof(*idev->port_info), > + rte_mem_page_size()); >=20 > snprintf(z_name, sizeof(z_name), "%s_port_%s_info", > IONIC_DRV_NAME, adapter->name); > diff --git a/drivers/net/ionic/ionic_osdep.h b/drivers/net/ionic/ionic_os= dep.h > index a6575c36b5..89ed106d11 100644 > --- a/drivers/net/ionic/ionic_osdep.h > +++ b/drivers/net/ionic/ionic_osdep.h > @@ -17,6 +17,7 @@ > #include > #include > #include > +#include >=20 > #include "ionic_logs.h" >=20 > @@ -25,7 +26,6 @@ >=20 > #ifndef PAGE_SHIFT > #define PAGE_SHIFT 12 > -#define PAGE_SIZE (1 << PAGE_SHIFT) > #endif >=20 > #define __iomem > diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.= c > index e317539de7..e3f7e636d7 100644 > --- a/drivers/net/netvsc/hn_rndis.c > +++ b/drivers/net/netvsc/hn_rndis.c > @@ -67,7 +67,7 @@ hn_rndis_rid(struct hn_data *hv) >=20 > static void *hn_rndis_alloc(size_t size) > { > - return rte_zmalloc("RNDIS", size, PAGE_SIZE); > + return rte_zmalloc("RNDIS", size, rte_mem_page_size()); > } >=20 > #ifdef RTE_LIBRTE_NETVSC_DEBUG_DUMP > @@ -265,17 +265,17 @@ static int hn_nvs_send_rndis_ctrl(struct > vmbus_channel *chan, > return -EINVAL; > } >=20 > - if (unlikely(reqlen > PAGE_SIZE)) { > + if (unlikely(reqlen > rte_mem_page_size())) { > PMD_DRV_LOG(ERR, "RNDIS request %u greater than page > size", > reqlen); > return -EINVAL; > } >=20 > - sg.page =3D addr / PAGE_SIZE; > + sg.page =3D addr / rte_mem_page_size(); > sg.ofs =3D addr & PAGE_MASK; > sg.len =3D reqlen; >=20 > - if (sg.ofs + reqlen > PAGE_SIZE) { > + if (sg.ofs + reqlen > rte_mem_page_size()) { > PMD_DRV_LOG(ERR, "RNDIS request crosses page boundary"); > return -EINVAL; > } > @@ -479,7 +479,7 @@ hn_rndis_query(struct hn_data *hv, uint32_t oid, > return -ENOMEM; >=20 > comp_len =3D sizeof(*comp) + odlen; > - comp =3D rte_zmalloc("QUERY", comp_len, PAGE_SIZE); > + comp =3D rte_zmalloc("QUERY", comp_len, rte_mem_page_size()); > if (!comp) { > error =3D -ENOMEM; > goto done; > @@ -736,7 +736,7 @@ hn_rndis_set(struct hn_data *hv, uint32_t oid, const > void *data, uint32_t dlen) > int error; >=20 > reqlen =3D sizeof(*req) + dlen; > - req =3D rte_zmalloc("RNDIS_SET", reqlen, PAGE_SIZE); > + req =3D rte_zmalloc("RNDIS_SET", reqlen, rte_mem_page_size()); > if (!req) > return -ENOMEM; >=20 > diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c > index 0f4ef0100b..c6bf7cc132 100644 > --- a/drivers/net/netvsc/hn_rxtx.c > +++ b/drivers/net/netvsc/hn_rxtx.c > @@ -1387,7 +1387,8 @@ static unsigned int hn_get_slots(const struct rte_m= buf > *m) > unsigned int size =3D rte_pktmbuf_data_len(m); > unsigned int offs =3D rte_mbuf_data_iova(m) & PAGE_MASK; >=20 > - slots +=3D (offs + size + PAGE_SIZE - 1) / PAGE_SIZE; > + slots +=3D (offs + size + rte_mem_page_size() - 1) / > + rte_mem_page_size(); > m =3D m->next; > } >=20 > @@ -1402,12 +1403,13 @@ static unsigned int hn_fill_sg(struct vmbus_gpa *= sg, >=20 > while (m) { > rte_iova_t addr =3D rte_mbuf_data_iova(m); > - unsigned int page =3D addr / PAGE_SIZE; > + unsigned int page =3D addr / rte_mem_page_size(); > unsigned int offset =3D addr & PAGE_MASK; > unsigned int len =3D rte_pktmbuf_data_len(m); >=20 > while (len > 0) { > - unsigned int bytes =3D RTE_MIN(len, PAGE_SIZE - offset); > + unsigned int bytes =3D RTE_MIN(len, > + rte_mem_page_size() - offset); >=20 > sg[segs].page =3D page; > sg[segs].ofs =3D offset; > @@ -1450,7 +1452,7 @@ static int hn_xmit_sg(struct hn_tx_queue *txq, > addr =3D txq->tx_rndis_iova + > ((char *)txd->rndis_pkt - (char *)txq->tx_rndis); >=20 > - sg[0].page =3D addr / PAGE_SIZE; > + sg[0].page =3D addr / rte_mem_page_size(); > sg[0].ofs =3D addr & PAGE_MASK; > sg[0].len =3D RNDIS_PACKET_MSG_OFFSET_ABS(hn_rndis_pktlen(txd- > >rndis_pkt)); > segs =3D 1; > diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h > index b7405ca726..43642408bc 100644 > --- a/drivers/net/netvsc/hn_var.h > +++ b/drivers/net/netvsc/hn_var.h > @@ -6,6 +6,8 @@ > * All rights reserved. > */ >=20 > +#include > + > /* > * Tunable ethdev params > */ > @@ -28,13 +30,8 @@ >=20 > #define HN_RX_EXTMBUF_ENABLE 0 >=20 > -/* Buffers need to be aligned */ > -#ifndef PAGE_SIZE > -#define PAGE_SIZE 4096 > -#endif > - > #ifndef PAGE_MASK > -#define PAGE_MASK (PAGE_SIZE - 1) > +#define PAGE_MASK (rte_mem_page_size() - 1) > #endif >=20 > struct hn_data; > diff --git a/drivers/net/virtio/virtio.h b/drivers/net/virtio/virtio.h > index 21d54904e7..2c987d19ab 100644 > --- a/drivers/net/virtio/virtio.h > +++ b/drivers/net/virtio/virtio.h > @@ -98,7 +98,7 @@ > * > * Note the sizeof(struct vring_desc) is 16 bytes. > */ > -#define VIRTIO_MAX_INDIRECT ((int)(PAGE_SIZE / 16)) > +#define VIRTIO_MAX_INDIRECT ((int)(rte_mem_page_size() / 16)) >=20 > /* > * Maximum number of virtqueues per device. > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virt= io_ethdev.c > index 333a5243a9..289b240c4e 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -21,8 +21,8 @@ > #include > #include > #include > - > #include > +#include > #include > #include > #include > @@ -469,7 +469,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t > queue_idx) > sz_hdr_mz =3D vq_size * sizeof(struct virtio_tx_region); > } else if (queue_type =3D=3D VTNET_CQ) { > /* Allocate a page for control vq command, data and status */ > - sz_hdr_mz =3D PAGE_SIZE; > + sz_hdr_mz =3D rte_mem_page_size(); > } >=20 > vq =3D rte_zmalloc_socket(vq_name, size, RTE_CACHE_LINE_SIZE, > @@ -568,7 +568,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t > queue_idx) > cvq->mz =3D mz; > cvq->virtio_net_hdr_mz =3D hdr_mz; > cvq->virtio_net_hdr_mem =3D hdr_mz->iova; > - memset(cvq->virtio_net_hdr_mz->addr, 0, PAGE_SIZE); > + memset(cvq->virtio_net_hdr_mz->addr, 0, > rte_mem_page_size()); >=20 > hw->cvq =3D cvq; > } > diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virt= io_ethdev.h > index 873327d989..5a501e7890 100644 > --- a/drivers/net/virtio/virtio_ethdev.h > +++ b/drivers/net/virtio/virtio_ethdev.h > @@ -11,10 +11,6 @@ >=20 > #include "virtio.h" >=20 > -#ifndef PAGE_SIZE > -#define PAGE_SIZE 4096 > -#endif > - > #define VIRTIO_MAX_RX_QUEUES 128U > #define VIRTIO_MAX_TX_QUEUES 128U > #define VIRTIO_MAX_MAC_ADDRS 64 > diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.= c > index 6a1b44bc77..39237aecf7 100644 > --- a/drivers/vdpa/ifc/ifcvf_vdpa.c > +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c > @@ -11,6 +11,7 @@ > #include > #include >=20 > +#include > #include > #include > #include > @@ -30,10 +31,6 @@ RTE_LOG_REGISTER(ifcvf_vdpa_logtype, > pmd.net.ifcvf_vdpa, NOTICE); > rte_log(RTE_LOG_ ## level, ifcvf_vdpa_logtype, \ > "IFCVF %s(): " fmt "\n", __func__, ##args) >=20 > -#ifndef PAGE_SIZE > -#define PAGE_SIZE 4096 > -#endif > - > #define IFCVF_USED_RING_LEN(size) \ > ((size) * sizeof(struct vring_used_elem) + sizeof(uint16_t) * 3) >=20 > @@ -600,11 +597,11 @@ m_ifcvf_start(struct ifcvf_internal *internal) > for (i =3D 0; i < nr_vring; i++) { > rte_vhost_get_vhost_vring(vid, i, &vq); >=20 > - size =3D RTE_ALIGN_CEIL(vring_size(vq.size, PAGE_SIZE), > - PAGE_SIZE); > - vring_buf =3D rte_zmalloc("ifcvf", size, PAGE_SIZE); > + size =3D RTE_ALIGN_CEIL(vring_size(vq.size, > rte_mem_page_size()), > + rte_mem_page_size()); > + vring_buf =3D rte_zmalloc("ifcvf", size, rte_mem_page_size()); > vring_init(&internal->m_vring[i], vq.size, vring_buf, > - PAGE_SIZE); > + rte_mem_page_size()); >=20 > ret =3D rte_vfio_container_dma_map(internal- > >vfio_container_fd, > (uint64_t)(uintptr_t)vring_buf, m_vring_iova, size); > @@ -686,8 +683,8 @@ m_ifcvf_stop(struct ifcvf_internal *internal) > len =3D IFCVF_USED_RING_LEN(vq.size); > rte_vhost_log_used_vring(vid, i, 0, len); >=20 > - size =3D RTE_ALIGN_CEIL(vring_size(vq.size, PAGE_SIZE), > - PAGE_SIZE); > + size =3D RTE_ALIGN_CEIL(vring_size(vq.size, > rte_mem_page_size()), > + rte_mem_page_size()); > rte_vfio_container_dma_unmap(internal->vfio_container_fd, > (uint64_t)(uintptr_t)internal->m_vring[i].desc, > m_vring_iova, size); > -- > 2.30.1 ack