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

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next

Jeff Kirsher says:

====================
Intel Wired LAN Driver Updates 2014-11-20

This series contains updates to ixgbevf, i40e and i40evf.

Emil updates ixgbevf with much of the work that Alex Duyck did while at
Intel.  First updates the driver to clear the status bits on allocation
instead of in the cleanup routine, this way we can leave the recieve
descriptor rings as a read only memory block until we actually have
buffers to give back to the hardware.  Clean up ixgbevf_clean_rx_irq()
by creating ixgbevf_process_skb_field() to merge several similar
operations into this new function.  Cleanup temporary variables within
the receive hot-path and reducing the scope of variables that do not
need to exist outside the main loop.  Save on stack space by just
storing our updated values back in next_to_clean instead of using
a stack variable, which also collapses the size the function.  Improve
performace on IOMMU enabled systems and reduce cache misses by changing
the basic receive patch for ixgbevf so that instead of receiving the
data into an skb, it is received into a double buffered page.  Add
netpoll support by creating ixgbevf_netpoll(), which is a callback for
.ndo_poll_controller to allow for the VF interface to be used with
netconsole.

Mitch provides several cleanups and trivial fixes for i40e and i40evf.
First is a fix the overloading of the msg_size field in the
arq_event_info struct by splitting the field into two and renaming to
indicate the actual function of each field.  Updates code comments
to match the actual function.  Cleanup several checkpatch.pl warnings
by adding or removing blank lines, aligning function parameters, and
correcting over-long lines (which makes the code more readable).

Shannon provides a patch for i40e to write the extra bits that will
turn off the ITR wait for the interrupt, since we want the SW INT to
go off as soon as possible.

