[dpdk-dev] Updating http://dpdk.org/doc/nics

2016-07-24 Thread Ajit Khaparde
I don't see the Broadcom NICs listed in the list of supported NICs.
Can you add an entry for the Broadcom NICs supported by the bnxt PMD driver?

Thanks
Ajit


[dpdk-dev] [PATCH v6 00/38] new bnxt poll mode driver library

2016-06-16 Thread Ajit Khaparde
On Thu, Jun 16, 2016 at 9:24 AM, Bruce Richardson <
bruce.richardson at intel.com> wrote:

> On Wed, Jun 15, 2016 at 02:23:00PM -0700, Stephen Hurd wrote:
> > The bnxt poll mode library (librte_pmd_bnxt) implements support for
> > Broadcom NetXtreme C-Series.  These adapters support Standards-
> > compliant 10/25/50Gbps 30MPPS full-duplex throughput.
> >
> > Information about this family of adapters can be found in the
> > NetXtreme Brand section https://goo.gl/4H7q63 of the Broadcom web
> > site http://www.broadcom.com/
> >
> > With the current driver, allocated mbufs must be large enough to hold
> > the entire received frame.  If the mbufs are not large enough, the
> > packets will be dropped.  This is most limiting when jumbo frames are
> > used.
> >
>
> Applied to dpdk-next-net/rel_16_07
>
> On apply I got conflicts with the nic overview document, so please check
> the
> resulting information in that document is correct in the next-net tree.
> I also added a very short entry to the release notes for this new driver as
> part of patch 1, since that was missing. Please also check that for
> correctness
> and send on any additional comments/corrections you want on that.
>
Thanks Bruce. I had a cursory glance ?and it looked good.
We will update the
?m? further
if necessary.
?


> Thanks for all the work on this driver.
>
> Regards,
> /Bruce
>


[dpdk-dev] [PATCH v6 00/38] new bnxt poll mode driver library

2016-06-21 Thread Ajit Khaparde
Bruce,
We have a set of patches which add support to a couple of new Broadcom PCI
devices.
Should I use the dpdk-next-net/rel_16_07 to push them out?
Let me know if there is any other way to do this.

Thanks

On Thu, Jun 16, 2016 at 1:51 PM, Ajit Khaparde 
wrote:

>
> On Thu, Jun 16, 2016 at 9:24 AM, Bruce Richardson <
> bruce.richardson at intel.com> wrote:
>
>> On Wed, Jun 15, 2016 at 02:23:00PM -0700, Stephen Hurd wrote:
>> > The bnxt poll mode library (librte_pmd_bnxt) implements support for
>> > Broadcom NetXtreme C-Series.  These adapters support Standards-
>> > compliant 10/25/50Gbps 30MPPS full-duplex throughput.
>> >
>> > Information about this family of adapters can be found in the
>> > NetXtreme Brand section https://goo.gl/4H7q63 of the Broadcom web
>> > site http://www.broadcom.com/
>> >
>> > With the current driver, allocated mbufs must be large enough to hold
>> > the entire received frame.  If the mbufs are not large enough, the
>> > packets will be dropped.  This is most limiting when jumbo frames are
>> > used.
>> >
>>
>> Applied to dpdk-next-net/rel_16_07
>>
>> On apply I got conflicts with the nic overview document, so please check
>> the
>> resulting information in that document is correct in the next-net tree.
>> I also added a very short entry to the release notes for this new driver
>> as
>> part of patch 1, since that was missing. Please also check that for
>> correctness
>> and send on any additional comments/corrections you want on that.
>>
> Thanks Bruce. I had a cursory glance ?and it looked good.
> We will update the
> ?m? further
> if necessary.
> ?
>
>
>> Thanks for all the work on this driver.
>>
>> Regards,
>> /Bruce
>>
>
>


[dpdk-dev] [PATCH] bnxt: Add Cumulus+ PCI ID

2016-06-21 Thread Ajit Khaparde
This patch adds support for Cumulus+ Ethernet adapters.
These Cumulus+ Ethernet adapters support 10Gb/25Gb/40Gb/50Gb speeds.

Signed-off-by: Ajit Khaparde 
---
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_eal/common/include/rte_pci_dev_ids.h 
b/lib/librte_eal/common/include/rte_pci_dev_ids.h
index 49799e6..ba38a25 100644
--- a/lib/librte_eal/common/include/rte_pci_dev_ids.h
+++ b/lib/librte_eal/common/include/rte_pci_dev_ids.h
@@ -710,6 +710,7 @@ RTE_PCI_DEV_ID_DECL_BNX2X(PCI_VENDOR_ID_BROADCOM, 
BNX2X_DEV_ID_57840_MF)
 #define BROADCOM_DEV_ID_57406_PF   0x16d2
 #define BROADCOM_DEV_ID_57406_VF   0x16d3
 #define BROADCOM_DEV_ID_57406_MF   0x16d4
+#define BROADCOM_DEV_ID_57314  0x16df

 RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57301)
 RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57302)
@@ -720,6 +721,7 @@ RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, 
BROADCOM_DEV_ID_57404)
 RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_PF)
 RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_VF)
 RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_MF)
+RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57314)

 /*
  * Undef all RTE_PCI_DEV_ID_DECL_* here.
-- 
2.7.4 (Apple Git-66)



[dpdk-dev] [PATCH] bnxt: Add Cumulus+ PCI ID

2016-06-24 Thread Ajit Khaparde
On Fri, Jun 24, 2016 at 6:59 AM, Bruce Richardson <
bruce.richardson at intel.com> wrote:

> On Tue, Jun 21, 2016 at 04:58:20PM -0500, Ajit Khaparde wrote:
> > This patch adds support for Cumulus+ Ethernet adapters.
> > These Cumulus+ Ethernet adapters support 10Gb/25Gb/40Gb/50Gb speeds.
> >
> > Signed-off-by: Ajit Khaparde 
>
> Applied to dpdk-next-net/rel_16_07
>
?Thanks Bruce. At what point in time will the changes under rel_16_07
be available in the dpdk tree?
git://dpdk.org/dpdk

?Thanks?

?


>
> /Bruce
>


[dpdk-dev] [PATCH] bnxt: Fix a bug in broadcast/multicast setting

2016-07-04 Thread Ajit Khaparde
Currently we are wrongly setting HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST
flag in bnxt_hwrm_cfa_l2_set_rx_mask() which is preventing promiscuous
and multicast promiscuous settings from working correctly.
This patch fixes it.

Signed-off-by: Ajit Khaparde 
---
 drivers/net/bnxt/bnxt_hwrm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 5d81a60..2ed4c2f 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -177,8 +177,7 @@ int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt *bp, struct 
bnxt_vnic_info *vnic)
mask = HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS;
if (vnic->flags & BNXT_VNIC_INFO_ALLMULTI)
mask = HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST;
-   req.mask = rte_cpu_to_le_32(HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST |
-   HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST |
+   req.mask = rte_cpu_to_le_32(HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST |
mask);

rc = bnxt_hwrm_send_message(bp, , sizeof(req));
-- 
2.7.4 (Apple Git-66)



[dpdk-dev] [PATCH] bnxt: use unsigned short instead of signed integer in bnxt_alloc_vnic_attributes

2016-11-01 Thread Ajit Khaparde
Prevent the arithmetic in bnxt_alloc_vnic_attributes from causing
any unintentional havoc because of the usage of a signed variable.

Coverity: 137874

Signed-off-by: Ajit Khaparde 
---
 drivers/net/bnxt/bnxt_vnic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index 205a940..4cdca35 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -179,7 +179,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table) +
HW_HASH_KEY_SIZE);
uint16_t max_vnics;
-   int i;
+   uint16_t i;

if (BNXT_PF(bp)) {
struct bnxt_pf_info *pf = >pf;
-- 
1.8.3.1



[dpdk-dev] [PATCH 1/2 v2] bnxt: use appropriate data type in bnxt_alloc_vnic_attributes

2016-11-03 Thread Ajit Khaparde
Prevent the arithmetic in bnxt_alloc_vnic_attributes from causing
any unintentional havoc because of the usage of a signed variable.

Coverity: 137874

Signed-off-by: Ajit Khaparde 

--
v2: Previous attempt did not seem complete.
---
 drivers/net/bnxt/bnxt_vnic.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index 205a940..23c85af 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -179,7 +179,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table) +
HW_HASH_KEY_SIZE);
uint16_t max_vnics;
-   int i;
+   uint16_t i;

if (BNXT_PF(bp)) {
struct bnxt_pf_info *pf = >pf;
@@ -197,7 +197,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
mz = rte_memzone_lookup(mz_name);
if (!mz) {
mz = rte_memzone_reserve(mz_name,
-entry_length * max_vnics,
+(uint32_t) entry_length * max_vnics,
 SOCKET_ID_ANY,
 RTE_MEMZONE_2MB |
 RTE_MEMZONE_SIZE_HINT_ONLY);
@@ -210,10 +210,11 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)

/* Allocate rss table and hash key */
vnic->rss_table =
-   (void *)((char *)mz->addr + (entry_length * i));
+   (void *)((char *)mz->addr + ((uint32_t) entry_length * i));
memset(vnic->rss_table, -1, entry_length);

