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 31AE6A0547; Thu, 21 Oct 2021 10:52:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E4BF8411C7; Thu, 21 Oct 2021 10:52:30 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2045.outbound.protection.outlook.com [40.107.220.45]) by mails.dpdk.org (Postfix) with ESMTP id 8C10840142; Thu, 21 Oct 2021 10:52:29 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fJ1wgb4I7eMGICmvjmgL2X4yzsNdNdnQR/m1ILwTCdfcZ+OhRoWZqn7Xka//MVR0oLHxc0PnZoZTZdp4VOfzlQFaiaevjwJe794PZDuAo1q2aDAhe5WGbAETtccMb+GT1OpjWFzhJjcm0DteUxrVGdmtpPGha2v423ZjulLkCIzXgcPAHmQg5Mil75XzsEXPvUnvkYCsZzPIjmgEnWRQ36ZHg01ee6pR+v5uDNdQFM7Aaz+5a95W6XUDd2le//Uk0N9rcB8mG5tkMwjujhWLD59Aj+7l4z8+GfDClGtlv8e01mL3wz0V/FHLFHLOa9KIB2kO3wMTOb+j1jkTbu3hDw== 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=k7rBZ4w6pThiDYQhF0pohTBZ7Cat7sDG3bUXdwvZ5tI=; b=dzl2dhRF96eC0AjCoetNYYh6yFgKGAwk50m6rDMyV/yrJdZP3JiVqGwI8wuVeir0CTxSOVDfmpS9LnArT4GWS3HnZctrwK3M07jAwYhofo+r/uJvKaRnh5pAVcJWCx7xTxq2y75ytq0qjVQrZfNvhw0jl8+mGoNeN9a6kBd8DhoNEEjtDn9h3tkgdIejA4KVrQ97gisPN5s64h/mOTrTRZs2X8eQAiX1MvgifF5MWxvWcyEIz1TwmYiKuTSxPDNzCIJJiepwcU6PHba3Dgq2jjujEfLP4UnHTG7sTySKelzfsX0CseyQUnnNJsNWxabnbDb/CBTzuisuk2bL1V3N5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=k7rBZ4w6pThiDYQhF0pohTBZ7Cat7sDG3bUXdwvZ5tI=; b=Zlf54uphOby7vxLKpzC+RZsi77xDzfBUUD+SMRD03nsW058qTkUJ9IBp/fEaSxh5sq6Mc7h8Sy2MQfqQlSxjSkBF+bHiBKYan8CuOBy33EIorlacvAD70s4ikxfqp6TU6qyohBohgf5lColpPeYE1+Dl1dy7r9NFKJxPkoUegdkcihUIu3LPMzCwVrvQ/QgEFEzXt7u4H0DoCFctGmsZRwhCBqGF7Nn/tJ+XcVTXySd5tY9aXVRqqlbc3zHJQew5UxXkTTgJGXmyZvZMcp87RCr6XZx9SiQehaJDgyulKGUaWCKtncOdodcwxRTXuSAyzk/B0CpcXqh8uqnOIKgDSA== Received: from MW4PR03CA0115.namprd03.prod.outlook.com (2603:10b6:303:b7::30) by PH0PR12MB5450.namprd12.prod.outlook.com (2603:10b6:510:e8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.18; Thu, 21 Oct 2021 08:52:27 +0000 Received: from CO1NAM11FT003.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b7:cafe::82) by MW4PR03CA0115.outlook.office365.com (2603:10b6:303:b7::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.18 via Frontend Transport; Thu, 21 Oct 2021 08:52:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT003.mail.protection.outlook.com (10.13.175.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4628.16 via Frontend Transport; Thu, 21 Oct 2021 08:52:26 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 21 Oct 2021 08:52:20 +0000 From: Eli Britstein To: CC: Matan Azrad , Asaf Penso , "Slava Ovsiienko" , Thomas Monjalon , , , , Eli Britstein , Date: Thu, 21 Oct 2021 11:51:31 +0300 Message-ID: <20211021085132.12672-2-elibr@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20211021085132.12672-1-elibr@nvidia.com> References: <20210713064910.12793-1-elibr@nvidia.com> <20211021085132.12672-1-elibr@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: be6fbea2-9e62-4d68-5804-08d994701b9a X-MS-TrafficTypeDiagnostic: PH0PR12MB5450: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:208; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zcaQC+W9qIOShfBK0kNdXKLKs+m4i/S4F2PJf0/HcTnYf3A4gA+cMNkGExTIzzFIGfw5dezlYv2FizNedE9vrp+EpiWf9TptmJbiOAF4dlv4TGBvgucbRPAwShnP4e5i2wp6lm18Dg5rt8aUzdzerkXgM/bupB/Bh8sILNzyRdG09tfG7cN7v+zevaUicWIJk6nQ7Oyt/bW/c/11kVotliwnAHcfU1LYnLadBq9sy3oQ+tln7vLgM0VpVGK8F2L0wlbS4QcO46goAfKEFKb2hQz9vIv0GXn/41adcpV7fSs7U9WIfPyEC2QiDZ/Px5IHjPBltPByLEmz0OH0KEVAecTTV3+yw1ZuPwxxr+2TWHP5rvICfzFuD2a8AGzW0Y4nmxSIXUeTwOgi2ThOKcgqZAogotCG7b5IA4Lnfup+4hHh+jUu/TNxm14Rf23tyGM4sX44hPTi4FpwjfXeKyuq8XuTgBLFVtjtXdHsrrbwRV7+OnQyvvXQIgXwy4zKfOdygeqwkFcxFmsLyipK3x4bwmmyMtiDPPyWUMnOEF+5dSFv8+EHQmplw0FAWzwwinIhgY77wzLgoVCApSffNlvlQi+L15K7ILiTIH0+WUcjZaJpJg61WN0CZXx4MacsGpjZB4Kev1nCOWmiW1tTC0JjG99nmPjYYkMszA2HwWtzgYeNvZEdrHQBH//8hXGI6pGSoKHQwQhhXdyMkY9ct9NEug== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(70586007)(8936002)(36756003)(508600001)(316002)(26005)(82310400003)(1076003)(2906002)(55016002)(36906005)(336012)(2616005)(6286002)(7636003)(426003)(356005)(16526019)(6666004)(186003)(70206006)(36860700001)(8676002)(6916009)(7696005)(83380400001)(5660300002)(86362001)(54906003)(47076005)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2021 08:52:26.4486 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: be6fbea2-9e62-4d68-5804-08d994701b9a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT003.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB5450 Subject: [dpdk-dev] [PATCH V2 2/3] mbuf: avoid cast-align warning in pktmbuf mtod offset macro 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" In rte_pktmbuf_mtod_offset macro, there is a casting from char * to type 't', which may cause cast-align warning when using strict cast align flag with supporting gcc: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 CFLAGS="-Wcast-align=strict" make V=1 -C examples/l2fwd clean static main.c: In function 'l2fwd_mac_updating': /dpdk/build/include/rte_mbuf_core.h:719:3: warning: cast increases required alignment of target type [-Wcast-align] 719 | ((t)((char *)(m)->buf_addr + (m)->data_off + (o))) | ^ /dpdk/build/include/rte_mbuf_core.h:733:32: note: in expansion of macro 'rte_pktmbuf_mtod_offset' 733 | #define rte_pktmbuf_mtod(m, t) rte_pktmbuf_mtod_offset(m, t, 0) | ^~~~~~~~~~~~~~~~~~~~~~~ As the code assumes correct alignment, add first a (void *) casting, to avoid the warning. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Eli Britstein Acked-by: Olivier Matz --- lib/mbuf/rte_mbuf_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h index fdaaaf67f2..dd08d42aca 100644 --- a/lib/mbuf/rte_mbuf_core.h +++ b/lib/mbuf/rte_mbuf_core.h @@ -716,7 +716,7 @@ struct rte_mbuf_ext_shared_info { * The type to cast the result into. */ #define rte_pktmbuf_mtod_offset(m, t, o) \ - ((t)((char *)(m)->buf_addr + (m)->data_off + (o))) + ((t)(void *)((char *)(m)->buf_addr + (m)->data_off + (o))) /** * A macro that points to the start of the data in the mbuf. -- 2.28.0.2311.g225365fb51