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 6F046A00BE for ; Tue, 29 Oct 2019 07:15:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4231E1BEE9; Tue, 29 Oct 2019 07:15:43 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 8D8725F13; Tue, 29 Oct 2019 07:15:37 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Oct 2019 23:15:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,242,1569308400"; d="scan'208";a="350882588" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga004.jf.intel.com with ESMTP; 28 Oct 2019 23:15:35 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 28 Oct 2019 23:15:18 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 28 Oct 2019 23:15:17 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.213]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.127]) with mapi id 14.03.0439.000; Tue, 29 Oct 2019 14:15:15 +0800 From: "Yang, Qiming" To: "Ye, Xiaolong" CC: "Jiang, JunyuX" , "dev@dpdk.org" , Chas Williams , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/bonding: fix segfault using invalid port Thread-Index: AQHViuThhmsqij44m0ivUL/05k704advjuIAgADgRACAALtLMA== Date: Tue, 29 Oct 2019 06:15:15 +0000 Message-ID: References: <20191024205551.26273-1-junyux.jiang@intel.com> <20191029030406.GC12923@intel.com> In-Reply-To: <20191029030406.GC12923@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODU3OGQwZjAtY2UzNC00MDQxLThlNmItZGRhMjA5YWEzZWUyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQkZ6blJrRU80Y2lSMkY3Vjl5ZTMzcWRxZE02TXhQbmZrRG1vTWl4M3NtTVlFN3BuMURCcnJjXC9wN0h6UXNQQTcifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] net/bonding: fix segfault using invalid port X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" > -----Original Message----- > From: Ye, Xiaolong > Sent: Tuesday, October 29, 2019 11:04 AM > To: Yang, Qiming > Cc: Jiang, JunyuX ; dev@dpdk.org; Chas Williams > ; stable@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] net/bonding: fix segfault using invalid p= ort >=20 > On 10/28, Yang, Qiming wrote: > >Hi, Junyu > > > >> + dev =3D &rte_eth_devices[port]; > >> + internals =3D dev->data->dev_private; > >Have you build success? I think we need to add (struct bond_dev_private = *) > for force transfer >=20 > dev_private is a void *, an explicit type conversion is not needed here. OK, I saw the original code used.=20 - struct bond_dev_private *internals =3D (struct bond_dev_private *) - dev->data->dev_private;=20 >=20 > Thanks, > Xiaolong > > > >> > >> if (check_for_bonded_ethdev(dev) !=3D 0) > >> return -1; > >> @@ -1689,9 +1696,14 @@ int > >> rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port) { > >> int retval =3D 0; > >> - struct rte_eth_dev *dev =3D &rte_eth_devices[port]; > >> - struct bond_dev_private *internals =3D (struct bond_dev_private *) > >> - dev->data->dev_private; > >> + struct rte_eth_dev *dev; > >> + struct bond_dev_private *internals; > >> + > >> + if (valid_bonded_port_id(port) !=3D 0) > >> + return -EINVAL; > >> + > >> + dev =3D &rte_eth_devices[port]; > >> + internals =3D dev->data->dev_private; > >Same as before > > > >> > >> if (check_for_bonded_ethdev(dev) !=3D 0) > >> return -1; > >> -- > >> 2.17.1 > >