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 8414AA0C40; Fri, 30 Jul 2021 12:57:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DE7F24068B; Fri, 30 Jul 2021 12:57:46 +0200 (CEST) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mails.dpdk.org (Postfix) with ESMTP id 8F93540042 for ; Fri, 30 Jul 2021 12:57:45 +0200 (CEST) Received: by mail-wr1-f42.google.com with SMTP id d8so10770757wrm.4 for ; Fri, 30 Jul 2021 03:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=PFxDGTEjlp3vRoNLEsJI5tOZ/7t8CuulFshbJVYc9tE=; b=DLlNTM+YsHc1tGSW7QCaSxfuicEzRpvayWmR9A7rd53YQeGoe6HS3yn67kZPRgHPTy iZGjYxvUmKeA/F4MyiJsYNoU3oXaqhPEd27RChfSXVxenxH24TxeWXxE+T9zifXELEeE J+fdcEg4cMTn5+LI/TssUuccBNOTZjILYd+TuGnEusTOFAfXZVsDGGHu73rRUunSHtJM Nn5AgMeUolnMYaT883C1dOD38z6BLXjsPk6Fr0KRI+vFFCfCLJxosOJQkdlElICg1Wuf 8dFp1V3yi5H6JanGtxtnD8vRtbN7ezDwf8uZ84BLVngQ8UGTKAmPYoO+jKpVG/r4Ntce owng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=PFxDGTEjlp3vRoNLEsJI5tOZ/7t8CuulFshbJVYc9tE=; b=P2CQvvKa8240pm7exmqlSY0L614sCAcDpwEDfS/+zEwmfg4Dt9E2BnZkychm7pwdzS RM94qv8a8F0LRY+cX59U5YPkvZhZbtqYqGdtP4pYw0XuITZuF05hyqk1cpyc8i4eaH0L 3H7Zmp53WwIz0u9K4hnmENAJv4vAjtKQiw28PVr4jLgHXljFWboXbKUv8pV+fPAt+mCC suY2eQtkIiiPt6mrZrPuuH4ZUjHFB4JG+wZMXnqW8K5mifjZ/tKDeRdBLZ9OYc5BvwL3 YZg0s6l7SA07ZnEIsZ6JUNl4CMazhaH8JfEg8oVOrbYBZMNk5fpCeLCoBOWYpL/ivLTy fSHQ== X-Gm-Message-State: AOAM532ik3fcdXxbGJdTa/KZ3ZlaxruBnJdJYnF0SaCnAiXxKPn4pQmq OWSXzdkUagZ/z5h3vIC9J8jUxg== X-Google-Smtp-Source: ABdhPJyYHSMEPMByXGxWQtxJKkwK6aaTFI5lnTxtHJb6SAnqW6fkY3TsOdSm0woV5RaXySdi//bVvw== X-Received: by 2002:adf:e10c:: with SMTP id t12mr2366673wrz.36.1627642665353; Fri, 30 Jul 2021 03:57:45 -0700 (PDT) Received: from 6wind.com ([2a01:e0a:5ac:6460:c065:401d:87eb:9b25]) by smtp.gmail.com with ESMTPSA id j14sm1338247wru.58.2021.07.30.03.57.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 03:57:44 -0700 (PDT) Date: Fri, 30 Jul 2021 12:57:43 +0200 From: Olivier Matz To: Eli Britstein Cc: dev@dpdk.org, Ilya Maximets , Gaetan Rivet , Majd Dibbiny , Asaf Penso , Thomas Monjalon , Harry Van Haaren , stable@dpdk.org Message-ID: References: <20210713064910.12793-1-elibr@nvidia.com> <20210713064910.12793-2-elibr@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210713064910.12793-2-elibr@nvidia.com> Subject: Re: [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" On Tue, Jul 13, 2021 at 09:49:08AM +0300, Eli Britstein wrote: > 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 Acked-by: Olivier Matz