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 AA413A0C52 for ; Thu, 21 Oct 2021 17:48:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8C8574118E; Thu, 21 Oct 2021 17:48:54 +0200 (CEST) Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by mails.dpdk.org (Postfix) with ESMTP id 4AA6F4118E for ; Thu, 21 Oct 2021 17:48:53 +0200 (CEST) Received: by mail-pf1-f181.google.com with SMTP id y7so1008771pfg.8 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=xW0LPTHOs6AaLMmrr/Rq+eekEPQD3cWd4FyWWnpdWdsvm5o3GKwkCqNRelXAS5w55+ j9HNJVR3Jv9M+8VhfUzI9270APngO4PK3wZlbGAo3hIuC/EhywiBiitGh19zat4gPbhU ze0e1vTotklOVJbTaycB1RTZ43d7XGqy4Kn/atjOu6r3FHt8xZwlw7TYvAG76t+z+KQ0 I/m4iYy2XFhW8sHyc8y8LEWV5jvA8l8nWulu11WM5AfpppaWTd45PVmHV+sl8BVUE2E3 3JyQaWncLVXZbogdL5xKagKdLoVjurdrjibNJGnZp+nLo617yGrZFG16ir1U2sSIGsvu HYWQ== X-Gm-Message-State: AOAM5314hUmU+3NmhkwD58ZSKZK4t/wCJNy7lAjnhMx+OV1PLDvi9Kb+ nGGbEJEasw2OvfhDYcCsvw8/Lg== 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-stable] [dpdk-dev] [PATCH V2 1/3] net: avoid cast-align warning in VLAN insert function X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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.