Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194294
b: refs/heads/master
c: 1ac218c
h: refs/heads/master
v: v3
  • Loading branch information
Vladislav Zolotarov authored and David S. Miller committed Apr 19, 2010
1 parent 6fbdad4 commit b18cef5
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dea7aab1923a9ee81c5cafaa4bd47266abf30186
refs/heads/master: 1ac218c83fbfc6bcdbef36b38f79d0ee08420285
18 changes: 13 additions & 5 deletions trunk/drivers/net/bnx2x.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,25 @@
#define BCM_VLAN 1
#endif

#define BNX2X_MULTI_QUEUE

#define BNX2X_NEW_NAPI



#if defined(CONFIG_CNIC) || defined(CONFIG_CNIC_MODULE)
#define BCM_CNIC 1
#include "cnic_if.h"
#endif

#define BNX2X_MULTI_QUEUE

#define BNX2X_NEW_NAPI


#ifdef BCM_CNIC
#define BNX2X_MIN_MSIX_VEC_CNT 3
#define BNX2X_MSIX_VEC_FP_START 2
#else
#define BNX2X_MIN_MSIX_VEC_CNT 2
#define BNX2X_MSIX_VEC_FP_START 1
#endif

#include <linux/mdio.h>
#include "bnx2x_reg.h"
Expand Down Expand Up @@ -862,7 +871,6 @@ struct bnx2x {
#endif
#define INT_MODE_INTx 1
#define INT_MODE_MSI 2
#define INT_MODE_MSIX 3

int tx_ring_size;

Expand Down
28 changes: 25 additions & 3 deletions trunk/drivers/net/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7418,7 +7418,31 @@ static int bnx2x_enable_msix(struct bnx2x *bp)

rc = pci_enable_msix(bp->pdev, &bp->msix_table[0],
BNX2X_NUM_QUEUES(bp) + offset);
if (rc) {

/*
* reconfigure number of tx/rx queues according to available
* MSI-X vectors
*/
if (rc >= BNX2X_MIN_MSIX_VEC_CNT) {
/* vectors available for FP */
int fp_vec = rc - BNX2X_MSIX_VEC_FP_START;

DP(NETIF_MSG_IFUP,
"Trying to use less MSI-X vectors: %d\n", rc);

rc = pci_enable_msix(bp->pdev, &bp->msix_table[0], rc);

if (rc) {
DP(NETIF_MSG_IFUP,
"MSI-X is not attainable rc %d\n", rc);
return rc;
}

bp->num_queues = min(bp->num_queues, fp_vec);

DP(NETIF_MSG_IFUP, "New queue configuration set: %d\n",
bp->num_queues);
} else if (rc) {
DP(NETIF_MSG_IFUP, "MSI-X is not attainable rc %d\n", rc);
return rc;
}
Expand Down Expand Up @@ -7841,8 +7865,6 @@ static int bnx2x_set_num_queues(struct bnx2x *bp)
bp->num_queues = 1;
DP(NETIF_MSG_IFUP, "set number of queues to 1\n");
break;

case INT_MODE_MSIX:
default:
/* Set number of queues according to bp->multi_mode value */
bnx2x_set_num_queues_msix(bp);
Expand Down

0 comments on commit b18cef5

Please sign in to comment.