From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 72E53A0613 for ; Tue, 30 Jul 2019 13:34:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 427921C0D5; Tue, 30 Jul 2019 13:34:55 +0200 (CEST) Received: from mail-ua1-f66.google.com (mail-ua1-f66.google.com [209.85.222.66]) by dpdk.org (Postfix) with ESMTP id B19431C0AE for ; Tue, 30 Jul 2019 13:34:53 +0200 (CEST) Received: by mail-ua1-f66.google.com with SMTP id v18so25297830uad.12 for ; Tue, 30 Jul 2019 04:34:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2q1C26VFZq1IlHKfYaA3Cpb/v4T68xZGuctWYVIHrrc=; b=jkHgnGgLDnZWNOVVRpaw/vM10gCIgVKsN+7v2x7C90guO8KiPTNfpcbhOnvqZj5GeH 0M4YIrZJCZtZlT1k1wVTd1N1u8s86N9Gq63+GZgTVDaLjzcMvuFCH9qhTfIH7Gj/Fm1H C7hLd2mliCn/WyF2dHMSOzj4dsBiHUMQ+CgkUPZQCKnLECo8sHfI+nMDDRDxr+e6CI1x 9Tg2mXNE+PHlWCxEOA5k/Rm9khx1C9Fk/WOed4FHNTt+O+sp1ZlC50a15dQswa2PIJQc pCW09jp5PBYgxndUMcxqgpaFCw2dD8kyXaWd3rjnPKglpbw+t3OoXdslUFDYM6P8qaAL aE9w== X-Gm-Message-State: APjAAAXs1xBqXAEPJbOLEjFu21WQc2HVe0UqwrMOy86VDGSecGuMc1Oq SebGYe+d2AKpz2ialC9N1aMfZPgK5Iwst8YWZR1qSQ== X-Google-Smtp-Source: APXvYqxN8GJN2KSpnzVC59Yj3ArRCnOYq952T+QhtQBPSmMHAFuoxaVOCBJqPKlGdsOu+n8Aehdv8YrzN3NTLB6ZiC8= X-Received: by 2002:ab0:6198:: with SMTP id h24mr8735533uan.41.1564486493139; Tue, 30 Jul 2019 04:34:53 -0700 (PDT) MIME-Version: 1.0 References: <20190730113135.19907-1-kkanas@marvell.com> In-Reply-To: <20190730113135.19907-1-kkanas@marvell.com> From: David Marchand Date: Tue, 30 Jul 2019 13:34:41 +0200 Message-ID: To: kkanas@marvell.com Cc: dev , Chas Williams , danielx.t.mrzyglod@intel.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] net/bonding: fix stack overflow in selection logic X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 Tue, Jul 30, 2019 at 1:32 PM wrote: > > From: Krzysztof Kanas > > Bonding selection logic uses agg_bandwidth, agg_count indexed by port_id > but those arrays are 8 entries long. > > Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes") > Cc: danielx.t.mrzyglod@intel.com > > Signed-off-by: Krzysztof Kanas > --- > drivers/net/bonding/rte_eth_bond_8023ad.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c > index 1e6a3fc7c641..a7c040e26931 100644 > --- a/drivers/net/bonding/rte_eth_bond_8023ad.c > +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c > @@ -669,8 +669,8 @@ selection_logic(struct bond_dev_private *internals, uint16_t slave_id) > struct port *agg, *port; > uint16_t slaves_count, new_agg_id, i, j = 0; > uint16_t *slaves; > - uint64_t agg_bandwidth[8] = {0}; > - uint64_t agg_count[8] = {0}; > + uint64_t agg_bandwidth[RTE_MAX_ETHPORTS] = {0}; > + uint64_t agg_count[RTE_MAX_ETHPORTS] = {0}; > uint16_t default_slave = 0; > uint8_t mode_count_id, mode_band_id; > struct rte_eth_link link_info; > -- > 2.21.0 > I already sent the same patch. Please see the comments if you want to take over this: https://patchwork.dpdk.org/patch/51492/ -- David Marchand