DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chas Williams <3chas3@gmail.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>,
	"Zhaohui (zhaohui, Polestar)" <zhaohui8@huawei.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: chenchanghu <chenchanghu@huawei.com>,
	wangyunjian <wangyunjian@huawei.com>,
	"stable@dpdk.org" <stable@dpdk.org>,
	"Mrzyglod, Daniel T" <daniel.t.mrzyglod@intel.com>,
	Declan Doherty <declan.doherty@intel.com>,
	"Nicolau, Radu" <radu.nicolau@intel.com>
Subject: Re: [dpdk-dev] [PATCH] net/bonding: fix Segfault when eal thread executing nic‘s lsc event for mode 4
Date: Tue, 19 Mar 2019 14:00:10 -0400	[thread overview]
Message-ID: <abdc4b28-fd94-b6cd-73e8-5667e1f5140b@gmail.com> (raw)
Message-ID: <20190319180010.v4DXAh93v1xFJPeh2S8CpVN12WI7-iTTLjFx1uD168M@z> (raw)
In-Reply-To: <306e53ea-988f-8e75-4002-b4f2832e50ef@intel.com>

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;
>> --
> 

  parent reply	other threads:[~2019-03-19 18:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-06  3:42 Zhaohui (zhaohui, Polestar)
2019-03-19 17:37 ` Ferruh Yigit
2019-03-19 17:37   ` Ferruh Yigit
2019-03-19 18:00   ` Chas Williams [this message]
2019-03-19 18:00     ` Chas Williams
2019-03-20 13:11 Zhaohui (zhaohui, Polestar)
2019-03-20 13:11 ` Zhaohui (zhaohui, Polestar)
2019-03-20 13:39 ` David Marchand
2019-03-20 13:39   ` David Marchand
2019-03-20 13:54   ` [dpdk-dev] 答复: " Zhaohui (zhaohui, Polestar)
2019-03-20 13:54     ` Zhaohui (zhaohui, Polestar)
2019-03-20 14:21     ` [dpdk-dev] " David Marchand
2019-03-20 14:21       ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=abdc4b28-fd94-b6cd-73e8-5667e1f5140b@gmail.com \
    --to=3chas3@gmail.com \
    --cc=chenchanghu@huawei.com \
    --cc=daniel.t.mrzyglod@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=radu.nicolau@intel.com \
    --cc=stable@dpdk.org \
    --cc=wangyunjian@huawei.com \
    --cc=zhaohui8@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).