DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2 00/11] bnx2x: Enhancement, fixes, licensing and doumentation
@ 2015-11-09 23:56 Rasesh Mody
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 01/11] bnx2x: Update VF to support newer PF drivers Rasesh Mody
                   ` (10 more replies)
  0 siblings, 11 replies; 14+ messages in thread
From: Rasesh Mody @ 2015-11-09 23:56 UTC (permalink / raw)
  To: thomas.monjalon; +Cc: dev, sony.chacko

Hi Thomas,

          This patch set consists of enhancements, fixes, licensing and
documentation changes for the QLogic bnx2x Poll Mode Driver. The patches
addresses the review feedback and have been generated and tested against
latest dpdk tree.

This patch set enables the BNX2X PMD and versions the driver at 1.0.0.

Please apply.

Thanks!
Rasesh

Harish Patil (5):
  bnx2x: Update VF to support newer PF drivers
  bnx2x: Fix x86_64-native-linuxapp-clang build error
  bnx2x: Add periodic debug option
  doc: Add BNX2X PMD documentation
  config: Enable BNX2X driver build by default

Rasesh Mody (6):
  bnx2x: Add LICENSE.bnx2x_pmd and update source files
  bnx2x: FreeBSD enablement
  bnx2x: Linux 32bit enablement
  bnx2x: Handle zlib compatibility error
  maintainers: Add maintainers for BNX2X PMD
  bnx2x: Add BNX2X PMD versioning

 MAINTAINERS                         |    6 +-
 config/common_bsdapp                |    5 +-
 config/common_linuxapp              |    5 +-
 doc/guides/nics/bnx2x.rst           |  344 +++++++++++++++++++++++++++++++++++
 drivers/net/bnx2x/LICENSE.bnx2x_pmd |   28 +++
 drivers/net/bnx2x/Makefile          |    4 +-
 drivers/net/bnx2x/bnx2x.c           |  155 +++++++++-------
 drivers/net/bnx2x/bnx2x.h           |   66 +++----
 drivers/net/bnx2x/bnx2x_ethdev.c    |    8 +-
 drivers/net/bnx2x/bnx2x_ethdev.h    |    4 +
 drivers/net/bnx2x/bnx2x_logs.h      |   12 ++
 drivers/net/bnx2x/bnx2x_rxtx.c      |   15 +-
 drivers/net/bnx2x/bnx2x_rxtx.h      |    4 +
 drivers/net/bnx2x/bnx2x_stats.c     |   29 +--
 drivers/net/bnx2x/bnx2x_stats.h     |   27 +--
 drivers/net/bnx2x/bnx2x_vfpf.c      |   19 +-
 drivers/net/bnx2x/bnx2x_vfpf.h      |   19 ++
 drivers/net/bnx2x/debug.c           |   63 +++----
 drivers/net/bnx2x/ecore_fw_defs.h   |   27 +--
 drivers/net/bnx2x/ecore_hsi.h       |   29 +--
 drivers/net/bnx2x/ecore_init.h      |   27 +--
 drivers/net/bnx2x/ecore_init_ops.h  |   45 ++---
 drivers/net/bnx2x/ecore_mfw_req.h   |   27 +--
 drivers/net/bnx2x/ecore_reg.h       |   27 +--
 drivers/net/bnx2x/ecore_sp.c        |   27 +--
 drivers/net/bnx2x/ecore_sp.h        |   33 +---
 drivers/net/bnx2x/elink.c           |   29 +--
 drivers/net/bnx2x/elink.h           |   29 +--
 28 files changed, 665 insertions(+), 448 deletions(-)
 create mode 100644 doc/guides/nics/bnx2x.rst
 create mode 100644 drivers/net/bnx2x/LICENSE.bnx2x_pmd

-- 
1.7.10.3

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH v2 01/11] bnx2x: Update VF to support newer PF drivers
  2015-11-09 23:56 [dpdk-dev] [PATCH v2 00/11] bnx2x: Enhancement, fixes, licensing and doumentation Rasesh Mody
@ 2015-11-09 23:56 ` Rasesh Mody
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 02/11] bnx2x: Fix x86_64-native-linuxapp-clang build error Rasesh Mody
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Rasesh Mody @ 2015-11-09 23:56 UTC (permalink / raw)
  To: thomas.monjalon; +Cc: dev, sony.chacko

From: Harish Patil <harish.patil@qlogic.com>

SR-IOV is supported using bnx2x poll mode driver running as VF driver and
native linux driver running as PF (in host/hypervisor). There is no issue
while running with the PF driver which is at the base version as that of
PMD. However, there is a compatibility issue between newer out-of-box PF
drivers with older VF driver. So the newer VFs would also need to send
BNX2X_VF_TLV_PHYS_PORT_ID (among other TLVs) to differentiate between
newer and older VFs.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
---
 drivers/net/bnx2x/bnx2x_vfpf.c |   11 +++++++++--
 drivers/net/bnx2x/bnx2x_vfpf.h |   15 +++++++++++++++
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnx2x/bnx2x_vfpf.c b/drivers/net/bnx2x/bnx2x_vfpf.c
index 661f0a5..39fd59a 100644
--- a/drivers/net/bnx2x/bnx2x_vfpf.c
+++ b/drivers/net/bnx2x/bnx2x_vfpf.c
@@ -257,8 +257,15 @@ int bnx2x_vf_get_resources(struct bnx2x_softc *sc, uint8_t tx_count, uint8_t rx_
 
 	acq->bulletin_addr = sc->pf2vf_bulletin_mapping.paddr;
 
-	BNX2X_TLV_APPEND(acq, acq->first_tlv.length, BNX2X_VF_TLV_LIST_END,
-			sizeof(struct channel_list_end_tlv));
+	/* Request physical port identifier */
+	BNX2X_TLV_APPEND(acq, acq->first_tlv.length,
+			 BNX2X_VF_TLV_PHYS_PORT_ID,
+			 sizeof(struct channel_tlv));
+
+	BNX2X_TLV_APPEND(acq,
+			 (acq->first_tlv.length + sizeof(struct channel_tlv)),
+			 BNX2X_VF_TLV_LIST_END,
+			 sizeof(struct channel_list_end_tlv));
 
 	/* requesting the resources in loop */
 	obtain_status = bnx2x_loop_obtain_resources(sc);
diff --git a/drivers/net/bnx2x/bnx2x_vfpf.h b/drivers/net/bnx2x/bnx2x_vfpf.h
index 94ce9f0..4f25321 100644
--- a/drivers/net/bnx2x/bnx2x_vfpf.h
+++ b/drivers/net/bnx2x/bnx2x_vfpf.h
@@ -34,12 +34,24 @@ struct vf_resource_query {
 #define	BNX2X_VF_Q_FLAG_DHC             0x0200
 #define	BNX2X_VF_Q_FLAG_LEADING_RSS     0x0400
 
+#define TLV_BUFFER_SIZE			1024
+
+/* general tlv header (used for both vf->pf request and pf->vf response) */
+struct channel_tlv {
+	uint16_t type;
+	uint16_t length;
+};
+
 struct vf_first_tlv {
 	uint16_t type;
 	uint16_t length;
 	uint32_t reply_offset;
 };
 
+struct tlv_buffer_size {
+	uint8_t tlv_buffer[TLV_BUFFER_SIZE];
+};
+
 /* tlv struct for all PF replies except acquire */
 struct vf_common_reply_tlv {
 	uint16_t type;
@@ -244,12 +256,14 @@ union query_tlvs {
 	struct vf_release_tlv		release;
 	struct vf_rss_tlv		update_rss;
 	struct channel_list_end_tlv     list_end;
+	struct tlv_buffer_size		tlv_buf_size;
 };
 
 union resp_tlvs {
 	struct vf_common_reply_tlv	common_reply;
 	struct vf_acquire_resp_tlv	acquire_resp;
 	struct channel_list_end_tlv	list_end;
+	struct tlv_buffer_size		tlv_buf_size;
 };
 
 /* struct allocated by VF driver, PF sends updates to VF via bulletin */
@@ -300,6 +314,7 @@ enum channel_tlvs {
 	BNX2X_VF_TLV_PF_SET_MAC,
 	BNX2X_VF_TLV_PF_SET_VLAN,
 	BNX2X_VF_TLV_UPDATE_RSS,
+	BNX2X_VF_TLV_PHYS_PORT_ID,
 	BNX2X_VF_TLV_MAX
 };
 
-- 
1.7.10.3

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH v2 02/11] bnx2x: Fix x86_64-native-linuxapp-clang build error
  2015-11-09 23:56 [dpdk-dev] [PATCH v2 00/11] bnx2x: Enhancement, fixes, licensing and doumentation Rasesh Mody
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 01/11] bnx2x: Update VF to support newer PF drivers Rasesh Mody
@ 2015-11-09 23:56 ` Rasesh Mody
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 03/11] bnx2x: Add periodic debug option Rasesh Mody
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Rasesh Mody @ 2015-11-09 23:56 UTC (permalink / raw)
  To: thomas.monjalon; +Cc: dev, sony.chacko

From: Harish Patil <harish.patil@qlogic.com>

Fix for the following clang build error:
drivers/net/bnx2x/elink.c:10384:41: error: shifting a
      negative signed value is undefined [-Werror,-Wshift-negative-value]
                vars->eee_status &= ~SHMEM_EEE_1G_ADV <<
                                    ~~~~~~~~~~~~~~~~~ ^
1 error generated.
make[6]: *** [elink.o] Error 1
make[5]: *** [bnx2x] Error 2
make[4]: *** [net] Error 2
make[3]: *** [drivers] Error 2
make[2]: *** [all] Error 2
make[1]: *** [x86_64-native-linuxapp-clang_install] Error 2
make: *** [install] Error 2

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
---
 drivers/net/bnx2x/ecore_hsi.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnx2x/ecore_hsi.h b/drivers/net/bnx2x/ecore_hsi.h
index a4ed9b5..fe72938 100644
--- a/drivers/net/bnx2x/ecore_hsi.h
+++ b/drivers/net/bnx2x/ecore_hsi.h
@@ -2529,7 +2529,7 @@ struct shmem2_region {
 	#define SHMEM_EEE_SUPPORTED_SHIFT	   16
 	#define SHMEM_EEE_ADV_STATUS_MASK	   0x00f00000
 		#define SHMEM_EEE_100M_ADV	   (1<<0)
-		#define SHMEM_EEE_1G_ADV	   (1<<1)
+		#define SHMEM_EEE_1G_ADV	   (1U<<1)
 		#define SHMEM_EEE_10G_ADV	   (1<<2)
 	#define SHMEM_EEE_ADV_STATUS_SHIFT	   20
 	#define	SHMEM_EEE_LP_ADV_STATUS_MASK	   0x0f000000
-- 
1.7.10.3

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH v2 03/11] bnx2x: Add periodic debug option
  2015-11-09 23:56 [dpdk-dev] [PATCH v2 00/11] bnx2x: Enhancement, fixes, licensing and doumentation Rasesh Mody
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 01/11] bnx2x: Update VF to support newer PF drivers Rasesh Mody
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 02/11] bnx2x: Fix x86_64-native-linuxapp-clang build error Rasesh Mody
@ 2015-11-09 23:56 ` Rasesh Mody
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 04/11] doc: Add BNX2X PMD documentation Rasesh Mody
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Rasesh Mody @ 2015-11-09 23:56 UTC (permalink / raw)
  To: thomas.monjalon; +Cc: dev, sony.chacko

From: Harish Patil <harish.patil@qlogic.com>

The periodic debug option is used to collect periodic
events like statistics, register access etc and won't
interfere with user-level messages.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
---
 config/common_bsdapp             |    1 +
 config/common_linuxapp           |    1 +
 drivers/net/bnx2x/Makefile       |    4 ++--
 drivers/net/bnx2x/bnx2x.c        |    6 +++---
 drivers/net/bnx2x/bnx2x.h        |    2 +-
 drivers/net/bnx2x/bnx2x_ethdev.c |    2 +-
 drivers/net/bnx2x/bnx2x_logs.h   |    8 ++++++++
 drivers/net/bnx2x/bnx2x_stats.c  |    2 +-
 drivers/net/bnx2x/debug.c        |   36 ++++++++++++++++++++----------------
 9 files changed, 38 insertions(+), 24 deletions(-)

