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 0309AA0544; Fri, 23 Sep 2022 10:24:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 957EB400D7; Fri, 23 Sep 2022 10:24:16 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 00AEA4003C for ; Fri, 23 Sep 2022 10:24:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663921455; x=1695457455; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=YdfYTNQPXrQ2tAVt+GChC2sH4YAs0VMc4LFpxwSFLa0=; b=ZVEKzn3JZy88nAj+z3gQoCLjW4JEkSkVTRNp1pCyGRl99JaCEbIApH2e 7AYwNKBfCg3gvYpqACXuyNkBcewIvum9Xfo95OwJ+EYGt/1mAlVBQHcyF j/LHh4Z0x9R6GWxFr4EMhOdXepOs/DApXoQjPXhrdWfBtqYaylYd7Pd+A X6gQ0f99J/0Ngk32vEuVfzCx7Fdhxq0ST7EcA5v1X8AXbw1mQoFLriNX5 apchK2mnvbD+PYK9z4mEY7Zmu2sKOz6K3ua9pkecgbpKbyDEweb4O8TY5 9vaV1KTzJevXZ55dLYkSkl/ueDpX16vSp9kD8BKNIFVqKjVhH8wY2ad5c g==; X-IronPort-AV: E=McAfee;i="6500,9779,10478"; a="280909712" X-IronPort-AV: E=Sophos;i="5.93,337,1654585200"; d="scan'208";a="280909712" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 01:24:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,337,1654585200"; d="scan'208";a="653324708" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga001.jf.intel.com with ESMTP; 23 Sep 2022 01:24:11 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) 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.2375.31; Fri, 23 Sep 2022 01:24:11 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.2375.31 via Frontend Transport; Fri, 23 Sep 2022 01:24:11 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.48) 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.2375.31; Fri, 23 Sep 2022 01:24:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H0iEGwMDQiJLxyHe0lK9VNgHLWEOAR6KSi2komjyBdoslmUdwIobU7T8zMz6iaMJzpKaNaujLjBZUi2O4LV1ZbX6mNRMUR+tBBIeaNUvtnj4NDUUb7bH0rXkhPe2JjoJCMhQkoUXIFbXrhBMBMW/Ni+GHys5m7tFK8Q8BROpFGJMyjbJtWFGbC+h6MZH/PB4PqHSqVBtY4nrvKtRwoLfKVt+pCTU1aMRTWQzA8EZFqjISk/CDhyHf7Gybyr8e15NK8jA2AqRXWT9Z6lX5bPKUbTchFeJizw5zvZSfEH140pbJIKu4TjBYNYQMuEb5KEE/QXpv/D/v3esPAYLkP6RXg== 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=Or1aKYM78BAiaUXE7G0sRy1jP7a4tV7fZCSxLXEEEoY=; b=SjcxRj1YtP2zUZ+8rFsktkxXBbRXRcIJSL2CSu2ST20l1dRa7LoEm/W9RCE17b4p9bf7yTnFwcir4YgX0ugU4JE6w8NlzJ2urxMJ6+4OCSdgXpM7bkapSRyR0IJitroynnEuLs6x6aEqDhF8pMQV2jToLjVfmcPY/Kl1TqNXP+GAswFL/N9NR/gOUXZn+U2SyNKERL9aJfeSgW0jI/gAk4dwZUHVDbiGvI48XjyIpGLqW5NyRTCXmllRoNZ7ft1DdiILjFihsmOVMUgwJn/FW98wMdmMZFExkm9IlbVAjwn6lBXtWzsp4A2RtjhSMii5cZjQohgkFXnmiJRb7oOZeA== 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 Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) by PH0PR11MB5173.namprd11.prod.outlook.com (2603:10b6:510:39::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.20; Fri, 23 Sep 2022 08:24:09 +0000 Received: from MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::13c:8120:d994:16d2]) by MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::13c:8120:d994:16d2%6]) with mapi id 15.20.5654.020; Fri, 23 Sep 2022 08:24:09 +0000 Date: Fri, 23 Sep 2022 09:24:03 +0100 From: Bruce Richardson To: Morten =?iso-8859-1?Q?Br=F8rup?= CC: , , Subject: Re: [PATCH v3] eal: Pointer alignment check improvements Message-ID: References: <98CBD80474FA8B44BF855DF32C47DC35D8734D@smartserver.smartshare.dk> <20220922132730.5178-1-mb@smartsharesystems.com> <98CBD80474FA8B44BF855DF32C47DC35D87351@smartserver.smartshare.dk> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D87351@smartserver.smartshare.dk> X-ClientProxiedBy: LO2P265CA0152.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::20) To MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR11MB1629:EE_|PH0PR11MB5173:EE_ X-MS-Office365-Filtering-Correlation-Id: bff81981-2956-4d18-e685-08da9d3cfcc4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: odqipmf21RgQG1H3/o/LqtWXTU7ZEkPbpXdJkbSAnpALHnWMT7UYS4ifFFe5FExuoOLOjWNDoGj7i2Xfo8eSz5csLYmLUbVVW+B5L6wiwUb+jnyqSA3OeclMrqS1BxzQb8eCVkL6Stwu74gNoIERNPkGYceA47DM1d71LN4d4mG8Bq7xAeWtSsoru3XkBJ+fPBTqTjXJbZiYFlhz2bVPJESQJbiiQbJ6ibKyM9HCtj/BrsSVBcHKwxwaws5wszkx8s3imLO8fNDpGwK2K0MGUo5Dz+Jf8PK9CyoyhMSnJjApDtG8ATKRQxzopazSbXR49BGA/xc6rbdD7lL/AOWgtJiNRJToQsP80OrrT0yD0Lhm10G7GE76Xsujzq1Xt3L3dKloPzEl4UoRE60EiL5xLSVSNONhHJh/dH64EH5zsBvipaF7RY8h7toE4JBhRIJdJzPesELxm53Ahgv6G2pzP+/FhovZTGBnU2A5RbENPJB5uDKnGWShrsgsuuDhyUy6cMGdHanuxnf6NvEJeV/qPxLsMCnfAqa09pEflsCDQzXblLHyawR1pUyUdX6E6AluCLQJURPaSe2VF9ORahZ94FxCY/Mu/tt6YyGQ1Bx77rCvA9i1LzvXQ6rVwAqUGYQR3aYQBfHEe5fXW+/NMD7I0bAzwuj1V6exerhf4KYLhD+whJX67sIxM+EdLsdQhbYwEUxn8J2RwbMNZJCwIH12h8yeJFMRTPsXbDHMVeWyD2Y= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1629.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(366004)(39860400002)(136003)(396003)(346002)(451199015)(83380400001)(66574015)(6506007)(38100700002)(5660300002)(316002)(186003)(41300700001)(82960400001)(6916009)(44832011)(2906002)(66946007)(66556008)(66476007)(6512007)(26005)(966005)(6486002)(8936002)(4326008)(8676002)(6666004)(478600001)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?ITyt6iRZgbmERRvl5y1bCxgZAzOdT4MjmyBgK9mhym2qeSF/VhsFN+ZJ5U?= =?iso-8859-1?Q?nkr/AfJVNlTbB8QKy4s8DMEcRkj1y5vGqbCqqn+6ujLiNxf+03416Ano7x?= =?iso-8859-1?Q?9XLwOt2zVpfMrr14bFCmFOGS1QD7kAln7khvtove2FXMNMugmei0xV7q7Z?= =?iso-8859-1?Q?LEBUACFDnKEsSRwHBF9mSY7j/dXzMZ262AX55Qx9uOyIVyppKdoFtY3AaO?= =?iso-8859-1?Q?Z5CpSrRYkXyxTiGrzFgFMFUsDDPMaVi/7eebDaNQdddt5xQaZeWOMvALW0?= =?iso-8859-1?Q?8fbFjeyZagwiieQOXf84rTOqDVbdfE6ljE/Ku1PWEdT/TkuRzMJIrMzf6d?= =?iso-8859-1?Q?rbKzmQUimtJ3F8+uFKnE++fxh/nnbemQWfy5LnSO7nMKQWWAl3z/OvhLWW?= =?iso-8859-1?Q?MGBepBykqS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jqpOoZ0Dkr3s0p?= =?iso-8859-1?Q?o4o3q6JFR9CLzt5CDMmHDmrKqF88lxsLwRVYyVCrJ0aMSPj9yT13BLxydx?= =?iso-8859-1?Q?JTRCPrn0zX+/9wlpQ2AUUK75xzLkIdfb8Z1ZeytHpsAi6+FGJFxrERZaxX?= =?iso-8859-1?Q?qrumAGvN0S9sMtGN1wC6rpXDmMa477jnKZI5qGqftcrpmi2X2pfgy9B/qA?= =?iso-8859-1?Q?R9kgFCII0GfMt0nDX28scgf7r4bfXDW6WamUw4rxSFX0/gztgf2LBBvq23?= =?iso-8859-1?Q?EVmWp7DDVArCRKqgJbl8E6vzO5yNNydrbDFApDEU1XvcY7BiX9oARjde4o?= =?iso-8859-1?Q?9CiQvzNH48rBfrF2KM5muQ2nyVp2or/q9fsCG1lkhcETS0F9HvRsg6hg?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: bff81981-2956-4d18-e685-08da9d3cfcc4 X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1629.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 08:24:09.3363 (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: 1LU3+bV/B2Ymuh66Jnpg0hM7t5wfWLTmHw0ck5/INCheOEoZpKKPPS6E1b50ZL/z7uu8miExcqZmtSUA3soHIB5DL30q2yg14Xb8uG4xFoU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5173 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 On Thu, Sep 22, 2022 at 10:54:38PM +0200, Morten Brørup wrote: > > From: Bruce Richardson [mailto:bruce.richardson@intel.com] > > Sent: Thursday, 22 September 2022 15.39 > > > > On Thu, Sep 22, 2022 at 03:27:30PM +0200, Morten Brørup wrote: > > > Checking a const pointer for alignment would emit a warning about the > > > const qualifier being discarded. > > > > > > No need to calculate the aligned pointer; just check the last bits of > > the > > > pointer. > > > > > > v3: > > > - Make the uintptr_t const to avoid potential future warnings. > > (Bruce) > > > v2: > > > - Remove compiler attribute ((const)) from function; > > > it was a coding style issue. > > > > > > Signed-off-by: Morten Brørup > > > > Acked-by: Bruce Richardson > > > > Or perhaps it should be "Const-acked-by: ... " :-) > > Unfortunately not as const as expected by both of us... > > The v3 build fails at github [1] with: > > ../lib/eal/include/rte_common.h: In function 'int rte_is_aligned(const void*, unsigned int)': > ../lib/eal/include/rte_common.h:409:27: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers] > 409 | return ((const uintptr_t)ptr & (align - 1)) == 0; > | ^~~ > > [1] http://mails.dpdk.org/archives/test-report/2022-September/308604.html > > I don't understand what the problem is, so my solution is omitting the const, i.e. rolling back to v2, which doesn't fail building. Unless you can suggest a better solution, Bruce? > > I have changed v2 status in Patchwork back to New and v3 to Superseded. > That is fine. I'll ack v2 so.