From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 72FABA00E6 for ; Tue, 19 Mar 2019 19:00:13 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4918D1DBD; Tue, 19 Mar 2019 19:00:13 +0100 (CET) Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) by dpdk.org (Postfix) with ESMTP id 24E89A3; Tue, 19 Mar 2019 19:00:12 +0100 (CET) Received: by mail-qt1-f193.google.com with SMTP id x12so7083102qts.7; Tue, 19 Mar 2019 11:00:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=sZbDpTslOOVI+P7l/o9irWV2WJMPlnlj+1NFws1DvLk=; b=dRSUfY6lJQlTyQHRF4bTtsJ7L3HjnHQWkbwRj4Ug3fZ2k5STlMi6WwKG2Dt+OnQbBY eYX4nJf3WmhLJ90xDKpApXA6p82rEg/jHtGsVsgYjtNcvcqK11esnr9TbZ0HcMXsa/Zz Tsbd9kXQrzdZk28fr9N1fOsSTi72BpIvsGtLw5FXMoGo6u6RjZ4vZtqGeEAVhJ16uB83 ilQxtWB3qHAMliCWXiHhN00ogS7HIv2W4uEFvJ7TlKh+9EAFFw6zNn+hz85GdMzciVx8 6FwZq0R90KPUqKpzehqM5uF7XYHwhcvM2+feTSfPtq+C+D1ACofgi5/Ie65V3zY1dFoa u0cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=sZbDpTslOOVI+P7l/o9irWV2WJMPlnlj+1NFws1DvLk=; b=UHq8T6gY9g+bb7u4ucDRLrYcJ2mRbvD/uzS0f19rZ6JJ4sTE7nXVcTW8xlx8oZvfJy pD2LRB1CZ6/ckcIb+37rVqpXyhP7ZY72s6MOuA5TxHgkWzD2I+GC80uYVseKRtVLxNMx MPbMNAyeTU+6kCPskb9l5E3JrS0hrcFuYH7RpOAQVIdOAAMrBufZPGgSMG9QjZien3Er zATqsniOv6wei/t5rGGBuW4iSgEO6PFq7UWhPK2qon3Vd7+0F2JqxY2J7lzz5fJq5WZD JWsCwl8dFOYy3y6j32Qx1FjVPOwNkIa5NU+upMSs1z06MHgSpp47h1GibZCHfL9skI4m vqGg== X-Gm-Message-State: APjAAAURRs4YDDBecPQHSXIl8gltl8KaQKp3H52uWpCj8yvEiUZX8BRy /A+LaixijLmA9o4RB3lEVIQ= X-Google-Smtp-Source: APXvYqz7+lpXdwkmfi+pgqi2JCoRGgHOkFto7sqsCk8IZoXm2+05Xn1ojy3dEbjhpE4cblOPFizA2w== X-Received: by 2002:ac8:65c3:: with SMTP id t3mr3458395qto.12.1553018411506; Tue, 19 Mar 2019 11:00:11 -0700 (PDT) Received: from [192.168.1.10] (pool-96-255-82-34.washdc.fios.verizon.net. [96.255.82.34]) by smtp.gmail.com with ESMTPSA id s76sm8574361qki.42.2019.03.19.11.00.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Mar 2019 11:00:10 -0700 (PDT) To: Ferruh Yigit , "Zhaohui (zhaohui, Polestar)" , "dev@dpdk.org" Cc: chenchanghu , wangyunjian , "stable@dpdk.org" , "Mrzyglod, Daniel T" , Declan Doherty , "Nicolau, Radu" References: <306e53ea-988f-8e75-4002-b4f2832e50ef@intel.com> From: Chas Williams <3chas3@gmail.com> Message-ID: Date: Tue, 19 Mar 2019 14:00:10 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <306e53ea-988f-8e75-4002-b4f2832e50ef@intel.com> Content-Type: text/plain; charset="UTF-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] =?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?= 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" Message-ID: <20190319180010.v4DXAh93v1xFJPeh2S8CpVN12WI7-iTTLjFx1uD168M@z> On 3/19/19 1:37 PM, Ferruh Yigit wrote: > 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. Zhaohui, Has this been an actual problem in practice? I ask because the number of possible slaves for the bonding drivers appears to be RTE_MAX_ETHPORTS. I suspect people typically have far fewer slaves on a bonding device in practice. > Is there any specific reason to pick the number '8'? I suspect someone guessed this was the maximum reasonable number of slaves. > Also this function gets 'uint8_t slave_id' as argument, if this is port_is, > should it be uint16_t? It probably was never completely changed when the DPDK port id changed from uint8 to uint16. > >> uint16_t default_slave = 0; >> uint8_t mode_count_id, mode_band_id; >> struct rte_eth_link link_info; >> -- >