diff --git a/config/common_bsdapp b/config/common_bsdapp
index fba29e5..74d75cf 100644
--- a/config/common_bsdapp
+++ b/config/common_bsdapp
@@ -234,6 +234,7 @@ CONFIG_RTE_LIBRTE_BNX2X_DEBUG_INIT=n
 CONFIG_RTE_LIBRTE_BNX2X_DEBUG_RX=n
 CONFIG_RTE_LIBRTE_BNX2X_DEBUG_TX=n
 CONFIG_RTE_LIBRTE_BNX2X_MF_SUPPORT=n
+CONFIG_RTE_LIBRTE_BNX2X_DEBUG_PERIODIC=n
 
 #
 # Compile burst-oriented Chelsio Terminator 10GbE/40GbE (CXGBE) PMD
diff --git a/config/common_linuxapp b/config/common_linuxapp
index 7248262..3b4116a 100644
--- a/config/common_linuxapp
+++ b/config/common_linuxapp
@@ -232,6 +232,7 @@ CONFIG_RTE_LIBRTE_BNX2X_DEBUG_INIT=n
 CONFIG_RTE_LIBRTE_BNX2X_DEBUG_RX=n
 CONFIG_RTE_LIBRTE_BNX2X_DEBUG_TX=n
 CONFIG_RTE_LIBRTE_BNX2X_MF_SUPPORT=n
+CONFIG_RTE_LIBRTE_BNX2X_DEBUG_PERIODIC=n
 
 #
 # Compile burst-oriented Chelsio Terminator 10GbE/40GbE (CXGBE) PMD
diff --git a/drivers/net/bnx2x/Makefile b/drivers/net/bnx2x/Makefile
index 87f31b6..13bbc81 100644
--- a/drivers/net/bnx2x/Makefile
+++ b/drivers/net/bnx2x/Makefile
@@ -5,7 +5,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 #
 LIB = librte_pmd_bnx2x.a
 
-CFLAGS += -O3 -g
+CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -DZLIB_CONST
 
@@ -23,7 +23,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += bnx2x_ethdev.c
 SRCS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += ecore_sp.c
 SRCS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += elink.c
 SRCS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += bnx2x_vfpf.c
