From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from huawei.com (szxga01-in.huawei.com [45.249.212.187]) by dpdk.org (Postfix) with ESMTP id 5A27F1DA4; Wed, 6 Mar 2019 04:42:42 +0100 (CET) Received: from dggeml406-hub.china.huawei.com (unknown [172.30.72.57]) by Forcepoint Email with ESMTP id D5F213E1558CDFC45FEB; Wed, 6 Mar 2019 11:42:39 +0800 (CST) Received: from DGGEML529-MBX.china.huawei.com ([169.254.6.187]) by dggeml406-hub.china.huawei.com ([10.3.17.50]) with mapi id 14.03.0415.000; Wed, 6 Mar 2019 11:42:31 +0800 From: "Zhaohui (zhaohui, Polestar)" To: "dev@dpdk.org" , Chas Williams <3chas3@gmail.com>, "ferruh.yigit@intel.com" CC: chenchanghu , wangyunjian , "stable@dpdk.org" Thread-Topic: =?Windows-1252?Q?[dpdk-dev]_[PATCH]_net/bonding:_fix_Segfault_when_eal_th?= =?Windows-1252?Q?read_executing_nic=91s_lsc_event_for_mode_4?= Thread-Index: AdTTyzos85/zmyfwQ1y6sSMulCbjpw== Date: Wed, 6 Mar 2019 03:42:30 +0000 Message-ID: Accept-Language: en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.62.33.217] MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Mailman-Approved-At: Wed, 06 Mar 2019 16:59:57 +0100 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] =?windows-1252?q?_=5BPATCH=5D_net/bonding=3A_fix_Segfa?= =?windows-1252?q?ult_when_eal_thread_executing_nic=91s_lsc_event_for_mode?= =?windows-1252?q?_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: , X-List-Received-Date: Wed, 06 Mar 2019 03:42:43 -0000 When the number of slave slave devices exceeds 8, it will cause the array s= ubscript 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/bondin= g/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 *i= nternals, uint8_t slave_id struct port *agg, *port; uint16_t slaves_count, new_agg_id, i, j =3D 0; uint16_t *slaves; - uint64_t agg_bandwidth[8] =3D {0}; - uint64_t agg_count[8] =3D {0}; + uint64_t agg_bandwidth[RTE_MAX_ETHPORTS] =3D {0}; + uint64_t agg_count[RTE_MAX_ETHPORTS] =3D {0}; uint16_t default_slave =3D 0; uint8_t mode_count_id, mode_band_id; struct rte_eth_link link_info; --