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 6DA1D455AD for ; Mon, 15 Jul 2024 17:29:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 68D9640BA0; Mon, 15 Jul 2024 17:29:38 +0200 (CEST) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mails.dpdk.org (Postfix) with ESMTP id D7B3C40A71 for ; Mon, 15 Jul 2024 17:29:37 +0200 (CEST) Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4266b1f1b21so29879585e9.1 for ; Mon, 15 Jul 2024 08:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721057377; x=1721662177; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cnswhPWkiywgCS4gib6ZsSLy7ziF9N/mcY3lZLNpNfc=; b=c/ql2IyoDiiu5rYNQp2pVAd9XOTMrE+r9ajLISNCrxuOMgahlx8CD1VRAQfE8pGsjz fU6SvwTn9NP9/mWByeHeudrnCHogsSHanVpPhXTgfE87zjtVkSesDuWbW+gp/Nf10Zbu PAZwCZqbwFJIjLm0ODWr4AkEsOkq2hvlkaf2gu5sia1ycF+yJHwGAVl8ouvGZ1yhBd4H waLEUtx9ssW2LpSt1MqG/FxoksevFLGmjicoJlQXdx1r7jSMaiDytJZM+DVkozSTwAnf pdqO1PikrJr1zfMSVZJWHaNfDmN1wzYIMP70FtCmuR1gaQORHI6wirwqAWEze5nhFQPO tbVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721057377; x=1721662177; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cnswhPWkiywgCS4gib6ZsSLy7ziF9N/mcY3lZLNpNfc=; b=sYYflNBkUSbJVuc/KvlhBQX7TsiZ6wvZPxUB/bZtho1FceoleC1WOjCYTsUMRId+da sV0/wz6Yr6ytHoFWhiGy8ok1XrB8pz0raJisjAkDhtzXVkN2Oa8qwn7K/9aGGUqunxnL mKKFAHmdOEfIVWw6t4pAZoel47FR8N+O1WAnr2HMvBlpD9dd6WMbC7cpSH76oOyLH3jZ Kgnn2zQu4oU4Ja0wTGihzBlTnvN+ULPoDyoy4nBbuPQUTGHmrMHvdnk7LAFGKZ4AR6pR fjW81Tdf8+PE19OIUjGOXP0hEEfT+UEZGskPNoPgYNJ1o8JoiICvGhIpiv8KcQYQlnP2 gX9w== X-Forwarded-Encrypted: i=1; AJvYcCUYWmrWOU4vP7DOrvPSFCS/54HVD2J4gcHu1Cmeas12W6wZ5VZXakw4uAzCu1/pOIB41WMsdvrOIq6MVaoa6D4= X-Gm-Message-State: AOJu0YzKt4sGGAm9QUHEi8aPiJqEfHirkBSiHhUyQOd64ISFkdUJguDP 01Z8yr3505BG3wb0R49kO8ccDrUeLLJpfUF+FX6D3mFpVQeiw6QE X-Google-Smtp-Source: AGHT+IGLr8cF1MoO4ioF86lV5SXzAbNXC2mct0SiPFerwGh46WNKKUWQ504MCKNZZCRip2U/92fLcg== X-Received: by 2002:adf:fdc1:0:b0:361:d3ec:1031 with SMTP id ffacd0b85a97d-3682408e16emr60864f8f.31.1721057377487; Mon, 15 Jul 2024 08:29:37 -0700 (PDT) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3680dafbb07sm6703332f8f.86.2024.07.15.08.29.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jul 2024 08:29:37 -0700 (PDT) From: luca.boccassi@gmail.com To: Jacob Keller Cc: Ian Stokes , Bruce Richardson , dpdk stable Subject: patch 'net/ice/base: fix size when allocating children arrays' has been queued to stable release 22.11.6 Date: Mon, 15 Jul 2024 16:26:25 +0100 Message-Id: <20240715152704.2229503-47-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240715152704.2229503-1-luca.boccassi@gmail.com> References: <20240624235907.885628-81-luca.boccassi@gmail.com> <20240715152704.2229503-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 22.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/17/24. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/f3701c8b98920a64c3774b5a250ba48512c1fda8 Thanks. Luca Boccassi --- >From f3701c8b98920a64c3774b5a250ba48512c1fda8 Mon Sep 17 00:00:00 2001 From: Jacob Keller Date: Wed, 26 Jun 2024 12:41:08 +0100 Subject: [PATCH] net/ice/base: fix size when allocating children arrays [ upstream commit 3072e5e2da9870d8cb119f15482eae9d9fb51e98 ] The ice_sched_add_root_node() and ice_sched_add_node() functions have comments to suppress Coverity warnings about a suspicious sizeof used when allocating the children array of an struct ice_sched_node. The size is calculated using the size of the scheduler node, which overallocates the array by a significant amount. Fix the code to correctly calculate the size by using *root->children and *node->children respectively. This saves some memory and allows us to drop the Coverity suppression comments. Fixes: 93e84b1bfc92 ("net/ice/base: add basic Tx scheduler") Signed-off-by: Jacob Keller Signed-off-by: Ian Stokes Acked-by: Bruce Richardson --- drivers/net/ice/base/ice_sched.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c index d505c8d16c..25bf3fca76 100644 --- a/drivers/net/ice/base/ice_sched.c +++ b/drivers/net/ice/base/ice_sched.c @@ -28,9 +28,8 @@ ice_sched_add_root_node(struct ice_port_info *pi, if (!root) return ICE_ERR_NO_MEMORY; - /* coverity[suspicious_sizeof] */ root->children = (struct ice_sched_node **) - ice_calloc(hw, hw->max_children[0], sizeof(*root)); + ice_calloc(hw, hw->max_children[0], sizeof(*root->children)); if (!root->children) { ice_free(hw, root); return ICE_ERR_NO_MEMORY; @@ -180,9 +179,9 @@ ice_sched_add_node(struct ice_port_info *pi, u8 layer, if (!node) return ICE_ERR_NO_MEMORY; if (hw->max_children[layer]) { - /* coverity[suspicious_sizeof] */ node->children = (struct ice_sched_node **) - ice_calloc(hw, hw->max_children[layer], sizeof(*node)); + ice_calloc(hw, hw->max_children[layer], + sizeof(*node->children)); if (!node->children) { ice_free(hw, node); return ICE_ERR_NO_MEMORY; -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-07-15 16:19:37.009241692 +0100 +++ 0047-net-ice-base-fix-size-when-allocating-children-array.patch 2024-07-15 16:19:34.588206890 +0100 @@ -1 +1 @@ -From 3072e5e2da9870d8cb119f15482eae9d9fb51e98 Mon Sep 17 00:00:00 2001 +From f3701c8b98920a64c3774b5a250ba48512c1fda8 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 3072e5e2da9870d8cb119f15482eae9d9fb51e98 ] + @@ -20 +21,0 @@ -Cc: stable@dpdk.org @@ -30 +31 @@ -index c9d70fb043..74d57329da 100644 +index d505c8d16c..25bf3fca76 100644 @@ -44 +45 @@ -@@ -186,9 +185,9 @@ ice_sched_add_node(struct ice_port_info *pi, u8 layer, +@@ -180,9 +179,9 @@ ice_sched_add_node(struct ice_port_info *pi, u8 layer,