-SRCS-$(CONFIG_RTE_LIBRTE_BNX2X_DEBUG) += debug.c
+SRCS-$(CONFIG_RTE_LIBRTE_BNX2X_DEBUG_PERIODIC) += debug.c
 
 # this lib depends upon:
 DEPDIRS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += lib/librte_eal lib/librte_ether lib/librte_hash
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index fed7a06..5d41d4f 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -4335,7 +4335,7 @@ static void bnx2x_eq_int(struct bnx2x_softc *sc)
 /* handle eq element */
 		switch (opcode) {
 		case EVENT_RING_OPCODE_STAT_QUERY:
-			PMD_DRV_LOG(DEBUG, "got statistics completion event %d",
+			PMD_DEBUG_PERIODIC_LOG(DEBUG, "got statistics completion event %d",
 				    sc->stats_comp++);
 			/* nothing to do with stats comp */
 			goto next_spqe;
@@ -4486,7 +4486,7 @@ static int bnx2x_handle_sp_tq(struct bnx2x_softc *sc)
 	/* SP events: STAT_QUERY and others */
 	if (status & BNX2X_DEF_SB_IDX) {
 /* handle EQ completions */
-		PMD_DRV_LOG(DEBUG, "---> EQ INTR <---");
+		PMD_DEBUG_PERIODIC_LOG(DEBUG, "---> EQ INTR <---");
 		bnx2x_eq_int(sc);
 		bnx2x_ack_sb(sc, sc->igu_dsb_id, USTORM_ID,
 			   le16toh(sc->def_idx), IGU_INT_NOP, 1);
@@ -4559,7 +4559,7 @@ int bnx2x_intr_legacy(struct bnx2x_softc *sc, int scan_fp)
 		return 0;
 	}
 
-	PMD_DRV_LOG(DEBUG, "Interrupt status 0x%04x", status);
+	PMD_DEBUG_PERIODIC_LOG(DEBUG, "Interrupt status 0x%04x", status);
 	//bnx2x_dump_status_block(sc);
 
 	FOR_EACH_ETH_QUEUE(sc, i) {
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index 867b92a..a5f9f1d 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -1445,7 +1445,7 @@ struct bnx2x_func_init_params {
 #define BAR1 2
 #define BAR2 4
 
-#ifdef RTE_LIBRTE_BNX2X_DEBUG
+#ifdef RTE_LIBRTE_BNX2X_DEBUG_PERIODIC
 uint8_t bnx2x_reg_read8(struct bnx2x_softc *sc, size_t offset);
 uint16_t bnx2x_reg_read16(struct bnx2x_softc *sc, size_t offset);
 uint32_t bnx2x_reg_read32(struct bnx2x_softc *sc, size_t offset);
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c
index 36779ea..d09c72f 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.c
+++ b/drivers/net/bnx2x/bnx2x_ethdev.c
@@ -52,7 +52,7 @@ bnx2x_interrupt_action(struct rte_eth_dev *dev)
 	struct bnx2x_softc *sc = dev->data->dev_private;
 	uint32_t link_status;
 
-	PMD_DRV_LOG(INFO, "Interrupt handled");
+	PMD_DEBUG_PERIODIC_LOG(INFO, "Interrupt handled");
 
 	if (bnx2x_intr_legacy(sc, 0))
 		DELAY_MS(250);
diff --git a/drivers/net/bnx2x/bnx2x_logs.h b/drivers/net/bnx2x/bnx2x_logs.h
index d31c253..32f8c62 100644
--- a/drivers/net/bnx2x/bnx2x_logs.h
+++ b/drivers/net/bnx2x/bnx2x_logs.h
@@ -47,4 +47,12 @@
 #define PMD_DRV_LOG(level, fmt, args...) \
 	PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
 
+#ifdef RTE_LIBRTE_BNX2X_DEBUG_PERIODIC
+#define PMD_DEBUG_PERIODIC_LOG(level, fmt, args...) \
+	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+#else
+#define PMD_DEBUG_PERIODIC_LOG(level, fmt, args...) do { } while(0)
+#endif
+
+
 #endif /* _PMD_LOGS_H_ */
diff --git a/drivers/net/bnx2x/bnx2x_stats.c b/drivers/net/bnx2x/bnx2x_stats.c
index 80260f0..e161f4f 100644
--- a/drivers/net/bnx2x/bnx2x_stats.c
+++ b/drivers/net/bnx2x/bnx2x_stats.c
@@ -105,7 +105,7 @@ bnx2x_storm_stats_post(struct bnx2x_softc *sc)
 		sc->fw_stats_req->hdr.drv_stats_counter =
 			htole16(sc->stats_counter++);
 
-		PMD_DRV_LOG(DEBUG,
+		PMD_DEBUG_PERIODIC_LOG(DEBUG,
 				"sending statistics ramrod %d",
 				le16toh(sc->fw_stats_req->hdr.drv_stats_counter));
 
diff --git a/drivers/net/bnx2x/debug.c b/drivers/net/bnx2x/debug.c
index 9ab4f1d..d8d0c13 100644
--- a/drivers/net/bnx2x/debug.c
+++ b/drivers/net/bnx2x/debug.c
@@ -44,30 +44,32 @@
 void
 bnx2x_reg_write8(struct bnx2x_softc *sc, size_t offset, uint8_t val)
 {
-	PMD_DRV_LOG(DEBUG, "offset=0x%08lx val=0x%02x", offset, val);
-	*((volatile uint8_t*)((uint64_t)sc->bar[BAR0].base_addr + offset)) = val;
+	PMD_DEBUG_PERIODIC_LOG(DEBUG, "offset=0x%08lx val=0x%02x", (unsigned long)offset, val);
+	*((volatile uint8_t*)((uintptr_t)sc->bar[BAR0].base_addr + offset)) = val;
 }
 
 void
 bnx2x_reg_write16(struct bnx2x_softc *sc, size_t offset, uint16_t val)
 {
 	if ((offset % 2) != 0) {
-		PMD_DRV_LOG(DEBUG, "Unaligned 16-bit write to 0x%08lx", offset);
+		PMD_DRV_LOG(NOTICE, "Unaligned 16-bit write to 0x%08lx",
+			    (unsigned long)offset);
 	}
 
-	PMD_DRV_LOG(DEBUG, "offset=0x%08lx val=0x%04x", offset, val);
-	*((volatile uint16_t*)((uint64_t)sc->bar[BAR0].base_addr + offset)) = val;
+	PMD_DEBUG_PERIODIC_LOG(DEBUG, "offset=0x%08lx val=0x%04x", (unsigned long)offset, val);
+	*((volatile uint16_t*)((uintptr_t)sc->bar[BAR0].base_addr + offset)) = val;
 }
 
 void
 bnx2x_reg_write32(struct bnx2x_softc *sc, size_t offset, uint32_t val)
 {
 	if ((offset % 4) != 0) {
-		PMD_DRV_LOG(DEBUG, "Unaligned 32-bit write to 0x%08lx", offset);
+		PMD_DRV_LOG(NOTICE, "Unaligned 32-bit write to 0x%08lx",
+			    (unsigned long)offset);
 	}
 
-	PMD_DRV_LOG(DEBUG, "offset=0x%08lx val=0x%08x", offset, val);
-	*((volatile uint32_t*)((uint64_t)sc->bar[BAR0].base_addr + offset)) = val;
+	PMD_DEBUG_PERIODIC_LOG(DEBUG, "offset=0x%08lx val=0x%08x", (unsigned long)offset, val);
+	*((volatile uint32_t*)((uintptr_t)sc->bar[BAR0].base_addr + offset)) = val;
 }
 
 uint8_t
@@ -75,8 +77,8 @@ bnx2x_reg_read8(struct bnx2x_softc *sc, size_t offset)
 {
 	uint8_t val;
 
-	val = (uint8_t)(*((volatile uint8_t*)((uint64_t)sc->bar[BAR0].base_addr + offset)));
-	PMD_DRV_LOG(DEBUG, "offset=0x%08lx val=0x%02x", offset, val);
+	val = (uint8_t)(*((volatile uint8_t*)((uintptr_t)sc->bar[BAR0].base_addr + offset)));
+	PMD_DEBUG_PERIODIC_LOG(DEBUG, "offset=0x%08lx val=0x%02x", (unsigned long)offset, val);
 
 	return (val);
 }
@@ -87,11 +89,12 @@ bnx2x_reg_read16(struct bnx2x_softc *sc, size_t offset)
 	uint16_t val;
 
 	if ((offset % 2) != 0) {
-		PMD_DRV_LOG(DEBUG, "Unaligned 16-bit read from 0x%08lx", offset);
+		PMD_DRV_LOG(NOTICE, "Unaligned 16-bit read from 0x%08lx",
+			    (unsigned long)offset);
 	}
 
-	val = (uint16_t)(*((volatile uint16_t*)((uint64_t)sc->bar[BAR0].base_addr + offset)));
-	PMD_DRV_LOG(DEBUG, "offset=0x%08lx val=0x%08x", offset, val);
+	val = (uint16_t)(*((volatile uint16_t*)((uintptr_t)sc->bar[BAR0].base_addr + offset)));
+	PMD_DEBUG_PERIODIC_LOG(DEBUG, "offset=0x%08lx val=0x%08x", (unsigned long)offset, val);
 
 	return (val);
 }
@@ -102,12 +105,13 @@ bnx2x_reg_read32(struct bnx2x_softc *sc, size_t offset)
 	uint32_t val;
 
 	if ((offset % 4) != 0) {
-		PMD_DRV_LOG(DEBUG, "Unaligned 32-bit read from 0x%08lx", offset);
+		PMD_DRV_LOG(NOTICE, "Unaligned 32-bit read from 0x%08lx",
+			    (unsigned long)offset);
 		return 0;
 	}
 
-	val = (uint32_t)(*((volatile uint32_t*)((uint64_t)sc->bar[BAR0].base_addr + offset)));
-	PMD_DRV_LOG(DEBUG, "offset=0x%08lx val=0x%08x", offset, val);
+	val = (uint32_t)(*((volatile uint32_t*)((uintptr_t)sc->bar[BAR0].base_addr + offset)));
+	PMD_DEBUG_PERIODIC_LOG(DEBUG, "offset=0x%08lx val=0x%08x", (unsigned long)offset, val);
 
 	return (val);
 }
-- 
1.7.10.3

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH v2 04/11] doc: Add BNX2X PMD documentation
  2015-11-09 23:56 [dpdk-dev] [PATCH v2 00/11] bnx2x: Enhancement, fixes, licensing and doumentation Rasesh Mody
                   ` (2 preceding siblings ...)
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 03/11] bnx2x: Add periodic debug option Rasesh Mody
@ 2015-11-09 23:56 ` Rasesh Mody
  2015-11-13 16:11   ` Mcnamara, John
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 05/11] bnx2x: Add LICENSE.bnx2x_pmd and update source files Rasesh Mody
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 14+ messages in thread
From: Rasesh Mody @ 2015-11-09 23:56 UTC (permalink / raw)
  To: thomas.monjalon; +Cc: dev, sony.chacko

From: Harish Patil <harish.patil@qlogic.com>

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
---
 doc/guides/nics/bnx2x.rst |  324 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 324 insertions(+)
 create mode 100644 doc/guides/nics/bnx2x.rst

diff --git a/doc/guides/nics/bnx2x.rst b/doc/guides/nics/bnx2x.rst
new file mode 100644
index 0000000..613a2b7
--- /dev/null
+++ b/doc/guides/nics/bnx2x.rst
@@ -0,0 +1,324 @@
+..  BSD LICENSE
+    Copyright (c) 2015 QLogic Corporation
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met:
+
+    * Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+    * Neither the name of QLogic Corporation nor the names of its
+    contributors may be used to endorse or promote products derived
+    from this software without specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+BNX2X Poll Mode Driver
+======================
+
+The BNX2X poll mode driver library (**librte_pmd_bnx2x**) implemements support
+for **QLogic 578xx** 10/20 Gbps family of adapters as well as their virtual
+functions (VF) in SR-IOV context. It is supported on several standard Linux
+distros like Red Hat 7.x and SLES12 OS. It is compile-tested under FreeBSD OS.
+
+More information can be found at `QLogic Corporation's Official Website
+<http://www.qlogic.com>`_.
+
+Supported Features
+------------------
+
+BNX2X PMD has support for:
+
+- Base L2 features
+- Unicast/multicast filtering
+- Promiscuous mode
+- Port hardware statistics
+- SR-IOV VF
+
+Non-supported Features
+----------------------
+
+The features not yet supported include:
+
+- TSS (Transmit Side Scaling)
+- RSS (Receive Side Scaling)
+- LRO/TSO offload
+- Checksum offload
+- SR-IOV PF
+
+Co-existence considerations
+---------------------------
+
+- BCM578xx being a CNA can have both NIC and Storage personalities.
+However, coexistence with storage protocol drivers (cnic, bnx2fc and
+bnx2fi) is not supported on the same adapter. So storage personality
+has to be disabled on that adapter when used in DPDK applications.
+
+- For SR-IOV case, bnx2x PMD will be used to bind to SR-IOV VF device and
+linux native kernel driver (bnx2x) will be attached to SR-IOV PF.
+
+
+Supported QLogic NICs
+---------------------
+
+- 578xx
+
+Prerequisites
+-------------
+
+- Requires firmware version **7.2.51.0**. It is inbox on most of the
+  standard linux distros. If it is not available visit
+  `QLogic Driver Download Center <http://driverdownloads.qlogic.com>`
+  to get the required firmware.
+
+Pre-Installation Configuration
+------------------------------
+
+Config File Options
+~~~~~~~~~~~~~~~~~~~
+
+The following options can be modified in the ``.config`` file. Please note that
+enabling debugging options may affect system performance.
+
+- ``CONFIG_RTE_LIBRTE_BNX2X_PMD`` (default **y**)
+
+  Toggle compilation of bnx2x driver.
+
+- ``CONFIG_RTE_LIBRTE_BNX2X_DEBUG`` (default **n**)
+
+  Toggle display of generic debugging messages.
+
+- ``CONFIG_RTE_LIBRTE_BNX2X_DEBUG_INIT`` (default **n**)
+
+  Toggle display of initialization related messages.
+
+- ``CONFIG_RTE_LIBRTE_BNX2X_DEBUG_TX`` (default **n**)
+
+  Toggle display of transmit fast path run-time messages.
+
+- ``CONFIG_RTE_LIBRTE_BNX2X_DEBUG_RX`` (default **n**)
+
+  Toggle display of receive fast path run-time messages.
+
+- ``CONFIG_RTE_LIBRTE_BNX2X_REG_ACCESS`` (default **n**)
+
+  Toggle display of register reads and writes.
+
+
+.. _driver-compilation:
+
+Driver Compilation
+~~~~~~~~~~~~~~~~~~
+
+To compile BNX2X PMD for Linux x86_64 gcc target, run the following "make"
+command:
+
+.. code-block:: console
+
+   cd <DPDK-source-directory>
+   make config T=x86_64-native-linuxapp-gcc install
+
+To compile BNX2X PMD for Linux x86_64 clang target, run the following "make"
+command:
+
+.. code-block:: console
+
+   cd <DPDK-source-directory>
+   make config T=x86_64-native-linuxapp-clang install
+
+To compile BNX2X PMD for FreeBSD x86_64 clang target, run the following "gmake"
+command:
+
+.. code-block:: console
+
+   cd <DPDK-source-directory>
+   gmake config T=x86_64-native-bsdapp-clang install
+
+Linux
+-----
+
+.. _linux-installation:
+
+Linux Installation
+~~~~~~~~~~~~~~~~~~
+
+Sample Application Notes
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+This section demonstrates how to launch **testpmd** with QLogic 578xx
+devices managed by librte_pmd_bnx2x in Linux operating system.
+
+#. Request huge pages:
+
+   .. code-block:: console
+
+      echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages/nr_hugepages
+
+#. Load igb_uio or vfio-pci driver:
+
+   .. code-block:: console
+
+      insmod ./x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
+
+   or
+
+   .. code-block:: console
+
+      modprobe vfio-pci
+
+#. Bind the QLogic adapters to igb_uio or vfio-pci loaded in the previous
+   step:
+
+   .. code-block:: console
+
+      ./tools/dpdk_nic_bind.py --bind igb_uio 0000:84:00.0 0000:84:00.1
+
+   or
+
+   Setup VFIO permissions for regular users and then bind to vfio-pci:
+
+   .. code-block:: console
+
+      sudo chmod a+x /dev/vfio
+
+      sudo chmod 0666 /dev/vfio/*
+
+      ./tools/dpdk_nic_bind.py --bind vfio-pci 0000:84:00.0 0000:84:00.1
+
+#. Start testpmd with basic parameters:
+
+   .. code-block:: console
+
+      ./x86_64-native-linuxapp-gcc/app/testpmd -c 0xf -n 4 -- -i
+
+   Example output:
+
+   .. code-block:: console
+
+      [...]
+      EAL: PCI device 0000:84:00.0 on NUMA socket 1
+      EAL:   probe driver: 14e4:168e rte_bnx2x_pmd
+      EAL:   PCI memory mapped at 0x7f14f6fe5000
+      EAL:   PCI memory mapped at 0x7f14f67e5000
+      EAL:   PCI memory mapped at 0x7f15fbd9b000
+      EAL: PCI device 0000:84:00.1 on NUMA socket 1
+      EAL:   probe driver: 14e4:168e rte_bnx2x_pmd
+      EAL:   PCI memory mapped at 0x7f14f5fe5000
+      EAL:   PCI memory mapped at 0x7f14f57e5000
+      EAL:   PCI memory mapped at 0x7f15fbd4f000
+      Interactive-mode selected
+      Configuring Port 0 (socket 0)
+      PMD: bnx2x_dev_tx_queue_setup(): fp[00] req_bd=512, thresh=512, usable_bd=1020, total_bd=1024, tx_pages=4
+      PMD: bnx2x_dev_rx_queue_setup(): fp[00] req_bd=128, thresh=0, usable_bd=510, total_bd=512, rx_pages=1, cq_pages=8
+      PMD: bnx2x_print_adapter_info():
+      [...]
+      Checking link statuses...
+      Port 0 Link Up - speed 10000 Mbps - full-duplex
+      Port 1 Link Up - speed 10000 Mbps - full-duplex
+      Done
+      testpmd>
+
+SR-IOV: Prerequistes and sample Application Notes
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This section provides instructions to configure SR-IOV with Linux OS.
+
+#. Verify SR-IOV and ARI capabilities are enabled on the adapter using lspci:
+
+   .. code-block:: console
+
+      lspci -s <slot> -vvv
+
+   Example output:
+
+        .. code-block:: console
+
+           [...]
+           Capabilities: [1b8 v1] Alternative Routing-ID Interpretation (ARI)
+           [...]
+           Capabilities: [1c0 v1] Single Root I/O Virtualization (SR-IOV)
+           [...]
+           Kernel driver in use: igb_uio
+
+#. Load the kernel module:
+
+   .. code-block:: console
+
+      modprobe bnx2x
+
+   Example output:
+
+   .. code-block:: console
+
+      systemd-udevd[4848]: renamed network interface eth0 to ens5f0
+      systemd-udevd[4848]: renamed network interface eth1 to ens5f1
+
+#. Bring up the PF ports:
+
+   .. code-block:: console
+
+      ifconfig ens5f0 up
+      ifconfig ens5f1 up
+
+#. Create VF device(s):
+
+   .. code-block:: console
+
+      Echo the number of VFs to be created into "sriov_numvfs" sysfs entry
+      of the parent PF.
+
+   Example output:
+
+        .. code-block:: console
+
+           echo 2 > /sys/devices/pci0000:00/0000:00:03.0/0000:81:00.0/sriov_numvfs
+
+
+#. Assign VF MAC address:
+
+   .. code-block:: console
+
+      Assign MAC address to the VF using iproute2 ulility. The syntax is:
+      ip link set <PF iface> vf <VF id> mac <macaddr>
+
+   Example output:
+
+      .. code-block:: console
+
+      ip link set ens5f0 vf 0 mac 52:54:00:2f:9d:e8
+
+
+#. PCI passthrough:
+
+   .. code-block:: console
+
+      The VF devices may be passthru'ed to the guest VM using virt-manager or virsh etc.
+      bnx2x PMD should be used to bind the VF devices in the guest VM using the instructions
+      outlined in Application notes.
+
+
+FreeBSD
+-------
+
+.. _freebsd-installation:
+
+FreeBSD Installation
+~~~~~~~~~~~~~~~~~~~~
+
+Sample Application Notes
+~~~~~~~~~~~~~~~~~~~~~~~~
-- 
1.7.10.3

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH v2 05/11] bnx2x: Add LICENSE.bnx2x_pmd and update source files
  2015-11-09 23:56 [dpdk-dev] [PATCH v2 00/11] bnx2x: Enhancement, fixes, licensing and doumentation Rasesh Mody
                   ` (3 preceding siblings ...)
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 04/11] doc: Add BNX2X PMD documentation Rasesh Mody
@ 2015-11-09 23:56 ` Rasesh Mody
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 06/11] bnx2x: FreeBSD enablement Rasesh Mody
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Rasesh Mody @ 2015-11-09 23:56 UTC (permalink / raw)
  To: thomas.monjalon; +Cc: dev, sony.chacko

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
---
 drivers/net/bnx2x/LICENSE.bnx2x_pmd |   28 ++++++++++++++++++++++++++++
 drivers/net/bnx2x/bnx2x.c           |   29 ++++-------------------------
 drivers/net/bnx2x/bnx2x.h           |   29 ++++-------------------------
 drivers/net/bnx2x/bnx2x_ethdev.c    |    4 ++++
 drivers/net/bnx2x/bnx2x_ethdev.h    |    4 ++++
 drivers/net/bnx2x/bnx2x_logs.h      |    4 ++++
 drivers/net/bnx2x/bnx2x_rxtx.c      |    4 ++++
 drivers/net/bnx2x/bnx2x_rxtx.h      |    4 ++++
 drivers/net/bnx2x/bnx2x_stats.c     |   27 +++------------------------
 drivers/net/bnx2x/bnx2x_stats.h     |   27 +++------------------------
 drivers/net/bnx2x/bnx2x_vfpf.c      |    4 ++++
 drivers/net/bnx2x/bnx2x_vfpf.h      |    4 ++++
 drivers/net/bnx2x/debug.c           |   27 +++------------------------
 drivers/net/bnx2x/ecore_fw_defs.h   |   27 ++++-----------------------
 drivers/net/bnx2x/ecore_hsi.h       |   27 ++++-----------------------
 drivers/net/bnx2x/ecore_init.h      |   27 +++------------------------
 drivers/net/bnx2x/ecore_init_ops.h  |   27 +++------------------------
 drivers/net/bnx2x/ecore_mfw_req.h   |   27 ++++-----------------------
 drivers/net/bnx2x/ecore_reg.h       |   27 ++++-----------------------
 drivers/net/bnx2x/ecore_sp.c        |   27 +++------------------------
 drivers/net/bnx2x/ecore_sp.h        |   27 +++------------------------
 drivers/net/bnx2x/elink.c           |   29 ++++-------------------------
 drivers/net/bnx2x/elink.h           |   29 ++++-------------------------
 23 files changed, 109 insertions(+), 360 deletions(-)
 create mode 100644 drivers/net/bnx2x/LICENSE.bnx2x_pmd

diff --git a/drivers/net/bnx2x/LICENSE.bnx2x_pmd b/drivers/net/bnx2x/LICENSE.bnx2x_pmd
new file mode 100644
index 0000000..96c7c1e
--- /dev/null
+++ b/drivers/net/bnx2x/LICENSE.bnx2x_pmd
@@ -0,0 +1,28 @@
+/*
+ * BSD LICENSE
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Broadcom Corporation nor the name of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written consent.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 5d41d4f..c149ac5 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -1,37 +1,16 @@
 /*-
- * Copyright (c) 2007-2013 QLogic Corporation. All rights reserved.
+ * Copyright (c) 2007-2013 Broadcom Corporation.
  *
  * Eric Davis        <edavis@broadcom.com>
  * David Christensen <davidch@broadcom.com>
  * Gary Zambrano     <zambrano@broadcom.com>
  *
  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
+ * Copyright (c) 2015 QLogic Corporation.
  * All rights reserved.
+ * www.qlogic.com
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Broadcom Corporation nor the name of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written consent.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #define BNX2X_DRIVER_VERSION "1.78.18"
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index a5f9f1d..b049bd1 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -1,37 +1,16 @@
 /*-
- * Copyright (c) 2007-2013 QLogic Corporation. All rights reserved.
+ * Copyright (c) 2007-2013 Broadcom Corporation.
  *
  * Eric Davis        <edavis@broadcom.com>
  * David Christensen <davidch@broadcom.com>
  * Gary Zambrano     <zambrano@broadcom.com>
  *
  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
+ * Copyright (c) 2015 QLogic Corporation.
  * All rights reserved.
+ * www.qlogic.com
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Broadcom Corporation nor the name of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written consent.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #ifndef __BNX2X_H__
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c
index d09c72f..0117049 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.c
+++ b/drivers/net/bnx2x/bnx2x_ethdev.c
@@ -1,7 +1,11 @@
 /*
  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
  *
+ * Copyright (c) 2015 QLogic Corporation.
  * All rights reserved.
+ * www.qlogic.com
+ *
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #include "bnx2x.h"
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.h b/drivers/net/bnx2x/bnx2x_ethdev.h
index 569bfdf..a9da9de 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.h
+++ b/drivers/net/bnx2x/bnx2x_ethdev.h
@@ -1,7 +1,11 @@
 /*
  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
  *
+ * Copyright (c) 2015 QLogic Corporation.
  * All rights reserved.
+ * www.qlogic.com
+ *
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #ifndef PMD_BNX2X_ETHDEV_H
diff --git a/drivers/net/bnx2x/bnx2x_logs.h b/drivers/net/bnx2x/bnx2x_logs.h
index 32f8c62..dff014d 100644
--- a/drivers/net/bnx2x/bnx2x_logs.h
+++ b/drivers/net/bnx2x/bnx2x_logs.h
@@ -1,7 +1,11 @@
 /*
  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
  *
+ * Copyright (c) 2015 QLogic Corporation.
  * All rights reserved.
+ * www.qlogic.com
+ *
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #ifndef _PMD_LOGS_H_
diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c
index 9379127..c25a898 100644
--- a/drivers/net/bnx2x/bnx2x_rxtx.c
+++ b/drivers/net/bnx2x/bnx2x_rxtx.c
@@ -1,7 +1,11 @@
 /*
  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
  *
+ * Copyright (c) 2015 QLogic Corporation.
  * All rights reserved.
+ * www.qlogic.com
+ *
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #include "bnx2x.h"
diff --git a/drivers/net/bnx2x/bnx2x_rxtx.h b/drivers/net/bnx2x/bnx2x_rxtx.h
index c7a0d70..ccb22fc 100644
--- a/drivers/net/bnx2x/bnx2x_rxtx.h
+++ b/drivers/net/bnx2x/bnx2x_rxtx.h
@@ -1,7 +1,11 @@
 /*
  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
  *
+ * Copyright (c) 2015 QLogic Corporation.
  * All rights reserved.
+ * www.qlogic.com
+ *
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #ifndef _BNX2X_RXTX_H_
diff --git a/drivers/net/bnx2x/bnx2x_stats.c b/drivers/net/bnx2x/bnx2x_stats.c
index e161f4f..c489cbe 100644
--- a/drivers/net/bnx2x/bnx2x_stats.c
+++ b/drivers/net/bnx2x/bnx2x_stats.c
@@ -6,32 +6,11 @@
  * Gary Zambrano     <zambrano@broadcom.com>
  *
  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
+ * Copyright (c) 2015 QLogic Corporation.
  * All rights reserved.
+ * www.qlogic.com
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Broadcom Corporation nor the name of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written consent.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #include "bnx2x.h"
diff --git a/drivers/net/bnx2x/bnx2x_stats.h b/drivers/net/bnx2x/bnx2x_stats.h
index 71fd4c4..3396de3 100644
--- a/drivers/net/bnx2x/bnx2x_stats.h
+++ b/drivers/net/bnx2x/bnx2x_stats.h
@@ -6,32 +6,11 @@
  * Gary Zambrano     <zambrano@broadcom.com>
  *
  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
+ * Copyright (c) 2015 QLogic Corporation.
  * All rights reserved.
+ * www.qlogic.com
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Broadcom Corporation nor the name of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written consent.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #ifndef BNX2X_STATS_H
diff --git a/drivers/net/bnx2x/bnx2x_vfpf.c b/drivers/net/bnx2x/bnx2x_vfpf.c
index 39fd59a..b3fcceb 100644
--- a/drivers/net/bnx2x/bnx2x_vfpf.c
+++ b/drivers/net/bnx2x/bnx2x_vfpf.c
@@ -1,7 +1,11 @@
 /*
  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
  *
+ * Copyright (c) 2015 QLogic Corporation.
  * All rights reserved.
+ * www.qlogic.com
+ *
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #include "bnx2x.h"
diff --git a/drivers/net/bnx2x/bnx2x_vfpf.h b/drivers/net/bnx2x/bnx2x_vfpf.h
index 4f25321..966240c 100644
--- a/drivers/net/bnx2x/bnx2x_vfpf.h
+++ b/drivers/net/bnx2x/bnx2x_vfpf.h
@@ -1,7 +1,11 @@
 /*
  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
  *
+ * Copyright (c) 2015 QLogic Corporation.
  * All rights reserved.
+ * www.qlogic.com
+ *
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #ifndef BNX2X_VFPF_H
diff --git a/drivers/net/bnx2x/debug.c b/drivers/net/bnx2x/debug.c
index d8d0c13..f84925b 100644
--- a/drivers/net/bnx2x/debug.c
+++ b/drivers/net/bnx2x/debug.c
@@ -6,32 +6,11 @@
  * Gary Zambrano     <zambrano@broadcom.com>
  *
  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
+ * Copyright (c) 2015 QLogic Corporation.
  * All rights reserved.
+ * www.qlogic.com
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Broadcom Corporation nor the name of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written consent.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #include "bnx2x.h"
diff --git a/drivers/net/bnx2x/ecore_fw_defs.h b/drivers/net/bnx2x/ecore_fw_defs.h
index 38492cc..ab490ef 100644
--- a/drivers/net/bnx2x/ecore_fw_defs.h
+++ b/drivers/net/bnx2x/ecore_fw_defs.h
@@ -5,30 +5,11 @@
  * David Christensen <davidch@broadcom.com>
  * Gary Zambrano     <zambrano@broadcom.com>
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
+ * Copyright (c) 2014-2015 QLogic Corporation.
+ * All rights reserved.
+ * www.qlogic.com
  *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Broadcom Corporation nor the name of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written consent.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #ifndef ECORE_FW_DEFS_H
diff --git a/drivers/net/bnx2x/ecore_hsi.h b/drivers/net/bnx2x/ecore_hsi.h
index fe72938..a74c8fe 100644
--- a/drivers/net/bnx2x/ecore_hsi.h
+++ b/drivers/net/bnx2x/ecore_hsi.h
@@ -5,30 +5,11 @@
  * David Christensen <davidch@broadcom.com>
  * Gary Zambrano     <zambrano@broadcom.com>
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
+ * Copyright (c) 2014-2015 QLogic Corporation.
+ * All rights reserved.
+ * www.qlogic.com
  *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Broadcom Corporation nor the name of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written consent.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #ifndef ECORE_HSI_H
diff --git a/drivers/net/bnx2x/ecore_init.h b/drivers/net/bnx2x/ecore_init.h
index 7fc5644..d25e280 100644
--- a/drivers/net/bnx2x/ecore_init.h
+++ b/drivers/net/bnx2x/ecore_init.h
@@ -6,32 +6,11 @@
  * Gary Zambrano     <zambrano@broadcom.com>
  *
  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
+ * Copyright (c) 2015 QLogic Corporation.
  * All rights reserved.
+ * www.qlogic.com
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Broadcom Corporation nor the name of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written consent.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #ifndef ECORE_INIT_H
diff --git a/drivers/net/bnx2x/ecore_init_ops.h b/drivers/net/bnx2x/ecore_init_ops.h
index 4357d68..b6f9832 100644
--- a/drivers/net/bnx2x/ecore_init_ops.h
+++ b/drivers/net/bnx2x/ecore_init_ops.h
@@ -6,32 +6,11 @@
  * Gary Zambrano     <zambrano@broadcom.com>
  *
  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
+ * Copyright (c) 2015 QLogic Corporation.
  * All rights reserved.
+ * www.qlogic.com
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Broadcom Corporation nor the name of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written consent.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #ifndef ECORE_INIT_OPS_H
diff --git a/drivers/net/bnx2x/ecore_mfw_req.h b/drivers/net/bnx2x/ecore_mfw_req.h
index 3812d79..5752909 100644
--- a/drivers/net/bnx2x/ecore_mfw_req.h
+++ b/drivers/net/bnx2x/ecore_mfw_req.h
@@ -5,30 +5,11 @@
  * David Christensen <davidch@broadcom.com>
  * Gary Zambrano     <zambrano@broadcom.com>
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
+ * Copyright (c) 2014-2015 QLogic Corporation.
+ * All rights reserved.
+ * www.qlogic.com
  *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Broadcom Corporation nor the name of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written consent.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #ifndef ECORE_MFW_REQ_H
diff --git a/drivers/net/bnx2x/ecore_reg.h b/drivers/net/bnx2x/ecore_reg.h
index 56784d4..d8203b4 100644
--- a/drivers/net/bnx2x/ecore_reg.h
+++ b/drivers/net/bnx2x/ecore_reg.h
@@ -5,30 +5,11 @@
  * David Christensen <davidch@broadcom.com>
  * Gary Zambrano     <zambrano@broadcom.com>
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
+ * Copyright (c) 2014-2015 QLogic Corporation.
+ * All rights reserved.
+ * www.qlogic.com
  *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Broadcom Corporation nor the name of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written consent.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #ifndef ECORE_REG_H
diff --git a/drivers/net/bnx2x/ecore_sp.c b/drivers/net/bnx2x/ecore_sp.c
index 31ab8cf..e6fecd8 100644
--- a/drivers/net/bnx2x/ecore_sp.c
+++ b/drivers/net/bnx2x/ecore_sp.c
@@ -6,32 +6,11 @@
  * Gary Zambrano     <zambrano@broadcom.com>
  *
  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
+ * Copyright (c) 2015 QLogic Corporation.
  * All rights reserved.
+ * www.qlogic.com
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Broadcom Corporation nor the name of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written consent.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #include "bnx2x.h"
diff --git a/drivers/net/bnx2x/ecore_sp.h b/drivers/net/bnx2x/ecore_sp.h
index 2a7545e..8e65584 100644
--- a/drivers/net/bnx2x/ecore_sp.h
+++ b/drivers/net/bnx2x/ecore_sp.h
@@ -6,32 +6,11 @@
  * Gary Zambrano     <zambrano@broadcom.com>
  *
  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
+ * Copyright (c) 2015 QLogic Corporation.
  * All rights reserved.
+ * www.qlogic.com
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Broadcom Corporation nor the name of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written consent.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #ifndef ECORE_SP_H
diff --git a/drivers/net/bnx2x/elink.c b/drivers/net/bnx2x/elink.c
index cb2b1b6..31b18b3 100644
--- a/drivers/net/bnx2x/elink.c
+++ b/drivers/net/bnx2x/elink.c
@@ -1,4 +1,4 @@
-/*-
+/*
  * Copyright (c) 2007-2013 QLogic Corporation. All rights reserved.
  *
  * Eric Davis        <edavis@broadcom.com>
@@ -6,32 +6,11 @@
  * Gary Zambrano     <zambrano@broadcom.com>
  *
  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
+ * Copyright (c) 2015 QLogic Corporation.
  * All rights reserved.
+ * www.qlogic.com
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Broadcom Corporation nor the name of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written consent.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #include "bnx2x.h"
diff --git a/drivers/net/bnx2x/elink.h b/drivers/net/bnx2x/elink.h
index ad5fb43..c4f886a 100644
--- a/drivers/net/bnx2x/elink.h
+++ b/drivers/net/bnx2x/elink.h
@@ -1,4 +1,4 @@
-/*-
+/*
  * Copyright (c) 2007-2013 QLogic Corporation. All rights reserved.
  *
  * Eric Davis        <edavis@broadcom.com>
@@ -6,32 +6,11 @@
  * Gary Zambrano     <zambrano@broadcom.com>
  *
  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
+ * Copyright (c) 2015 QLogic Corporation.
  * All rights reserved.
+ * www.qlogic.com
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Broadcom Corporation nor the name of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written consent.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * See LICENSE.bnx2x_pmd for copyright and licensing details.
  */
 
 #ifndef ELINK_H
-- 
1.7.10.3

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH v2 06/11] bnx2x: FreeBSD enablement
  2015-11-09 23:56 [dpdk-dev] [PATCH v2 00/11] bnx2x: Enhancement, fixes, licensing and doumentation Rasesh Mody
                   ` (4 preceding siblings ...)
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 05/11] bnx2x: Add LICENSE.bnx2x_pmd and update source files Rasesh Mody
@ 2015-11-09 23:56 ` Rasesh Mody
  2015-11-10 10:48   ` Bruce Richardson
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 07/11] bnx2x: Linux 32bit enablement Rasesh Mody
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 14+ messages in thread
From: Rasesh Mody @ 2015-11-09 23:56 UTC (permalink / raw)
  To: thomas.monjalon; +Cc: dev, sony.chacko

Compile tested.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
---
 doc/guides/nics/bnx2x.rst    |   16 ++++++++++++++++
 drivers/net/bnx2x/bnx2x.c    |    9 +++++++++
 drivers/net/bnx2x/bnx2x.h    |   23 +++++++++++++++++++++++
 drivers/net/bnx2x/ecore_sp.h |    6 ++++++
 4 files changed, 54 insertions(+)

diff --git a/doc/guides/nics/bnx2x.rst b/doc/guides/nics/bnx2x.rst
index 613a2b7..b70de04 100644
--- a/doc/guides/nics/bnx2x.rst
+++ b/doc/guides/nics/bnx2x.rst
@@ -141,6 +141,14 @@ command:
    cd <DPDK-source-directory>
    make config T=x86_64-native-linuxapp-clang install
 
+To compile BNX2X PMD for Linux i686 gcc target, run the following "make"
+command:
+
+.. code-block:: console
+
+   cd <DPDK-source-directory>
+   make config T=i686-native-linuxapp-gcc install
+
 To compile BNX2X PMD for FreeBSD x86_64 clang target, run the following "gmake"
 command:
 
@@ -149,6 +157,14 @@ command:
    cd <DPDK-source-directory>
    gmake config T=x86_64-native-bsdapp-clang install
 
+To compile BNX2X PMD for FreeBSD x86_64 gcc target, run the following "gmake"
+command:
+
+.. code-block:: console
+
+   cd <DPDK-source-directory>
+   gmake config T=x86_64-native-bsdapp-gcc install -Wl,-rpath=/usr/local/lib/gcc48 CC=gcc48
+
 Linux
 -----
 
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index c149ac5..f125c79 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -9505,13 +9505,22 @@ static int bnx2x_pci_get_caps(struct bnx2x_softc *sc)
 		return -ENOMEM;
 	}
 
+#ifndef __FreeBSD__
 	pci_read(sc, PCI_STATUS, &status, 2);
 	if (!(status & PCI_STATUS_CAP_LIST)) {
+#else
+	pci_read(sc, PCIR_STATUS, &status, 2);
+	if (!(status & PCIM_STATUS_CAPPRESENT)) {
+#endif
 		PMD_DRV_LOG(NOTICE, "PCIe capability reading failed");
 		return -1;
 	}
 
+#ifndef __FreeBSD__
 	pci_read(sc, PCI_CAPABILITY_LIST, &pci_cap.next, 1);
+#else
+	pci_read(sc, PCIR_CAP_PTR, &pci_cap.next, 1);
+#endif
 	while (pci_cap.next) {
 		cap->addr = pci_cap.next & ~3;
 		pci_read(sc, pci_cap.next & ~3, &pci_cap, 2);
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index b049bd1..0362e4b 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -16,6 +16,12 @@
 #ifndef __BNX2X_H__
 #define __BNX2X_H__
 
+#ifdef __FreeBSD__
+#define __LITTLE_ENDIAN _LITTLE_ENDIAN
+#define __BIG_ENDIAN    _BIG_ENDIAN
+#define __BYTE_ORDER    _BYTE_ORDER
+#endif
+
 #include "bnx2x_ethdev.h"
 
 #if __BYTE_ORDER == __LITTLE_ENDIAN
@@ -47,6 +53,7 @@
 
 #include "elink.h"
 
+#ifndef __FreeBSD__
 #include <linux/pci_regs.h>
 
 #define PCIY_PMG                       PCI_CAP_ID_PM
@@ -68,11 +75,15 @@
 #define PCIM_PSTAT_PMEENABLE           PCI_PM_CTRL_PME_ENABLE
 #define PCIR_MSIX_CTRL                 PCI_MSIX_FLAGS
 #define PCIM_MSIXCTRL_TABLE_SIZE       PCI_MSIX_FLAGS_QSIZE
+#else
+#include <dev/pci/pcireg.h>
+#endif
 
 #define IFM_10G_CX4                    20 /* 10GBase CX4 copper */
 #define IFM_10G_TWINAX                 22 /* 10GBase Twinax copper */
 #define IFM_10G_T                      26 /* 10GBase-T - RJ45 */
 
+#ifndef __FreeBSD__
 #define PCIR_EXPRESS_DEVICE_STA        PCI_EXP_TYPE_RC_EC
 #define PCIM_EXP_STA_TRANSACTION_PND   PCI_EXP_DEVSTA_TRPND
 #define PCIR_EXPRESS_LINK_STA          PCI_EXP_LNKSTA
@@ -81,6 +92,16 @@
 #define PCIR_EXPRESS_DEVICE_CTL        PCI_EXP_DEVCTL
 #define PCIM_EXP_CTL_MAX_PAYLOAD       PCI_EXP_DEVCTL_PAYLOAD
 #define PCIM_EXP_CTL_MAX_READ_REQUEST  PCI_EXP_DEVCTL_READRQ
+#else
+#define PCIR_EXPRESS_DEVICE_STA	PCIER_DEVICE_STA
+#define PCIM_EXP_STA_TRANSACTION_PND   PCIEM_STA_TRANSACTION_PND
+#define PCIR_EXPRESS_LINK_STA          PCIER_LINK_STA
+#define PCIM_LINK_STA_WIDTH            PCIEM_LINK_STA_WIDTH
+#define PCIM_LINK_STA_SPEED            PCIEM_LINK_STA_SPEED
+#define PCIR_EXPRESS_DEVICE_CTL        PCIER_DEVICE_CTL
+#define PCIM_EXP_CTL_MAX_PAYLOAD       PCIEM_CTL_MAX_PAYLOAD
+#define PCIM_EXP_CTL_MAX_READ_REQUEST  PCIEM_CTL_MAX_READ_REQUEST
+#endif
 
 #ifndef ARRAY_SIZE
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
@@ -148,6 +169,7 @@ struct bnx2x_device_type {
 #endif
 #define MCLBYTES                              (1 << MCLSHIFT)
 
+#if !defined(MJUMPAGESIZE)
 #if BNX2X_PAGE_SIZE < 2048
 #define MJUMPAGESIZE    MCLBYTES
 #elif BNX2X_PAGE_SIZE <= 8192
@@ -155,6 +177,7 @@ struct bnx2x_device_type {
 #else
 #define MJUMPAGESIZE    (8 * 1024)
 #endif
+#endif
 #define MJUM9BYTES      (9 * 1024)
 #define MJUM16BYTES     (16 * 1024)
 
diff --git a/drivers/net/bnx2x/ecore_sp.h b/drivers/net/bnx2x/ecore_sp.h
index 8e65584..a0b7b75 100644
--- a/drivers/net/bnx2x/ecore_sp.h
+++ b/drivers/net/bnx2x/ecore_sp.h
@@ -16,6 +16,12 @@
 #ifndef ECORE_SP_H
 #define ECORE_SP_H
 
+#ifdef __FreeBSD__
+#define __LITTLE_ENDIAN _LITTLE_ENDIAN
+#define __BIG_ENDIAN    _BIG_ENDIAN
+#define __BYTE_ORDER    _BYTE_ORDER
+#endif
+
 #if __BYTE_ORDER == __LITTLE_ENDIAN
 #ifndef LITTLE_ENDIAN
 #define LITTLE_ENDIAN
-- 
1.7.10.3

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH v2 07/11] bnx2x: Linux 32bit enablement
  2015-11-09 23:56 [dpdk-dev] [PATCH v2 00/11] bnx2x: Enhancement, fixes, licensing and doumentation Rasesh Mody
                   ` (5 preceding siblings ...)
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 06/11] bnx2x: FreeBSD enablement Rasesh Mody
@ 2015-11-09 23:56 ` Rasesh Mody
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 08/11] bnx2x: Handle zlib compatibility error Rasesh Mody
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Rasesh Mody @ 2015-11-09 23:56 UTC (permalink / raw)
  To: thomas.monjalon; +Cc: dev, sony.chacko

Compile tested.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
---
 drivers/net/bnx2x/bnx2x.h        |   12 ++++++------
 drivers/net/bnx2x/bnx2x_ethdev.c |    2 +-
 drivers/net/bnx2x/bnx2x_rxtx.c   |   11 +++++++----
 drivers/net/bnx2x/bnx2x_vfpf.c   |    4 ++--
 4 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index 0362e4b..55ffbf1 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -1457,22 +1457,22 @@ void bnx2x_reg_write16(struct bnx2x_softc *sc, size_t offset, uint16_t val);
 void bnx2x_reg_write32(struct bnx2x_softc *sc, size_t offset, uint32_t val);
 #else
 #define bnx2x_reg_write8(sc, offset, val)\
-	*((volatile uint8_t*)((uint64_t)sc->bar[BAR0].base_addr + offset)) = val
+	*((volatile uint8_t*)((uintptr_t)sc->bar[BAR0].base_addr + offset)) = val
 
 #define bnx2x_reg_write16(sc, offset, val)\
-	*((volatile uint16_t*)((uint64_t)sc->bar[BAR0].base_addr + offset)) = val
+	*((volatile uint16_t*)((uintptr_t)sc->bar[BAR0].base_addr + offset)) = val
 
 #define bnx2x_reg_write32(sc, offset, val)\
-	*((volatile uint32_t*)((uint64_t)sc->bar[BAR0].base_addr + offset)) = val
+	*((volatile uint32_t*)((uintptr_t)sc->bar[BAR0].base_addr + offset)) = val
 
 #define bnx2x_reg_read8(sc, offset)\
-	(*((volatile uint8_t*)((uint64_t)sc->bar[BAR0].base_addr + offset)))
+	(*((volatile uint8_t*)((uintptr_t)sc->bar[BAR0].base_addr + offset)))
 
 #define bnx2x_reg_read16(sc, offset)\
-	(*((volatile uint16_t*)((uint64_t)sc->bar[BAR0].base_addr + offset)))
+	(*((volatile uint16_t*)((uintptr_t)sc->bar[BAR0].base_addr + offset)))
 
 #define bnx2x_reg_read32(sc, offset)\
-	(*((volatile uint32_t*)((uint64_t)sc->bar[BAR0].base_addr + offset)))
+	(*((volatile uint32_t*)((uintptr_t)sc->bar[BAR0].base_addr + offset)))
 #endif
 
 #define REG_ADDR(sc, offset) (((uint64_t)sc->bar[BAR0].base_addr) + (offset))
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c
index 0117049..69df02e 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.c
+++ b/drivers/net/bnx2x/bnx2x_ethdev.c
@@ -442,7 +442,7 @@ bnx2x_common_dev_init(struct rte_eth_dev *eth_dev, int is_vf)
 	sc->bar[BAR0].base_addr = (void *)pci_dev->mem_resource[0].addr;
 	if (is_vf)
 		sc->bar[BAR1].base_addr = (void *)
-			((uint64_t)pci_dev->mem_resource[0].addr + PXP_VF_ADDR_DB_START);
+			((uintptr_t)pci_dev->mem_resource[0].addr + PXP_VF_ADDR_DB_START);
 	else
 		sc->bar[BAR1].base_addr = pci_dev->mem_resource[2].addr;
 
diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c
index c25a898..0f8b9bd 100644
--- a/drivers/net/bnx2x/bnx2x_rxtx.c
+++ b/drivers/net/bnx2x/bnx2x_rxtx.c
@@ -110,8 +110,10 @@ bnx2x_dev_rx_queue_setup(struct rte_eth_dev *dev,
 
 	PMD_INIT_LOG(DEBUG, "fp[%02d] req_bd=%u, thresh=%u, usable_bd=%lu, "
 		       "total_bd=%lu, rx_pages=%u, cq_pages=%u",
-		       queue_idx, nb_desc, rxq->rx_free_thresh, USABLE_RX_BD(rxq),
-		       TOTAL_RX_BD(rxq), rxq->nb_rx_pages, rxq->nb_cq_pages);
+		       queue_idx, nb_desc, rxq->rx_free_thresh,
+		       (unsigned long)USABLE_RX_BD(rxq),
+		       (unsigned long)TOTAL_RX_BD(rxq), rxq->nb_rx_pages,
+		       rxq->nb_cq_pages);
 
 	/* Allocate RX ring hardware descriptors */
 	dma_size = rxq->nb_rx_desc * sizeof(struct eth_rx_bd);
@@ -291,8 +293,9 @@ bnx2x_dev_tx_queue_setup(struct rte_eth_dev *dev,
 
 	PMD_INIT_LOG(DEBUG, "fp[%02d] req_bd=%u, thresh=%u, usable_bd=%lu, "
 		     "total_bd=%lu, tx_pages=%u",
-		     queue_idx, nb_desc, txq->tx_free_thresh, USABLE_TX_BD(txq),
-		     TOTAL_TX_BD(txq), txq->nb_tx_pages);
+		     queue_idx, nb_desc, txq->tx_free_thresh,
+		     (unsigned long)USABLE_TX_BD(txq),
+		     (unsigned long)TOTAL_TX_BD(txq), txq->nb_tx_pages);
 
 	/* Allocate TX ring hardware descriptors */
 	tsize = txq->nb_tx_desc * sizeof(union eth_tx_bd_types);
diff --git a/drivers/net/bnx2x/bnx2x_vfpf.c b/drivers/net/bnx2x/bnx2x_vfpf.c
index b3fcceb..765cc92 100644
--- a/drivers/net/bnx2x/bnx2x_vfpf.c
+++ b/drivers/net/bnx2x/bnx2x_vfpf.c
@@ -66,8 +66,8 @@ bnx2x_check_bull(struct bnx2x_softc *sc)
 
 /* add tlv to a buffer */
 #define BNX2X_TLV_APPEND(_tlvs, _offset, _type, _length) \
-	((struct vf_first_tlv *)((uint64_t)_tlvs + _offset))->type   = _type; \
-	((struct vf_first_tlv *)((uint64_t)_tlvs + _offset))->length = _length
+	((struct vf_first_tlv *)((unsigned long)_tlvs + _offset))->type   = _type; \
+	((struct vf_first_tlv *)((unsigned long)_tlvs + _offset))->length = _length
 
 /* Initiliaze header of the first tlv and clear mailbox*/
 static void
-- 
1.7.10.3

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH v2 08/11] bnx2x: Handle zlib compatibility error
  2015-11-09 23:56 [dpdk-dev] [PATCH v2 00/11] bnx2x: Enhancement, fixes, licensing and doumentation Rasesh Mody
                   ` (6 preceding siblings ...)
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 07/11] bnx2x: Linux 32bit enablement Rasesh Mody
@ 2015-11-09 23:56 ` Rasesh Mody
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 09/11] maintainers: Add maintainers for BNX2X PMD Rasesh Mody
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Rasesh Mody @ 2015-11-09 23:56 UTC (permalink / raw)
  To: thomas.monjalon; +Cc: dev, sony.chacko

Following error will be reported:

PMD: ecore_gunzip(): Newer version of zlib required, 1.2.5.2 or higher
EAL: Error - exiting with code: 1
  Cause: rte_eth_dev_start:err=-1, port=0

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
---
 doc/guides/nics/bnx2x.rst          |    4 ++++
 drivers/net/bnx2x/bnx2x.c          |   10 +++++++++-
 drivers/net/bnx2x/ecore_init_ops.h |   18 ++++++++++++------
 3 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/doc/guides/nics/bnx2x.rst b/doc/guides/nics/bnx2x.rst
index b70de04..d3912ed 100644
--- a/doc/guides/nics/bnx2x.rst
+++ b/doc/guides/nics/bnx2x.rst
@@ -86,6 +86,10 @@ Prerequisites
   `QLogic Driver Download Center <http://driverdownloads.qlogic.com>`
   to get the required firmware.
 
