Commit 8ce0c825 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-03

This series contains updates to i40e and i40evf.

Akeem adds a check for i40e so that flow director flush and reinit are
not done when flow director is not enabled.

Mitch fixes the i40evf driver to properly handle multiple admin queue
messages, by reinit the msg_size field each time we go through the loop.
Without this, we may receive truncated messages due to the firmware
thinking we have insufficient buffer size.  Also fixes the link checking
logic to only check the carrier state if the interface is actually
open, which allows link changes to be reported correctly without spamming
the VFs.  Updates i40e to inset the VSI ID in the QTX_CTL register
when configuring queues for VMDq VSIs.

Paul adds support for 10G-base-T in i40evf.

Jesse fixes i40e where the call to irq_dynamic_disable() was turning off
the interrupt completely when trying to set ITR to 0 (for lowest
moderation).

Shannon removes debugfs dump stats function, since it was not being
kept up-to-date and was redundant with the ethtool output.  Also, scales
back the LAN MSIx usage to force queue/vector sharing and leave some
vectors for Flow Director, VMDq, etc. when there are more cores than
vectors available to the PF.  Cleans up the error reporting for
get_lump() resource tracking errors.  Also adds a check for the
debug module parameter earlier to be able to catch the early configuration
phase admin queue messages.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents ec5a0ec1 2089ad03
......@@ -894,90 +894,6 @@ static void i40e_dbg_dump_eth_stats(struct i40e_pf *pf,
estats->tx_discards, estats->tx_errors);
}
/**
* i40e_dbg_dump_stats - handles dump stats write into command datum
* @pf: the i40e_pf created in command write
* @stats: the stats structure to be dumped
**/
static void i40e_dbg_dump_stats(struct i40e_pf *pf,
struct i40e_hw_port_stats *stats)
{
int i;
dev_info(&pf->pdev->dev, " stats:\n");
dev_info(&pf->pdev->dev,
" crc_errors = \t\t%lld \tillegal_bytes = \t%lld \terror_bytes = \t\t%lld\n",
stats->crc_errors, stats->illegal_bytes, stats->error_bytes);
dev_info(&pf->pdev->dev,
" mac_local_faults = \t%lld \tmac_remote_faults = \t%lld \trx_length_errors = \t%lld\n",
stats->mac_local_faults, stats->mac_remote_faults,
stats->rx_length_errors);
dev_info(&pf->pdev->dev,
" link_xon_rx = \t\t%lld \tlink_xoff_rx = \t\t%lld \tlink_xon_tx = \t\t%lld\n",
stats->link_xon_rx, stats->link_xoff_rx, stats->link_xon_tx);
dev_info(&pf->pdev->dev,
" link_xoff_tx = \t\t%lld \trx_size_64 = \t\t%lld \trx_size_127 = \t\t%lld\n",
stats->link_xoff_tx, stats->rx_size_64, stats->rx_size_127);
dev_info(&pf->pdev->dev,
" rx_size_255 = \t\t%lld \trx_size_511 = \t\t%lld \trx_size_1023 = \t\t%lld\n",
stats->rx_size_255, stats->rx_size_511, stats->rx_size_1023);
dev_info(&pf->pdev->dev,
" rx_size_big = \t\t%lld \trx_undersize = \t\t%lld \trx_jabber = \t\t%lld\n",
stats->rx_size_big, stats->rx_undersize, stats->rx_jabber);
dev_info(&pf->pdev->dev,
" rx_fragments = \t\t%lld \trx_oversize = \t\t%lld \ttx_size_64 = \t\t%lld\n",
stats->rx_fragments, stats->rx_oversize, stats->tx_size_64);
dev_info(&pf->pdev->dev,
" tx_size_127 = \t\t%lld \ttx_size_255 = \t\t%lld \ttx_size_511 = \t\t%lld\n",
stats->tx_size_127, stats->tx_size_255, stats->tx_size_511);
dev_info(&pf->pdev->dev,
" tx_size_1023 = \t\t%lld \ttx_size_big = \t\t%lld \tmac_short_packet_dropped = \t%lld\n",
stats->tx_size_1023, stats->tx_size_big,
stats->mac_short_packet_dropped);
for (i = 0; i < 8; i += 4) {
dev_info(&pf->pdev->dev,
" priority_xon_rx[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n",
i, stats->priority_xon_rx[i],
i+1, stats->priority_xon_rx[i+1],
i+2, stats->priority_xon_rx[i+2],
i+3, stats->priority_xon_rx[i+3]);
}
for (i = 0; i < 8; i += 4) {
dev_info(&pf->pdev->dev,
" priority_xoff_rx[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n",
i, stats->priority_xoff_rx[i],
i+1, stats->priority_xoff_rx[i+1],
i+2, stats->priority_xoff_rx[i+2],
i+3, stats->priority_xoff_rx[i+3]);
}
for (i = 0; i < 8; i += 4) {
dev_info(&pf->pdev->dev,
" priority_xon_tx[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n",
i, stats->priority_xon_tx[i],
i+1, stats->priority_xon_tx[i+1],
i+2, stats->priority_xon_tx[i+2],
i+3, stats->priority_xon_rx[i+3]);
}
for (i = 0; i < 8; i += 4) {
dev_info(&pf->pdev->dev,
" priority_xoff_tx[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n",
i, stats->priority_xoff_tx[i],
i+1, stats->priority_xoff_tx[i+1],
i+2, stats->priority_xoff_tx[i+2],
i+3, stats->priority_xoff_tx[i+3]);
}
for (i = 0; i < 8; i += 4) {
dev_info(&pf->pdev->dev,
" priority_xon_2_xoff[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n",
i, stats->priority_xon_2_xoff[i],
i+1, stats->priority_xon_2_xoff[i+1],
i+2, stats->priority_xon_2_xoff[i+2],
i+3, stats->priority_xon_2_xoff[i+3]);
}
i40e_dbg_dump_eth_stats(pf, &stats->eth);
}
/**
* i40e_dbg_dump_veb_seid - handles dump stats of a single given veb
* @pf: the i40e_pf created in command write
......@@ -1342,11 +1258,6 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
"dump desc rx <vsi_seid> <ring_id> [<desc_n>]\n");
dev_info(&pf->pdev->dev, "dump desc aq\n");
}
} else if (strncmp(&cmd_buf[5], "stats", 5) == 0) {
dev_info(&pf->pdev->dev, "pf stats:\n");
i40e_dbg_dump_stats(pf, &pf->stats);
dev_info(&pf->pdev->dev, "pf stats_offsets:\n");
i40e_dbg_dump_stats(pf, &pf->stats_offsets);
} else if (strncmp(&cmd_buf[5], "reset stats", 11) == 0) {
dev_info(&pf->pdev->dev,
"core reset count: %d\n", pf->corer_count);
......@@ -1464,8 +1375,8 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
} else {
dev_info(&pf->pdev->dev,
"dump desc tx <vsi_seid> <ring_id> [<desc_n>], dump desc rx <vsi_seid> <ring_id> [<desc_n>],\n");
dev_info(&pf->pdev->dev, "dump switch, dump vsi [seid] or\n");
dev_info(&pf->pdev->dev, "dump stats\n");
dev_info(&pf->pdev->dev, "dump switch\n");
dev_info(&pf->pdev->dev, "dump vsi [seid]\n");
dev_info(&pf->pdev->dev, "dump reset stats\n");
dev_info(&pf->pdev->dev, "dump port\n");
dev_info(&pf->pdev->dev,
......
......@@ -1574,7 +1574,6 @@ static int i40e_set_coalesce(struct net_device *netdev,
vsi->rx_itr_setting = ec->rx_coalesce_usecs;
} else if (ec->rx_coalesce_usecs == 0) {
vsi->rx_itr_setting = ec->rx_coalesce_usecs;
i40e_irq_dynamic_disable(vsi, vector);
if (ec->use_adaptive_rx_coalesce)
netif_info(pf, drv, netdev,
"Rx-secs=0, need to disable adaptive-Rx for a complete disable\n");
......@@ -1589,7 +1588,6 @@ static int i40e_set_coalesce(struct net_device *netdev,
vsi->tx_itr_setting = ec->tx_coalesce_usecs;
} else if (ec->tx_coalesce_usecs == 0) {
vsi->tx_itr_setting = ec->tx_coalesce_usecs;
i40e_irq_dynamic_disable(vsi, vector);
if (ec->use_adaptive_tx_coalesce)
netif_info(pf, drv, netdev,
"Tx-secs=0, need to disable adaptive-Tx for a complete disable\n");
......
......@@ -2462,10 +2462,14 @@ static int i40e_configure_tx_ring(struct i40e_ring *ring)
}
/* Now associate this queue with this PCI function */
if (vsi->type == I40E_VSI_VMDQ2)
if (vsi->type == I40E_VSI_VMDQ2) {
qtx_ctl = I40E_QTX_CTL_VM_QUEUE;
else
qtx_ctl |= ((vsi->id) << I40E_QTX_CTL_VFVM_INDX_SHIFT) &
I40E_QTX_CTL_VFVM_INDX_MASK;
} else {
qtx_ctl = I40E_QTX_CTL_PF_QUEUE;
}
qtx_ctl |= ((hw->pf_id << I40E_QTX_CTL_PF_INDX_SHIFT) &
I40E_QTX_CTL_PF_INDX_MASK);
wr32(hw, I40E_QTX_CTL(pf_q), qtx_ctl);
......@@ -5211,6 +5215,9 @@ static void i40e_fdir_flush_and_replay(struct i40e_pf *pf)
int flush_wait_retry = 50;
int reg;
if (!(pf->flags & (I40E_FLAG_FD_SB_ENABLED | I40E_FLAG_FD_ATR_ENABLED)))
return;
if (time_after(jiffies, pf->fd_flush_timestamp +
(I40E_MIN_FD_FLUSH_INTERVAL * HZ))) {
set_bit(__I40E_FD_FLUSH_REQUESTED, &pf->state);
......@@ -5272,6 +5279,9 @@ static void i40e_fdir_reinit_subtask(struct i40e_pf *pf)
if (test_bit(__I40E_DOWN, &pf->state))
return;
if (!(pf->flags & (I40E_FLAG_FD_SB_ENABLED | I40E_FLAG_FD_ATR_ENABLED)))
return;
if ((pf->fd_add_err >= I40E_MAX_FD_PROGRAM_ERROR) &&
(i40e_get_current_atr_cnt(pf) >= pf->fd_atr_cnt) &&
(i40e_get_current_atr_cnt(pf) > pf->fdir_pf_filter_count))
......@@ -5352,6 +5362,7 @@ static void i40e_veb_link_event(struct i40e_veb *veb, bool link_up)
static void i40e_link_event(struct i40e_pf *pf)
{
bool new_link, old_link;
struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];
/* set this to force the get_link_status call to refresh state */
pf->hw.phy.get_link_info = true;
......@@ -5360,10 +5371,12 @@ static void i40e_link_event(struct i40e_pf *pf)
new_link = i40e_get_link_status(&pf->hw);
if (new_link == old_link &&
new_link == netif_carrier_ok(pf->vsi[pf->lan_vsi]->netdev))
(test_bit(__I40E_DOWN, &vsi->state) ||
new_link == netif_carrier_ok(vsi->netdev)))
return;
if (!test_bit(__I40E_DOWN, &pf->vsi[pf->lan_vsi]->state))
i40e_print_link_message(pf->vsi[pf->lan_vsi], new_link);
if (!test_bit(__I40E_DOWN, &vsi->state))
i40e_print_link_message(vsi, new_link);
/* Notify the base of the switch tree connected to
* the link. Floating VEBs are not notified.
......@@ -5371,7 +5384,7 @@ static void i40e_link_event(struct i40e_pf *pf)
if (pf->lan_veb != I40E_NO_VEB && pf->veb[pf->lan_veb])
i40e_veb_link_event(pf->veb[pf->lan_veb], new_link);
else
i40e_vsi_link_event(pf->vsi[pf->lan_vsi], new_link);
i40e_vsi_link_event(vsi, new_link);
if (pf->vf)
i40e_vc_notify_link_state(pf);
......@@ -6161,12 +6174,13 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
if (reg & I40E_GL_MDET_TX_VALID_MASK) {
u8 pf_num = (reg & I40E_GL_MDET_TX_PF_NUM_MASK) >>
I40E_GL_MDET_TX_PF_NUM_SHIFT;
u8 vf_num = (reg & I40E_GL_MDET_TX_VF_NUM_MASK) >>
u16 vf_num = (reg & I40E_GL_MDET_TX_VF_NUM_MASK) >>
I40E_GL_MDET_TX_VF_NUM_SHIFT;
u8 event = (reg & I40E_GL_MDET_TX_EVENT_MASK) >>
I40E_GL_MDET_TX_EVENT_SHIFT;
u8 queue = (reg & I40E_GL_MDET_TX_QUEUE_MASK) >>
I40E_GL_MDET_TX_QUEUE_SHIFT;
u16 queue = ((reg & I40E_GL_MDET_TX_QUEUE_MASK) >>
I40E_GL_MDET_TX_QUEUE_SHIFT) -
pf->hw.func_caps.base_queue;
if (netif_msg_tx_err(pf))
dev_info(&pf->pdev->dev, "Malicious Driver Detection event 0x%02x on TX queue %d pf number 0x%02x vf number 0x%02x\n",
event, queue, pf_num, vf_num);
......@@ -6179,8 +6193,9 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
I40E_GL_MDET_RX_FUNCTION_SHIFT;
u8 event = (reg & I40E_GL_MDET_RX_EVENT_MASK) >>
I40E_GL_MDET_RX_EVENT_SHIFT;
u8 queue = (reg & I40E_GL_MDET_RX_QUEUE_MASK) >>
I40E_GL_MDET_RX_QUEUE_SHIFT;
u16 queue = ((reg & I40E_GL_MDET_RX_QUEUE_MASK) >>
I40E_GL_MDET_RX_QUEUE_SHIFT) -
pf->hw.func_caps.base_queue;
if (netif_msg_rx_err(pf))
dev_info(&pf->pdev->dev, "Malicious Driver Detection event 0x%02x on RX queue %d of function 0x%02x\n",
event, queue, func);
......@@ -6690,6 +6705,7 @@ static int i40e_init_msix(struct i40e_pf *pf)
{
i40e_status err = 0;
struct i40e_hw *hw = &pf->hw;
int other_vecs = 0;
int v_budget, i;
int vec;
......@@ -6715,10 +6731,10 @@ static int i40e_init_msix(struct i40e_pf *pf)
*/
pf->num_lan_msix = pf->num_lan_qps - (pf->rss_size_max - pf->rss_size);
pf->num_vmdq_msix = pf->num_vmdq_qps;
v_budget = 1 + pf->num_lan_msix;
v_budget += (pf->num_vmdq_vsis * pf->num_vmdq_msix);
other_vecs = 1;
other_vecs += (pf->num_vmdq_vsis * pf->num_vmdq_msix);
if (pf->flags & I40E_FLAG_FD_SB_ENABLED)
v_budget++;
other_vecs++;
#ifdef I40E_FCOE
if (pf->flags & I40E_FLAG_FCOE_ENABLED) {
......@@ -6728,7 +6744,9 @@ static int i40e_init_msix(struct i40e_pf *pf)
#endif
/* Scale down if necessary, and the rings will share vectors */
v_budget = min_t(int, v_budget, hw->func_caps.num_msix_vectors);
pf->num_lan_msix = min_t(int, pf->num_lan_msix,
(hw->func_caps.num_msix_vectors - other_vecs));
v_budget = pf->num_lan_msix + other_vecs;
pf->msix_entries = kcalloc(v_budget, sizeof(struct msix_entry),
GFP_KERNEL);
......@@ -7945,8 +7963,8 @@ static int i40e_vsi_setup_vectors(struct i40e_vsi *vsi)
vsi->num_q_vectors, vsi->idx);
if (vsi->base_vector < 0) {
dev_info(&pf->pdev->dev,
"failed to get queue tracking for VSI %d, err=%d\n",
vsi->seid, vsi->base_vector);
"failed to get tracking for %d vectors for VSI %d, err=%d\n",
vsi->num_q_vectors, vsi->seid, vsi->base_vector);
i40e_vsi_free_q_vectors(vsi);
ret = -ENOENT;
goto vector_setup_out;
......@@ -7982,8 +8000,9 @@ static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi)
ret = i40e_get_lump(pf, pf->qp_pile, vsi->alloc_queue_pairs, vsi->idx);
if (ret < 0) {
dev_info(&pf->pdev->dev, "VSI %d get_lump failed %d\n",
vsi->seid, ret);
dev_info(&pf->pdev->dev,
"failed to get tracking for %d queues for VSI %d err=%d\n",
vsi->alloc_queue_pairs, vsi->seid, ret);
goto err_vsi;
}
vsi->base_queue = ret;
......@@ -8112,8 +8131,9 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
ret = i40e_get_lump(pf, pf->qp_pile, vsi->alloc_queue_pairs,
vsi->idx);
if (ret < 0) {
dev_info(&pf->pdev->dev, "VSI %d get_lump failed %d\n",
vsi->seid, ret);
dev_info(&pf->pdev->dev,
"failed to get tracking for %d queues for VSI %d err=%d\n",
vsi->alloc_queue_pairs, vsi->seid, ret);
goto err_vsi;
}
vsi->base_queue = ret;
......@@ -9009,6 +9029,11 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
hw->bus.func = PCI_FUNC(pdev->devfn);
pf->instance = pfs_found;
if (debug != -1) {
pf->msg_enable = pf->hw.debug_mask;
pf->msg_enable = debug;
}
/* do a special CORER for clearing PXE mode once at init */
if (hw->revision_id == 0 &&
(rd32(hw, I40E_GLLAN_RCTL_0) & I40E_GLLAN_RCTL_0_PXE_MODE_MASK)) {
......
......@@ -50,6 +50,7 @@ i40e_status i40e_set_mac_type(struct i40e_hw *hw)
case I40E_DEV_ID_QSFP_A:
case I40E_DEV_ID_QSFP_B:
case I40E_DEV_ID_QSFP_C:
case I40E_DEV_ID_10G_BASE_T:
hw->mac.type = I40E_MAC_XL710;
break;
case I40E_DEV_ID_VF:
......
......@@ -43,6 +43,7 @@
#define I40E_DEV_ID_QSFP_A 0x1583
#define I40E_DEV_ID_QSFP_B 0x1584
#define I40E_DEV_ID_QSFP_C 0x1585
#define I40E_DEV_ID_10G_BASE_T 0x1586
#define I40E_DEV_ID_VF 0x154C
#define I40E_DEV_ID_VF_HV 0x1571
......
......@@ -1647,10 +1647,8 @@ static void i40evf_adminq_task(struct work_struct *work)
v_msg->v_retval, event.msg_buf,
event.msg_size);
if (pending != 0) {
dev_info(&adapter->pdev->dev,
"%s: ARQ: Pending events %d\n",
__func__, pending);
memset(event.msg_buf, 0, I40EVF_MAX_AQ_BUF_SIZE);
event.msg_size = I40EVF_MAX_AQ_BUF_SIZE;
}
} while (pending);
......
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