|
@@ -2874,22 +2874,15 @@ static void i40e_vsi_free_rx_resources(struct i40e_vsi *vsi)
|
|
|
static void i40e_config_xps_tx_ring(struct i40e_ring *ring)
|
|
|
{
|
|
|
struct i40e_vsi *vsi = ring->vsi;
|
|
|
- cpumask_var_t mask;
|
|
|
|
|
|
if (!ring->q_vector || !ring->netdev)
|
|
|
return;
|
|
|
|
|
|
- /* Single TC mode enable XPS */
|
|
|
- if (vsi->tc_config.numtc <= 1) {
|
|
|
- if (!test_and_set_bit(__I40E_TX_XPS_INIT_DONE, &ring->state))
|
|
|
- netif_set_xps_queue(ring->netdev,
|
|
|
- &ring->q_vector->affinity_mask,
|
|
|
- ring->queue_index);
|
|
|
- } else if (alloc_cpumask_var(&mask, GFP_KERNEL)) {
|
|
|
- /* Disable XPS to allow selection based on TC */
|
|
|
- bitmap_zero(cpumask_bits(mask), nr_cpumask_bits);
|
|
|
- netif_set_xps_queue(ring->netdev, mask, ring->queue_index);
|
|
|
- free_cpumask_var(mask);
|
|
|
+ if ((vsi->tc_config.numtc <= 1) &&
|
|
|
+ !test_and_set_bit(__I40E_TX_XPS_INIT_DONE, &ring->state)) {
|
|
|
+ netif_set_xps_queue(ring->netdev,
|
|
|
+ get_cpu_mask(ring->q_vector->v_idx),
|
|
|
+ ring->queue_index);
|
|
|
}
|
|
|
|
|
|
/* schedule our worker thread which will take care of
|
|
@@ -3513,8 +3506,10 @@ static int i40e_vsi_request_irq_msix(struct i40e_vsi *vsi, char *basename)
|
|
|
q_vector->affinity_notify.notify = i40e_irq_affinity_notify;
|
|
|
q_vector->affinity_notify.release = i40e_irq_affinity_release;
|
|
|
irq_set_affinity_notifier(irq_num, &q_vector->affinity_notify);
|
|
|
- /* assign the mask for this irq */
|
|
|
- irq_set_affinity_hint(irq_num, &q_vector->affinity_mask);
|
|
|
+ /* get_cpu_mask returns a static constant mask with
|
|
|
+ * a permanent lifetime so it's ok to use here.
|
|
|
+ */
|
|
|
+ irq_set_affinity_hint(irq_num, get_cpu_mask(q_vector->v_idx));
|
|
|
}
|
|
|
|
|
|
vsi->irqs_ready = true;
|
|
@@ -4296,7 +4291,7 @@ static void i40e_vsi_free_irq(struct i40e_vsi *vsi)
|
|
|
|
|
|
/* clear the affinity notifier in the IRQ descriptor */
|
|
|
irq_set_affinity_notifier(irq_num, NULL);
|
|
|
- /* clear the affinity_mask in the IRQ descriptor */
|
|
|
+ /* remove our suggested affinity mask for this IRQ */
|
|
|
irq_set_affinity_hint(irq_num, NULL);
|
|
|
synchronize_irq(irq_num);
|
|
|
free_irq(irq_num, vsi->q_vectors[i]);
|
|
@@ -5354,6 +5349,7 @@ void i40e_print_link_message(struct i40e_vsi *vsi, bool isup)
|
|
|
char *speed = "Unknown";
|
|
|
char *fc = "Unknown";
|
|
|
char *fec = "";
|
|
|
+ char *req_fec = "";
|
|
|
char *an = "";
|
|
|
|
|
|
new_speed = vsi->back->hw.phy.link_info.link_speed;
|
|
@@ -5415,6 +5411,7 @@ void i40e_print_link_message(struct i40e_vsi *vsi, bool isup)
|
|
|
}
|
|
|
|
|
|
if (vsi->back->hw.phy.link_info.link_speed == I40E_LINK_SPEED_25GB) {
|
|
|
+ req_fec = ", Requested FEC: None";
|
|
|
fec = ", FEC: None";
|
|
|
an = ", Autoneg: False";
|
|
|
|
|
@@ -5427,10 +5424,22 @@ void i40e_print_link_message(struct i40e_vsi *vsi, bool isup)
|
|
|
else if (vsi->back->hw.phy.link_info.fec_info &
|
|
|
I40E_AQ_CONFIG_FEC_RS_ENA)
|
|
|
fec = ", FEC: CL108 RS-FEC";
|
|
|
+
|
|
|
+ /* 'CL108 RS-FEC' should be displayed when RS is requested, or
|
|
|
+ * both RS and FC are requested
|
|
|
+ */
|
|
|
+ if (vsi->back->hw.phy.link_info.req_fec_info &
|
|
|
+ (I40E_AQ_REQUEST_FEC_KR | I40E_AQ_REQUEST_FEC_RS)) {
|
|
|
+ if (vsi->back->hw.phy.link_info.req_fec_info &
|
|
|
+ I40E_AQ_REQUEST_FEC_RS)
|
|
|
+ req_fec = ", Requested FEC: CL108 RS-FEC";
|
|
|
+ else
|
|
|
+ req_fec = ", Requested FEC: CL74 FC-FEC/BASE-R";
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- netdev_info(vsi->netdev, "NIC Link is Up, %sbps Full Duplex%s%s, Flow Control: %s\n",
|
|
|
- speed, fec, an, fc);
|
|
|
+ netdev_info(vsi->netdev, "NIC Link is Up, %sbps Full Duplex%s%s%s, Flow Control: %s\n",
|
|
|
+ speed, req_fec, fec, an, fc);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -8228,7 +8237,7 @@ static int i40e_vsi_alloc_q_vector(struct i40e_vsi *vsi, int v_idx, int cpu)
|
|
|
|
|
|
q_vector->vsi = vsi;
|
|
|
q_vector->v_idx = v_idx;
|
|
|
- cpumask_set_cpu(cpu, &q_vector->affinity_mask);
|
|
|
+ cpumask_copy(&q_vector->affinity_mask, cpu_possible_mask);
|
|
|
|
|
|
if (vsi->netdev)
|
|
|
netif_napi_add(vsi->netdev, &q_vector->napi,
|
|
@@ -9690,8 +9699,13 @@ static int i40e_config_netdev(struct i40e_vsi *vsi)
|
|
|
i40e_add_mac_filter(vsi, mac_addr);
|
|
|
spin_unlock_bh(&vsi->mac_filter_hash_lock);
|
|
|
} else {
|
|
|
- /* relate the VSI_VMDQ name to the VSI_MAIN name */
|
|
|
- snprintf(netdev->name, IFNAMSIZ, "%sv%%d",
|
|
|
+ /* Relate the VSI_VMDQ name to the VSI_MAIN name. Note that we
|
|
|
+ * are still limited by IFNAMSIZ, but we're adding 'v%d\0' to
|
|
|
+ * the end, which is 4 bytes long, so force truncation of the
|
|
|
+ * original name by IFNAMSIZ - 4
|
|
|
+ */
|
|
|
+ snprintf(netdev->name, IFNAMSIZ, "%.*sv%%d",
|
|
|
+ IFNAMSIZ - 4,
|
|
|
pf->vsi[pf->lan_vsi]->netdev->name);
|
|
|
random_ether_addr(mac_addr);
|
|
|
|
|
@@ -9865,13 +9879,15 @@ static int i40e_add_vsi(struct i40e_vsi *vsi)
|
|
|
*/
|
|
|
ret = i40e_vsi_config_tc(vsi, enabled_tc);
|
|
|
if (ret) {
|
|
|
+ /* Single TC condition is not fatal,
|
|
|
+ * message and continue
|
|
|
+ */
|
|
|
dev_info(&pf->pdev->dev,
|
|
|
"failed to configure TCs for main VSI tc_map 0x%08x, err %s aq_err %s\n",
|
|
|
enabled_tc,
|
|
|
i40e_stat_str(&pf->hw, ret),
|
|
|
i40e_aq_str(&pf->hw,
|
|
|
pf->hw.aq.asq_last_status));
|
|
|
- ret = -ENOENT;
|
|
|
}
|
|
|
}
|
|
|
break;
|