[0/3] net/sfc: fix power of 2 alignment macros
Message ID | 1563973146-16577-1-git-send-email-arybchenko@solarflare.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4CF771C1D5; Wed, 24 Jul 2019 14:59:23 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 0EDDE1C1D5 for <dev@dpdk.org>; Wed, 24 Jul 2019 14:59:22 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us2.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 447E0A40064 for <dev@dpdk.org>; Wed, 24 Jul 2019 12:59:20 +0000 (UTC) Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 24 Jul 2019 05:59:16 -0700 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Wed, 24 Jul 2019 05:59:16 -0700 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id x6OCxFaV001004 for <dev@dpdk.org>; Wed, 24 Jul 2019 13:59:15 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 969751613C5 for <dev@dpdk.org>; Wed, 24 Jul 2019 13:59:15 +0100 (BST) From: Andrew Rybchenko <arybchenko@solarflare.com> To: <dev@dpdk.org> Date: Wed, 24 Jul 2019 13:59:03 +0100 Message-ID: <1563973146-16577-1-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24792.002 X-TM-AS-Result: No-0.734400-4.000000-10 X-TMASE-MatchedRID: qODGUxeApuy1Ex1hMscILk95wQijrwBLEAImHgFYA95+SLLtNOiBhihX k2o7PB3tuW76JsuTd2VktokPgethAZsgjpxKhfKzuwdUMMznEA9XjjsM2/DfxtHHJnNDqaTc8FS rkmy6/FKWm1ySr9ym7skWVeHghw5wr78SC5iivxwURSScn+QSXt0H8LFZNFG7CKFCmhdu5cU7ch cRk2H7LPpAaGKVSHlW5eBn2DxOcKVRlxdPLM+qCblhjnzTzpazbB74W00m9I2FHK9qMaHR0V7lw Kt+im2mIJY5KYL8vwQA5SS2XRjKFM+aZOIheolUvvUo0hZPhlzM/43UL1MJR/qy+VVvqH2X X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10-0.734400-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24792.002 X-MDID: 1563973160-OmVZjQa3acif Subject: [dpdk-dev] [PATCH 0/3] net/sfc: fix power of 2 alignment macros X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Message
Andrew Rybchenko
July 24, 2019, 12:59 p.m. UTC
P2ROUNDUP() and P2ALIGN() macros are buggy when alignment type is smaller than type of the value to be aligned. IS_P2ALIGNED() has no the problem since it cast its arugments to uintptr_t inside, but fixed anyway to follow the same approach as new EFX_P2ROUNDUP() and EFX_P2ALIGN(). Patches have checkpatches.sh warnings in base driver since space is required after sizeof. Andrew Rybchenko (3): net/sfc: fix power of 2 round up when align has smaller type net/sfc: fix align to power of 2 when align has smaller type net/sfc: unify power of 2 alignment check macro drivers/net/sfc/base/ef10_impl.h | 9 +++--- drivers/net/sfc/base/ef10_nvram.c | 3 +- drivers/net/sfc/base/ef10_rx.c | 11 ++++--- drivers/net/sfc/base/efx.h | 21 ++++++++++--- drivers/net/sfc/base/efx_mcdi.h | 9 ++++-- drivers/net/sfc/base/efx_tx.c | 4 +-- drivers/net/sfc/efsys.h | 51 +++++++++++++++---------------- drivers/net/sfc/sfc_ethdev.c | 2 +- drivers/net/sfc/sfc_rx.c | 2 +- 9 files changed, 64 insertions(+), 48 deletions(-)