|
@@ -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)) {
|