-   vnic->rss_table_dma_addr = mz->phys_addr + (entry_length * i);
+   vnic->rss_table_dma_addr =
+   mz->phys_addr + ((uint32_t) entry_length * i);
vnic->rss_hash_key = (void *)((char *)vnic->rss_table +
 HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table));

-- 
1.8.3.1



[dpdk-dev] [PATCH 1/2 v2] bnxt: use appropriate data type in bnxt_alloc_vnic_attributes

2016-11-04 Thread Ajit Khaparde
On Fri, Nov 4, 2016 at 5:52 AM, Ferruh Yigit  wrote:

> On 11/3/2016 6:58 PM, Ajit Khaparde wrote:
> > Prevent the arithmetic in bnxt_alloc_vnic_attributes from causing
> > any unintentional havoc because of the usage of a signed variable.
> >
> > Coverity: 137874
> >
> > Signed-off-by: Ajit Khaparde 
> >
> > --
> > v2: Previous attempt did not seem complete.
> > ---
> >  drivers/net/bnxt/bnxt_vnic.c | 9 +
> >  1 file changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
> > index 205a940..23c85af 100644
> > --- a/drivers/net/bnxt/bnxt_vnic.c
> > +++ b/drivers/net/bnxt/bnxt_vnic.c
> > @@ -179,7 +179,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
> >   HW_HASH_INDEX_SIZE *
> sizeof(*vnic->rss_table) +
> >   HW_HASH_KEY_SIZE);
> >   uint16_t max_vnics;
> > - int i;
> > + uint16_t i;
> >
> >   if (BNXT_PF(bp)) {
> >   struct bnxt_pf_info *pf = >pf;
> > @@ -197,7 +197,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
> >   mz = rte_memzone_lookup(mz_name);
> >   if (!mz) {
> >   mz = rte_memzone_reserve(mz_name,
> > -  entry_length * max_vnics,
> > +  (uint32_t) entry_length *
> max_vnics,
> >SOCKET_ID_ANY,
> >RTE_MEMZONE_2MB |
> >RTE_MEMZONE_SIZE_HINT_ONLY);
> > @@ -210,10 +210,11 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
> >
> >   /* Allocate rss table and hash key */
> >   vnic->rss_table =
> > - (void *)((char *)mz->addr + (entry_length * i));
> > + (void *)((char *)mz->addr + ((uint32_t) entry_length * i));
> >   memset(vnic->rss_table, -1, entry_length);
> >
> > - vnic->rss_table_dma_addr = mz->phys_addr + (entry_length *
> i);
> > + vnic->rss_table_dma_addr =
> > + mz->phys_addr + ((uint32_t) entry_length * i);
>
> ((uint32_t) entry_length * i)
> casting entry_length to uint32_t will prevent the integer promotion and
> fix the coverity issue, but if this is the case, why not make
> entry_length uint32_t at first place?
>
> It seems "entry_length" converted from "int" to "uint16_t" to prevent
> integer promotion (e8a197d2aa9a), but
> "entry_length * max_vnics" => "uint16_t * uint16_t" or
> "entry_length * i" => "uint16_t * int"
> still causing the promotion.
>
> I guess converting "entry_length" to uint32_t (instead of uint16_t) will
> fix both triaged 127557 and new introduced 137874 coverity issues, and
> it is simpler modification, - if I don't miss anything J
>
?Sounds reasonable to me. I will send a patch in a little while.

Thanks?


>
> Thanks,
> ferruh
>
>
> >   vnic->rss_hash_key = (void *)((char *)vnic->rss_table +
> >HW_HASH_INDEX_SIZE *
> sizeof(*vnic->rss_table));
> >
> >
>
>


[dpdk-dev] [PATCH 1/3 v3] bnxt: use appropriate data type in bnxt_alloc_vnic_attributes

2016-11-04 Thread Ajit Khaparde
Prevent the arithmetic in bnxt_alloc_vnic_attributes from causing
any unintentional havoc because of the usage of a signed variable.

Coverity: 137874

Signed-off-by: Ajit Khaparde 

--
v1: Previous attempt did not seem complete.
v2: simplify the fix by redoing the fix for Coverity 127557
---
 drivers/net/bnxt/bnxt_vnic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index 205a940..33fdde2 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -175,7 +175,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
struct rte_pci_device *pdev = bp->pdev;
const struct rte_memzone *mz;
char mz_name[RTE_MEMZONE_NAMESIZE];
-   uint16_t entry_length = RTE_CACHE_LINE_ROUNDUP(
+   uint32_t entry_length = RTE_CACHE_LINE_ROUNDUP(
HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table) +
HW_HASH_KEY_SIZE);
uint16_t max_vnics;
-- 
1.8.3.1



[dpdk-dev] [PATCH 2/3] bnxt: add a FALLTHROUGH comment in the cascading switch statement

2016-11-04 Thread Ajit Khaparde
The cascading switch statement in bnxt_hwrm.c is missing the FALLTHROUGH
comment. Adding that.

Coverity: 127552

Signed-off-by: Ajit Khaparde 
Acked-by: Ferruh Yigit 
---
 drivers/net/bnxt/bnxt_hwrm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index cf79fc6..07e7124 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -606,6 +606,7 @@ int bnxt_hwrm_ring_alloc(struct bnxt *bp,
switch (ring_type) {
case HWRM_RING_ALLOC_INPUT_RING_TYPE_TX:
req.queue_id = bp->cos_queue[0].id;
+   /* FALLTHROUGH */
case HWRM_RING_ALLOC_INPUT_RING_TYPE_RX:
req.ring_type = ring_type;
req.cmpl_ring_id =
-- 
1.8.3.1



[dpdk-dev] [PATCH 3/3] bnxt: remove support for few PCI IDs

2016-11-04 Thread Ajit Khaparde
Some of the production parts will arrive after the 16.11 release.
Back off support for those devices. We will add these IDs again
at an appropriate time.
---
 drivers/net/bnxt/bnxt_ethdev.c | 30 --
 1 file changed, 30 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 2a95031..035fe07 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -63,34 +63,19 @@ static const char bnxt_version[] =
 #define BROADCOM_DEV_ID_57302 0x16c9
 #define BROADCOM_DEV_ID_57304_PF 0x16ca
 #define BROADCOM_DEV_ID_57304_VF 0x16cb
-#define BROADCOM_DEV_ID_57417_MF 0x16cc
 #define BROADCOM_DEV_ID_NS2 0x16cd
-#define BROADCOM_DEV_ID_57311 0x16ce
-#define BROADCOM_DEV_ID_57312 0x16cf
 #define BROADCOM_DEV_ID_57402 0x16d0
 #define BROADCOM_DEV_ID_57404 0x16d1
 #define BROADCOM_DEV_ID_57406_PF 0x16d2
 #define BROADCOM_DEV_ID_57406_VF 0x16d3
 #define BROADCOM_DEV_ID_57402_MF 0x16d4
 #define BROADCOM_DEV_ID_57407_RJ45 0x16d5
-#define BROADCOM_DEV_ID_57412 0x16d6
-#define BROADCOM_DEV_ID_57414 0x16d7
-#define BROADCOM_DEV_ID_57416_RJ45 0x16d8
-#define BROADCOM_DEV_ID_57417_RJ45 0x16d9
 #define BROADCOM_DEV_ID_5741X_VF 0x16dc
-#define BROADCOM_DEV_ID_57412_MF 0x16de
-#define BROADCOM_DEV_ID_57314 0x16df
-#define BROADCOM_DEV_ID_57317_RJ45 0x16e0
 #define BROADCOM_DEV_ID_5731X_VF 0x16e1
-#define BROADCOM_DEV_ID_57417_SFP 0x16e2
-#define BROADCOM_DEV_ID_57416_SFP 0x16e3
-#define BROADCOM_DEV_ID_57317_SFP 0x16e4
 #define BROADCOM_DEV_ID_57404_MF 0x16e7
 #define BROADCOM_DEV_ID_57406_MF 0x16e8
 #define BROADCOM_DEV_ID_57407_SFP 0x16e9
 #define BROADCOM_DEV_ID_57407_MF 0x16ea
-#define BROADCOM_DEV_ID_57414_MF 0x16ec
-#define BROADCOM_DEV_ID_57416_MF 0x16ee

 static struct rte_pci_id bnxt_pci_id_map[] = {
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57301) },
@@ -103,28 +88,13 @@ static struct rte_pci_id bnxt_pci_id_map[] = {
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_PF) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_VF) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57402_MF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57314) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57407_RJ45) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57404_MF) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_MF) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57407_SFP) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57407_MF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57417_MF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57311) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57312) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57412) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57414) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57416_RJ45) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57417_RJ45) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_5741X_VF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57412_MF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57317_RJ45) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_5731X_VF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57417_SFP) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57416_SFP) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57317_SFP) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57414_MF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57416_MF) },
{ .vendor_id = 0, /* sentinel */ },
 };