+- This driver relies on external zlib library for unzipping the firmware image.
+  The zlib library is not part of DPDK and must be installed separately. The
+  minimum version of zlib library required is v1.2.5.2.
+
 Pre-Installation Configuration
 ------------------------------
 
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index f125c79..088c041 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -10029,6 +10029,7 @@ static int bnx2x_init_hw_common(struct bnx2x_softc *sc)
 {
 	uint8_t abs_func_id;
 	uint32_t val;
+	int ret = 0;
 
 	PMD_DRV_LOG(DEBUG, "starting common init for func %d", SC_ABS_FUNC(sc));
 
@@ -10328,7 +10329,9 @@ static int bnx2x_init_hw_common(struct bnx2x_softc *sc)
 		DELAY(20000);
 	}
 
-	ecore_init_block(sc, BLOCK_TSEM, PHASE_COMMON);
+	ret = ecore_init_block(sc, BLOCK_TSEM, PHASE_COMMON);
+	if (ret != 0)
+		return ret;
 	ecore_init_block(sc, BLOCK_USEM, PHASE_COMMON);
 	ecore_init_block(sc, BLOCK_CSEM, PHASE_COMMON);
 	ecore_init_block(sc, BLOCK_XSEM, PHASE_COMMON);
@@ -11567,7 +11570,12 @@ static int ecore_gunzip(struct bnx2x_softc *sc, const uint8_t * zbuf, int len)
 	}
 
 	memset(&zlib_stream, 0, sizeof(zlib_stream));
+#if ZLIB_VERNUM < 0x1252
+	PMD_INIT_LOG(ERR, "Newer version of zlib required, 1.2.5.2 or higher");
+	return Z_VERSION_ERROR;
+#else
 	zlib_stream.next_in = zbuf + data_begin;
+#endif
 	zlib_stream.avail_in = len - data_begin;
 	zlib_stream.next_out = sc->gz_buf;
 	zlib_stream.avail_out = FW_BUF_SIZE;
diff --git a/drivers/net/bnx2x/ecore_init_ops.h b/drivers/net/bnx2x/ecore_init_ops.h
index b6f9832..cd042bb 100644
--- a/drivers/net/bnx2x/ecore_init_ops.h
+++ b/drivers/net/bnx2x/ecore_init_ops.h
@@ -150,18 +150,18 @@ static void ecore_wr_64(struct bnx2x_softc *sc, uint32_t reg, uint32_t val_lo,
 	REG_WR_DMAE_LEN(sc, reg, wb_write, 2);
 }
 
-static void ecore_init_wr_zp(struct bnx2x_softc *sc, uint32_t addr, uint32_t len,
+static int ecore_init_wr_zp(struct bnx2x_softc *sc, uint32_t addr, uint32_t len,
 			     uint32_t blob_off)
 {
 	const uint8_t *data = NULL;
-	int rc;
+	int rc = 0;
 	uint32_t i;
 
 	data = ecore_sel_blob(sc, addr, data) + blob_off*4;
 
 	rc = ecore_gunzip(sc, data, len);
 	if (rc)
-		return;
+		return rc;
 
 	/* gunzip_outlen is in dwords */
 	len = GUNZIP_OUTLEN(sc);
@@ -170,9 +170,11 @@ static void ecore_init_wr_zp(struct bnx2x_softc *sc, uint32_t addr, uint32_t len
 				ECORE_CPU_TO_LE32(((uint32_t *)GUNZIP_BUF(sc))[i]);
 
 	ecore_write_big_buf_wb(sc, addr, len);
+
+	return rc;
 }
 
-static void ecore_init_block(struct bnx2x_softc *sc, uint32_t block, uint32_t stage)
+static int ecore_init_block(struct bnx2x_softc *sc, uint32_t block, uint32_t stage)
 {
 	uint16_t op_start =
 		INIT_OPS_OFFSETS(sc)[BLOCK_OPS_IDX(block, stage,
@@ -183,10 +185,11 @@ static void ecore_init_block(struct bnx2x_softc *sc, uint32_t block, uint32_t st
 	const union init_op *op;
 	uint32_t op_idx, op_type, addr, len;
 	const uint32_t *data, *data_base;
+	int ret = 0;
 
 	/* If empty block */
 	if (op_start == op_end)
-		return;
+		return ret;
 
 	data_base = INIT_DATA(sc);
 
@@ -221,7 +224,9 @@ static void ecore_init_block(struct bnx2x_softc *sc, uint32_t block, uint32_t st
 			ecore_init_fill(sc, addr, 0, op->zero.len);
 			break;
 		case OP_ZP:
-			ecore_init_wr_zp(sc, addr, len, op->arr_wr.data_off);
+			ret = ecore_init_wr_zp(sc, addr, len, op->arr_wr.data_off);
+			if (ret != 0)
+				return ret;
 			break;
 		case OP_WR_64:
 			ecore_init_wr_64(sc, addr, data, len);
@@ -254,6 +259,7 @@ static void ecore_init_block(struct bnx2x_softc *sc, uint32_t block, uint32_t st
 			break;
 		}
 	}
+	return ret;
 }
 
 
-- 
1.7.10.3

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH v2 09/11] maintainers: Add maintainers for BNX2X PMD
  2015-11-09 23:56 [dpdk-dev] [PATCH v2 00/11] bnx2x: Enhancement, fixes, licensing and doumentation Rasesh Mody
                   ` (7 preceding siblings ...)
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 08/11] bnx2x: Handle zlib compatibility error Rasesh Mody
@ 2015-11-09 23:56 ` Rasesh Mody
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 10/11] config: Enable BNX2X driver build by default Rasesh Mody
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 11/11] bnx2x: Add BNX2X PMD versioning Rasesh Mody
  10 siblings, 0 replies; 14+ messages in thread
From: Rasesh Mody @ 2015-11-09 23:56 UTC (permalink / raw)
  To: thomas.monjalon; +Cc: dev, sony.chacko

Add maintainers for BNX2X PMD.
Add file path to BNX2X PMD guide.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
---
 MAINTAINERS |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index c8be5d2..537586b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -281,8 +281,12 @@ M: John McNamara <john.mcnamara@intel.com>
 F: drivers/net/pcap/
 F: doc/guides/nics/pcap_ring.rst
 
-QLogic/Broadcom bnx2x
+QLogic bnx2x
+M: Sony Chacko <sony.chacko@qlogic.com>
+M: Harish Patil <harish.patil@qlogic.com>
+M: Rasesh Mody <rasesh.mody@qlogic.com>
 F: drivers/net/bnx2x/
+F: doc/guides/nics/bnx2x.rst
 
 Ring PMD
 M: Bruce Richardson <bruce.richardson@intel.com>
-- 
1.7.10.3

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH v2 10/11] config: Enable BNX2X driver build by default
  2015-11-09 23:56 [dpdk-dev] [PATCH v2 00/11] bnx2x: Enhancement, fixes, licensing and doumentation Rasesh Mody
                   ` (8 preceding siblings ...)
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 09/11] maintainers: Add maintainers for BNX2X PMD Rasesh Mody
@ 2015-11-09 23:56 ` Rasesh Mody
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 11/11] bnx2x: Add BNX2X PMD versioning Rasesh Mody
  10 siblings, 0 replies; 14+ messages in thread
