From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: =?utf-8?q?=5BPATCH=5D_net/bonding=3A_fix_Segfault_when?= =?utf-8?q?_eal_thread_executing_nic=E2=80=98s_lsc_event_for_mode_4?= Date: Tue, 19 Mar 2019 17:37:45 +0000 Message-ID: <306e53ea-988f-8e75-4002-b4f2832e50ef@intel.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: chenchanghu , wangyunjian , "stable@dpdk.org" , "Mrzyglod, Daniel T" , Declan Doherty , "Nicolau, Radu" To: "Zhaohui (zhaohui, Polestar)" , "dev@dpdk.org" , Chas Williams <3chas3@gmail.com> Return-path: In-Reply-To: Content-Language: en-US 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 3/6/2019 3:42 AM, Zhaohui (zhaohui, Polestar) wrote: > When the number of slave slave devices exceeds 8, it will cause the array > subscript to cross the boundary. > > --- > 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 f6f8b28..b5589c7 100644 > --- a/drivers/net/bonding/rte_eth_bond_8023ad.c > +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c > @@ -920,8 +920,8 @@ static void selection_logic (struct bond_dev_private > *internals, uint8_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}; Patch doesn't apply clearly but I think the intention in the fix is clear. Is there any specific reason to pick the number '8'? Also this function gets 'uint8_t slave_id' as argument, if this is port_is, should it be uint16_t? >        uint16_t default_slave = 0; >        uint8_t mode_count_id, mode_band_id; >        struct rte_eth_link link_info; > --