-- 
1.8.3.1



[dpdk-dev] [PATCH 3/3 v2] bnxt: remove support for few PCI IDs

2016-11-07 Thread Ajit Khaparde
Some of the production parts will arrive after the 16.11 release.
Back off support for those devices. We will add these IDs again
at an appropriate time.

Signed-off-by: Ajit Khaparde 
--
v2: Adding Signed-off-by which seems to have fallen off in the previous attempt.
---
 drivers/net/bnxt/bnxt_ethdev.c | 30 --
 1 file changed, 30 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 2a95031..035fe07 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -63,34 +63,19 @@ static const char bnxt_version[] =
 #define BROADCOM_DEV_ID_57302 0x16c9
 #define BROADCOM_DEV_ID_57304_PF 0x16ca
 #define BROADCOM_DEV_ID_57304_VF 0x16cb
-#define BROADCOM_DEV_ID_57417_MF 0x16cc
 #define BROADCOM_DEV_ID_NS2 0x16cd
-#define BROADCOM_DEV_ID_57311 0x16ce
-#define BROADCOM_DEV_ID_57312 0x16cf
 #define BROADCOM_DEV_ID_57402 0x16d0
 #define BROADCOM_DEV_ID_57404 0x16d1
 #define BROADCOM_DEV_ID_57406_PF 0x16d2
 #define BROADCOM_DEV_ID_57406_VF 0x16d3
 #define BROADCOM_DEV_ID_57402_MF 0x16d4
 #define BROADCOM_DEV_ID_57407_RJ45 0x16d5
-#define BROADCOM_DEV_ID_57412 0x16d6
-#define BROADCOM_DEV_ID_57414 0x16d7
-#define BROADCOM_DEV_ID_57416_RJ45 0x16d8
-#define BROADCOM_DEV_ID_57417_RJ45 0x16d9
 #define BROADCOM_DEV_ID_5741X_VF 0x16dc
-#define BROADCOM_DEV_ID_57412_MF 0x16de
-#define BROADCOM_DEV_ID_57314 0x16df
-#define BROADCOM_DEV_ID_57317_RJ45 0x16e0
 #define BROADCOM_DEV_ID_5731X_VF 0x16e1
-#define BROADCOM_DEV_ID_57417_SFP 0x16e2
-#define BROADCOM_DEV_ID_57416_SFP 0x16e3
-#define BROADCOM_DEV_ID_57317_SFP 0x16e4
 #define BROADCOM_DEV_ID_57404_MF 0x16e7
 #define BROADCOM_DEV_ID_57406_MF 0x16e8
 #define BROADCOM_DEV_ID_57407_SFP 0x16e9
 #define BROADCOM_DEV_ID_57407_MF 0x16ea
-#define BROADCOM_DEV_ID_57414_MF 0x16ec
-#define BROADCOM_DEV_ID_57416_MF 0x16ee

 static struct rte_pci_id bnxt_pci_id_map[] = {
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57301) },
@@ -103,28 +88,13 @@ static struct rte_pci_id bnxt_pci_id_map[] = {
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_PF) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_VF) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57402_MF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57314) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57407_RJ45) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57404_MF) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_MF) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57407_SFP) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57407_MF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57417_MF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57311) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57312) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57412) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57414) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57416_RJ45) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57417_RJ45) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_5741X_VF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57412_MF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57317_RJ45) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_5731X_VF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57417_SFP) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57416_SFP) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57317_SFP) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57414_MF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57416_MF) },
{ .vendor_id = 0, /* sentinel */ },
 };

-- 
1.8.3.1



[dpdk-dev] [PATCH 2/3] bnxt: add a FALLTHROUGH comment in the cascading switch statement

2016-11-07 Thread Ajit Khaparde
The cascading switch statement in bnxt_hwrm.c is missing the FALLTHROUGH
comment. Adding that.

Coverity: 127552