v2: updated patch 07 based on feedback from Alex Duyck by
 - adding pfmemalloc check to a new function for reusable page
 - moved atomic_inc outside of #if/else in ixgbevf_add_rx_frag()
 - reverted the removal of the API check in ixgbevf_change_mtu()
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 7d7a1079 5d1ff106
...@@ -980,10 +980,10 @@ i40e_status i40e_clean_arq_element(struct i40e_hw *hw, ...@@ -980,10 +980,10 @@ i40e_status i40e_clean_arq_element(struct i40e_hw *hw,
e->desc = *desc; e->desc = *desc;
datalen = le16_to_cpu(desc->datalen); datalen = le16_to_cpu(desc->datalen);
e->msg_size = min(datalen, e->msg_size); e->msg_len = min(datalen, e->buf_len);
if (e->msg_buf != NULL && (e->msg_size != 0)) if (e->msg_buf != NULL && (e->msg_len != 0))
memcpy(e->msg_buf, hw->aq.arq.r.arq_bi[desc_idx].va, memcpy(e->msg_buf, hw->aq.arq.r.arq_bi[desc_idx].va,
e->msg_size); e->msg_len);
i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQRX: desc and buffer:\n"); i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQRX: desc and buffer:\n");
i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, e->msg_buf, i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, e->msg_buf,
......
...@@ -76,7 +76,8 @@ struct i40e_asq_cmd_details { ...@@ -76,7 +76,8 @@ struct i40e_asq_cmd_details {
/* ARQ event information */ /* ARQ event information */
struct i40e_arq_event_info { struct i40e_arq_event_info {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
u16 msg_size; u16 msg_len;
u16 buf_len;
u8 *msg_buf; u8 *msg_buf;
}; };
......
...@@ -1400,7 +1400,10 @@ static int i40e_intr_test(struct net_device *netdev, u64 *data) ...@@ -1400,7 +1400,10 @@ static int i40e_intr_test(struct net_device *netdev, u64 *data)
netif_info(pf, hw, netdev, "interrupt test\n"); netif_info(pf, hw, netdev, "interrupt test\n");
wr32(&pf->hw, I40E_PFINT_DYN_CTL0, wr32(&pf->hw, I40E_PFINT_DYN_CTL0,
(I40E_PFINT_DYN_CTL0_INTENA_MASK | (I40E_PFINT_DYN_CTL0_INTENA_MASK |
I40E_PFINT_DYN_CTL0_SWINT_TRIG_MASK)); I40E_PFINT_DYN_CTL0_SWINT_TRIG_MASK |
I40E_PFINT_DYN_CTL0_ITR_INDX_MASK |
I40E_PFINT_DYN_CTL0_SW_ITR_INDX_ENA_MASK |
I40E_PFINT_DYN_CTL0_SW_ITR_INDX_MASK));
usleep_range(1000, 2000); usleep_range(1000, 2000);
*data = (swc_old == pf->sw_int_count); *data = (swc_old == pf->sw_int_count);
......
...@@ -5565,11 +5565,17 @@ static void i40e_check_hang_subtask(struct i40e_pf *pf) ...@@ -5565,11 +5565,17 @@ static void i40e_check_hang_subtask(struct i40e_pf *pf)
if (!(pf->flags & I40E_FLAG_MSIX_ENABLED)) { if (!(pf->flags & I40E_FLAG_MSIX_ENABLED)) {
wr32(&vsi->back->hw, I40E_PFINT_DYN_CTL0, wr32(&vsi->back->hw, I40E_PFINT_DYN_CTL0,
(I40E_PFINT_DYN_CTL0_INTENA_MASK | (I40E_PFINT_DYN_CTL0_INTENA_MASK |
I40E_PFINT_DYN_CTL0_SWINT_TRIG_MASK)); I40E_PFINT_DYN_CTL0_SWINT_TRIG_MASK |
I40E_PFINT_DYN_CTL0_ITR_INDX_MASK |
I40E_PFINT_DYN_CTL0_SW_ITR_INDX_ENA_MASK |
I40E_PFINT_DYN_CTL0_SW_ITR_INDX_MASK));
} else { } else {
u16 vec = vsi->base_vector - 1; u16 vec = vsi->base_vector - 1;
u32 val = (I40E_PFINT_DYN_CTLN_INTENA_MASK | u32 val = (I40E_PFINT_DYN_CTLN_INTENA_MASK |
I40E_PFINT_DYN_CTLN_SWINT_TRIG_MASK); I40E_PFINT_DYN_CTLN_SWINT_TRIG_MASK |
I40E_PFINT_DYN_CTLN_ITR_INDX_MASK |
I40E_PFINT_DYN_CTLN_SW_ITR_INDX_ENA_MASK |
I40E_PFINT_DYN_CTLN_SW_ITR_INDX_MASK);
for (i = 0; i < vsi->num_q_vectors; i++, vec++) for (i = 0; i < vsi->num_q_vectors; i++, vec++)
wr32(&vsi->back->hw, wr32(&vsi->back->hw,
I40E_PFINT_DYN_CTLN(vec), val); I40E_PFINT_DYN_CTLN(vec), val);
...@@ -5750,13 +5756,12 @@ static void i40e_clean_adminq_subtask(struct i40e_pf *pf) ...@@ -5750,13 +5756,12 @@ static void i40e_clean_adminq_subtask(struct i40e_pf *pf)
if (oldval != val) if (oldval != val)
wr32(&pf->hw, pf->hw.aq.asq.len, val); wr32(&pf->hw, pf->hw.aq.asq.len, val);
event.msg_size = I40E_MAX_AQ_BUF_SIZE; event.buf_len = I40E_MAX_AQ_BUF_SIZE;
event.msg_buf = kzalloc(event.msg_size, GFP_KERNEL); event.msg_buf = kzalloc(event.buf_len, GFP_KERNEL);
if (!event.msg_buf) if (!event.msg_buf)
return; return;
do { do {
event.msg_size = I40E_MAX_AQ_BUF_SIZE; /* reinit each time */
ret = i40e_clean_arq_element(hw, &event, &pending); ret = i40e_clean_arq_element(hw, &event, &pending);
if (ret == I40E_ERR_ADMIN_QUEUE_NO_WORK) if (ret == I40E_ERR_ADMIN_QUEUE_NO_WORK)
break; break;
...@@ -5777,7 +5782,7 @@ static void i40e_clean_adminq_subtask(struct i40e_pf *pf) ...@@ -5777,7 +5782,7 @@ static void i40e_clean_adminq_subtask(struct i40e_pf *pf)
le32_to_cpu(event.desc.cookie_high), le32_to_cpu(event.desc.cookie_high),
le32_to_cpu(event.desc.cookie_low), le32_to_cpu(event.desc.cookie_low),
event.msg_buf, event.msg_buf,
event.msg_size); event.msg_len);
break; break;
case i40e_aqc_opc_lldp_update_mib: case i40e_aqc_opc_lldp_update_mib:
dev_dbg(&pf->pdev->dev, "ARQ: Update LLDP MIB event received\n"); dev_dbg(&pf->pdev->dev, "ARQ: Update LLDP MIB event received\n");
......
...@@ -929,10 +929,10 @@ i40e_status i40evf_clean_arq_element(struct i40e_hw *hw, ...@@ -929,10 +929,10 @@ i40e_status i40evf_clean_arq_element(struct i40e_hw *hw,
e->desc = *desc; e->desc = *desc;
datalen = le16_to_cpu(desc->datalen); datalen = le16_to_cpu(desc->datalen);
e->msg_size = min(datalen, e->msg_size); e->msg_len = min(datalen, e->buf_len);
if (e->msg_buf != NULL && (e->msg_size != 0)) if (e->msg_buf != NULL && (e->msg_len != 0))
memcpy(e->msg_buf, hw->aq.arq.r.arq_bi[desc_idx].va, memcpy(e->msg_buf, hw->aq.arq.r.arq_bi[desc_idx].va,
e->msg_size); e->msg_len);
if (i40e_is_nvm_update_op(&e->desc)) if (i40e_is_nvm_update_op(&e->desc))
hw->aq.nvm_busy = false; hw->aq.nvm_busy = false;
......
...@@ -76,7 +76,8 @@ struct i40e_asq_cmd_details { ...@@ -76,7 +76,8 @@ struct i40e_asq_cmd_details {
/* ARQ event information */ /* ARQ event information */
struct i40e_arq_event_info { struct i40e_arq_event_info {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
u16 msg_size; u16 msg_len;
u16 buf_len;
u8 *msg_buf; u8 *msg_buf;
}; };
......
...@@ -244,7 +244,7 @@ struct i40evf_adapter { ...@@ -244,7 +244,7 @@ struct i40evf_adapter {
struct i40e_hw hw; /* defined in i40e_type.h */ struct i40e_hw hw; /* defined in i40e_type.h */
enum i40evf_state_t state; enum i40evf_state_t state;
volatile unsigned long crit_section; unsigned long crit_section;
struct work_struct watchdog_task; struct work_struct watchdog_task;
bool netdev_registered; bool netdev_registered;
......
...@@ -58,7 +58,7 @@ static const struct i40evf_stats i40evf_gstrings_stats[] = { ...@@ -58,7 +58,7 @@ static const struct i40evf_stats i40evf_gstrings_stats[] = {
#define I40EVF_GLOBAL_STATS_LEN ARRAY_SIZE(i40evf_gstrings_stats) #define I40EVF_GLOBAL_STATS_LEN ARRAY_SIZE(i40evf_gstrings_stats)
#define I40EVF_QUEUE_STATS_LEN(_dev) \ #define I40EVF_QUEUE_STATS_LEN(_dev) \
(((struct i40evf_adapter *) \ (((struct i40evf_adapter *)\
netdev_priv(_dev))->num_active_queues \ netdev_priv(_dev))->num_active_queues \
* 2 * (sizeof(struct i40e_queue_stats) / sizeof(u64))) * 2 * (sizeof(struct i40e_queue_stats) / sizeof(u64)))
#define I40EVF_STATS_LEN(_dev) \ #define I40EVF_STATS_LEN(_dev) \
...@@ -175,6 +175,7 @@ static void i40evf_get_strings(struct net_device *netdev, u32 sset, u8 *data) ...@@ -175,6 +175,7 @@ static void i40evf_get_strings(struct net_device *netdev, u32 sset, u8 *data)
static u32 i40evf_get_msglevel(struct net_device *netdev) static u32 i40evf_get_msglevel(struct net_device *netdev)
{ {
struct i40evf_adapter *adapter = netdev_priv(netdev); struct i40evf_adapter *adapter = netdev_priv(netdev);
return adapter->msg_enable; return adapter->msg_enable;
} }
...@@ -189,6 +190,7 @@ static u32 i40evf_get_msglevel(struct net_device *netdev) ...@@ -189,6 +190,7 @@ static u32 i40evf_get_msglevel(struct net_device *netdev)
static void i40evf_set_msglevel(struct net_device *netdev, u32 data) static void i40evf_set_msglevel(struct net_device *netdev, u32 data)
{ {
struct i40evf_adapter *adapter = netdev_priv(netdev); struct i40evf_adapter *adapter = netdev_priv(netdev);
adapter->msg_enable = data; adapter->msg_enable = data;
} }
...@@ -621,7 +623,7 @@ static u32 i40evf_get_rxfh_indir_size(struct net_device *netdev) ...@@ -621,7 +623,7 @@ static u32 i40evf_get_rxfh_indir_size(struct net_device *netdev)
* i40evf_get_rxfh - get the rx flow hash indirection table * i40evf_get_rxfh - get the rx flow hash indirection table
* @netdev: network interface device structure * @netdev: network interface device structure
* @indir: indirection table * @indir: indirection table
* @key: hash key (will be %NULL until get_rxfh_key_size is implemented) * @key: hash key
* *
* Reads the indirection table directly from the hardware. Always returns 0. * Reads the indirection table directly from the hardware. Always returns 0.
**/ **/
...@@ -646,7 +648,7 @@ static int i40evf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key) ...@@ -646,7 +648,7 @@ static int i40evf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key)
* i40evf_set_rxfh - set the rx flow hash indirection table * i40evf_set_rxfh - set the rx flow hash indirection table
* @netdev: network interface device structure * @netdev: network interface device structure
* @indir: indirection table * @indir: indirection table
* @key: hash key (will be %NULL until get_rxfh_key_size is implemented) * @key: hash key
* *
* Returns -EINVAL if the table specifies an inavlid queue id, otherwise * Returns -EINVAL if the table specifies an inavlid queue id, otherwise
* returns 0 after programming the table. * returns 0 after programming the table.
......
...@@ -185,6 +185,7 @@ static void i40evf_tx_timeout(struct net_device *netdev) ...@@ -185,6 +185,7 @@ static void i40evf_tx_timeout(struct net_device *netdev)
static void i40evf_misc_irq_disable(struct i40evf_adapter *adapter) static void i40evf_misc_irq_disable(struct i40evf_adapter *adapter)
{ {
struct i40e_hw *hw = &adapter->hw; struct i40e_hw *hw = &adapter->hw;
wr32(hw, I40E_VFINT_DYN_CTL01, 0); wr32(hw, I40E_VFINT_DYN_CTL01, 0);
/* read flush */ /* read flush */
...@@ -200,6 +201,7 @@ static void i40evf_misc_irq_disable(struct i40evf_adapter *adapter) ...@@ -200,6 +201,7 @@ static void i40evf_misc_irq_disable(struct i40evf_adapter *adapter)
static void i40evf_misc_irq_enable(struct i40evf_adapter *adapter) static void i40evf_misc_irq_enable(struct i40evf_adapter *adapter)
{ {
struct i40e_hw *hw = &adapter->hw; struct i40e_hw *hw = &adapter->hw;
wr32(hw, I40E_VFINT_DYN_CTL01, I40E_VFINT_DYN_CTL01_INTENA_MASK | wr32(hw, I40E_VFINT_DYN_CTL01, I40E_VFINT_DYN_CTL01_INTENA_MASK |
I40E_VFINT_DYN_CTL01_ITR_INDX_MASK); I40E_VFINT_DYN_CTL01_ITR_INDX_MASK);
wr32(hw, I40E_VFINT_ICR0_ENA1, I40E_VFINT_ICR0_ENA_ADMINQ_MASK); wr32(hw, I40E_VFINT_ICR0_ENA1, I40E_VFINT_ICR0_ENA_ADMINQ_MASK);
...@@ -226,7 +228,6 @@ static void i40evf_irq_disable(struct i40evf_adapter *adapter) ...@@ -226,7 +228,6 @@ static void i40evf_irq_disable(struct i40evf_adapter *adapter)
} }
/* read flush */ /* read flush */
rd32(hw, I40E_VFGEN_RSTAT); rd32(hw, I40E_VFGEN_RSTAT);
} }
/** /**
...@@ -253,8 +254,7 @@ void i40evf_irq_enable_queues(struct i40evf_adapter *adapter, u32 mask) ...@@ -253,8 +254,7 @@ void i40evf_irq_enable_queues(struct i40evf_adapter *adapter, u32 mask)
* @adapter: board private structure * @adapter: board private structure
* @mask: bitmap of vectors to trigger * @mask: bitmap of vectors to trigger
**/ **/
static void i40evf_fire_sw_int(struct i40evf_adapter *adapter, static void i40evf_fire_sw_int(struct i40evf_adapter *adapter, u32 mask)
u32 mask)
{ {
struct i40e_hw *hw = &adapter->hw; struct i40e_hw *hw = &adapter->hw;
int i; int i;
...@@ -551,6 +551,7 @@ static void i40evf_free_traffic_irqs(struct i40evf_adapter *adapter) ...@@ -551,6 +551,7 @@ static void i40evf_free_traffic_irqs(struct i40evf_adapter *adapter)
{ {
int i; int i;
int q_vectors; int q_vectors;
q_vectors = adapter->num_msix_vectors - NONQ_VECS; q_vectors = adapter->num_msix_vectors - NONQ_VECS;
for (i = 0; i < q_vectors; i++) { for (i = 0; i < q_vectors; i++) {
...@@ -584,6 +585,7 @@ static void i40evf_configure_tx(struct i40evf_adapter *adapter) ...@@ -584,6 +585,7 @@ static void i40evf_configure_tx(struct i40evf_adapter *adapter)
{ {
struct i40e_hw *hw = &adapter->hw; struct i40e_hw *hw = &adapter->hw;
int i; int i;
for (i = 0; i < adapter->num_active_queues; i++) for (i = 0; i < adapter->num_active_queues; i++)
adapter->tx_rings[i]->tail = hw->hw_addr + I40E_QTX_TAIL1(i); adapter->tx_rings[i]->tail = hw->hw_addr + I40E_QTX_TAIL1(i);
} }
...@@ -667,9 +669,9 @@ i40evf_vlan_filter *i40evf_add_vlan(struct i40evf_adapter *adapter, u16 vlan) ...@@ -667,9 +669,9 @@ i40evf_vlan_filter *i40evf_add_vlan(struct i40evf_adapter *adapter, u16 vlan)
struct i40evf_vlan_filter *f; struct i40evf_vlan_filter *f;
f = i40evf_find_vlan(adapter, vlan); f = i40evf_find_vlan(adapter, vlan);
if (NULL == f) { if (!f) {
f = kzalloc(sizeof(*f), GFP_ATOMIC); f = kzalloc(sizeof(*f), GFP_ATOMIC);
if (NULL == f) if (!f)
return NULL; return NULL;
f->vlan = vlan; f->vlan = vlan;
...@@ -772,9 +774,9 @@ i40evf_mac_filter *i40evf_add_filter(struct i40evf_adapter *adapter, ...@@ -772,9 +774,9 @@ i40evf_mac_filter *i40evf_add_filter(struct i40evf_adapter *adapter,
udelay(1); udelay(1);
f = i40evf_find_filter(adapter, macaddr); f = i40evf_find_filter(adapter, macaddr);
if (NULL == f) { if (!f) {
f = kzalloc(sizeof(*f), GFP_ATOMIC); f = kzalloc(sizeof(*f), GFP_ATOMIC);
if (NULL == f) { if (!f) {
clear_bit(__I40EVF_IN_CRITICAL_TASK, clear_bit(__I40EVF_IN_CRITICAL_TASK,
&adapter->crit_section); &adapter->crit_section);
return NULL; return NULL;
...@@ -881,6 +883,7 @@ static void i40evf_napi_enable_all(struct i40evf_adapter *adapter) ...@@ -881,6 +883,7 @@ static void i40evf_napi_enable_all(struct i40evf_adapter *adapter)
for (q_idx = 0; q_idx < q_vectors; q_idx++) { for (q_idx = 0; q_idx < q_vectors; q_idx++) {
struct napi_struct *napi; struct napi_struct *napi;
q_vector = adapter->q_vector[q_idx]; q_vector = adapter->q_vector[q_idx];
napi = &q_vector->napi; napi = &q_vector->napi;
napi_enable(napi); napi_enable(napi);
...@@ -920,6 +923,7 @@ static void i40evf_configure(struct i40evf_adapter *adapter) ...@@ -920,6 +923,7 @@ static void i40evf_configure(struct i40evf_adapter *adapter)
for (i = 0; i < adapter->num_active_queues; i++) { for (i = 0; i < adapter->num_active_queues; i++) {
struct i40e_ring *ring = adapter->rx_rings[i]; struct i40e_ring *ring = adapter->rx_rings[i];
i40evf_alloc_rx_buffers(ring, ring->count); i40evf_alloc_rx_buffers(ring, ring->count);
ring->next_to_use = ring->count - 1; ring->next_to_use = ring->count - 1;
writel(ring->next_to_use, ring->tail); writel(ring->next_to_use, ring->tail);
...@@ -1088,7 +1092,7 @@ static int i40evf_alloc_queues(struct i40evf_adapter *adapter) ...@@ -1088,7 +1092,7 @@ static int i40evf_alloc_queues(struct i40evf_adapter *adapter)
struct i40e_ring *tx_ring; struct i40e_ring *tx_ring;
struct i40e_ring *rx_ring; struct i40e_ring *rx_ring;
tx_ring = kzalloc(sizeof(struct i40e_ring) * 2, GFP_KERNEL); tx_ring = kzalloc(sizeof(*tx_ring) * 2, GFP_KERNEL);
if (!tx_ring) if (!tx_ring)
goto err_out; goto err_out;
...@@ -1172,7 +1176,7 @@ static int i40evf_alloc_q_vectors(struct i40evf_adapter *adapter) ...@@ -1172,7 +1176,7 @@ static int i40evf_alloc_q_vectors(struct i40evf_adapter *adapter)
num_q_vectors = adapter->num_msix_vectors - NONQ_VECS; num_q_vectors = adapter->num_msix_vectors - NONQ_VECS;
for (q_idx = 0; q_idx < num_q_vectors; q_idx++) { for (q_idx = 0; q_idx < num_q_vectors; q_idx++) {
q_vector = kzalloc(sizeof(struct i40e_q_vector), GFP_KERNEL); q_vector = kzalloc(sizeof(*q_vector), GFP_KERNEL);
if (!q_vector) if (!q_vector)
goto err_out; goto err_out;
q_vector->adapter = adapter; q_vector->adapter = adapter;
...@@ -1265,8 +1269,8 @@ int i40evf_init_interrupt_scheme(struct i40evf_adapter *adapter) ...@@ -1265,8 +1269,8 @@ int i40evf_init_interrupt_scheme(struct i40evf_adapter *adapter)
} }
dev_info(&adapter->pdev->dev, "Multiqueue %s: Queue pair count = %u", dev_info(&adapter->pdev->dev, "Multiqueue %s: Queue pair count = %u",
(adapter->num_active_queues > 1) ? "Enabled" : (adapter->num_active_queues > 1) ? "Enabled" : "Disabled",
"Disabled", adapter->num_active_queues); adapter->num_active_queues);
return 0; return 0;
err_alloc_queues: err_alloc_queues:
...@@ -1284,6 +1288,7 @@ int i40evf_init_interrupt_scheme(struct i40evf_adapter *adapter) ...@@ -1284,6 +1288,7 @@ int i40evf_init_interrupt_scheme(struct i40evf_adapter *adapter)
static void i40evf_watchdog_timer(unsigned long data) static void i40evf_watchdog_timer(unsigned long data)
{ {
struct i40evf_adapter *adapter = (struct i40evf_adapter *)data; struct i40evf_adapter *adapter = (struct i40evf_adapter *)data;
schedule_work(&adapter->watchdog_task); schedule_work(&adapter->watchdog_task);
/* timer will be rescheduled in watchdog task */ /* timer will be rescheduled in watchdog task */
} }
...@@ -1508,7 +1513,6 @@ static void i40evf_reset_task(struct work_struct *work) ...@@ -1508,7 +1513,6 @@ static void i40evf_reset_task(struct work_struct *work)
if ((rstat_val != I40E_VFR_VFACTIVE) && if ((rstat_val != I40E_VFR_VFACTIVE) &&
(rstat_val != I40E_VFR_COMPLETED)) (rstat_val != I40E_VFR_COMPLETED))
break; break;
else
msleep(I40EVF_RESET_WAIT_MS); msleep(I40EVF_RESET_WAIT_MS);
} }
if (i == I40EVF_RESET_WAIT_COUNT) { if (i == I40EVF_RESET_WAIT_COUNT) {
...@@ -1523,7 +1527,6 @@ static void i40evf_reset_task(struct work_struct *work) ...@@ -1523,7 +1527,6 @@ static void i40evf_reset_task(struct work_struct *work)
if ((rstat_val == I40E_VFR_VFACTIVE) || if ((rstat_val == I40E_VFR_VFACTIVE) ||
(rstat_val == I40E_VFR_COMPLETED)) (rstat_val == I40E_VFR_COMPLETED))
break; break;
else
msleep(I40EVF_RESET_WAIT_MS); msleep(I40EVF_RESET_WAIT_MS);
} }
if (i == I40EVF_RESET_WAIT_COUNT) { if (i == I40EVF_RESET_WAIT_COUNT) {
...@@ -1632,8 +1635,8 @@ static void i40evf_adminq_task(struct work_struct *work) ...@@ -1632,8 +1635,8 @@ static void i40evf_adminq_task(struct work_struct *work)
if (adapter->flags & I40EVF_FLAG_PF_COMMS_FAILED) if (adapter->flags & I40EVF_FLAG_PF_COMMS_FAILED)
return; return;
event.msg_size = I40EVF_MAX_AQ_BUF_SIZE; event.buf_len = I40EVF_MAX_AQ_BUF_SIZE;
event.msg_buf = kzalloc(event.msg_size, GFP_KERNEL); event.msg_buf = kzalloc(event.buf_len, GFP_KERNEL);
if (!event.msg_buf) if (!event.msg_buf)
return; return;
...@@ -1645,11 +1648,9 @@ static void i40evf_adminq_task(struct work_struct *work) ...@@ -1645,11 +1648,9 @@ static void i40evf_adminq_task(struct work_struct *work)
i40evf_virtchnl_completion(adapter, v_msg->v_opcode, i40evf_virtchnl_completion(adapter, v_msg->v_opcode,
v_msg->v_retval, event.msg_buf, v_msg->v_retval, event.msg_buf,
event.msg_size); event.msg_len);
if (pending != 0) { if (pending != 0)
memset(event.msg_buf, 0, I40EVF_MAX_AQ_BUF_SIZE); memset(event.msg_buf, 0, I40EVF_MAX_AQ_BUF_SIZE);
event.msg_size = I40EVF_MAX_AQ_BUF_SIZE;
}
} while (pending); } while (pending);
/* check for error indications */ /* check for error indications */
...@@ -1706,7 +1707,6 @@ static void i40evf_free_all_tx_resources(struct i40evf_adapter *adapter) ...@@ -1706,7 +1707,6 @@ static void i40evf_free_all_tx_resources(struct i40evf_adapter *adapter)
for (i = 0; i < adapter->num_active_queues; i++) for (i = 0; i < adapter->num_active_queues; i++)
if (adapter->tx_rings[i]->desc) if (adapter->tx_rings[i]->desc)
i40evf_free_tx_resources(adapter->tx_rings[i]); i40evf_free_tx_resources(adapter->tx_rings[i]);
} }
/** /**
...@@ -2136,7 +2136,7 @@ static void i40evf_init_task(struct work_struct *work) ...@@ -2136,7 +2136,7 @@ static void i40evf_init_task(struct work_struct *work)
ether_addr_copy(netdev->perm_addr, adapter->hw.mac.addr); ether_addr_copy(netdev->perm_addr, adapter->hw.mac.addr);
f = kzalloc(sizeof(*f), GFP_ATOMIC); f = kzalloc(sizeof(*f), GFP_ATOMIC);
if (NULL == f) if (!f)
goto err_sw_init; goto err_sw_init;
ether_addr_copy(f->macaddr, adapter->hw.mac.addr); ether_addr_copy(f->macaddr, adapter->hw.mac.addr);
...@@ -2501,6 +2501,7 @@ static struct pci_driver i40evf_driver = { ...@@ -2501,6 +2501,7 @@ static struct pci_driver i40evf_driver = {
static int __init i40evf_init_module(void) static int __init i40evf_init_module(void)
{ {
int ret; int ret;
pr_info("i40evf: %s - version %s\n", i40evf_driver_string, pr_info("i40evf: %s - version %s\n", i40evf_driver_string,
i40evf_driver_version); i40evf_driver_version);
......
...@@ -92,8 +92,8 @@ int i40evf_verify_api_ver(struct i40evf_adapter *adapter) ...@@ -92,8 +92,8 @@ int i40evf_verify_api_ver(struct i40evf_adapter *adapter)
enum i40e_virtchnl_ops op; enum i40e_virtchnl_ops op;
i40e_status err; i40e_status err;
event.msg_size = I40EVF_MAX_AQ_BUF_SIZE; event.buf_len = I40EVF_MAX_AQ_BUF_SIZE;
event.msg_buf = kzalloc(event.msg_size, GFP_KERNEL); event.msg_buf = kzalloc(event.buf_len, GFP_KERNEL);
if (!event.msg_buf) { if (!event.msg_buf) {
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
...@@ -169,15 +169,14 @@ int i40evf_get_vf_config(struct i40evf_adapter *adapter) ...@@ -169,15 +169,14 @@ int i40evf_get_vf_config(struct i40evf_adapter *adapter)
len = sizeof(struct i40e_virtchnl_vf_resource) + len = sizeof(struct i40e_virtchnl_vf_resource) +
I40E_MAX_VF_VSI * sizeof(struct i40e_virtchnl_vsi_resource); I40E_MAX_VF_VSI * sizeof(struct i40e_virtchnl_vsi_resource);
event.msg_size = len; event.buf_len = len;
event.msg_buf = kzalloc(event.msg_size, GFP_KERNEL); event.msg_buf = kzalloc(event.buf_len, GFP_KERNEL);
if (!event.msg_buf) { if (!event.msg_buf) {
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
} }
while (1) { while (1) {
event.msg_size = len;
/* When the AQ is empty, i40evf_clean_arq_element will return /* When the AQ is empty, i40evf_clean_arq_element will return
* nonzero and this loop will terminate. * nonzero and this loop will terminate.
*/ */
...@@ -191,7 +190,7 @@ int i40evf_get_vf_config(struct i40evf_adapter *adapter) ...@@ -191,7 +190,7 @@ int i40evf_get_vf_config(struct i40evf_adapter *adapter)
} }
err = (i40e_status)le32_to_cpu(event.desc.cookie_low); err = (i40e_status)le32_to_cpu(event.desc.cookie_low);
memcpy(adapter->vf_res, event.msg_buf, min(event.msg_size, len)); memcpy(adapter->vf_res, event.msg_buf, min(event.msg_len, len));
i40e_vf_parse_hw_config(hw, adapter->vf_res); i40e_vf_parse_hw_config(hw, adapter->vf_res);
out_alloc: out_alloc:
...@@ -638,6 +637,7 @@ void i40evf_set_promiscuous(struct i40evf_adapter *adapter, int flags) ...@@ -638,6 +637,7 @@ void i40evf_set_promiscuous(struct i40evf_adapter *adapter, int flags)
void i40evf_request_stats(struct i40evf_adapter *adapter) void i40evf_request_stats(struct i40evf_adapter *adapter)
{ {
struct i40e_virtchnl_queue_select vqs; struct i40e_virtchnl_queue_select vqs;
if (adapter->current_op != I40E_VIRTCHNL_OP_UNKNOWN) { if (adapter->current_op != I40E_VIRTCHNL_OP_UNKNOWN) {
/* no error message, this isn't crucial */ /* no error message, this isn't crucial */
return; return;
...@@ -712,7 +712,6 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter, ...@@ -712,7 +712,6 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,
"%s: Unknown event %d from pf\n", "%s: Unknown event %d from pf\n",
__func__, vpe->event); __func__, vpe->event);
break; break;
} }
return; return;
} }
......
...@@ -58,8 +58,9 @@ struct ixgbevf_tx_buffer { ...@@ -58,8 +58,9 @@ struct ixgbevf_tx_buffer {
}; };
struct ixgbevf_rx_buffer { struct ixgbevf_rx_buffer {
struct sk_buff *skb;
dma_addr_t dma; dma_addr_t dma;
struct page *page;
unsigned int page_offset;
}; };
struct ixgbevf_stats { struct ixgbevf_stats {
...@@ -79,7 +80,6 @@ struct ixgbevf_tx_queue_stats { ...@@ -79,7 +80,6 @@ struct ixgbevf_tx_queue_stats {
}; };
struct ixgbevf_rx_queue_stats { struct ixgbevf_rx_queue_stats {
u64 non_eop_descs;
u64 alloc_rx_page_failed; u64 alloc_rx_page_failed;
u64 alloc_rx_buff_failed; u64 alloc_rx_buff_failed;
u64 csum_err; u64 csum_err;
...@@ -92,9 +92,10 @@ struct ixgbevf_ring { ...@@ -92,9 +92,10 @@ struct ixgbevf_ring {
void *desc; /* descriptor ring memory */ void *desc; /* descriptor ring memory */
dma_addr_t dma; /* phys. address of descriptor ring */ dma_addr_t dma; /* phys. address of descriptor ring */
unsigned int size; /* length in bytes */ unsigned int size; /* length in bytes */
unsigned int count; /* amount of descriptors */ u16 count; /* amount of descriptors */
unsigned int next_to_use; u16 next_to_use;
unsigned int next_to_clean; u16 next_to_clean;
u16 next_to_alloc;
union { union {
struct ixgbevf_tx_buffer *tx_buffer_info; struct ixgbevf_tx_buffer *tx_buffer_info;
...@@ -110,12 +111,11 @@ struct ixgbevf_ring { ...@@ -110,12 +111,11 @@ struct ixgbevf_ring {
u64 hw_csum_rx_error; u64 hw_csum_rx_error;
u8 __iomem *tail; u8 __iomem *tail;
struct sk_buff *skb;
u16 reg_idx; /* holds the special value that gets the hardware register u16 reg_idx; /* holds the special value that gets the hardware register
* offset associated with this ring, which is different * offset associated with this ring, which is different
* for DCB and RSS modes */ * for DCB and RSS modes */
u16 rx_buf_len;
int queue_index; /* needed for multiqueue queue management */ int queue_index; /* needed for multiqueue queue management */
}; };
...@@ -134,12 +134,10 @@ struct ixgbevf_ring { ...@@ -134,12 +134,10 @@ struct ixgbevf_ring {
/* Supported Rx Buffer Sizes */ /* Supported Rx Buffer Sizes */
#define IXGBEVF_RXBUFFER_256 256 /* Used for packet split */ #define IXGBEVF_RXBUFFER_256 256 /* Used for packet split */
#define IXGBEVF_RXBUFFER_2K 2048 #define IXGBEVF_RXBUFFER_2048 2048
#define IXGBEVF_RXBUFFER_4K 4096
#define IXGBEVF_RXBUFFER_8K 8192
#define IXGBEVF_RXBUFFER_10K 10240
#define IXGBEVF_RX_HDR_SIZE IXGBEVF_RXBUFFER_256 #define IXGBEVF_RX_HDR_SIZE IXGBEVF_RXBUFFER_256
#define IXGBEVF_RX_BUFSZ IXGBEVF_RXBUFFER_2048
#define MAXIMUM_ETHERNET_VLAN_SIZE (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN) #define MAXIMUM_ETHERNET_VLAN_SIZE (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)
...@@ -307,6 +305,13 @@ static inline bool ixgbevf_qv_disable(struct ixgbevf_q_vector *q_vector) ...@@ -307,6 +305,13 @@ static inline bool ixgbevf_qv_disable(struct ixgbevf_q_vector *q_vector)
((_eitr) ? (1000000000 / ((_eitr) * 256)) : 8) ((_eitr) ? (1000000000 / ((_eitr) * 256)) : 8)
#define EITR_REG_TO_INTS_PER_SEC EITR_INTS_PER_SEC_TO_REG #define EITR_REG_TO_INTS_PER_SEC EITR_INTS_PER_SEC_TO_REG
/* ixgbevf_test_staterr - tests bits in Rx descriptor status and error fields */
static inline __le32 ixgbevf_test_staterr(union ixgbe_adv_rx_desc *rx_desc,
const u32 stat_err_bits)
{
return rx_desc->wb.upper.status_error & cpu_to_le32(stat_err_bits);
}
static inline u16 ixgbevf_desc_unused(struct ixgbevf_ring *ring) static inline u16 ixgbevf_desc_unused(struct ixgbevf_ring *ring)
{ {
u16 ntc = ring->next_to_clean; u16 ntc = ring->next_to_clean;
...@@ -339,8 +344,10 @@ static inline void ixgbevf_write_tail(struct ixgbevf_ring *ring, u32 value) ...@@ -339,8 +344,10 @@ static inline void ixgbevf_write_tail(struct ixgbevf_ring *ring, u32 value)
/* board specific private data structure */ /* board specific private data structure */
struct ixgbevf_adapter { struct ixgbevf_adapter {
struct timer_list watchdog_timer; /* this field must be first, see ixgbevf_process_skb_fields */
unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]; unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
struct timer_list watchdog_timer;
struct work_struct reset_task; struct work_struct reset_task;
struct ixgbevf_q_vector *q_vector[MAX_MSIX_Q_VECTORS]; struct ixgbevf_q_vector *q_vector[MAX_MSIX_Q_VECTORS];
...@@ -363,7 +370,6 @@ struct ixgbevf_adapter { ...@@ -363,7 +370,6 @@ struct ixgbevf_adapter {
struct ixgbevf_ring *rx_ring[MAX_TX_QUEUES]; /* One per active queue */ struct ixgbevf_ring *rx_ring[MAX_TX_QUEUES]; /* One per active queue */
u64 hw_csum_rx_error; u64 hw_csum_rx_error;
u64 hw_rx_no_dma_resources; u64 hw_rx_no_dma_resources;
u64 non_eop_descs;
int num_msix_vectors; int num_msix_vectors;
u32 alloc_rx_page_failed; u32 alloc_rx_page_failed;
u32 alloc_rx_buff_failed; u32 alloc_rx_buff_failed;
...@@ -373,7 +379,7 @@ struct ixgbevf_adapter { ...@@ -373,7 +379,7 @@ struct ixgbevf_adapter {
*/ */
u32 flags; u32 flags;
#define IXGBE_FLAG_IN_WATCHDOG_TASK (u32)(1) #define IXGBE_FLAG_IN_WATCHDOG_TASK (u32)(1)
#define IXGBE_FLAG_IN_NETPOLL (u32)(1 << 1)
#define IXGBEVF_FLAG_QUEUE_RESET_REQUESTED (u32)(1 << 2) #define IXGBEVF_FLAG_QUEUE_RESET_REQUESTED (u32)(1 << 2)
struct msix_entry *msix_entries; struct msix_entry *msix_entries;
...@@ -423,11 +429,6 @@ enum ixbgevf_state_t { ...@@ -423,11 +429,6 @@ enum ixbgevf_state_t {
__IXGBEVF_WORK_INIT, __IXGBEVF_WORK_INIT,
}; };
struct ixgbevf_cb {
struct sk_buff *prev;
};
#define IXGBE_CB(skb) ((struct ixgbevf_cb *)(skb)->cb)
enum ixgbevf_boards { enum ixgbevf_boards {
board_82599_vf, board_82599_vf,
board_X540_vf, board_X540_vf,
......
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