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 A9961A0613 for ; Wed, 25 Sep 2019 09:08:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B15A02BE6; Wed, 25 Sep 2019 09:08:35 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id B8B852BCE for ; Wed, 25 Sep 2019 09:08:33 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Sep 2019 00:08:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,547,1559545200"; d="scan'208";a="188699129" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga008.fm.intel.com with ESMTP; 25 Sep 2019 00:08:30 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Sep 2019 00:08:29 -0700 Received: from shsmsx105.ccr.corp.intel.com ([169.254.11.23]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.53]) with mapi id 14.03.0439.000; Wed, 25 Sep 2019 15:08:26 +0800 From: "Pei, Andy" To: "Zhang, Qi Z" , "dev@dpdk.org" CC: "Xu, Rosen" , "Zhang, Tianfei" , "Ye, Xiaolong" , "Lomartire, David" , "Yigit, Ferruh" Thread-Topic: [PATCH v6 01/17] net/i40e: i40e support ipn3ke FPGA port bonding Thread-Index: AQHVbssRNbIkLmN/zUutjPgSwe4PDaczufIwgAhIWfA= Date: Wed, 25 Sep 2019 07:08:26 +0000 Message-ID: <5941F446C088714A85408FA3132CFCBB01075FF9@SHSMSX105.ccr.corp.intel.com> References: <1568881185-89233-2-git-send-email-andy.pei@intel.com> <1568883774-92149-1-git-send-email-andy.pei@intel.com> <1568883774-92149-2-git-send-email-andy.pei@intel.com> <039ED4275CED7440929022BC67E7061153D99147@SHSMSX105.ccr.corp.intel.com> In-Reply-To: <039ED4275CED7440929022BC67E7061153D99147@SHSMSX105.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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-dev] [PATCH v6 01/17] net/i40e: i40e support ipn3ke FPGA port bonding 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" Hi Qi, Will modify in next version. -----Original Message----- From: Zhang, Qi Z=20 Sent: Friday, September 20, 2019 8:55 AM To: Pei, Andy ; dev@dpdk.org Cc: Xu, Rosen ; Zhang, Tianfei ; Ye, Xiaolong ; Lomartire, David ; Yigit, Ferruh Subject: RE: [PATCH v6 01/17] net/i40e: i40e support ipn3ke FPGA port bondi= ng > -----Original Message----- > From: Pei, Andy > Sent: Thursday, September 19, 2019 5:03 PM > To: dev@dpdk.org > Cc: Xu, Rosen ; Zhang, Tianfei=20 > ; Ye, Xiaolong ;=20 > Zhang, Qi Z ; Lomartire, David=20 > ; Yigit, Ferruh > Subject: [PATCH v6 01/17] net/i40e: i40e support ipn3ke FPGA port=20 > bonding >=20 > In ipn3ke, each FPGA network side port bonding to an i40e pf, each=20 > i40e pf link status should get data from FPGA network, side port. This=20 > patch provide bonding relationship. >=20 > Signed-off-by: Rosen Xu > Signed-off-by: Andy Pei > --- > drivers/net/i40e/base/i40e_type.h | 3 +++ > drivers/net/i40e/i40e_ethdev.c | 20 ++++++++++++++++++++ > drivers/net/i40e/rte_pmd_i40e.h | 4 ++++ > 3 files changed, 27 insertions(+) >=20 > diff --git a/drivers/net/i40e/base/i40e_type.h > b/drivers/net/i40e/base/i40e_type.h > index 112866b..06863d7 100644 > --- a/drivers/net/i40e/base/i40e_type.h > +++ b/drivers/net/i40e/base/i40e_type.h > @@ -660,6 +660,9 @@ struct i40e_hw { > struct i40e_nvm_info nvm; > struct i40e_fc_info fc; >=20 > + /* switch device is used to get link status when i40e is in ipn3ke */ > + struct rte_eth_dev *switch_dev; > + > /* pci info */ > u16 device_id; > u16 vendor_id; > diff --git a/drivers/net/i40e/i40e_ethdev.c=20 > b/drivers/net/i40e/i40e_ethdev.c index 4e40b7a..6c4b1e8 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -1312,6 +1312,9 @@ static inline void i40e_config_automask(struct=20 > i40e_pf *pf) > hw->adapter_stopped =3D 0; > hw->adapter_closed =3D 0; >=20 > + /* Init switch device pointer */ > + hw->switch_dev =3D NULL; > + > /* > * Switch Tag value should not be identical to either the First Tag > * or Second Tag values. So set something other than common=20 > Ethertype @@ -2782,6 +2785,20 @@ void=20 > i40e_flex_payload_reg_set_default(struct > i40e_hw *hw) > } > } >=20 > +void > +i40e_set_switch_dev(struct rte_eth_dev *i40e_dev, struct rte_eth_dev > +*switch_dev) { > + struct i40e_hw *hw; > + > + if (!i40e_dev) > + return; > + > + hw =3D I40E_DEV_PRIVATE_TO_HW(i40e_dev->data->dev_private); > + > + hw->switch_dev =3D switch_dev; > +} Better to move the function implementation into rte_pmd_i40e.c since it is = declared at rte_pmd_i40e.h > + > int > i40e_dev_link_update(struct rte_eth_dev *dev, > int wait_to_complete) > @@ -2803,6 +2820,9 @@ void i40e_flex_payload_reg_set_default(struct > i40e_hw *hw) > else > update_link_aq(hw, &link, enable_lse, wait_to_complete); >=20 > + if (hw->switch_dev) > + rte_eth_linkstatus_get(hw->switch_dev, &link); > + > ret =3D rte_eth_linkstatus_set(dev, &link); > i40e_notify_all_vfs_link_status(dev); >=20 > diff --git a/drivers/net/i40e/rte_pmd_i40e.h=20 > b/drivers/net/i40e/rte_pmd_i40e.h index faac9e2..9d77c85 100644 > --- a/drivers/net/i40e/rte_pmd_i40e.h > +++ b/drivers/net/i40e/rte_pmd_i40e.h > @@ -1061,4 +1061,8 @@ int rte_pmd_i40e_inset_set(uint16_t port,=20 > uint8_t pctype, > return 0; > } >=20 > +void > +i40e_set_switch_dev(struct rte_eth_dev *i40e_dev, struct rte_eth_dev=20 > +*switch_dev); 1. Missing doxygen header here for the new API. 2. Also as an external API, we should use port_id but not rte_eth_dev as pa= rameter. 3. you may also need to update the rte_pmd_i40e_version.map. Regards Qi > + > #endif /* _PMD_I40E_H_ */ > -- > 1.8.3.1