Signed-off-by: Ajit Khaparde 
Acked-by: Ferruh Yigit 
---
 drivers/net/bnxt/bnxt_hwrm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index cf79fc6..07e7124 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -606,6 +606,7 @@ int bnxt_hwrm_ring_alloc(struct bnxt *bp,
switch (ring_type) {
case HWRM_RING_ALLOC_INPUT_RING_TYPE_TX:
req.queue_id = bp->cos_queue[0].id;
+   /* FALLTHROUGH */
case HWRM_RING_ALLOC_INPUT_RING_TYPE_RX:
req.ring_type = ring_type;
req.cmpl_ring_id =
-- 
1.8.3.1



[dpdk-dev] [PATCH 1/3 v3] bnxt: use appropriate data type in bnxt_alloc_vnic_attributes

2016-11-07 Thread Ajit Khaparde
Prevent the arithmetic in bnxt_alloc_vnic_attributes from causing
any unintentional havoc because of the usage of a signed variable.

Coverity: 137874

Signed-off-by: Ajit Khaparde 

--
v1: attempt did not seem complete.
v2: simplify the fix by redoing the fix for Coverity 127557
---
 drivers/net/bnxt/bnxt_vnic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index 205a940..33fdde2 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -175,7 +175,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
struct rte_pci_device *pdev = bp->pdev;
const struct rte_memzone *mz;
char mz_name[RTE_MEMZONE_NAMESIZE];
-   uint16_t entry_length = RTE_CACHE_LINE_ROUNDUP(
+   uint32_t entry_length = RTE_CACHE_LINE_ROUNDUP(
HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table) +
HW_HASH_KEY_SIZE);
uint16_t max_vnics;
-- 
1.8.3.1



[dpdk-dev] [PATCH] net/bnxt: fix a segfault encountered during PMD exit

2016-11-15 Thread Ajit Khaparde
This patch fixes segfault encountered during dev_uninit/close routine.
KNI sample app can be used to reproduce the issue.

backported from upstream commit 316e412

Cc: 
Signed-off-by: Ajit Khaparde 
---
 drivers/net/bnxt/bnxt.h|  1 +
 drivers/net/bnxt/bnxt_ethdev.c | 28 ++--
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index df1f771..0e21ace 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -171,6 +171,7 @@ struct bnxt {

struct bnxt_pf_info pf;
struct bnxt_vf_info vf;
+   uint8_t dev_stopped;
 };

 #endif
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 3795fac..deeb54c 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -384,6 +384,7 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
int rc;

+   bp->dev_stopped = 0;
rc = bnxt_hwrm_func_reset(bp);
if (rc) {
RTE_LOG(ERR, PMD, "hwrm chip reset failure rc: %x\n", rc);
@@ -427,16 +428,6 @@ static int bnxt_dev_set_link_down_op(struct rte_eth_dev 
*eth_dev)
return 0;
 }

-static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
-{
-   struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
-
-   bnxt_free_tx_mbufs(bp);
-   bnxt_free_rx_mbufs(bp);
-   bnxt_free_mem(bp);
-   rte_free(eth_dev->data->mac_addrs);
-}
-
 /* Unload the driver, release resources */
 static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
 {
@@ -449,6 +440,19 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
bnxt_shutdown_nic(bp);
 }

+static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
+{
+   struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
+
+   if (bp->dev_stopped == 0)
+   bnxt_dev_stop_op(eth_dev);
+
+   bnxt_free_tx_mbufs(bp);
+   bnxt_free_rx_mbufs(bp);
+   bnxt_free_mem(bp);
+   rte_free(eth_dev->data->mac_addrs);
+}
+
 static void bnxt_mac_addr_remove_op(struct rte_eth_dev *eth_dev,
uint32_t index)
 {
@@ -1021,6 +1025,8 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
eth_dev->pci_dev->mem_resource[0].phys_addr,
eth_dev->pci_dev->mem_resource[0].addr);

+   bp->dev_stopped = 0;
+
return 0;

 error_free:
@@ -1040,6 +1046,8 @@ bnxt_dev_uninit(struct rte_eth_dev *eth_dev) {
rte_free(bp->grp_info);
rc = bnxt_hwrm_func_driver_unregister(bp, 0);
bnxt_free_hwrm_resources(bp);
+   if (bp->dev_stopped == 0)
+   bnxt_dev_close_op(eth_dev);
return rc;
 }

-- 
2.8.4 (Apple Git-73)



[dpdk-dev] [PATCH v12 0/6] add Tx preparation

2016-11-30 Thread Ajit Khaparde
On Mon,
??
Nov 28, 2016 at 5:03 AM, Thomas Monjalon  wrote:

> We need attention of every PMD developers on this thread.
>
> Reminder of what Konstantin suggested:
> "
> - if the PMD supports TX offloads AND
> - if to be able use any of these offloads the upper layer SW would have to:
> * modify the contents of the packet OR
> * obey HW specific restrictions
> then it is a PMD developer responsibility to provide tx_prep() that would
> implement
> expected modifications of the packet contents and restriction checks.
> Otherwise, tx_prep() implementation is not required and can be safely set
> to NULL.
> "
>
> I copy/paste also my previous conclusion:
>
> Before txprep, there is only one API: the application must prepare the
> packets checksum itself (get_psd_sum in testpmd).
> With txprep, the application have 2 choices: keep doing the job itself
> or call txprep which calls a PMD-specific function.
> The question is: does non-Intel drivers need a checksum preparation for
> TSO?
> Will it behave well if txprep does nothing in these drivers?
>
> When looking at the code, most of drivers handle the TSO flags.
> But it is hard to know whether they rely on the pseudo checksum or not.
>
> git grep -l 'PKT_TX_UDP_CKSUM\|PKT_TX_TCP_CKSUM\|PKT_TX_TCP_SEG'
> drivers/net/
>
> drivers/net/bnxt/bnxt_txr.c
>
?::: snip:::
?


>
> Please, we need a comment for each driver saying
> "it is OK, we do not need any checksum preparation for TSO"
> or
> "yes we have to implement tx_prepare or TSO will not work in this mode"
>

?The bnxt devices
 don't need pse
??
udo header checksum in the packet for TSO or TX
checksum offload.
? So..
?
"it is OK, we do not need any checksum preparation for TSO"


[dpdk-dev] [PATCH 1/4] testpmd: Add support to configure 25G and 50G speeds

2016-10-10 Thread Ajit Khaparde
On Mon, Oct 10, 2016 at 10:01 AM, Ferruh Yigit 
wrote:

> Hi Ajit,
>
> On 9/29/2016 6:03 PM, Ajit Khaparde wrote:
> > Support to configure 25G and 50G speeds is missing from testpmd.
> > This patch also updates the testpmd user guide accordingly.
> >
> > Signed-off-by: Ajit Khaparde 
>
> This patch seems not really part of the patchset for bnxt driver, but
> standalone testpmd only modification,
> ??
> and can be threaded as single patch.
>
?OK. Got it.
I had worked on this change in the middle of other things.
?So it got bundled along with other bnxt patches.


>
> I am adding testpmd maintainer to cc.
>
?Let me know if you want me to send it again as a standalone patch.

Thanks?


>
> Thanks,
> ferruh
>
>


[dpdk-dev] [PATCH 2/4] bnxt: Fix a segfault encountered during KNI exit

2016-10-10 Thread Ajit Khaparde
On Mon, Oct 10, 2016 at 10:24 AM, Ferruh Yigit 
wrote:

> On 9/29/2016 8:06 PM, Ajit Khaparde wrote:
> > On Thu, Sep 29, 2016 at 12:41 PM, Ferruh Yigit  > <mailto:ferruh.yigit at intel.com>>wrote:
> >
> > On 9/29/2016 6:03 PM, Ajit Khaparde wrote:
> > > The bnxt PMD is running into a segfault when exiting out of KNI
> >
> > KNI?
> >
> > examples/kni
> >
> > ?On closing the kni app, I am seeing a segfault.? because of improper
> > cleanup of resources
> > in the dev_uninit path.
>
> So this is mainly related to driver exit, KNI app is just a way to
> reproduce it.
>
> Are you OK with following update in commit log:
>
> "
> net/bnxt: fix a segfault encountered during PMD exit
>
> This patch fixes segfault encountered during dev_uninit/close routine.
> KNI sample app can be used to reproduce the issue.
> "
>
?I am OK with this Ferruh.

Thanks?


[dpdk-dev] [PATCH v2 4/4] net/bnxt: add ULL suffix to constant 1 for bit shift in bnxt_mac_addr_remove_op

2016-10-10 Thread Ajit Khaparde
On Thu, Sep 29, 2016 at 12:39 PM, John W. Linville 
wrote:

> Some(?) compilers will treat the unmarked constant 1 as a 32-bit
> integer, but the shift operation is in a loop that could run up to
> 63 times -- undefined behavior!
>
> Coverity issue: 127546
> Fixes: 778b759ba10e ("net/bnxt: add MAC address")
>
> Signed-off-by: John W. Linville 
>
?Acked
-by: Ajit Khaparde 


> ---
> v2: fix-up changelog entries based-on comments from Ferruh Yigit
>
>  drivers/net/bnxt/bnxt_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev
> .c
> index f4eedfd812bb..d7447b15983b 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -463,7 +463,7 @@ static void bnxt_mac_addr_remove_op(struct rte_eth_dev
> *eth_dev,
>  * remove the corresponding MAC addr filter
>  */
> for (i = 0; i < MAX_FF_POOLS; i++) {
> -   if (!(pool_mask & (1 << i)))
> +   if (!(pool_mask & (1ULL << i)))
> continue;
>
> STAILQ_FOREACH(vnic, >ff_pool[i], next) {
> --
> 2.7.4
>
>


[dpdk-dev] [PATCH 3/4] bnxt: Add support for Async Link Notification

2016-10-10 Thread Ajit Khaparde
On Mon, Oct 10, 2016 at 10:40 AM, Ferruh Yigit 
wrote:

> Hi Ajit,
>
> On 9/29/2016 6:03 PM, Ajit Khaparde wrote:
> > This patch adds support to get Link notification asynchronously.
> > The HW sends Async notifications on default completion ring. The
> > PMD processes these notifications and logs a message appropriately.
> >
> > Signed-off-by: Ajit Khaparde 
> > ---
> >  drivers/net/bnxt/Makefile  |   1 +
> >  drivers/net/bnxt/bnxt.h|   6 +-
> >  drivers/net/bnxt/bnxt_cpr.c|  21 +++---
> >  drivers/net/bnxt/bnxt_ethdev.c | 114 ++
> >  drivers/net/bnxt/bnxt_hwrm.c   |  93 
> >  drivers/net/bnxt/bnxt_irq.c| 156 ++
> +++
> >  drivers/net/bnxt/bnxt_irq.h|  51 ++
> >  7 files changed, 367 insertions(+), 75 deletions(-)
> >  create mode 100644 drivers/net/bnxt/bnxt_irq.c
> >  create mode 100644 drivers/net/bnxt/bnxt_irq.h
> >
>
> <...>
>
> > +static inline int
> > +rte_bnxt_atomic_read_link_status(struct rte_eth_dev *eth_dev,
> > + struct rte_eth_link *link)
> > +{
> > + struct rte_eth_link *dst = link;
> > + struct rte_eth_link *src = _dev->data->dev_link;
> > +
> > + if (rte_atomic64_cmpset((uint64_t *)dst, *(uint64_t *)dst,
> > + *(uint64_t *)src) == 0)
> > + return 1;
> > +
> > + return 0;
> > +}
> > +
>
> This creates a compilation error:
> .../drivers/net/bnxt/bnxt_ethdev.c:444:1:
> error: unused function 'rte_bnxt_atomic_read_link_status'
> [-Werror,-Wunused-function]
> rte_bnxt_atomic_read_link_status(struct rte_eth_dev *eth_dev,
> ^
>
> Since the patches in this patchet really not related, it is OK to send a
> ??
> new version of just this patch.
>
?Sure. Let me respin it. Thanks
?


>
> Thanks,
> ferruh
>
>


[dpdk-dev] [PATCH v2] bnxt: Add support for Async Link Notification

2016-10-11 Thread Ajit Khaparde
This patch adds support to get Link notification asynchronously.
The HW sends Async notifications on default completion ring. The
PMD processes these notifications and logs a message appropriately.

Signed-off-by: Ajit Khaparde 

--
v2: Remove unused function rte_bnxt_atomic_read_link_status which
was causing a compilation error.
---
 drivers/net/bnxt/Makefile  |   1 +
 drivers/net/bnxt/bnxt.h|   6 +-
 drivers/net/bnxt/bnxt_cpr.c|  21 +++---
 drivers/net/bnxt/bnxt_ethdev.c | 100 ++
 drivers/net/bnxt/bnxt_hwrm.c   |  93 
 drivers/net/bnxt/bnxt_irq.c| 156 +
 drivers/net/bnxt/bnxt_irq.h|  51 ++
 7 files changed, 353 insertions(+), 75 deletions(-)
 create mode 100644 drivers/net/bnxt/bnxt_irq.c
 create mode 100644 drivers/net/bnxt/bnxt_irq.h

diff --git a/drivers/net/bnxt/Makefile b/drivers/net/bnxt/Makefile
index d9c5a4c..65aaa92 100644
--- a/drivers/net/bnxt/Makefile
+++ b/drivers/net/bnxt/Makefile
@@ -59,6 +59,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_stats.c
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_txq.c
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_txr.c
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_vnic.c
+SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_irq.c

 #
 # Export include files
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 07b4cf2..4418c7f 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -95,7 +95,7 @@ struct bnxt_pf_info {
 #define BNXT_LINK_WAIT_CNT 10
 #define BNXT_LINK_WAIT_INTERVAL100
 struct bnxt_link_info {
-   uint8_t phy_flags;
+   uint32_tphy_flags;
uint8_t mac_type;
uint8_t phy_link_status;
uint8_t loop_back;
@@ -159,6 +159,8 @@ struct bnxt {
 #define MAX_FF_POOLS   ETH_64_POOLS
STAILQ_HEAD(, bnxt_vnic_info)   ff_pool[MAX_FF_POOLS];

+   struct bnxt_irq *irq_tbl;
+
 #define MAX_NUM_MAC_ADDR   32
uint8_t mac_addr[ETHER_ADDR_LEN];

@@ -178,4 +180,6 @@ struct bnxt {
uint8_t dev_stopped;
 };

+int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_complete);
+
 #endif
diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index e9f9741..3aedcb8 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -42,28 +42,23 @@
 /*
  * Async event handling
  */
-void bnxt_handle_async_event(struct bnxt *bp __rte_unused,
+void bnxt_handle_async_event(struct bnxt *bp,
 struct cmpl_base *cmp)
 {
struct hwrm_async_event_cmpl *async_cmp =
(struct hwrm_async_event_cmpl *)cmp;
+   uint16_t event_id = rte_le_to_cpu_16(async_cmp->event_id);

/* TODO: HWRM async events are not defined yet */
/* Needs to handle: link events, error events, etc. */
-   switch (async_cmp->event_id) {
-   case 0:
-   /* Assume LINK_CHANGE == 0 */
-   RTE_LOG(INFO, PMD, "Link change event\n");
-
-   /* Can just prompt the update_op routine to do a qcfg
-* instead of doing the actual qcfg
-*/
-   break;
-   case 1:
+   switch (event_id) {
+   case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE:
+   case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE:
+   case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE:
+   bnxt_link_update_op(bp->eth_dev, 0);
break;
default:
-   RTE_LOG(ERR, PMD, "handle_async_event id = 0x%x\n",
-   async_cmp->event_id);
+   RTE_LOG(ERR, PMD, "handle_async_event id = 0x%x\n", event_id);
break;
}
 }
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 86f4c45..e30f976 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -43,6 +43,7 @@
 #include "bnxt_cpr.h"
 #include "bnxt_filter.h"
 #include "bnxt_hwrm.h"
+#include "bnxt_irq.h"
 #include "bnxt_ring.h"
 #include "bnxt_rxq.h"
 #include "bnxt_rxr.h"
@@ -189,6 +190,7 @@ alloc_mem_err:
 static int bnxt_init_chip(struct bnxt *bp)
 {
unsigned int i, rss_idx, fw_idx;
+   struct rte_eth_link new;
int rc;

rc = bnxt_alloc_all_hwrm_stat_ctxs(bp);
@@ -275,6 +277,21 @@ static int bnxt_init_chip(struct bnxt *bp)
goto err_out;
}

+   rc = bnxt_get_hwrm_link_config(bp, );
+   if (rc) {
+   RTE_LOG(ERR, PMD, "HWRM Get link config failure rc: %x\n", rc);
+   goto err_out;
+   }
+
+   if (!bp->link_info.link_up) {
+   rc = bnxt_set_hwrm_link_config(bp, true);
+ 

[dpdk-dev] [PATCH v2] app/testpmd: add support to configure 25G and 50G speeds

2016-10-12 Thread Ajit Khaparde
Support to configure 25G and 50G speeds is missing from testpmd.
This patch also updates the testpmd user guide accordingly.

Signed-off-by: Ajit Khaparde 
--
v2: shorten lines > 80 character limit
---
 app/test-pmd/cmdline.c  | 16 +++-
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  2 +-
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index a1da8b8..b8c7b8b 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -545,7 +545,7 @@ static void cmd_help_long_parsed(void *parsed_result,
"Detach physical or virtual dev by port_id\n\n"

"port config (port_id|all)"
-   " speed (10|100|1000|1|4|10|auto)"
+   " speed 
(10|100|1000|1|25000|4|5|10|auto)"
" duplex (half|full|auto)\n"
"Set speed and duplex for all ports or port_id\n\n"

@@ -1016,8 +1016,12 @@ parse_and_check_speed_duplex(char *speedstr, char 
*duplexstr, uint32_t *speed)
*speed = ETH_LINK_SPEED_1G;
} else if (!strcmp(speedstr, "1")) {
*speed = ETH_LINK_SPEED_10G;
+   } else if (!strcmp(speedstr, "25000")) {
+   *speed = ETH_LINK_SPEED_25G;
} else if (!strcmp(speedstr, "4")) {
*speed = ETH_LINK_SPEED_40G;
+   } else if (!strcmp(speedstr, "5")) {
+   *speed = ETH_LINK_SPEED_50G;
} else if (!strcmp(speedstr, "10")) {
*speed = ETH_LINK_SPEED_100G;
} else if (!strcmp(speedstr, "auto")) {
@@ -1067,7 +1071,7 @@ cmdline_parse_token_string_t cmd_config_speed_all_item1 =
TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, item1, "speed");
 cmdline_parse_token_string_t cmd_config_speed_all_value1 =
TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, value1,
-   
"10#100#1000#1#4#10#auto");
+   
"10#100#1000#1#25000#4#5#10#auto");
 cmdline_parse_token_string_t cmd_config_speed_all_item2 =
TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, item2, "duplex");
 cmdline_parse_token_string_t cmd_config_speed_all_value2 =
@@ -1077,7 +1081,8 @@ cmdline_parse_token_string_t cmd_config_speed_all_value2 =
 cmdline_parse_inst_t cmd_config_speed_all = {
.f = cmd_config_speed_all_parsed,
.data = NULL,
-   .help_str = "port config all speed 10|100|1000|1|4|10|auto 
duplex "
+   .help_str = "port config all speed "
+   "10|100|1000|1|25000|4|5|10|auto duplex "
"half|full|auto",
.tokens = {
(void *)_config_speed_all_port,
@@ -1141,7 +1146,7 @@ cmdline_parse_token_string_t 
cmd_config_speed_specific_item1 =
"speed");
 cmdline_parse_token_string_t cmd_config_speed_specific_value1 =
TOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, value1,
-   
"10#100#1000#1#4#10#auto");
+   
"10#100#1000#1#25000#4#5#10#auto");
 cmdline_parse_token_string_t cmd_config_speed_specific_item2 =
TOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, item2,
"duplex");
@@ -1152,7 +1157,8 @@ cmdline_parse_token_string_t 
cmd_config_speed_specific_value2 =
 cmdline_parse_inst_t cmd_config_speed_specific = {
.f = cmd_config_speed_specific_parsed,
.data = NULL,
-   .help_str = "port config X speed 10|100|1000|1|4|10|auto 
duplex "
+   .help_str = "port config X speed "
+   "10|100|1000|1|25000|4|5|10|auto duplex "
"half|full|auto",
.tokens = {
(void *)_config_speed_specific_port,
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst 
b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index f87e0c2..e1eea34 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -1167,7 +1167,7 @@ port config - speed

 Set the speed and duplex mode for all ports or a specific port::

-   testpmd> port config (port_id|all) speed 
(10|100|1000|1|4|10|auto) \
+   testpmd> port config (port_id|all) speed 
(10|100|1000|1|25000|4|5|10|auto) \
 duplex (half|full|auto)

 port config - queues/descriptors
-- 
2.8.4 (Apple Git-73)



[dpdk-dev] [PATCH 0/5] bnxt patchset

2016-08-15 Thread Ajit Khaparde
Please consider applying the following patches:
  bnxt: Add support for Broadcom StrataGX Communication Processors
  bnxt: Enable support for NPAR 1.0 feature
  bnxt: Add support for new HWRM version
  bnxt: Add support for new DIDs
  bnxt: Update Broadcom PMD driver documentation

 doc/guides/nics/bnxt.rst   |   23 +-
 drivers/net/bnxt/bnxt.h|4 +
 drivers/net/bnxt/bnxt_cpr.h|1 +
 drivers/net/bnxt/bnxt_ethdev.c |   61 +-
 drivers/net/bnxt/bnxt_hwrm.c   |   38 +
 drivers/net/bnxt/bnxt_hwrm.h   |1 +
 drivers/net/bnxt/bnxt_txr.h|1 +
 drivers/net/bnxt/hsi_struct_def_dpdk.h | 4616 +---
 8 files changed, 2606 insertions(+), 2139 deletions(-)

-- 
2.7.4 (Apple Git-66)



[dpdk-dev] [PATCH 1/5] bnxt: Add support for Broadcom StrataGX Communication Processors

2016-08-15 Thread Ajit Khaparde
This patch adds support for the Broadcom StrataGX? BCM5871X
series of Communucations Processors.

These ARM based processors target a broad range of networking
applications including virtual CPE (vCPE) and NFV appliances,
10G service routers and gateways, control plane processing for
Ethernet switches, and network attached storage (NAS).

Other than adding the PCI Id for supporting the device,
the patch also adds a memory barrier before the Tx doorbell
and Completing ring doorbell is written to. Since ARM has a
weakly ordered memory model this enforces a strict ordering
of the descriptor writes before the doorbell writes happen.

Signed-off-by: John Carney 
Signed-off-by: Ajit Khaparde 
---
 drivers/net/bnxt/bnxt_cpr.h| 1 +
 drivers/net/bnxt/bnxt_ethdev.c | 2 ++
 drivers/net/bnxt/bnxt_txr.h| 1 +
 3 files changed, 4 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_cpr.h b/drivers/net/bnxt/bnxt_cpr.h
index c176f8c..f9f2adb 100644
--- a/drivers/net/bnxt/bnxt_cpr.h
+++ b/drivers/net/bnxt/bnxt_cpr.h
@@ -54,6 +54,7 @@
RING_CMP(cpr->cp_ring_struct, raw_cons)))

 #define B_CP_DIS_DB(cpr, raw_cons) \
+   rte_smp_wmb();  \
(*(uint32_t *)((cpr)->cp_doorbell) = (DB_CP_FLAGS | \
RING_CMP(cpr->cp_ring_struct, raw_cons)))

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 3795fac..93269df 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -62,6 +62,7 @@ static const char bnxt_version[] =
 #define BROADCOM_DEV_ID_57302 0x16c9
 #define BROADCOM_DEV_ID_57304_PF 0x16ca
 #define BROADCOM_DEV_ID_57304_VF 0x16cb
+#define BROADCOM_DEV_ID_NS2 0x16cd
 #define BROADCOM_DEV_ID_57402 0x16d0
 #define BROADCOM_DEV_ID_57404 0x16d1
 #define BROADCOM_DEV_ID_57406_PF 0x16d2
@@ -74,6 +75,7 @@ static struct rte_pci_id bnxt_pci_id_map[] = {
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57302) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57304_PF) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57304_VF) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_NS2) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57402) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57404) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_PF) },
diff --git a/drivers/net/bnxt/bnxt_txr.h b/drivers/net/bnxt/bnxt_txr.h
index 2176aca..4c16101 100644
--- a/drivers/net/bnxt/bnxt_txr.h
+++ b/drivers/net/bnxt/bnxt_txr.h
@@ -38,6 +38,7 @@
 #define BNXT_TX_PUSH_THRESH 92

 #define B_TX_DB(db, prod)  \
