Commit fe23d634 authored by David S. Miller's avatar David S. Miller

Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
1GbE Intel Wired LAN Driver Updates 2019-12-31

This series contains updates to e1000e, igb and igc only.

Robert Beckett provide an igb change to assist in keeping packets from
being dropped due to receive descriptor ring being full when receive
flow control is enabled.  Create a separate function to setup SRRCTL to
ease in reuse and ensure that setting of the drop enable bit only if
receive flow control is not enabled.

Sasha adds support for scatter gather support in igc.  Improve the
direct memory address mapping flow by optimizing/simplifying and more
clear.  Update igc to use pci_release_mem_regions() instead of
pci_release_selected_regions().  Clean up function header comments to
align with the actual code.  Adds support for 64 bit DMA access, to help
handle socket buffer fragments in high memory.  Adds legacy power
management support in igc by implementing suspend, resume,
runtime_suspend/resume, and runtime_idle callbacks.  Clean up references
to Serdes interface in igc since that interface is not supported for
i225 devices.

Alex replaces the pr_info calls with netdev_info in all cases related to
netdev link state, as suggested by Joe Perches.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 31d518f3 684ea87c
...@@ -4723,7 +4723,7 @@ int e1000e_close(struct net_device *netdev) ...@@ -4723,7 +4723,7 @@ int e1000e_close(struct net_device *netdev)
e1000_free_irq(adapter); e1000_free_irq(adapter);
/* Link status message must follow this format */ /* Link status message must follow this format */
pr_info("%s NIC Link is Down\n", netdev->name); netdev_info(netdev, "NIC Link is Down\n");
} }
napi_disable(&adapter->napi); napi_disable(&adapter->napi);
...@@ -5073,12 +5073,13 @@ static void e1000_print_link_info(struct e1000_adapter *adapter) ...@@ -5073,12 +5073,13 @@ static void e1000_print_link_info(struct e1000_adapter *adapter)
u32 ctrl = er32(CTRL); u32 ctrl = er32(CTRL);
/* Link status message must follow this format for user tools */ /* Link status message must follow this format for user tools */
pr_info("%s NIC Link is Up %d Mbps %s Duplex, Flow Control: %s\n", netdev_info(adapter->netdev,
adapter->netdev->name, adapter->link_speed, "NIC Link is Up %d Mbps %s Duplex, Flow Control: %s\n",
adapter->link_duplex == FULL_DUPLEX ? "Full" : "Half", adapter->link_speed,
(ctrl & E1000_CTRL_TFCE) && (ctrl & E1000_CTRL_RFCE) ? "Rx/Tx" : adapter->link_duplex == FULL_DUPLEX ? "Full" : "Half",
(ctrl & E1000_CTRL_RFCE) ? "Rx" : (ctrl & E1000_CTRL_TFCE) && (ctrl & E1000_CTRL_RFCE) ? "Rx/Tx" :
(ctrl & E1000_CTRL_TFCE) ? "Tx" : "None"); (ctrl & E1000_CTRL_RFCE) ? "Rx" :
(ctrl & E1000_CTRL_TFCE) ? "Tx" : "None");
} }
static bool e1000e_has_link(struct e1000_adapter *adapter) static bool e1000e_has_link(struct e1000_adapter *adapter)
...@@ -5307,7 +5308,7 @@ static void e1000_watchdog_task(struct work_struct *work) ...@@ -5307,7 +5308,7 @@ static void e1000_watchdog_task(struct work_struct *work)
adapter->link_speed = 0; adapter->link_speed = 0;
adapter->link_duplex = 0; adapter->link_duplex = 0;
/* Link status message must follow this format */ /* Link status message must follow this format */
pr_info("%s NIC Link is Down\n", adapter->netdev->name); netdev_info(netdev, "NIC Link is Down\n");
netif_carrier_off(netdev); netif_carrier_off(netdev);
netif_stop_queue(netdev); netif_stop_queue(netdev);
if (!test_bit(__E1000_DOWN, &adapter->state)) if (!test_bit(__E1000_DOWN, &adapter->state))
......
...@@ -661,6 +661,7 @@ void igb_configure_tx_ring(struct igb_adapter *, struct igb_ring *); ...@@ -661,6 +661,7 @@ void igb_configure_tx_ring(struct igb_adapter *, struct igb_ring *);
void igb_configure_rx_ring(struct igb_adapter *, struct igb_ring *); void igb_configure_rx_ring(struct igb_adapter *, struct igb_ring *);
void igb_setup_tctl(struct igb_adapter *); void igb_setup_tctl(struct igb_adapter *);
void igb_setup_rctl(struct igb_adapter *); void igb_setup_rctl(struct igb_adapter *);
void igb_setup_srrctl(struct igb_adapter *, struct igb_ring *);
netdev_tx_t igb_xmit_frame_ring(struct sk_buff *, struct igb_ring *); netdev_tx_t igb_xmit_frame_ring(struct sk_buff *, struct igb_ring *);
void igb_alloc_rx_buffers(struct igb_ring *, u16); void igb_alloc_rx_buffers(struct igb_ring *, u16);
void igb_update_stats(struct igb_adapter *); void igb_update_stats(struct igb_adapter *);
......
...@@ -396,6 +396,7 @@ static int igb_set_pauseparam(struct net_device *netdev, ...@@ -396,6 +396,7 @@ static int igb_set_pauseparam(struct net_device *netdev,
struct igb_adapter *adapter = netdev_priv(netdev); struct igb_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
int retval = 0; int retval = 0;
int i;
/* 100basefx does not support setting link flow control */ /* 100basefx does not support setting link flow control */
if (hw->dev_spec._82575.eth_flags.e100_base_fx) if (hw->dev_spec._82575.eth_flags.e100_base_fx)
...@@ -428,6 +429,13 @@ static int igb_set_pauseparam(struct net_device *netdev, ...@@ -428,6 +429,13 @@ static int igb_set_pauseparam(struct net_device *netdev,
retval = ((hw->phy.media_type == e1000_media_type_copper) ? retval = ((hw->phy.media_type == e1000_media_type_copper) ?
igb_force_mac_fc(hw) : igb_setup_link(hw)); igb_force_mac_fc(hw) : igb_setup_link(hw));
/* Make sure SRRCTL considers new fc settings for each ring */
for (i = 0; i < adapter->num_rx_queues; i++) {
struct igb_ring *ring = adapter->rx_ring[i];
igb_setup_srrctl(adapter, ring);
}
} }
clear_bit(__IGB_RESETTING, &adapter->state); clear_bit(__IGB_RESETTING, &adapter->state);
......
...@@ -4467,6 +4467,37 @@ static inline void igb_set_vmolr(struct igb_adapter *adapter, ...@@ -4467,6 +4467,37 @@ static inline void igb_set_vmolr(struct igb_adapter *adapter,
wr32(E1000_VMOLR(vfn), vmolr); wr32(E1000_VMOLR(vfn), vmolr);
} }
/**
* igb_setup_srrctl - configure the split and replication receive control
* registers
* @adapter: Board private structure
* @ring: receive ring to be configured
**/
void igb_setup_srrctl(struct igb_adapter *adapter, struct igb_ring *ring)
{
struct e1000_hw *hw = &adapter->hw;
int reg_idx = ring->reg_idx;
u32 srrctl = 0;
srrctl = IGB_RX_HDR_LEN << E1000_SRRCTL_BSIZEHDRSIZE_SHIFT;
if (ring_uses_large_buffer(ring))
srrctl |= IGB_RXBUFFER_3072 >> E1000_SRRCTL_BSIZEPKT_SHIFT;
else
srrctl |= IGB_RXBUFFER_2048 >> E1000_SRRCTL_BSIZEPKT_SHIFT;
srrctl |= E1000_SRRCTL_DESCTYPE_ADV_ONEBUF;
if (hw->mac.type >= e1000_82580)
srrctl |= E1000_SRRCTL_TIMESTAMP;
/* Only set Drop Enable if VFs allocated, or we are supporting multiple
* queues and rx flow control is disabled
*/
if (adapter->vfs_allocated_count ||
(!(hw->fc.current_mode & e1000_fc_rx_pause) &&
adapter->num_rx_queues > 1))
srrctl |= E1000_SRRCTL_DROP_EN;
wr32(E1000_SRRCTL(reg_idx), srrctl);
}
/** /**
* igb_configure_rx_ring - Configure a receive ring after Reset * igb_configure_rx_ring - Configure a receive ring after Reset
* @adapter: board private structure * @adapter: board private structure
...@@ -4481,7 +4512,7 @@ void igb_configure_rx_ring(struct igb_adapter *adapter, ...@@ -4481,7 +4512,7 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,
union e1000_adv_rx_desc *rx_desc; union e1000_adv_rx_desc *rx_desc;
u64 rdba = ring->dma; u64 rdba = ring->dma;
int reg_idx = ring->reg_idx; int reg_idx = ring->reg_idx;
u32 srrctl = 0, rxdctl = 0; u32 rxdctl = 0;
/* disable the queue */ /* disable the queue */
wr32(E1000_RXDCTL(reg_idx), 0); wr32(E1000_RXDCTL(reg_idx), 0);
...@@ -4499,19 +4530,7 @@ void igb_configure_rx_ring(struct igb_adapter *adapter, ...@@ -4499,19 +4530,7 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,
writel(0, ring->tail); writel(0, ring->tail);
/* set descriptor configuration */ /* set descriptor configuration */
srrctl = IGB_RX_HDR_LEN << E1000_SRRCTL_BSIZEHDRSIZE_SHIFT; igb_setup_srrctl(adapter, ring);
if (ring_uses_large_buffer(ring))
srrctl |= IGB_RXBUFFER_3072 >> E1000_SRRCTL_BSIZEPKT_SHIFT;
else
srrctl |= IGB_RXBUFFER_2048 >> E1000_SRRCTL_BSIZEPKT_SHIFT;
srrctl |= E1000_SRRCTL_DESCTYPE_ADV_ONEBUF;
if (hw->mac.type >= e1000_82580)
srrctl |= E1000_SRRCTL_TIMESTAMP;
/* Only set Drop Enable if we are supporting multiple queues */
if (adapter->vfs_allocated_count || adapter->num_rx_queues > 1)
srrctl |= E1000_SRRCTL_DROP_EN;
wr32(E1000_SRRCTL(reg_idx), srrctl);
/* set filtering for VMDQ pools */ /* set filtering for VMDQ pools */
igb_set_vmolr(adapter, reg_idx & 0x7, true); igb_set_vmolr(adapter, reg_idx & 0x7, true);
......
...@@ -370,6 +370,8 @@ struct igc_adapter { ...@@ -370,6 +370,8 @@ struct igc_adapter {
struct timer_list dma_err_timer; struct timer_list dma_err_timer;
struct timer_list phy_info_timer; struct timer_list phy_info_timer;
u32 wol;
u32 en_mng_pt;
u16 link_speed; u16 link_speed;
u16 link_duplex; u16 link_duplex;
......
...@@ -10,6 +10,37 @@ ...@@ -10,6 +10,37 @@
#define IGC_CTRL_EXT_DRV_LOAD 0x10000000 /* Drv loaded bit for FW */ #define IGC_CTRL_EXT_DRV_LOAD 0x10000000 /* Drv loaded bit for FW */
/* Definitions for power management and wakeup registers */
/* Wake Up Control */
#define IGC_WUC_PME_EN 0x00000002 /* PME Enable */
/* Wake Up Filter Control */
#define IGC_WUFC_LNKC 0x00000001 /* Link Status Change Wakeup Enable */
#define IGC_WUFC_MC 0x00000008 /* Directed Multicast Wakeup Enable */
#define IGC_CTRL_ADVD3WUC 0x00100000 /* D3 WUC */
/* Wake Up Status */
#define IGC_WUS_EX 0x00000004 /* Directed Exact */
#define IGC_WUS_ARPD 0x00000020 /* Directed ARP Request */
#define IGC_WUS_IPV4 0x00000040 /* Directed IPv4 */
#define IGC_WUS_IPV6 0x00000080 /* Directed IPv6 */
#define IGC_WUS_NSD 0x00000400 /* Directed IPv6 Neighbor Solicitation */
/* Packet types that are enabled for wake packet delivery */
#define WAKE_PKT_WUS ( \
IGC_WUS_EX | \
IGC_WUS_ARPD | \
IGC_WUS_IPV4 | \
IGC_WUS_IPV6 | \
IGC_WUS_NSD)
/* Wake Up Packet Length */
#define IGC_WUPL_MASK 0x00000FFF
/* Wake Up Packet Memory stores the first 128 bytes of the wake up packet */
#define IGC_WUPM_BYTES 128
/* Physical Func Reset Done Indication */ /* Physical Func Reset Done Indication */
#define IGC_CTRL_EXT_LINK_MODE_MASK 0x00C00000 #define IGC_CTRL_EXT_LINK_MODE_MASK 0x00C00000
......
This diff is collapsed.
...@@ -215,6 +215,15 @@ ...@@ -215,6 +215,15 @@
/* Shadow Ram Write Register - RW */ /* Shadow Ram Write Register - RW */
#define IGC_SRWR 0x12018 #define IGC_SRWR 0x12018
/* Wake Up registers */
#define IGC_WUC 0x05800 /* Wakeup Control - RW */
#define IGC_WUFC 0x05808 /* Wakeup Filter Control - RW */
#define IGC_WUS 0x05810 /* Wakeup Status - R/W1C */
#define IGC_WUPL 0x05900 /* Wakeup Packet Length - RW */
/* Wake Up packet memory */
#define IGC_WUPM_REG(_i) (0x05A00 + ((_i) * 4))
/* forward declaration */ /* forward declaration */
struct igc_hw; struct igc_hw;
u32 igc_rd32(struct igc_hw *hw, u32 reg); u32 igc_rd32(struct igc_hw *hw, u32 reg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment