[dpdk-dev] [PATCH v2 2/2] net/bnx2x: bump version to 1.0.7.1

2018-11-17 Thread Mody, Rasesh
Signed-off-by: Rasesh Mody 
---
 drivers/net/bnx2x/bnx2x.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index c80f84c..4c775c1 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -29,7 +29,7 @@
 #define BNX2X_PMD_VER_PREFIX "BNX2X PMD"
 #define BNX2X_PMD_VERSION_MAJOR 1
 #define BNX2X_PMD_VERSION_MINOR 0
-#define BNX2X_PMD_VERSION_REVISION 6
+#define BNX2X_PMD_VERSION_REVISION 7
 #define BNX2X_PMD_VERSION_PATCH 1
 
 static inline const char *
-- 
1.7.10.3



Re: [dpdk-dev] [PATCH 1/2] net/bnx2x: cleanup info logs

2018-11-17 Thread Mody, Rasesh
>From: Ferruh Yigit 
>Sent: Friday, November 16, 2018 3:26 AM
>
>On 11/14/2018 6:17 PM, Mody, Rasesh wrote:
>> Reduced number of INFO logs in BNX2X PMD by converting some INFO logs
>> to DEBUG and few NOTICE logs to INFO, removing extra new lines,
>> printing banner bar once for the adapter and device specific info.
>>
>> Fixes: ba7eeb035a5f ("net/bnx2x: fix logging to include device name")
>> Fixes: 540a211084a7 ("bnx2x: driver core")
>> Cc: sta...@dpdk.org
>>
>> Signed-off-by: Rasesh Mody 
>
><...>
>
>> + PMD_INIT_FUNC_TRACE(sc);
>> + offset = offsetof(struct shmem_region,
>> +   dev_info.port_hw_config[0].external_phy_config);
>> + if (sc->link_vars.phy_flags & PHY_XGXS_FLAG)
>> + ext_phy_type = ELINK_XGXS_EXT_PHY_TYPE(REG_RD(sc,
>> +   sc->
>> +   devinfo.
>> +   shmem_base
>> +   + offset));
>> + else
>> + ext_phy_type = ELINK_SERDES_EXT_PHY_TYPE(REG_RD(sc,
>> + sc->
>> + devinfo.
>> + shmem_base
>> + +
>> + offset));
>
>This looks ugly and hard to read, to avoid multi line derefernce, What do you
>think:
>
> reg_val = REG_RD(sc, sc->devinfo.shmem_base + offset);  ext_phy_type =
>ELINK_SERDES_EXT_PHY_TYPE(reg_val);

Updated patch is sent to avoid multi line dereference.

Thanks!
-Rasesh


[dpdk-dev] [PATCH v2 1/2] net/bnx2x: cleanup info logs

2018-11-17 Thread Mody, Rasesh
Reduced number of INFO logs in BNX2X PMD by converting some INFO
logs to DEBUG and few NOTICE logs to INFO, removing extra new lines,
printing banner bar once for the adapter and device specific info.

Fixes: ba7eeb035a5f ("net/bnx2x: fix logging to include device name")
Fixes: 540a211084a7 ("bnx2x: driver core")
Cc: sta...@dpdk.org

Signed-off-by: Rasesh Mody 
---
 drivers/net/bnx2x/bnx2x.c|  144 +++---
 drivers/net/bnx2x/bnx2x.h|3 +-
 drivers/net/bnx2x/bnx2x_ethdev.c |   20 +++---
 drivers/net/bnx2x/bnx2x_ethdev.h |1 +
 drivers/net/bnx2x/ecore_sp.c |8 +--
 5 files changed, 87 insertions(+), 89 deletions(-)

diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index a6d2687..c80f84c 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -5809,7 +5809,7 @@ static int bnx2x_set_power_state(struct bnx2x_softc *sc, 
uint8_t state)
 
/* If there is no power capability, silently succeed */
if (!(sc->devinfo.pcie_cap_flags & BNX2X_PM_CAPABLE_FLAG)) {
-   PMD_DRV_LOG(WARNING, sc, "No power capability");
+   PMD_DRV_LOG(INFO, sc, "No power capability");
return 0;
}
 