+   rte_smp_wmb();  \
(*(uint32_t *)db = (DB_KEY_TX | prod))

 struct bnxt_tx_ring_info {
-- 
2.7.4 (Apple Git-66)



[dpdk-dev] [PATCH 2/5] bnxt: Enable support for NPAR 1.0 feature

2016-08-15 Thread Ajit Khaparde
Adding code to enable support for NIC Partitioning or NPAR 1.0
As a part of NPAR, we don't allow port settings like speed or flow
control to be changed.

Signed-off-by: Ajit Khaparde 
---
 drivers/net/bnxt/bnxt.h|   4 +
 drivers/net/bnxt/bnxt_ethdev.c |  13 +-
 drivers/net/bnxt/bnxt_hwrm.c   |  38 ++
 drivers/net/bnxt/bnxt_hwrm.h   |   1 +
 drivers/net/bnxt/hsi_struct_def_dpdk.h | 211 +
 5 files changed, 259 insertions(+), 8 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index df1f771..c77ecef 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -63,6 +63,7 @@ struct bnxt_vf_info {
uint16_tmax_rx_rings;
uint16_tmax_l2_ctx;
uint16_tmax_vnics;
+   uint16_tvlan;
struct bnxt_pf_info *pf;
 };

@@ -130,6 +131,8 @@ struct bnxt {
 #define BNXT_FLAG_VF   (1 << 1)
 #define BNXT_PF(bp)(!((bp)->flags & BNXT_FLAG_VF))
 #define BNXT_VF(bp)((bp)->flags & BNXT_FLAG_VF)
+#define BNXT_NPAR_ENABLED(bp)  ((bp)->port_partition_type)
+#define BNXT_NPAR_PF(bp)   (BNXT_PF(bp) && BNXT_NPAR_ENABLED(bp))

unsigned intrx_nr_rings;
unsigned intrx_cp_nr_rings;
@@ -171,6 +174,7 @@ struct bnxt {

struct bnxt_pf_info pf;
struct bnxt_vf_info vf;
+   uint8_t port_partition_type;
 };

 #endif
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 93269df..6f95c90 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -815,6 +815,9 @@ static int bnxt_flow_ctrl_set_op(struct rte_eth_dev *dev,
 {
struct bnxt *bp = (struct bnxt *)dev->data->dev_private;

+   if (BNXT_NPAR_PF(bp))
+   return 0;
+
switch (fc_conf->mode) {
case RTE_FC_NONE:
bp->link_info.auto_pause = 0;
@@ -943,14 +946,6 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
if (version_printed++ == 0)
RTE_LOG(INFO, PMD, "%s", bnxt_version);

-   if (eth_dev->pci_dev->addr.function >= 2 &&
-   eth_dev->pci_dev->addr.function < 4) {
-   RTE_LOG(ERR, PMD, "Function not enabled %x:\n",
-   eth_dev->pci_dev->addr.function);
-   rc = -ENOMEM;
-   goto error;
-   }
-
rte_eth_copy_pci_info(eth_dev, eth_dev->pci_dev);
bp = eth_dev->data->dev_private;

@@ -978,6 +973,8 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
goto error_free;
bnxt_hwrm_queue_qportcfg(bp);

+   bnxt_hwrm_func_qcfg(bp);
+
/* Get the MAX capabilities for this function */
rc = bnxt_hwrm_func_qcaps(bp);
if (rc) {
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 2ed4c2f..3a6ff5c 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1452,6 +1452,9 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool 
link_up)
struct bnxt_link_info link_req;
uint16_t speed;

+   if (BNXT_NPAR_PF(bp))
+   return 0;
+
rc = bnxt_valid_link_speed(dev_conf->link_speeds,
bp->eth_dev->data->port_id);
if (rc)
@@ -1488,3 +1491,38 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool 
link_up)
 error:
return rc;
 }
+
+/* JIRA 22088 */
+int bnxt_hwrm_func_qcfg(struct bnxt *bp)
+{
+   struct hwrm_func_qcfg_input req = {0};
+   struct hwrm_func_qcfg_output *resp = bp->hwrm_cmd_resp_addr;
+   int rc = 0;
+
+   HWRM_PREP(req, FUNC_QCFG, -1, resp);
+   req.fid = rte_cpu_to_le_16(0x);
+
+   rc = bnxt_hwrm_send_message(bp, , sizeof(req));
+
+   HWRM_CHECK_RESULT;
+
+   if (BNXT_VF(bp)) {
+   struct bnxt_vf_info *vf = >vf;
+
+   /* Hard Coded.. 0xfff VLAN ID mask */
+   vf->vlan = rte_le_to_cpu_16(resp->vlan) & 0xfff;
+   }
+
+   switch (resp->port_partition_type) {
+   case HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_0:
+   case HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5:
+   case HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR2_0:
+   bp->port_partition_type = resp->port_partition_type;
+   break;
+   default:
+   bp->port_partition_type = 0;
+   break;
+   }
+
+   return rc;
+}
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index a508024..6519ef2 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -100,5 +100,6 @@ void bnxt_free_hwrm_resources(struct bnxt *bp);
 int bnxt_alloc_hwrm_resources(struct bnxt *bp);
 int bnxt_get_hwrm_link_co

[dpdk-dev] [PATCH 5/5] bnxt: Update Broadcom PMD driver documentation

2016-08-15 Thread Ajit Khaparde
Update doc/guides/nics/bnxt.rst to indicate that the bnxt PMD driver
supports Broadcom NetXtreme-C/NetXtreme-E BCM5730X/BCM5740X family of
network controllers and Broadcom StrataGX BCM5871X family of
communications processors.

Signed-off-by: Ajit Khaparde 
---
 doc/guides/nics/bnxt.rst | 23 +--
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/doc/guides/nics/bnxt.rst b/doc/guides/nics/bnxt.rst
index 2669e98..cf7fca8 100644
--- a/doc/guides/nics/bnxt.rst
+++ b/doc/guides/nics/bnxt.rst
@@ -30,13 +30,24 @@
 bnxt poll mode driver library
 =

-The bnxt poll mode library (**librte_pmd_bnxt**) implements support for
-**Broadcom NetXtreme? C-Series**.  These adapters support Standards-
-compliant 10/25/50Gbps 30MPPS full-duplex throughput.
-
-Information about this family of adapters can be found in the
+The bnxt poll mode library (**librte_pmd_bnxt**) implements support for:
+**Broadcom NetXtreme-C?/NetXtreme-E? BCM5730X and BCM5740X family of
+Ethernet Network Controllers**.  These adapters support Standards compliant
+10/25/50Gbps 30MPPS full-duplex throughput.
+**Broadcom StrataGX? BCM5871X Series of Communucations Processors**
+These ARM based processors target a broad range of networking applications
+including virtual CPE (vCPE) and NFV appliances, 10G service routers and
+gateways, control plane processing for Ethernet switches and network attached
+storage (NAS).
+
+Information about the NetXtreme family of adapters can be found in the
 `NetXtreme? Brand section 
<https://www.broadcom.com/products/ethernet-communication-and-switching?technology%5B%5D=88>`_
-of the `Broadcom web site <http://www.broadcom.com/>`_.
+of the `Broadcom website <http://www.broadcom.com/>`_.
+
+Information about the StrataGX family of adapters can be found in the
+`StrataGX? BCM5871X Series section
+<http://www.broadcom.com/products/enterprise-and-network-processors/processors/bcm58712>`_
+of the `Broadcom website <http://www.broadcom.com/>`_.

 Limitations
 ---
-- 
2.7.4 (Apple Git-66)



[dpdk-dev] [PATCH 4/5] bnxt: Add support for new DIDs

2016-08-15 Thread Ajit Khaparde
More PCI Device IDs for Cumulus, Cumulus+ and Whitney, Whitney+ SKUs.

The NPAR model supported by firmware has been altered. It now allocates a
unique Device ID for each NPAR partition for each device.  In addition,
ASIC's that are capable of supporting dual media have a unique DID
depending whether they are configured in copper or fiber mode.
This patch adds the necessary DIDs.

Signed-off-by: Ajit Khaparde 
Reviewed-by: David Christensen 
---
 drivers/net/bnxt/bnxt_ethdev.c | 46 --
 1 file changed, 44 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6f95c90..605d490 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -62,13 +62,34 @@ static const char bnxt_version[] =
 #define BROADCOM_DEV_ID_57302 0x16c9
 #define BROADCOM_DEV_ID_57304_PF 0x16ca
 #define BROADCOM_DEV_ID_57304_VF 0x16cb
+#define BROADCOM_DEV_ID_57417_MF 0x16cc
 #define BROADCOM_DEV_ID_NS2 0x16cd
+#define BROADCOM_DEV_ID_57311 0x16ce
+#define BROADCOM_DEV_ID_57312 0x16cf
 #define BROADCOM_DEV_ID_57402 0x16d0
 #define BROADCOM_DEV_ID_57404 0x16d1
 #define BROADCOM_DEV_ID_57406_PF 0x16d2
 #define BROADCOM_DEV_ID_57406_VF 0x16d3
-#define BROADCOM_DEV_ID_57406_MF 0x16d4
+#define BROADCOM_DEV_ID_57402_MF 0x16d4
+#define BROADCOM_DEV_ID_57407_RJ45 0x16d5
+#define BROADCOM_DEV_ID_57412 0x16d6
+#define BROADCOM_DEV_ID_57414 0x16d7
+#define BROADCOM_DEV_ID_57416_RJ45 0x16d8
+#define BROADCOM_DEV_ID_57417_RJ45 0x16d9
+#define BROADCOM_DEV_ID_5741X_VF 0x16dc
+#define BROADCOM_DEV_ID_57412_MF 0x16de
 #define BROADCOM_DEV_ID_57314 0x16df
+#define BROADCOM_DEV_ID_57317_RJ45 0x16e0
+#define BROADCOM_DEV_ID_5731X_VF 0x16e1
+#define BROADCOM_DEV_ID_57417_SFP 0x16e2
+#define BROADCOM_DEV_ID_57416_SFP 0x16e3
+#define BROADCOM_DEV_ID_57317_SFP 0x16e4
+#define BROADCOM_DEV_ID_57404_MF 0x16e7
+#define BROADCOM_DEV_ID_57406_MF 0x16e8
+#define BROADCOM_DEV_ID_57407_SFP 0x16e9
+#define BROADCOM_DEV_ID_57407_MF 0x16ea
+#define BROADCOM_DEV_ID_57414_MF 0x16ec
+#define BROADCOM_DEV_ID_57416_MF 0x16ee

 static struct rte_pci_id bnxt_pci_id_map[] = {
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57301) },
@@ -80,8 +101,29 @@ static struct rte_pci_id bnxt_pci_id_map[] = {
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57404) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_PF) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_VF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_MF) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57402_MF) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57314) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57407_RJ45) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57404_MF) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_MF) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57407_SFP) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57407_MF) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57417_MF) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57311) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57312) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57412) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57414) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57416_RJ45) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57417_RJ45) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_5741X_VF) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57412_MF) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57317_RJ45) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_5731X_VF) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57417_SFP) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57416_SFP) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57317_SFP) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57414_MF) },
+   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57416_MF) },
{ .vendor_id = 0, /* sentinel */ },
 };