From: Rasesh Mody @ 2015-11-09 23:56 UTC (permalink / raw)
  To: thomas.monjalon; +Cc: dev, sony.chacko

From: Harish Patil <harish.patil@qlogic.com>

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
---
 config/common_bsdapp   |    4 ++--
 config/common_linuxapp |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/config/common_bsdapp b/config/common_bsdapp
index 74d75cf..5ec5375 100644
--- a/config/common_bsdapp
+++ b/config/common_bsdapp
@@ -226,9 +226,9 @@ CONFIG_RTE_LIBRTE_MLX5_MAX_INLINE=0
 CONFIG_RTE_LIBRTE_MLX5_TX_MP_CACHE=8
 
 #
-# Compile burst-oriented Broadcom PMD driver
+# Compile burst-oriented QLogic BNX2X PMD
 #
-CONFIG_RTE_LIBRTE_BNX2X_PMD=n
+CONFIG_RTE_LIBRTE_BNX2X_PMD=y
 CONFIG_RTE_LIBRTE_BNX2X_DEBUG=n
 CONFIG_RTE_LIBRTE_BNX2X_DEBUG_INIT=n
 CONFIG_RTE_LIBRTE_BNX2X_DEBUG_RX=n
diff --git a/config/common_linuxapp b/config/common_linuxapp
index 3b4116a..9e28dc5 100644
--- a/config/common_linuxapp
+++ b/config/common_linuxapp
@@ -224,9 +224,9 @@ CONFIG_RTE_LIBRTE_MLX5_MAX_INLINE=0
 CONFIG_RTE_LIBRTE_MLX5_TX_MP_CACHE=8
 
 #
-# Compile burst-oriented Broadcom PMD driver
+# Compile burst-oriented QLogic BNX2X PMD
 #
-CONFIG_RTE_LIBRTE_BNX2X_PMD=n
+CONFIG_RTE_LIBRTE_BNX2X_PMD=y
 CONFIG_RTE_LIBRTE_BNX2X_DEBUG=n
 CONFIG_RTE_LIBRTE_BNX2X_DEBUG_INIT=n
 CONFIG_RTE_LIBRTE_BNX2X_DEBUG_RX=n
-- 
1.7.10.3

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH v2 11/11] bnx2x: Add BNX2X PMD versioning
  2015-11-09 23:56 [dpdk-dev] [PATCH v2 00/11] bnx2x: Enhancement, fixes, licensing and doumentation Rasesh Mody
                   ` (9 preceding siblings ...)
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 10/11] config: Enable BNX2X driver build by default Rasesh Mody
@ 2015-11-09 23:56 ` Rasesh Mody
  10 siblings, 0 replies; 14+ messages in thread
From: Rasesh Mody @ 2015-11-09 23:56 UTC (permalink / raw)
  To: thomas.monjalon; +Cc: dev, sony.chacko

Add BNX2X PMD version, print it as part of adapter info.
Adjusted print adapter info output formatting.

This patch versions BNX2X PMD at 1.0.0.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
---
 drivers/net/bnx2x/bnx2x.c |  101 +++++++++++++++++++++++++++++----------------
 1 file changed, 65 insertions(+), 36 deletions(-)

diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 088c041..423a9bf 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -21,6 +21,7 @@
 #include "ecore_init.h"
 #include "ecore_init_ops.h"
 
+#include "rte_version.h"
 #include "rte_pci_dev_ids.h"
 
 #include <sys/types.h>
@@ -28,6 +29,26 @@
 #include <fcntl.h>
 #include <zlib.h>
 
+#define BNX2X_PMD_VER_PREFIX "BNX2X PMD"
+#define BNX2X_PMD_VERSION_MAJOR 1
+#define BNX2X_PMD_VERSION_MINOR 0
+#define BNX2X_PMD_VERSION_PATCH 0
+
+static inline const char *
+bnx2x_pmd_version(void)
+{
+	static char version[32];
+
+	snprintf(version, sizeof(version), "%s %s_%d.%d.%d",
+			BNX2X_PMD_VER_PREFIX,
+			BNX2X_DRIVER_VERSION,
+			BNX2X_PMD_VERSION_MAJOR,
+			BNX2X_PMD_VERSION_MINOR,
+			BNX2X_PMD_VERSION_PATCH);
+
+	return version;
+}
+
 static z_stream zlib_stream;
 
 #define EVL_VLID_MASK 0x0FFF
@@ -11734,87 +11755,95 @@ void bnx2x_print_adapter_info(struct bnx2x_softc *sc)
 
 	PMD_INIT_LOG(DEBUG, "\n\n===================================\n");
 	/* Hardware chip info. */
