aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bnx2x_main.c')
-rw-r--r--drivers/net/bnx2x_main.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index 0c6dba24e37e..2bc35c794aec 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -1582,7 +1582,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
1582 struct sw_rx_bd *rx_buf = NULL; 1582 struct sw_rx_bd *rx_buf = NULL;
1583 struct sk_buff *skb; 1583 struct sk_buff *skb;
1584 union eth_rx_cqe *cqe; 1584 union eth_rx_cqe *cqe;
1585 u8 cqe_fp_flags; 1585 u8 cqe_fp_flags, cqe_fp_status_flags;
1586 u16 len, pad; 1586 u16 len, pad;
1587 1587
1588 comp_ring_cons = RCQ_BD(sw_comp_cons); 1588 comp_ring_cons = RCQ_BD(sw_comp_cons);
@@ -1598,6 +1598,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
1598 1598
1599 cqe = &fp->rx_comp_ring[comp_ring_cons]; 1599 cqe = &fp->rx_comp_ring[comp_ring_cons];
1600 cqe_fp_flags = cqe->fast_path_cqe.type_error_flags; 1600 cqe_fp_flags = cqe->fast_path_cqe.type_error_flags;
1601 cqe_fp_status_flags = cqe->fast_path_cqe.status_flags;
1601 1602
1602 DP(NETIF_MSG_RX_STATUS, "CQE type %x err %x status %x" 1603 DP(NETIF_MSG_RX_STATUS, "CQE type %x err %x status %x"
1603 " queue %x vlan %x len %u\n", CQE_TYPE(cqe_fp_flags), 1604 " queue %x vlan %x len %u\n", CQE_TYPE(cqe_fp_flags),
@@ -1616,7 +1617,6 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
1616 rx_buf = &fp->rx_buf_ring[bd_cons]; 1617 rx_buf = &fp->rx_buf_ring[bd_cons];
1617 skb = rx_buf->skb; 1618 skb = rx_buf->skb;
1618 prefetch(skb); 1619 prefetch(skb);
1619 prefetch((u8 *)skb + 256);
1620 len = le16_to_cpu(cqe->fast_path_cqe.pkt_len); 1620 len = le16_to_cpu(cqe->fast_path_cqe.pkt_len);
1621 pad = cqe->fast_path_cqe.placement_offset; 1621 pad = cqe->fast_path_cqe.placement_offset;
1622 1622
@@ -1667,7 +1667,6 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
1667 dma_unmap_addr(rx_buf, mapping), 1667 dma_unmap_addr(rx_buf, mapping),
1668 pad + RX_COPY_THRESH, 1668 pad + RX_COPY_THRESH,
1669 DMA_FROM_DEVICE); 1669 DMA_FROM_DEVICE);
1670 prefetch(skb);
1671 prefetch(((char *)(skb)) + 128); 1670 prefetch(((char *)(skb)) + 128);
1672 1671
1673 /* is this an error packet? */ 1672 /* is this an error packet? */
@@ -1727,6 +1726,12 @@ reuse_rx:
1727 1726
1728 skb->protocol = eth_type_trans(skb, bp->dev); 1727 skb->protocol = eth_type_trans(skb, bp->dev);
1729 1728
1729 if ((bp->dev->features & NETIF_F_RXHASH) &&
1730 (cqe_fp_status_flags &
1731 ETH_FAST_PATH_RX_CQE_RSS_HASH_FLG))
1732 skb->rxhash = le32_to_cpu(
1733 cqe->fast_path_cqe.rss_hash_result);
1734
1730 skb->ip_summed = CHECKSUM_NONE; 1735 skb->ip_summed = CHECKSUM_NONE;
1731 if (bp->rx_csum) { 1736 if (bp->rx_csum) {
1732 if (likely(BNX2X_RX_CSUM_OK(cqe))) 1737 if (likely(BNX2X_RX_CSUM_OK(cqe)))
@@ -5750,10 +5755,10 @@ static void bnx2x_init_internal_func(struct bnx2x *bp)
5750 u32 offset; 5755 u32 offset;
5751 u16 max_agg_size; 5756 u16 max_agg_size;
5752 5757
5753 if (is_multi(bp)) { 5758 tstorm_config.config_flags = RSS_FLAGS(bp);
5754 tstorm_config.config_flags = MULTI_FLAGS(bp); 5759
5760 if (is_multi(bp))
5755 tstorm_config.rss_result_mask = MULTI_MASK; 5761 tstorm_config.rss_result_mask = MULTI_MASK;
5756 }
5757 5762
5758 /* Enable TPA if needed */ 5763 /* Enable TPA if needed */
5759 if (bp->flags & TPA_ENABLE_FLAG) 5764 if (bp->flags & TPA_ENABLE_FLAG)
@@ -6629,10 +6634,8 @@ static int bnx2x_init_common(struct bnx2x *bp)
6629 bnx2x_init_block(bp, PBF_BLOCK, COMMON_STAGE); 6634 bnx2x_init_block(bp, PBF_BLOCK, COMMON_STAGE);
6630 6635
6631 REG_WR(bp, SRC_REG_SOFT_RST, 1); 6636 REG_WR(bp, SRC_REG_SOFT_RST, 1);
6632 for (i = SRC_REG_KEYRSS0_0; i <= SRC_REG_KEYRSS1_9; i += 4) { 6637 for (i = SRC_REG_KEYRSS0_0; i <= SRC_REG_KEYRSS1_9; i += 4)
6633 REG_WR(bp, i, 0xc0cac01a); 6638 REG_WR(bp, i, random32());
6634 /* TODO: replace with something meaningful */
6635 }
6636 bnx2x_init_block(bp, SRCH_BLOCK, COMMON_STAGE); 6639 bnx2x_init_block(bp, SRCH_BLOCK, COMMON_STAGE);
6637#ifdef BCM_CNIC 6640#ifdef BCM_CNIC
6638 REG_WR(bp, SRC_REG_KEYSEARCH_0, 0x63285672); 6641 REG_WR(bp, SRC_REG_KEYSEARCH_0, 0x63285672);
@@ -11001,6 +11004,11 @@ static int bnx2x_set_flags(struct net_device *dev, u32 data)
11001 changed = 1; 11004 changed = 1;
11002 } 11005 }
11003 11006
11007 if (data & ETH_FLAG_RXHASH)
11008 dev->features |= NETIF_F_RXHASH;
11009 else
11010 dev->features &= ~NETIF_F_RXHASH;
11011
11004 if (changed && netif_running(dev)) { 11012 if (changed && netif_running(dev)) {
11005 bnx2x_nic_unload(bp, UNLOAD_NORMAL); 11013 bnx2x_nic_unload(bp, UNLOAD_NORMAL);
11006 rc = bnx2x_nic_load(bp, LOAD_NORMAL); 11014 rc = bnx2x_nic_load(bp, LOAD_NORMAL);