-- 
2.7.4 (Apple Git-66)



[dpdk-dev] [PATCH 3/5] bnxt: Add support for new HWRM version

2016-08-15 Thread Ajit Khaparde
Update HWRM specification to 1.3.0 release.
Hardware Resource Manager or HWRM in short, is a set of API provided
by the firmware running in the ASIC to manage the various resources.

Signed-off-by: Ajit Khaparde 
---
 drivers/net/bnxt/hsi_struct_def_dpdk.h | 4731 +---
 1 file changed, 2445 insertions(+), 2286 deletions(-)

diff --git a/drivers/net/bnxt/hsi_struct_def_dpdk.h 
b/drivers/net/bnxt/hsi_struct_def_dpdk.h
index 5115937..08396cc 100644
--- a/drivers/net/bnxt/hsi_struct_def_dpdk.h
+++ b/drivers/net/bnxt/hsi_struct_def_dpdk.h
@@ -31,8 +31,8 @@
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */

-#ifndef _HSI_STRUCT_DEF_EXTERNAL_H_
-#define _HSI_STRUCT_DEF_EXTERNAL_H_
+#ifndef _HSI_STRUCT_DEF_DPDK_
+#define _HSI_STRUCT_DEF_DPDK_

 /*
  * per-context HW statistics -- chip view
@@ -63,20 +63,26 @@ struct ctx_hw_stats64 {
uint64_t tpa_aborts;
 } ctx_hw_stats64_t;

-/* HW Resource Manager Specification 1.2.0 */
+/* HW Resource Manager Specification 1.3.0 */
+/*
+ * Note: The Hardware Resource Manager (HWRM) manages various hardware 
resources
+ * inside the chip. The HWRM is implemented in firmware, and runs on embedded
+ * processors inside the chip. This firmware service is vital part of the chip.
+ * The chip can not be used by a driver or HWRM client without the HWRM.
+ */
 #define HWRM_VERSION_MAJOR 1
