From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Lu, Wenzhuo" Subject: Re: [PATCH v2 1/1] net/ixgbe: Add access and locking APIs for MDIO Date: Wed, 4 Apr 2018 02:15:58 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09093B75F6E8@shsmsx102.ccr.corp.intel.com> References: <20180321173618.74200-1-shweta.choudaha@gmail.com> <20180321173618.74200-2-shweta.choudaha@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "Ananyev, Konstantin" , "Zhang, Helin" , "Yigit, Ferruh" , "shweta.choudaha@att.com" To: Shweta Choudaha , "dev@dpdk.org" Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 9139E1BADA for ; Wed, 4 Apr 2018 04:18:35 +0200 (CEST) In-Reply-To: <20180321173618.74200-2-shweta.choudaha@gmail.com> Content-Language: en-US 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 Shweta, > -----Original Message----- > From: Shweta Choudaha [mailto:shweta.choudaha@gmail.com] > Sent: Thursday, March 22, 2018 1:36 AM > To: dev@dpdk.org > Cc: Lu, Wenzhuo ; Ananyev, Konstantin > ; Zhang, Helin ; > Yigit, Ferruh ; shweta.choudaha@att.com > Subject: [PATCH v2 1/1] net/ixgbe: Add access and locking APIs for MDIO >=20 > From: Shweta Choudaha >=20 > Add ixgbe MDIO lock/unlock and access APIs to read and write registers us= ing > specific device address. This provides MDIO access to any devices that ar= e > not associated with the autoprobed PHY.Export these APIs via the map file >=20 > Signed-off-by: Shweta Choudaha > Reviewed-by: Chas Williams > Reviewed-by: Luca Boccassi > --- > drivers/net/ixgbe/rte_pmd_ixgbe.c | 203 > ++++++++++++++++++++++++++++ > drivers/net/ixgbe/rte_pmd_ixgbe.h | 71 ++++++++++ > drivers/net/ixgbe/rte_pmd_ixgbe_version.map | 9 ++ > 3 files changed, 283 insertions(+) >=20 > diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c > b/drivers/net/ixgbe/rte_pmd_ixgbe.c > index d8ca8ca31..1846af89b 100644 > --- a/drivers/net/ixgbe/rte_pmd_ixgbe.c > +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c > @@ -5,6 +5,8 @@ > #include >=20 > #include "base/ixgbe_api.h" > +#include "base/ixgbe_x540.h" > +#include "base/ixgbe_x550.h" > #include "ixgbe_ethdev.h" > #include "rte_pmd_ixgbe.h" >=20 > @@ -1012,3 +1014,204 @@ rte_pmd_ixgbe_bypass_wd_reset(uint16_t > port_id) > return ixgbe_bypass_wd_reset(dev); > } > #endif > + > +/** > + * rte_pmd_ixgbe_acquire_swfw - Acquire SWFW semaphore > + * @hw: pointer to hardware structure > + * @mask: Mask to specify which semaphore to acquire > + * > + * Acquires the SWFW semaphore and get the shared phy token as needed > +*/ STATIC s32 rte_pmd_ixgbe_acquire_swfw(struct ixgbe_hw *hw, u32 mask) > +{ > + int retries =3D FW_PHY_TOKEN_RETRIES; > + s32 status =3D IXGBE_SUCCESS; > + > + while (--retries) { > + status =3D ixgbe_acquire_swfw_sync_X540(hw, mask); " ixgbe_acquire_swfw_sync_X540" is only for x540. Why not using " ixgbe_acq= uire_swfw_semaphore" which is common. The same for " ixgbe_release_swfw_sync_X540". > a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map > b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map > index bf776742c..88a91627a 100644 > --- a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map > +++ b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map > @@ -52,3 +52,12 @@ DPDK_17.08 { > rte_pmd_ixgbe_bypass_wd_timeout_show; > rte_pmd_ixgbe_bypass_wd_timeout_store; > } DPDK_17.05; > + > +EXPERIMENTAL { > + global: > + > + rte_pmd_ixgbe_lock_mdio; > + rte_pmd_ixgbe_unlock_mdio; > + rte_pmd_ixgbe_mdio_read_unlocked; > + rte_pmd_ixgbe_mdio_write_unlocked; > +} DPDK_17.08; 17.08 is old. Should add a 18.05 here. > -- > 2.11.0