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 1C229A0C4A; Tue, 13 Jul 2021 08:49:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 17B3E411D9; Tue, 13 Jul 2021 08:49:36 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2075.outbound.protection.outlook.com [40.107.220.75]) by mails.dpdk.org (Postfix) with ESMTP id 5D187411D5; Tue, 13 Jul 2021 08:49:34 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mce45kbosdmF7l4xjGdz3IBz5m4p9PJjpubMvJ5ZZLXskAwUJS+OqicZZ6GL5zthGwfSlQzIyVsq7m9zDNM47L5N+ME+I4h6StMSH/sJDa7JbVvr8HglVxvDrxo0SrPotDc3rdFwJs44jgeW59j+Gow+rSokg539iij6/RSM0iYtjdq0VRQBlls56KPs2kkDn8KlV9+JCPaP1JUufh/8jFgEG5+JFzH996gU2jyvRnt6XHs1pgUma6q7sW9jecd+8rzXQjlQpsnJvLd5V/w/GkTrvxx4UKLj5MuAiP1/cIZvfI61rzyr1DUzpdH1cS6GTEPKvyhAGxN9bjPgvdzSVQ== 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=MHedD7DyGF0uR77lZe8oxfgIYDFvxvHJpz9n5L32Xno=; b=iifG/is2QH7xC0SDCF6MS9j/K1HVwiYGQu/7pSoscgLMyE+Lr6mwQig/KtMhDhRxVotDYk4ictyaX/uWncUolHMwdBgzwCizgQ2woqOr5Jh5FwKyI9Qm5W1wpTCUwg7iRoBm37LiQtV/nVJPFpKUfM/2qXbqZ8hwyILdWgTu6ixc2CGb/1QbXcYHpllvj+Apva4PiVCqIKrvCU8ELxbUInF6/K6PvvhJqkDFSMOboOPhjItCwAJ9zthidpdJC9lQKEQyvouEh2rpCyQYCiAoNEh9oT1RqzGQvPO7k5kjYFEy6y6Dce5YpEv9HbXxP1+1Fo2DTuFz0JoYr/aAvEEXGw== 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=none sp=none 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=MHedD7DyGF0uR77lZe8oxfgIYDFvxvHJpz9n5L32Xno=; b=IKZVtHT+UuY2BDYVem+z3s5Qtex6iTHW2jzWeJYUpaSZdDb/X54t4w0XhCSp8+1FPTisLn696uDAK3yddj4Zd30VIsdWfOWxpo55vqoQhMQLP65W6PFcwbLGgB6jwLvRmCxcMP0fCkxcvl2MJ4wUUkU3KehkQTQm03lU8iMzIpwa01LUNaNlmNJObfI/Yod1PeFXcyzDBiWsn6K2mHMizOgBdyeXELjX363rD+mKPdmPWPOepLLpKcqVPNpPS3iPXWgVQRuxw1lsQ8l75jg8SytJ3qjnKoJy16NnDMCSsXs98mYhMsBHhpckBCBtA5hizfxLyDWHZETCF8Xixt1DpQ== Received: from DS7PR05CA0016.namprd05.prod.outlook.com (2603:10b6:5:3b9::21) by DM5PR12MB2453.namprd12.prod.outlook.com (2603:10b6:4:b5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.23; Tue, 13 Jul 2021 06:49:33 +0000 Received: from DM6NAM11FT014.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b9:cafe::a7) by DS7PR05CA0016.outlook.office365.com (2603:10b6:5:3b9::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.10 via Frontend Transport; Tue, 13 Jul 2021 06:49:33 +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 DM6NAM11FT014.mail.protection.outlook.com (10.13.173.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4308.20 via Frontend Transport; Tue, 13 Jul 2021 06:49:32 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 13 Jul 2021 06:49:29 +0000 From: Eli Britstein To: CC: Ilya Maximets , Gaetan Rivet , Majd Dibbiny , Asaf Penso , "Thomas Monjalon" , Harry Van Haaren , Date: Tue, 13 Jul 2021 09:49:08 +0300 Message-ID: <20210713064910.12793-2-elibr@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20210713064910.12793-1-elibr@nvidia.com> References: <20210713064910.12793-1-elibr@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.5] 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: db96b8c8-e2f1-4a43-fe78-08d945ca5f08 X-MS-TrafficTypeDiagnostic: DM5PR12MB2453: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1388; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BQxPsl4i43zCuKlqkKXXTEAjXP+P+syg0yrQEzx0vj43eZpMEFZR9NwqjXV3QAJsppQlFg8bfbE06V/AVNmaTLqkCKn/w4Fdg8fT/+3oMAe/83bN8lm04Je23aB9gO0xC8AKE8LAjQMTM/pe8ayWuyGTLKEtRdJf9EYorub5TcOFM4kYcFoVENVi3GuHM+X1wbqE/qkhODDIbm9JERQ/IZ4ubindW1T9Ua8vIJhcB/uA0B+PHLpl4PpMVg+653w3i5XM0p2Eh9DNiVaC2oqQj6EMOXBNAUuinefpKbJZC4TyABaAmlcSXi0bt/LsFM5Cv+NE2NGDnbSqDoWky7zpbYyPrqPqrdTpL6RwdYa9qb8Ql4mqRfOiiZGVxDjbD1MeIs/BLmIktqhfV5Vs10ZUgqbY8lQjmWVc6OZziQX8O6KziQCAaxzUdLwNp03uMIkWFm41f4Q6Drpi8AIY29lKXamg1HOOnjCliolJGyjB1XP2LFhSIlwM6USOXfTZvCv8WRFZcVs7LAogLhTMJncv2IuCxwMwpmsT8Fmw1tNUr8virTAlq04T/k9jXECkYpoPrXXLyZYd+2UX3gL8AM5ilRYuew/re8V8l54wpw9nBrmV6nt7C2+IWT1LQMveIhftSzT6PWMewzLdjAqHHzd/V44HiQvbCT3WGZX9slAuMS+avh2BptYHHgD/6OrqmdAFmYAdv6hkl3EizH7quPcXFq9B4wb41fijWH80QkdXnVQ= 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)(136003)(376002)(396003)(39860400002)(346002)(46966006)(36840700001)(5660300002)(47076005)(7696005)(8936002)(36860700001)(86362001)(1076003)(2906002)(2616005)(36756003)(82310400003)(478600001)(34020700004)(8676002)(70206006)(70586007)(186003)(16526019)(82740400003)(26005)(7636003)(356005)(83380400001)(6666004)(6916009)(36906005)(4326008)(6286002)(316002)(54906003)(336012)(55016002)(426003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2021 06:49:32.8711 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: db96b8c8-e2f1-4a43-fe78-08d945ca5f08 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: DM6NAM11FT014.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2453 Subject: [dpdk-dev] [PATCH 1/3] net: avoid cast-align warning in VLAN insert 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" In rte_vlan_insert there is a casting of rte_pktmbuf_prepend returned value to (struct rte_ether_hdr *), which causes cast-align warning when using gcc flags '-Werror -Wcast-align': In file included from .../include/rte_ethdev.h:165, from lib/netdev-dpdk.c:33: .../include/rte_ether.h: In function 'rte_vlan_insert': .../include/rte_ether.h:375:7: error: cast increases required alignment of target type [-Werror=cast-align] 375 | nh = (struct rte_ether_hdr *) | ^ As the code assumes correct alignment, add first a (void *) casting, to avoid the warning. Fixes: c974021a5949 ("ether: add soft vlan encap/decap") Cc: stable@dpdk.org Signed-off-by: Eli Britstein --- lib/net/rte_ether.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/net/rte_ether.h b/lib/net/rte_ether.h index 7ee5e9a292..6e21155161 100644 --- a/lib/net/rte_ether.h +++ b/lib/net/rte_ether.h @@ -372,7 +372,7 @@ static inline int rte_vlan_insert(struct rte_mbuf **m) return -EINVAL; oh = rte_pktmbuf_mtod(*m, struct rte_ether_hdr *); - nh = (struct rte_ether_hdr *) + nh = (struct rte_ether_hdr *)(void *) rte_pktmbuf_prepend(*m, sizeof(struct rte_vlan_hdr)); if (nh == NULL) return -ENOSPC; -- 2.28.0.2311.g225365fb51