aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_main.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2010-08-19 09:36:27 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-19 19:40:51 -0400
commit486545216472d67c16e3d3d60c5f21f60959c855 (patch)
tree0a439dbffa739a0d5b779dd4cfcc6c1731edf20e /drivers/net/ixgbe/ixgbe_main.c
parentacd37177cc2e034ecb6cbb784a8b998229fa85c4 (diff)
ixgbe: pull PSRTYPE configuration into a separate function
The configuration of PSRTYPE was being done conditionally on if packet split is enabled or not. It can be configured always since it will not have any effect when packet split is not enabled. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_main.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index ddabe14bbbca..88e6936a1579 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -2672,6 +2672,29 @@ static void ixgbe_configure_rx_ring(struct ixgbe_adapter *adapter,
2672 ring->tail = IXGBE_RDT(reg_idx); 2672 ring->tail = IXGBE_RDT(reg_idx);
2673} 2673}
2674 2674
2675static void ixgbe_setup_psrtype(struct ixgbe_adapter *adapter)
2676{
2677 struct ixgbe_hw *hw = &adapter->hw;
2678 int p;
2679
2680 /* PSRTYPE must be initialized in non 82598 adapters */
2681 u32 psrtype = IXGBE_PSRTYPE_TCPHDR |
2682 IXGBE_PSRTYPE_UDPHDR |
2683 IXGBE_PSRTYPE_IPV4HDR |
2684 IXGBE_PSRTYPE_L2HDR |
2685 IXGBE_PSRTYPE_IPV6HDR;
2686
2687 if (hw->mac.type == ixgbe_mac_82598EB)
2688 return;
2689
2690 if (adapter->flags & IXGBE_FLAG_RSS_ENABLED)
2691 psrtype |= (adapter->num_rx_queues_per_pool << 29);
2692
2693 for (p = 0; p < adapter->num_rx_pools; p++)
2694 IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(adapter->num_vfs + p),
2695 psrtype);
2696}
2697
2675/** 2698/**
2676 * ixgbe_configure_rx - Configure 8259x Receive Unit after Reset 2699 * ixgbe_configure_rx - Configure 8259x Receive Unit after Reset
2677 * @adapter: board private structure 2700 * @adapter: board private structure
@@ -2690,6 +2713,8 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
2690 u32 rdrxctl; 2713 u32 rdrxctl;
2691 int rx_buf_len; 2714 int rx_buf_len;
2692 2715
2716 ixgbe_setup_psrtype(adapter);
2717
2693 /* Decide whether to use packet split mode or not */ 2718 /* Decide whether to use packet split mode or not */
2694 /* Do not use packet split if we're in SR-IOV Mode */ 2719 /* Do not use packet split if we're in SR-IOV Mode */
2695 if (!adapter->num_vfs) 2720 if (!adapter->num_vfs)
@@ -2698,17 +2723,6 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
2698 /* Set the RX buffer length according to the mode */ 2723 /* Set the RX buffer length according to the mode */
2699 if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) { 2724 if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) {
2700 rx_buf_len = IXGBE_RX_HDR_SIZE; 2725 rx_buf_len = IXGBE_RX_HDR_SIZE;
2701 if (hw->mac.type == ixgbe_mac_82599EB) {
2702 /* PSRTYPE must be initialized in 82599 */
2703 u32 psrtype = IXGBE_PSRTYPE_TCPHDR |
2704 IXGBE_PSRTYPE_UDPHDR |
2705 IXGBE_PSRTYPE_IPV4HDR |
2706 IXGBE_PSRTYPE_IPV6HDR |
2707 IXGBE_PSRTYPE_L2HDR;
2708 IXGBE_WRITE_REG(hw,
2709 IXGBE_PSRTYPE(adapter->num_vfs),
2710 psrtype);
2711 }
2712 } else { 2726 } else {
2713 if (!(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) && 2727 if (!(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) &&
2714 (netdev->mtu <= ETH_DATA_LEN)) 2728 (netdev->mtu <= ETH_DATA_LEN))