Skip to content

Commit 7d96567

Browse files
Eilon Greensteindavem330
authored andcommitted
bnx2x: PCI configuration bug on big-endian
The current code read nothing but zeros on big-endian (wrong part of the 32bits). This caused poor performance on big-endian machines. Though this issue did not cause the system to crash, the performance is significantly better with the fix so I view it as critical bug fix. Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9a03544 commit 7d96567

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/net/bnx2x_init.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -564,14 +564,15 @@ static const struct arb_line write_arb_addr[NUM_WR_Q-1] = {
564564

565565
static void bnx2x_init_pxp(struct bnx2x *bp)
566566
{
567+
u16 devctl;
567568
int r_order, w_order;
568569
u32 val, i;
569570

570571
pci_read_config_word(bp->pdev,
571-
bp->pcie_cap + PCI_EXP_DEVCTL, (u16 *)&val);
572-
DP(NETIF_MSG_HW, "read 0x%x from devctl\n", (u16)val);
573-
w_order = ((val & PCI_EXP_DEVCTL_PAYLOAD) >> 5);
574-
r_order = ((val & PCI_EXP_DEVCTL_READRQ) >> 12);
572+
bp->pcie_cap + PCI_EXP_DEVCTL, &devctl);
573+
DP(NETIF_MSG_HW, "read 0x%x from devctl\n", devctl);
574+
w_order = ((devctl & PCI_EXP_DEVCTL_PAYLOAD) >> 5);
575+
r_order = ((devctl & PCI_EXP_DEVCTL_READRQ) >> 12);
575576

576577
if (r_order > MAX_RD_ORD) {
577578
DP(NETIF_MSG_HW, "read order of %d order adjusted to %d\n",

0 commit comments

Comments
 (0)