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 3F916A034F for ; Tue, 1 Mar 2022 11:46:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 379DD426E1; Tue, 1 Mar 2022 11:46:10 +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 D3478407FF for ; Tue, 1 Mar 2022 11:46:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646131568; 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=GFhbLS0nkDBzy3QgRXY1KOqOOZk0s8ecU7gCaE+ma+k=; b=V1jcGQ7Tm9uugVsD7XxPgIUzDvLLYbSwyA1nxfAbOsxO6Sde+58GoskTGVY8H+p33B5+FB uJeNxZ9axUMvwVlkZhBnT8+G4QAZeNGY8iRqXAYJpPdFYyP8VqsGXRKg2FRIiDJ7EyHGju BUO4aqIRQb2yRR2nAnRfyqQpMHBM/Eo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-296-gfyDrYL_MJ6uhJrWbBritQ-1; Tue, 01 Mar 2022 05:46:05 -0500 X-MC-Unique: gfyDrYL_MJ6uhJrWbBritQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2CE04814600; Tue, 1 Mar 2022 10:46:04 +0000 (UTC) Received: from rh.Home (unknown [10.39.194.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id E4344721DF; Tue, 1 Mar 2022 10:46:02 +0000 (UTC) From: Kevin Traynor To: Rakesh Kudurumalla Cc: Ferruh Yigit , Jerin Jacob , dpdk stable Subject: patch 'net/cnxk: fix build with GCC 12' has been queued to stable release 21.11.1 Date: Tue, 1 Mar 2022 10:42:48 +0000 Message-Id: <20220301104300.334382-92-ktraynor@redhat.com> In-Reply-To: <20220301104300.334382-1-ktraynor@redhat.com> References: <20220301104300.334382-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" 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.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/06/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/9a8eca798335e2afb3999f2f7a2f3e2a8292ce84 Thanks. Kevin --- >From 9a8eca798335e2afb3999f2f7a2f3e2a8292ce84 Mon Sep 17 00:00:00 2001 From: Rakesh Kudurumalla Date: Wed, 23 Feb 2022 15:25:40 +0530 Subject: [PATCH] net/cnxk: fix build with GCC 12 [ upstream commit b526599020ef06811dd08c4f15c0cdf049d7f9f2 ] Resolve following compilation error with gcc 12 version. error: storing the address of local variable message in *error.message Fixes: 26b034f78ca7 ("net/cnxk: support to validate meter policy") Reported-by: Ferruh Yigit Signed-off-by: Rakesh Kudurumalla Acked-by: Jerin Jacob --- drivers/net/cnxk/cnxk_ethdev_mtr.c | 59 ++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c index 39d8563826..6d14c88e7d 100644 --- a/drivers/net/cnxk/cnxk_ethdev_mtr.c +++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c @@ -278,4 +278,45 @@ cnxk_nix_mtr_profile_delete(struct rte_eth_dev *eth_dev, uint32_t profile_id, } +static int +update_mtr_err(uint32_t act_color, struct rte_mtr_error *error, bool action) +{ + const char *str; + switch (act_color) { + case RTE_COLOR_GREEN: + if (action) { + str = "Green action is not valid"; + goto notsup; + } else { + str = "Green action is null"; + goto notvalid; + } + break; + case RTE_COLOR_YELLOW: + if (action) { + str = "Yellow action is not valid"; + goto notsup; + } else { + str = "Yellow action is null"; + goto notvalid; + } + break; + case RTE_COLOR_RED: + if (action) { + str = "Red action is not valid"; + goto notsup; + } else { + str = "Red action is null"; + goto notvalid; + } + break; + } +notsup: + return -rte_mtr_error_set(error, ENOTSUP, + RTE_MTR_ERROR_TYPE_METER_POLICY, NULL, str); +notvalid: + return -rte_mtr_error_set(error, EINVAL, + RTE_MTR_ERROR_TYPE_METER_POLICY, NULL, str); +} + static int cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev, @@ -283,8 +324,6 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev, struct rte_mtr_error *error) { - static const char *const action_color[] = {"Green", "Yellow", "Red"}; bool supported[RTE_COLORS] = {false, false, false}; const struct rte_flow_action *action; - char message[1024]; uint32_t i; @@ -305,19 +344,9 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev, supported[i] = true; - if (!supported[i]) { - sprintf(message, - "%s action is not valid", - action_color[i]); - return -rte_mtr_error_set(error, - ENOTSUP, - RTE_MTR_ERROR_TYPE_METER_POLICY, NULL, - message); - } + if (!supported[i]) + return update_mtr_err(i, error, true); } } else { - sprintf(message, "%s action is null", action_color[i]); - return -rte_mtr_error_set(error, EINVAL, - RTE_MTR_ERROR_TYPE_METER_POLICY, NULL, - message); + return update_mtr_err(i, error, false); } } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-03-01 10:41:03.926973761 +0000 +++ 0092-net-cnxk-fix-build-with-GCC-12.patch 2022-03-01 10:41:01.460244130 +0000 @@ -1 +1 @@ -From b526599020ef06811dd08c4f15c0cdf049d7f9f2 Mon Sep 17 00:00:00 2001 +From 9a8eca798335e2afb3999f2f7a2f3e2a8292ce84 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit b526599020ef06811dd08c4f15c0cdf049d7f9f2 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index cc783e5f86..c8183aa12d 100644 +index 39d8563826..6d14c88e7d 100644 @@ -23 +24 @@ -@@ -286,4 +286,45 @@ cnxk_nix_mtr_profile_delete(struct rte_eth_dev *eth_dev, uint32_t profile_id, +@@ -278,4 +278,45 @@ cnxk_nix_mtr_profile_delete(struct rte_eth_dev *eth_dev, uint32_t profile_id, @@ -69 +70 @@ -@@ -291,8 +332,6 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev, +@@ -283,8 +324,6 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev, @@ -78 +79 @@ -@@ -316,19 +355,9 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev, +@@ -305,19 +344,9 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev,