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 C0BABA0542 for ; Fri, 11 Nov 2022 11:35:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BC05940150; Fri, 11 Nov 2022 11:35:20 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 232ED4014F for ; Fri, 11 Nov 2022 11:35:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668162918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rBSOwrpqoxVTIQoWcwAMcXJSBQMuRCfLE92nwWskmgI=; b=aEN/ikQtkwTk9Wiackw1zyn45RSBTYFRsQ3hZXlinF2geoRQxpaNJryGlqayMc7wbUgey6 4knDYY+zInd7L7Bl1Jn5BY4CBvRYJxsoSmFNoWRDU2sU5QmgNvgSspptJLbZoP7Z6EVknc OqVy5qf13hR/9d9PKoF+Dop4Ru1BFqA= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-590-3TfGvXjNOV-vq80O3Q0Z_g-1; Fri, 11 Nov 2022 05:35:17 -0500 X-MC-Unique: 3TfGvXjNOV-vq80O3Q0Z_g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 081B629DD985; Fri, 11 Nov 2022 10:35:17 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.195.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id 076F92022C2B; Fri, 11 Nov 2022 10:35:15 +0000 (UTC) From: Kevin Traynor To: Bing Zhao Cc: Thomas Monjalon , dpdk stable Subject: patch 'net/mlx5: fix build with recent compilers' has been queued to stable release 21.11.3 Date: Fri, 11 Nov 2022 10:33:37 +0000 Message-Id: <20221111103337.307408-47-ktraynor@redhat.com> In-Reply-To: <20221111103337.307408-1-ktraynor@redhat.com> References: <20221111103337.307408-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 Hi, FYI, your patch has been queued to stable release 21.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/14/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/81aba30795dfef41ab7d782ecdf3fa4cb3752a96 Thanks. Kevin --- >From 81aba30795dfef41ab7d782ecdf3fa4cb3752a96 Mon Sep 17 00:00:00 2001 From: Bing Zhao Date: Mon, 31 Oct 2022 20:24:56 +0200 Subject: [PATCH] net/mlx5: fix build with recent compilers [ upstream commit ccc6ea5d9c90650e3a8e29ab45e18b9fffd3d061 ] With some higher GCC/CLANG version, it is not recommended to use a structure with a tailing flexible array inside another structure. Accessing this array may be considered as a risk to corrupt the following field even if it is by intention. The error below was observed: drivers/net/mlx5/linux/mlx5_ethdev_os.c: In function 'mlx5_get_flag_dropless_rq': drivers/net/mlx5/linux/mlx5_ethdev_os.c:1679:42: error: invalid use of structure with flexible array member [-Werror=pedantic] 1679 | struct ethtool_sset_info hdr; | ^~~ Changing it to memory dynamic allocation method will help to get rid of this complain. Fixes: e848218741ea ("net/mlx5: check delay drop settings in kernel driver") Signed-off-by: Bing Zhao Acked-by: Thomas Monjalon --- drivers/net/mlx5/linux/mlx5_ethdev_os.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c index fadcbd7ef7..368d22de89 100644 --- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c +++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c @@ -1683,8 +1683,5 @@ mlx5_get_mac(struct rte_eth_dev *dev, uint8_t (*mac)[RTE_ETHER_ADDR_LEN]) int mlx5_get_flag_dropless_rq(struct rte_eth_dev *dev) { - struct { - struct ethtool_sset_info hdr; - uint32_t buf[1]; - } sset_info; + struct ethtool_sset_info *sset_info = NULL; struct ethtool_drvinfo drvinfo; struct ifreq ifr; @@ -1697,13 +1694,19 @@ int mlx5_get_flag_dropless_rq(struct rte_eth_dev *dev) int ret; - sset_info.hdr.cmd = ETHTOOL_GSSET_INFO; - sset_info.hdr.reserved = 0; - sset_info.hdr.sset_mask = 1ULL << ETH_SS_PRIV_FLAGS; + sset_info = mlx5_malloc(0, sizeof(struct ethtool_sset_info) + + sizeof(uint32_t), 0, SOCKET_ID_ANY); + if (sset_info == NULL) { + rte_errno = ENOMEM; + return -rte_errno; + } + sset_info->cmd = ETHTOOL_GSSET_INFO; + sset_info->reserved = 0; + sset_info->sset_mask = 1ULL << ETH_SS_PRIV_FLAGS; ifr.ifr_data = (caddr_t)&sset_info; ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr); if (!ret) { - const uint32_t *sset_lengths = sset_info.hdr.data; + const uint32_t *sset_lengths = sset_info->data; - len = sset_info.hdr.sset_mask ? sset_lengths[0] : 0; + len = sset_info->sset_mask ? sset_lengths[0] : 0; } else if (ret == -EOPNOTSUPP) { drvinfo.cmd = ETHTOOL_GDRVINFO; @@ -1778,4 +1781,5 @@ int mlx5_get_flag_dropless_rq(struct rte_eth_dev *dev) exit: mlx5_free(strings); + mlx5_free(sset_info); return ret; } -- 2.38.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-11-11 10:32:18.170746756 +0000 +++ 0047-net-mlx5-fix-build-with-recent-compilers.patch 2022-11-11 10:32:17.132301002 +0000 @@ -1 +1 @@ -From ccc6ea5d9c90650e3a8e29ab45e18b9fffd3d061 Mon Sep 17 00:00:00 2001 +From 81aba30795dfef41ab7d782ecdf3fa4cb3752a96 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit ccc6ea5d9c90650e3a8e29ab45e18b9fffd3d061 ] + @@ -23 +24,0 @@ -Cc: stable@dpdk.org @@ -32 +33 @@ -index 661d362dc0..72268c0c8a 100644 +index fadcbd7ef7..368d22de89 100644 @@ -35 +36 @@ -@@ -1676,8 +1676,5 @@ mlx5_get_mac(struct rte_eth_dev *dev, uint8_t (*mac)[RTE_ETHER_ADDR_LEN]) +@@ -1683,8 +1683,5 @@ mlx5_get_mac(struct rte_eth_dev *dev, uint8_t (*mac)[RTE_ETHER_ADDR_LEN]) @@ -45 +46 @@ -@@ -1690,13 +1687,19 @@ int mlx5_get_flag_dropless_rq(struct rte_eth_dev *dev) +@@ -1697,13 +1694,19 @@ int mlx5_get_flag_dropless_rq(struct rte_eth_dev *dev) @@ -70 +71 @@ -@@ -1771,4 +1774,5 @@ int mlx5_get_flag_dropless_rq(struct rte_eth_dev *dev) +@@ -1778,4 +1781,5 @@ int mlx5_get_flag_dropless_rq(struct rte_eth_dev *dev)