-	PMD_INIT_LOG(DEBUG, "%10s : %#08x\n", "ASIC", sc->devinfo.chip_id);
-	PMD_INIT_LOG(DEBUG, "%10s : %c%d\n", "Rev", (CHIP_REV(sc) >> 12) + 'A',
+	PMD_INIT_LOG(DEBUG, "%12s : %#08x", "ASIC", sc->devinfo.chip_id);
+	PMD_INIT_LOG(DEBUG, "%12s : %c%d", "Rev", (CHIP_REV(sc) >> 12) + 'A',
 		     (CHIP_METAL(sc) >> 4));
 
 	/* Bus info. */
-	PMD_INIT_LOG(DEBUG, "%10s : %d, ", "Bus PCIe", sc->devinfo.pcie_link_width);
+	PMD_INIT_LOG(DEBUG, "%12s : %d, ", "Bus PCIe", sc->devinfo.pcie_link_width);
 	switch (sc->devinfo.pcie_link_speed) {
 	case 1:
-		PMD_INIT_LOG(DEBUG, "2.5 Gbps\n");
+		PMD_INIT_LOG(DEBUG, "%23s", "2.5 Gbps");
 		break;
 	case 2:
-		PMD_INIT_LOG(DEBUG, "5 Gbps\n");
+		PMD_INIT_LOG(DEBUG, "%21s", "5 Gbps");
 		break;
 	case 4:
-		PMD_INIT_LOG(DEBUG, "8 Gbps\n");
+		PMD_INIT_LOG(DEBUG, "%21s", "8 Gbps");
 		break;
 	default:
-		PMD_INIT_LOG(DEBUG, "Unknown link speed\n");
+		PMD_INIT_LOG(DEBUG, "%33s", "Unknown link speed");
 	}
 
 	/* Device features. */
-	PMD_INIT_LOG(DEBUG, "%10s : ", "Flags");
+	PMD_INIT_LOG(DEBUG, "%12s : ", "Flags");
 
 	/* Miscellaneous flags. */
 	if (sc->devinfo.pcie_cap_flags & BNX2X_MSI_CAPABLE_FLAG) {
-		PMD_INIT_LOG(DEBUG, "MSI");
+		PMD_INIT_LOG(DEBUG, "%18s", "MSI");
 		i++;
 	}
 
 	if (sc->devinfo.pcie_cap_flags & BNX2X_MSIX_CAPABLE_FLAG) {
 		if (i > 0)
 			PMD_INIT_LOG(DEBUG, "|");
-		PMD_INIT_LOG(DEBUG, "MSI-X");
+		PMD_INIT_LOG(DEBUG, "%20s", "MSI-X");
 		i++;
 	}
 
-	PMD_INIT_LOG(DEBUG, "\n");
-
 	if (IS_PF(sc)) {
-		PMD_INIT_LOG(DEBUG, "\n%10s : ", "Queues");
+		PMD_INIT_LOG(DEBUG, "%12s : ", "Queues");
 		switch (sc->sp->rss_rdata.rss_mode) {
 		case ETH_RSS_MODE_DISABLED:
-			PMD_INIT_LOG(DEBUG, "None\n");
+			PMD_INIT_LOG(DEBUG, "%19s", "None");
 			break;
 		case ETH_RSS_MODE_REGULAR:
-			PMD_INIT_LOG(DEBUG, "RSS : %d\n", sc->num_queues);
+			PMD_INIT_LOG(DEBUG, "%18s : %d", "RSS", sc->num_queues);
 			break;
 		default:
-			PMD_INIT_LOG(DEBUG, "Unknown\n");
+			PMD_INIT_LOG(DEBUG, "%22s", "Unknown");
 			break;
 		}
 	}
 
+	/* RTE and Driver versions */
+	PMD_INIT_LOG(DEBUG, "%12s : %s", "DPDK",
+		     rte_version());
+	PMD_INIT_LOG(DEBUG, "%12s : %s", "Driver",
+		     bnx2x_pmd_version());
+
 	/* Firmware versions and device features. */
-	PMD_INIT_LOG(DEBUG, "%10s : %d.%d.%d\n%10s : %s\n",
+	PMD_INIT_LOG(DEBUG, "%12s : %d.%d.%d",
 		     "Firmware",
 		     BNX2X_5710_FW_MAJOR_VERSION,
 		     BNX2X_5710_FW_MINOR_VERSION,
-		     BNX2X_5710_FW_REVISION_VERSION,
+		     BNX2X_5710_FW_REVISION_VERSION);
+	PMD_INIT_LOG(DEBUG, "%12s : %s",
 		     "Bootcode", sc->devinfo.bc_ver_str);
 
-	PMD_INIT_LOG(DEBUG, "===================================\n");
-	PMD_INIT_LOG(DEBUG, "%10s : %u\n", "Bnx2x Func", sc->pcie_func);
-	PMD_INIT_LOG(DEBUG, "%10s : %s\n", "Bnx2x Flags", get_bnx2x_flags(sc->flags));
-	PMD_INIT_LOG(DEBUG, "%10s : %s\n", "DMAE Is",
+	PMD_INIT_LOG(DEBUG, "\n\n===================================\n");
+	PMD_INIT_LOG(DEBUG, "%12s : %u", "Bnx2x Func", sc->pcie_func);
+	PMD_INIT_LOG(DEBUG, "%12s : %s", "Bnx2x Flags", get_bnx2x_flags(sc->flags));
+	PMD_INIT_LOG(DEBUG, "%12s : %s", "DMAE Is",
 		     (sc->dmae_ready ? "Ready" : "Not Ready"));
-	PMD_INIT_LOG(DEBUG, "%10s : %s\n", "OVLAN", (OVLAN(sc) ? "YES" : "NO"));
-	PMD_INIT_LOG(DEBUG, "%10s : %s\n", "MF", (IS_MF(sc) ? "YES" : "NO"));
-	PMD_INIT_LOG(DEBUG, "%10s : %u\n", "MTU", sc->mtu);
-	PMD_INIT_LOG(DEBUG, "%10s : %s\n", "PHY Type", get_ext_phy_type(ext_phy_type));
-	PMD_INIT_LOG(DEBUG, "%10s : ", "MAC Addr");
-	for (i = 0; i < 6; i++)
-		PMD_INIT_LOG(DEBUG, "%x%s", sc->link_params.mac_addr[i],
-			     i < 5 ? ":" : "\n");
-	PMD_INIT_LOG(DEBUG, "%10s : %s\n", "RX Mode", get_rx_mode(sc->rx_mode));
-	PMD_INIT_LOG(DEBUG, "%10s : %s\n", "State", get_state(sc->state));
+	PMD_INIT_LOG(DEBUG, "%12s : %s", "OVLAN", (OVLAN(sc) ? "YES" : "NO"));
+	PMD_INIT_LOG(DEBUG, "%12s : %s", "MF", (IS_MF(sc) ? "YES" : "NO"));
+	PMD_INIT_LOG(DEBUG, "%12s : %u", "MTU", sc->mtu);
+	PMD_INIT_LOG(DEBUG, "%12s : %s", "PHY Type", get_ext_phy_type(ext_phy_type));
+	PMD_INIT_LOG(DEBUG, "%12s : %x:%x:%x:%x:%x:%x", "MAC Addr",
+			sc->link_params.mac_addr[0],
+			sc->link_params.mac_addr[1],
+			sc->link_params.mac_addr[2],
+			sc->link_params.mac_addr[3],
+			sc->link_params.mac_addr[4],
+			sc->link_params.mac_addr[5]);
+	PMD_INIT_LOG(DEBUG, "%12s : %s", "RX Mode", get_rx_mode(sc->rx_mode));
+	PMD_INIT_LOG(DEBUG, "%12s : %s", "State", get_state(sc->state));
 	if (sc->recovery_state)
-		PMD_INIT_LOG(DEBUG, "%10s : %s\n", "Recovery",
+		PMD_INIT_LOG(DEBUG, "%12s : %s", "Recovery",
 			     get_recovery_state(sc->recovery_state));
-	PMD_INIT_LOG(DEBUG, "%10s : CQ = %lx,  EQ = %lx\n", "SPQ Left",
+	PMD_INIT_LOG(DEBUG, "%12s : CQ = %lx,  EQ = %lx", "SPQ Left",
 		     sc->cq_spq_left, sc->eq_spq_left);
-	PMD_INIT_LOG(DEBUG, "%10s : %x\n", "Switch", sc->link_params.switch_cfg);
-	PMD_INIT_LOG(DEBUG, "===================================\n\n");
+	PMD_INIT_LOG(DEBUG, "%12s : %x", "Switch", sc->link_params.switch_cfg);
+	PMD_INIT_LOG(DEBUG, "\n\n===================================\n");
 }
-- 
1.7.10.3

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [dpdk-dev] [PATCH v2 06/11] bnx2x: FreeBSD enablement
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 06/11] bnx2x: FreeBSD enablement Rasesh Mody
@ 2015-11-10 10:48   ` Bruce Richardson
  0 siblings, 0 replies; 14+ messages in thread
From: Bruce Richardson @ 2015-11-10 10:48 UTC (permalink / raw)
  To: Rasesh Mody; +Cc: dev, sony.chacko

On Mon, Nov 09, 2015 at 03:56:21PM -0800, Rasesh Mody wrote:
> Compile tested.
> 
> Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
> ---
>  doc/guides/nics/bnx2x.rst    |   16 ++++++++++++++++
>  drivers/net/bnx2x/bnx2x.c    |    9 +++++++++
>  drivers/net/bnx2x/bnx2x.h    |   23 +++++++++++++++++++++++
>  drivers/net/bnx2x/ecore_sp.h |    6 ++++++
>  4 files changed, 54 insertions(+)
> 
> diff --git a/doc/guides/nics/bnx2x.rst b/doc/guides/nics/bnx2x.rst
> index 613a2b7..b70de04 100644
> --- a/doc/guides/nics/bnx2x.rst
> +++ b/doc/guides/nics/bnx2x.rst
> @@ -141,6 +141,14 @@ command:
>     cd <DPDK-source-directory>
>     make config T=x86_64-native-linuxapp-clang install
>  
> +To compile BNX2X PMD for Linux i686 gcc target, run the following "make"
> +command:
> +
> +.. code-block:: console
> +
> +   cd <DPDK-source-directory>
> +   make config T=i686-native-linuxapp-gcc install
> +

Minor nit, I think this block belongs in the next patch.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [dpdk-dev] [PATCH v2 04/11] doc: Add BNX2X PMD documentation
  2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 04/11] doc: Add BNX2X PMD documentation Rasesh Mody
@ 2015-11-13 16:11   ` Mcnamara, John
  0 siblings, 0 replies; 14+ messages in thread
From: Mcnamara, John @ 2015-11-13 16:11 UTC (permalink / raw)
  To: Rasesh Mody, thomas.monjalon; +Cc: dev, sony.chacko

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Rasesh Mody
> Sent: Monday, November 9, 2015 11:56 PM
> To: thomas.monjalon@6wind.com
> Cc: dev@dpdk.org; sony.chacko@qlogic.com
> Subject: [dpdk-dev] [PATCH v2 04/11] doc: Add BNX2X PMD documentation
>
> From: Harish Patil <harish.patil@qlogic.com>



Hi,

Thanks for the new PMD and the documentation.

The DPDK documentation guidelines provide some guidance on how to format and
build the DPDK documentation:

    http://dpdk.org/doc/guides/contributing/documentation.html

In terms of documentation for a PMD the Mellanox MLX4 docs are a good example:

    http://dpdk.org/doc/guides/nics/mlx4.html

Note, the bnx2x doc needs to be added to doc/guides/nics/index.rst. 

There are also the following build warnings:

    $ make doc-guides-html
    sphinx processing guides-html...

    doc/guides/nics/bnx2x.rst:68:
    WARNING: Bullet list ends without a blank line; unexpected unindent.

    doc/guides/nics/bnx2x.rst:73:
    WARNING: Bullet list ends without a blank line; unexpected unindent.

    doc/guides/nics/bnx2x.rst:321:
    WARNING: duplicate label freebsd-installation, other instance
             in doc/guides/nics/cxgbe.rst

    doc/guides/nics/bnx2x.rst:126:
    WARNING: duplicate label driver-compilation, other instance
             in doc/guides/nics/cxgbe.rst

    doc/guides/nics/bnx2x.rst:158:
    WARNING: duplicate label linux-installation, other instance
             in doc/guides/nics/cxgbe.rst

    doc/guides/nics/bnx2x.rst::
    WARNING: document isn't included in any toctree


Some other comments below:


> +BNX2X Poll Mode Driver
> +======================
> +
> +The BNX2X poll mode driver library (**librte_pmd_bnx2x**) implemements

Implements (check other spelling as well).


> +Co-existence considerations
> +---------------------------
> +
> +- BCM578xx being a CNA can have both NIC and Storage personalities.
> +However, coexistence with storage protocol drivers (cnic, bnx2fc and
> +bnx2fi) is not supported on the same adapter. So storage personality
> +has to be disabled on that adapter when used in DPDK applications.
> +
> +- For SR-IOV case, bnx2x PMD will be used to bind to SR-IOV VF device
> +and linux native kernel driver (bnx2x) will be attached to SR-IOV PF.


The follow-on sentences must be indented to the same level as the bullet
marker, like this:

- BCM578xx being a CNA can have both NIC and Storage personalities.
  However, coexistence with storage protocol drivers (cnic, bnx2fc and
  bnx2fi) is not supported on the same adapter. So storage personality
  has to be disabled on that adapter when used in DPDK applications.


> +- Requires firmware version **7.2.51.0**. It is inbox on most of the
> +  standard linux distros. If it is not available visit
> +  `QLogic Driver Download Center <http://driverdownloads.qlogic.com>`


Missing _ at the end of the link formatting:

    ... <http://driverdownloads.qlogic.com>`_.


> +.. _driver-compilation:

This, and other labels in the doc, aren't unique to the total documentation
and generate warnings.

Either, omit them (I don't see them used) or make them unique by prefixing
the doc name:

    .. _bnx2x_driver_compilation:



> +
> +#. Bind the QLogic adapters to igb_uio or vfio-pci loaded in the previous

It is worth using fixed width font formatting for things like application or
component names:

    #. Load ``igb_uio`` or ``vfio-pci`` driver:

This could be used in other places as well.



> +   step:
> +
> +   .. code-block:: console
> +
> +      ./tools/dpdk_nic_bind.py --bind igb_uio 0000:84:00.0 0000:84:00.1


If you don't need an explicit console block (usually only required for console
input or output) then you can use the simpler format of "::" plus indentation:

      step::

          ./tools/dpdk_nic_bind.py --bind igb_uio 0000:84:00.0 0000:84:00.1


> +      Interactive-mode selected
> +      Configuring Port 0 (socket 0)
> +      PMD: bnx2x_dev_tx_queue_setup(): fp[00] req_bd=512, thresh=512,
> usable_bd=1020, total_bd=1024, tx_pages=4
> +      PMD: bnx2x_dev_rx_queue_setup(): fp[00] req_bd=128, thresh=0,
> usable_bd=510, total_bd=512, rx_pages=1, cq_pages=8
> +      PMD: bnx2x_print_adapter_info():

Lines longer than 80 chars in verbatim/code blocks should be avoided since
they don't render correctly in pdf. The DPDK documentation guidelines
recommend wrapping the lines where possible. The following gives the
same information:


      Configuring Port 0 (socket 0)
      PMD: bnx2x_dev_tx_queue_setup(): fp[00] req_bd=512, thresh=512,
                                       usable_bd=1020, total_bd=1024,
				       tx_pages=4
      PMD: bnx2x_dev_rx_queue_setup(): fp[00] req_bd=128, thresh=0,
                                       usable_bd=510, total_bd=512,
                                       rx_pages=1, cq_pages=8
      PMD: bnx2x_print_adapter_info():



> +
> +#. Create VF device(s):
> +
> +   .. code-block:: console
> +
> +      Echo the number of VFs to be created into "sriov_numvfs" sysfs
> entry
> +      of the parent PF.

This is a paragraph and shouldn't be formatted as a console block. There
are 3-4 examples like this that should be fixed in this section.


> +#. PCI passthrough:
> +
> +   .. code-block:: console
> +
> +      The VF devices may be passthru'ed to the guest VM using virt-
> manager or virsh etc.

Probably better as: passed through



> +      bnx2x PMD should be used to bind the VF devices in the guest VM
> using the instructions
> +      outlined in Application notes.

Probably better as: outlined in the Application notes below.


> +FreeBSD
> +-------
> +
> +.. _freebsd-installation:
> +
> +FreeBSD Installation
> +~~~~~~~~~~~~~~~~~~~~
> +
> +Sample Application Notes
> +~~~~~~~~~~~~~~~~~~~~~~~~


It looks like there is some text missing here. If it is in another patch
it should be moved here.

Thanks,

John.
--

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-11-13 16:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-09 23:56 [dpdk-dev] [PATCH v2 00/11] bnx2x: Enhancement, fixes, licensing and doumentation Rasesh Mody
2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 01/11] bnx2x: Update VF to support newer PF drivers Rasesh Mody
2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 02/11] bnx2x: Fix x86_64-native-linuxapp-clang build error Rasesh Mody
2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 03/11] bnx2x: Add periodic debug option Rasesh Mody
2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 04/11] doc: Add BNX2X PMD documentation Rasesh Mody
2015-11-13 16:11   ` Mcnamara, John
2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 05/11] bnx2x: Add LICENSE.bnx2x_pmd and update source files Rasesh Mody
2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 06/11] bnx2x: FreeBSD enablement Rasesh Mody
2015-11-10 10:48   ` Bruce Richardson
2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 07/11] bnx2x: Linux 32bit enablement Rasesh Mody
2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 08/11] bnx2x: Handle zlib compatibility error Rasesh Mody
2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 09/11] maintainers: Add maintainers for BNX2X PMD Rasesh Mody
2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 10/11] config: Enable BNX2X driver build by default Rasesh Mody
2015-11-09 23:56 ` [dpdk-dev] [PATCH v2 11/11] bnx2x: Add BNX2X PMD versioning Rasesh Mody

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).