Hi Shweta, > -----Original Message----- > From: Shweta Choudaha [mailto:shweta.choud...@gmail.com] > Sent: Thursday, March 22, 2018 1:36 AM > To: dev@dpdk.org > Cc: Lu, Wenzhuo <wenzhuo...@intel.com>; Ananyev, Konstantin > <konstantin.anan...@intel.com>; Zhang, Helin <helin.zh...@intel.com>; > Yigit, Ferruh <ferruh.yi...@intel.com>; shweta.choud...@att.com > Subject: [PATCH v2 1/1] net/ixgbe: Add access and locking APIs for MDIO > > From: Shweta Choudaha <shweta.choud...@att.com> > > Add ixgbe MDIO lock/unlock and access APIs to read and write registers using > specific device address. This provides MDIO access to any devices that are > not associated with the autoprobed PHY.Export these APIs via the map file > > Signed-off-by: Shweta Choudaha <shweta.choud...@att.com> > Reviewed-by: Chas Williams <ch...@att.com> > Reviewed-by: Luca Boccassi <bl...@debian.org> > --- > 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(+) > > 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 <rte_ethdev_driver.h> > > #include "base/ixgbe_api.h" > +#include "base/ixgbe_x540.h" > +#include "base/ixgbe_x550.h" > #include "ixgbe_ethdev.h" > #include "rte_pmd_ixgbe.h" > > @@ -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 = FW_PHY_TOKEN_RETRIES; > + s32 status = IXGBE_SUCCESS; > + > + while (--retries) { > + status = ixgbe_acquire_swfw_sync_X540(hw, mask); " ixgbe_acquire_swfw_sync_X540" is only for x540. Why not using " ixgbe_acquire_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