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 62A89A0C52; Thu, 21 Oct 2021 17:48:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C2F144124B; Thu, 21 Oct 2021 17:48:54 +0200 (CEST) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by mails.dpdk.org (Postfix) with ESMTP id 56732411FE for ; Thu, 21 Oct 2021 17:48:53 +0200 (CEST) Received: by mail-pf1-f171.google.com with SMTP id q19so1021477pfl.4 for ; Thu, 21 Oct 2021 08:48:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nWhC7QBGId00T2u76DV3quNPn6FjZcZWctmqCMBpn44=; b=FsNd+aHqpuh0h71OBIAMLJqPwz2YTysCDt02XbYXQoP8lHpFXctkKIh63EMNdx1srf UkaL/YiVXzu56AMXDxNSh2pV0qB29iDQjdetQjyD8d/JbpJbu0SAIuk2n2eu6c/F1Ebk fm5/OdrcXY6Ng41HZw/LjxubT9UtEqaHDe4zA575hpA7/JMnrJvYA92MgacLtyehaotq K5V6IrUCrCom69/oolxpbIpOanNoE+xZXUietqLE3d29hHLmz1u6d3r1ZhYiQA8neC/g IcWP4/3XVN8bIgqMnl0Sq1jBio741EljP3CaIMHyY2UvBl1cir1fRo6v8XIS+Hz6TL2f p1AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nWhC7QBGId00T2u76DV3quNPn6FjZcZWctmqCMBpn44=; b=pWurxWA+4KIhK+q3HGfSzqVfBhe8C7n7hlBbNKeuzu/5WNWvlwDqyErkur8wiv3DLP Mj5fmDAELe+WQAyqc+S4bn37EOAu4gX7TGY64uVG9fEQ48EYx7Hu/+LVzJhSQKWuFbry GySZN4cYj00yeqjQKGUrPy0eoty/cCcw4JtG5K4kMTkoi2Cbnj1bMiqXfpwyq/Qc4XDr FJ5fRisfGaDIAtakWei7MtkAMnkV8dtNTBWcYp4NDKyHApHe3s1FEmLr0UsMnfnN4Zaj UxyrHU9eV7vy9SyCCgrHU/ufOovzzrwZP90mUfMEvdxPZE/c1G80vwDBlPlnA93NlHaG 8pdw== X-Gm-Message-State: AOAM532txlc9fz89YlUHi6UeprqhA3iC0EQKDxaH6aiC1pZp6m2WV/LE NUc6Pkl+eeBVUIyLjD8W50Idgg== X-Google-Smtp-Source: ABdhPJx3+Oswtv47mEgr2XSIfqfj6xUXwy0858ny3ZyR0J6EI5esq2QA/vRXqSbWa0IFY4voWQR+wA== X-Received: by 2002:a63:f145:: with SMTP id o5mr5092529pgk.273.1634831332378; Thu, 21 Oct 2021 08:48:52 -0700 (PDT) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id w13sm6888709pfc.10.2021.10.21.08.48.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:48:52 -0700 (PDT) Date: Thu, 21 Oct 2021 08:48:48 -0700 From: Stephen Hemminger To: Eli Britstein Cc: , Matan Azrad , Asaf Penso , "Slava Ovsiienko" , Thomas Monjalon , , , , Message-ID: <20211021084848.21e24030@hermes.local> 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; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH V2 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 Thu, 21 Oct 2021 11:51:30 +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 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 > > In file included from main.c:35: > /dpdk/build/include/rte_ether.h:370:7: warning: cast increases required > alignment of target type [-Wcast-align] > 370 | 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 After cast to void * the second cast is not necessary. nh = (void *)rte_pktmbuf_prepend(...) Ideally rte_pktmbuf_prepend() should return void * but that is an API change.