@@ -6918,19 +6918,19 @@ static void bnx2x_link_report_locked(struct bnx2x_softc 
*sc)
return;
}
 
-   PMD_DRV_LOG(INFO, sc, "Change in link status : cur_data = %lx, 
last_reported_link = %lx\n",
-   cur_data.link_report_flags,
-   sc->last_reported_link.link_report_flags);
+   ELINK_DEBUG_P2(sc, "Change in link status : cur_data = %lx, 
last_reported_link = %lx",
+  cur_data.link_report_flags,
+  sc->last_reported_link.link_report_flags);
 
sc->link_cnt++;
 
-   PMD_DRV_LOG(INFO, sc, "link status change count = %x\n", sc->link_cnt);
+   ELINK_DEBUG_P1(sc, "link status change count = %x", sc->link_cnt);
/* report new link params and remember the state for the next time */
rte_memcpy(&sc->last_reported_link, &cur_data, sizeof(cur_data));
 
if (bnx2x_test_bit(BNX2X_LINK_REPORT_LINK_DOWN,
 &cur_data.link_report_flags)) {
-   PMD_DRV_LOG(INFO, sc, "NIC Link is Down");
+   ELINK_DEBUG_P0(sc, "NIC Link is Down");
} else {
__rte_unused const char *duplex;
__rte_unused const char *flow;
@@ -6938,8 +6938,10 @@ static void bnx2x_link_report_locked(struct bnx2x_softc 
*sc)
if (bnx2x_test_and_clear_bit(BNX2X_LINK_REPORT_FULL_DUPLEX,
   &cur_data.link_report_flags)) {
duplex = "full";
+   ELINK_DEBUG_P0(sc, "link set to full duplex");
} else {
duplex = "half";
+   ELINK_DEBUG_P0(sc, "link set to half duplex");
}
 
 /*
@@ -7123,7 +7125,7 @@ void bnx2x_periodic_callout(struct bnx2x_softc *sc)
 {
if ((sc->state != BNX2X_STATE_OPEN) ||
(atomic_load_acq_long(&sc->periodic_flags) == PERIODIC_STOP)) {
-   PMD_DRV_LOG(INFO, sc, "periodic callout exit (state=0x%x)",
+   PMD_DRV_LOG(DEBUG, sc, "periodic callout exit (state=0x%x)",
sc->state);
return;
}
@@ -8317,7 +8319,7 @@ static int bnx2x_get_device_info(struct bnx2x_softc *sc)
 ((sc->devinfo.bc_ver >> 24) & 0xff),
 ((sc->devinfo.bc_ver >> 16) & 0xff),
 ((sc->devinfo.bc_ver >> 8) & 0xff));
-   PMD_DRV_LOG(INFO, sc, "Bootcode version: %s", sc->devinfo.bc_ver_str);
+   PMD_DRV_LOG(DEBUG, sc, "Bootcode version: %s", sc->devinfo.bc_ver_str);
 
/* get the bootcode shmem address */
sc->devinfo.mf_cfg_base = bnx2x_get_shmem_mf_cfg_base(sc);
@@ -11743,42 +11745,36 @@ static const char *get_bnx2x_flags(uint32_t flags)
return flag_str;
 }
 
-/*
- * Prints useful adapter info.
- */
+/* Prints useful adapter info. */
 void bnx2x_print_adapter_info(struct bnx2x_softc *sc)
 {
int i = 0;
-   __rte_unused uint32_t ext_phy_type;
 
-   PMD_INIT_FUNC_TRACE(sc);
-   if (sc->link_vars.phy_flags & PHY_XGXS_FLAG)
-   ext_phy_type = ELINK_XGXS_EXT_PHY_TYPE(REG_RD(sc,
- sc->
- devinfo.shmem_base
- + offsetof(struct
-
shmem_region,
-
dev_info.port_hw_config
-
[0].external_phy_config)));
-   else
-   ext_phy_type = ELINK_SERDES_EXT_PHY_TYPE(REG_RD(sc,
-