-#define HWRM_VERSION_MINOR 2
+#define HWRM_VERSION_MINOR 3
 #define HWRM_VERSION_UPDATE0

 /*
  * Following is the signature for HWRM message field that indicates not
  * applicable (All F's). Need to cast it the size of the field if needed.
  */
-#define HWRM_NA_SIGNATURE((uint32_t)(-1))
-#define HWRM_MAX_REQ_LEN   (128)  /* hwrm_func_buf_rgtr */
-#define HWRM_MAX_RESP_LEN  (176)  /* hwrm_func_qstats */
-#define HW_HASH_INDEX_SIZE  0x80/* 7 bit indirection table index. */
-#define HW_HASH_KEY_SIZE40
+#define HWRM_NA_SIGNATURE  ((uint32_t)(-1))
+#define HWRM_MAX_REQ_LEN   (128)   /* hwrm_func_buf_rgtr */
+#define HWRM_MAX_RESP_LEN  (176)   /* hwrm_func_qstats */
+#define HW_HASH_INDEX_SIZE 0x80/* 7 bit indirection table index. */
+#define HW_HASH_KEY_SIZE   40
 #define HWRM_RESP_VALID_KEY1 /* valid key for HWRM response */

 /*
@@ -124,10 +130,10 @@ struct tx_bd_short {
/* This value identifies the type of buffer descriptor. */
#define TX_BD_SHORT_TYPE_MASK   UINT32_C(0x3f)
#define TX_BD_SHORT_TYPE_SFT0
-   /*
-* Indicates that this BD is 16B long and is used for normal L2
-* packet transmission.
-*/
+   /*
+* Indicates that this BD is 16B long and is used for normal L2
+* packet transmission.
+*/
#define TX_BD_SHORT_TYPE_TX_BD_SHORT(UINT32_C(0x0) << 0)
/*
 * If set to 1, the packet ends with the data in the buffer pointed to
@@ -159,13 +165,13 @@ struct tx_bd_short {
 */
#define TX_BD_SHORT_FLAGS_LHINT_MASKUINT32_C(0x6000)
#define TX_BD_SHORT_FLAGS_LHINT_SFT 13
-   /* indicates packet length < 512B */
+   /* indicates packet length < 512B */
#define TX_BD_SHORT_FLAGS_LHINT_LT512   (UINT32_C(0x0) << 13)
-   /* indicates 512 <= packet length < 1KB */
+   /* indicates 512 <= packet length < 1KB */
#define TX_BD_SHORT_FLAGS_LHINT_LT1K(UINT32_C(0x1) << 13)
-   /* indicates 1KB <= packet length < 2KB */
+   /* indicates 1KB <= packet length < 2KB */
#define TX_BD_SHORT_FLAGS_LHINT_LT2K(UINT32_C(0x2) << 13)
-   /* indicates packet length >= 2KB */
+   /* indicates packet length >= 2KB */
#define TX_BD_SHORT_FLAGS_LHINT_GTE2K   (UINT32_C(0x3) << 13)
#define TX_BD_SHORT_FLAGS_LHINT_LASTTX_BD_SHORT_FLAGS_LHINT_GTE2K
/*
@@ -192,6 +198,7 @@ struct tx_bd_short {
 * bytes. This field must be valid on all BDs of a packet.
 */
uint16_t len;
+
/*
 * The opaque data field is pass through to the completion and can be
 * used for any data that the driver wants to associate with the
@@ -217,10 +224,10 @@ struct tx_bd_long {
/* This value identifies the type of buffer descriptor. */
#define TX_BD_LONG_TYPE_MASKUINT32_C(0x3f)
#define TX_BD_LONG_TYPE_SFT 0
-   /*
-* Indicates that this BD is 32B long and is used for normal L2
-* packet transmission.
-*/
+   /*
+* Indicates that this BD is 32B long and is used for normal L2
+* packet transmission.
+*/
#define TX_BD_LONG_TYPE_TX_BD_LONG  (UINT32_C(0x10) << 0)
  

[dpdk-dev] [PATCH] net/bnxt: make driver less verbose

2016-08-25 Thread Ajit Khaparde
On Thu, Aug 25, 2016 at 6:05 AM, Ferruh Yigit 
wrote:

> This line printed for every application even if driver is not used at
> all. Removing the line to reduce the noise.
>
> Signed-off-by: Ferruh Yigit 
> ---
>  drivers/net/bnxt/bnxt_ethdev.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_
> ethdev.c
> index 3795fac..37d0322 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -1056,7 +1056,6 @@ static struct eth_driver bnxt_rte_pmd = {
>
>  static int bnxt_rte_pmd_init(const char *name, const char *params
> __rte_unused)
>  {
> -   RTE_LOG(INFO, PMD, "bnxt_rte_pmd_init() called for %s\n", name);
>
How about changing the log level to DEBUG?

-   RTE_LOG(INFO, PMD, "bnxt_rte_pmd_init() called for %s\n", name);
+   RTE_LOG(DEBUG, PMD, "bnxt_rte_pmd_init() called for %s\n", name);

That should reduce the noise till the user explicitly changes the log level.

Thanks
?


> rte_eth_driver_register(_rte_pmd);
> return 0;
>  }
> --
> 2.7.4
>
>


[dpdk-dev] [PATCH] net/bnxt: make driver less verbose

2016-08-26 Thread Ajit Khaparde
On Fri, Aug 26, 2016 at 3:39 AM, Ferruh Yigit 
wrote:

> On 8/25/2016 8:03 PM, Ajit Khaparde wrote:
> >
> >
> > On Thu, Aug 25, 2016 at 6:05 AM, Ferruh Yigit  > <mailto:ferruh.yigit at intel.com>> wrote:
> >
> > This line printed for every application even if driver is not used at
> > all. Removing the line to reduce the noise.
> >
> > Signed-off-by: Ferruh Yigit  > <mailto:ferruh.yigit at intel.com>>
> > ---
> >  drivers/net/bnxt/bnxt_ethdev.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/net/bnxt/bnxt_ethdev.c
> > b/drivers/net/bnxt/bnxt_ethdev.c
> > index 3795fac..37d0322 100644
> > --- a/drivers/net/bnxt/bnxt_ethdev.c
> > +++ b/drivers/net/bnxt/bnxt_ethdev.c
> > @@ -1056,7 +1056,6 @@ static struct eth_driver bnxt_rte_pmd = {
> >
> >  static int bnxt_rte_pmd_init(const char *name, const char *params
> > __rte_unused)
> >  {
> > -   RTE_LOG(INFO, PMD, "bnxt_rte_pmd_init() called for %s\n",
> name);
> >
> > How about changing the log level to DEBUG?
> >
> > -   RTE_LOG(INFO, PMD, "bnxt_rte_pmd_init() called for %s\n", name);
> > +   RTE_LOG(DEBUG, PMD, "bnxt_rte_pmd_init() called for %s\n", name);
> >
> > That should reduce the noise till the user explicitly changes the log
> level.
>
> This will give similar result, this log is useless if you are not
> debugging this driver, but debug log level can be enabled for many reasons.
>
> Other drivers use PMD_INIT_FUNC_TRACE() macros, which requires
> specifically enabled in config for that driver.
>
There are other messages to aid tracing and debugging elsewhere in the code.
So here goes..

Acked-by: Ajit Khaparde 
?


>
> >
> > Thanks
> > ?
> >
> >
> > rte_eth_driver_register(_rte_pmd);
> > return 0;
> >  }
> > --
> > 2.7.4
> >
> >
>
>


[dpdk-dev] Unsupported SFP+ Module - Hardware Initialization Failure -19

2016-08-30 Thread Ajit Khaparde
On Tue, Aug 30, 2016 at 11:02 AM, Alex Forster  wrote:

> Hi guys,
>
> I have a problem again that I had about a year ago[1]. My Finisar
> FTL410QE2C (multimode QSFP) transceivers aren?t working with my Intel
> X520-QDA1?s. I have 7 servers, each with two X520?s and two QSFP
> transceivers in them, totaling 14 NICs and transceivers, and all of them
> fail with the same error: Unsupported SFP+ Module / Hardware Initialization
> Failure: -19.
>
> This doesn?t appear to be specifically a DPDK issue, but rather an IXGBE
> issue, since (a) the stock Debian 8 IXGBE, (b) the latest out of tree
> IXGBE, and (c) DPDK?s copy of IXGBE all fail in this same way. I?m happy to
> take this to an IXGBE mailing list if somebody can point me to one, but
> just in case anyone here can help, here?s the info I?ve gathered?
>
> * The exact function where IXGBE bails is here, annotated with the values
> read from the transceiver?s EEPROMs: https://www.googledrive.com/
> host/0B_-81lR_g8lyNDJ6QkkxS28yQzQ
> * I?ve modified DPDK?s copy of IXGBE to dump the whole EEPROM of these
> transceivers, which are here: https://gist.github.com/alexforster/
> 5da30cd89d49877d5d6908e9628baee8
>
> Here?s (I think) an important part: Last time I had this problem, I only
> had one server, and one of the two transceivers worked. I fixed the other
> transceiver in that server by replacing it with an identical model. Now,
> suddenly, neither of those transceivers (which have worked for ~11 months)
> are recognized. I don?t know how I could have done something that would
> have affected the EEPROM output, but I suspect I may have.
>
> Anybody able to offer any advice?
>
> Alex Forster
>
> [1] http://dpdk.org/ml/archives/dev/2015-October/024973.html


Adding e1000-devel at lists.sourceforge.net