Skip to content

Commit fe21882

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2015-08-26 This series contains updates to i40e and i40evf only. Anjali provides a fix for i40e where the part is not receiving multicast or VLAN tagged packets when in promiscuous mode. This can occur when a software bridge is created on top of the device. Fixed the legacy and MSI interrupt mode in the driver, which was non-existent before since we were assuming MSIX was the only mode that the driver ran in. Fixed the i40evf driver, where the wrong defines were getting used in the VF driver. Mitch fixes a sparse warning about comparing __le16 to u16 so use le16_to_cpu() to resolve the warning. Also fixed a dyslexic spelling of invalid. Shannon adds port.crc_errors to receive CRC error counter, since it is a receive counter. Catherine provides a fix to move the stopping of the service task and flow director to i40e_shutdown() instead of i40e_suspend(). Greg fixes the ethtool offline diagnostic with netqueues, which just need to be treated the same as virtual functions when someone wants to run the ethtool offline diagnostic test. Also fixed up code comments for the i40e ethtool diagnostic test function. Cleans up redundant and unneeded messages, since the kernel notifies all VXLAN capable registered drivers, so no need to log this. Neerav adds the ability to update statistics per VEB per traffic class and dump it via ethtool. Jingjing adds support for virtual channel offload to support receive polling mode in the VF driver. v2: dropped patch which added helper functions into a header, feedback from David Miller was to make the functions constant to reduce the driver footprint, so remove the patch while Anjali works on making the requested changes. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 0118e01 + bf41846 commit fe21882

File tree

15 files changed

+188
-3166
lines changed

15 files changed

+188
-3166
lines changed

drivers/net/ethernet/intel/i40e/i40e.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,8 @@ struct i40e_veb {
442442
bool stat_offsets_loaded;
443443
struct i40e_eth_stats stats;
444444
struct i40e_eth_stats stats_offsets;
445+
struct i40e_veb_tc_stats tc_stats;
446+
struct i40e_veb_tc_stats tc_stats_offsets;
445447
};
446448

447449
/* struct that defines a VSI, associated with a dev */

drivers/net/ethernet/intel/i40e/i40e_dcb.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,8 @@ i40e_status i40e_get_dcb_config(struct i40e_hw *hw)
588588
if (!ret) {
589589
/* CEE mode */
590590
hw->local_dcbx_config.dcbx_mode = I40E_DCBX_MODE_CEE;
591+
hw->local_dcbx_config.tlv_status =
592+
le16_to_cpu(cee_v1_cfg.tlv_status);
591593
i40e_cee_to_dcb_v1_config(&cee_v1_cfg,
592594
&hw->local_dcbx_config);
593595
}
@@ -597,6 +599,8 @@ i40e_status i40e_get_dcb_config(struct i40e_hw *hw)
597599
if (!ret) {
598600
/* CEE mode */
599601
hw->local_dcbx_config.dcbx_mode = I40E_DCBX_MODE_CEE;
602+
hw->local_dcbx_config.tlv_status =
603+
le32_to_cpu(cee_cfg.tlv_status);
600604
i40e_cee_to_dcb_config(&cee_cfg,
601605
&hw->local_dcbx_config);
602606
}

drivers/net/ethernet/intel/i40e/i40e_ethtool.c

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static struct i40e_stats i40e_gstrings_stats[] = {
114114
I40E_PF_STAT("tx_errors", stats.eth.tx_errors),
115115
I40E_PF_STAT("rx_dropped", stats.eth.rx_discards),
116116
I40E_PF_STAT("tx_dropped_link_down", stats.tx_dropped_link_down),
117-
I40E_PF_STAT("crc_errors", stats.crc_errors),
117+
I40E_PF_STAT("rx_crc_errors", stats.crc_errors),
118118
I40E_PF_STAT("illegal_bytes", stats.illegal_bytes),
119119
I40E_PF_STAT("mac_local_faults", stats.mac_local_faults),
120120
I40E_PF_STAT("mac_remote_faults", stats.mac_remote_faults),
@@ -197,7 +197,14 @@ static const struct i40e_stats i40e_gstrings_fcoe_stats[] = {
197197
FIELD_SIZEOF(struct i40e_pf, stats.priority_xon_tx) + \
198198
FIELD_SIZEOF(struct i40e_pf, stats.priority_xon_2_xoff)) \
199199
/ sizeof(u64))
200+
#define I40E_VEB_TC_STATS_LEN ( \
201+
(FIELD_SIZEOF(struct i40e_veb, tc_stats.tc_rx_packets) + \
202+
FIELD_SIZEOF(struct i40e_veb, tc_stats.tc_rx_bytes) + \
203+
FIELD_SIZEOF(struct i40e_veb, tc_stats.tc_tx_packets) + \
204+
FIELD_SIZEOF(struct i40e_veb, tc_stats.tc_tx_bytes)) \
205+
/ sizeof(u64))
200206
#define I40E_VEB_STATS_LEN ARRAY_SIZE(i40e_gstrings_veb_stats)
207+
#define I40E_VEB_STATS_TOTAL (I40E_VEB_STATS_LEN + I40E_VEB_TC_STATS_LEN)
201208
#define I40E_PF_STATS_LEN(n) (I40E_GLOBAL_STATS_LEN + \
202209
I40E_PFC_STATS_LEN + \
203210
I40E_VSI_STATS_LEN((n)))
@@ -1257,7 +1264,7 @@ static int i40e_get_sset_count(struct net_device *netdev, int sset)
12571264
int len = I40E_PF_STATS_LEN(netdev);
12581265

12591266
if (pf->lan_veb != I40E_NO_VEB)
1260-
len += I40E_VEB_STATS_LEN;
1267+
len += I40E_VEB_STATS_TOTAL;
12611268
return len;
12621269
} else {
12631270
return I40E_VSI_STATS_LEN(netdev);
@@ -1408,6 +1415,20 @@ static void i40e_get_strings(struct net_device *netdev, u32 stringset,
14081415
i40e_gstrings_veb_stats[i].stat_string);
14091416
p += ETH_GSTRING_LEN;
14101417
}
1418+
for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
1419+
snprintf(p, ETH_GSTRING_LEN,
1420+
"veb.tc_%u_tx_packets", i);
1421+
p += ETH_GSTRING_LEN;
1422+
snprintf(p, ETH_GSTRING_LEN,
1423+
"veb.tc_%u_tx_bytes", i);
1424+
p += ETH_GSTRING_LEN;
1425+
snprintf(p, ETH_GSTRING_LEN,
1426+
"veb.tc_%u_rx_packets", i);
1427+
p += ETH_GSTRING_LEN;
1428+
snprintf(p, ETH_GSTRING_LEN,
1429+
"veb.tc_%u_rx_bytes", i);
1430+
p += ETH_GSTRING_LEN;
1431+
}
14111432
}
14121433
for (i = 0; i < I40E_GLOBAL_STATS_LEN; i++) {
14131434
snprintf(p, ETH_GSTRING_LEN, "port.%s",
@@ -1559,6 +1580,21 @@ static inline bool i40e_active_vfs(struct i40e_pf *pf)
15591580
return false;
15601581
}
15611582

1583+
static inline bool i40e_active_vmdqs(struct i40e_pf *pf)
1584+
{
1585+
struct i40e_vsi **vsi = pf->vsi;
1586+
int i;
1587+
1588+
for (i = 0; i < pf->num_alloc_vsi; i++) {
1589+
if (!vsi[i])
1590+
continue;
1591+
if (vsi[i]->type == I40E_VSI_VMDQ2)
1592+
return true;
1593+
}
1594+
1595+
return false;
1596+
}
1597+
15621598
static void i40e_diag_test(struct net_device *netdev,
15631599
struct ethtool_test *eth_test, u64 *data)
15641600
{
@@ -1572,9 +1608,9 @@ static void i40e_diag_test(struct net_device *netdev,
15721608

15731609
set_bit(__I40E_TESTING, &pf->state);
15741610

1575-
if (i40e_active_vfs(pf)) {
1611+
if (i40e_active_vfs(pf) || i40e_active_vmdqs(pf)) {
15761612
dev_warn(&pf->pdev->dev,
1577-
"Please take active VFS offline and restart the adapter before running NIC diagnostics\n");
1613+
"Please take active VFs and Netqueues offline and restart the adapter before running NIC diagnostics\n");
15781614
data[I40E_ETH_TEST_REG] = 1;
15791615
data[I40E_ETH_TEST_EEPROM] = 1;
15801616
data[I40E_ETH_TEST_INTR] = 1;
@@ -1590,11 +1626,13 @@ static void i40e_diag_test(struct net_device *netdev,
15901626
/* indicate we're in test mode */
15911627
dev_close(netdev);
15921628
else
1629+
/* This reset does not affect link - if it is
1630+
* changed to a type of reset that does affect
1631+
* link then the following link test would have
1632+
* to be moved to before the reset
1633+
*/
15931634
i40e_do_reset(pf, BIT(__I40E_PF_RESET_REQUESTED));
15941635

1595-
/* Link test performed before hardware reset
1596-
* so autoneg doesn't interfere with test result
1597-
*/
15981636
if (i40e_link_test(netdev, &data[I40E_ETH_TEST_LINK]))
15991637
eth_test->flags |= ETH_TEST_FL_FAILED;
16001638

@@ -2508,7 +2546,7 @@ static int i40e_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,
25082546
* @indir: indirection table
25092547
* @key: hash key
25102548
*
2511-
* Returns -EINVAL if the table specifies an inavlid queue id, otherwise
2549+
* Returns -EINVAL if the table specifies an invalid queue id, otherwise
25122550
* returns 0 after programming the table.
25132551
**/
25142552
static int i40e_set_rxfh(struct net_device *netdev, const u32 *indir,

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 55 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static const char i40e_driver_string[] =
3939

4040
#define DRV_VERSION_MAJOR 1
4141
#define DRV_VERSION_MINOR 3
42-
#define DRV_VERSION_BUILD 6
42+
#define DRV_VERSION_BUILD 9
4343
#define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
4444
__stringify(DRV_VERSION_MINOR) "." \
4545
__stringify(DRV_VERSION_BUILD) DRV_KERN
@@ -624,11 +624,15 @@ static void i40e_update_veb_stats(struct i40e_veb *veb)
624624
struct i40e_hw *hw = &pf->hw;
625625
struct i40e_eth_stats *oes;
626626
struct i40e_eth_stats *es; /* device's eth stats */
627-
int idx = 0;
627+
struct i40e_veb_tc_stats *veb_oes;
628+
struct i40e_veb_tc_stats *veb_es;
629+
int i, idx = 0;
628630

629631
idx = veb->stats_idx;
630632
es = &veb->stats;
631633
oes = &veb->stats_offsets;
634+
veb_es = &veb->tc_stats;
635+
veb_oes = &veb->tc_stats_offsets;
632636

633637
/* Gather up the stats that the hw collects */
634638
i40e_stat_update32(hw, I40E_GLSW_TDPC(idx),
@@ -664,6 +668,28 @@ static void i40e_update_veb_stats(struct i40e_veb *veb)
664668
i40e_stat_update48(hw, I40E_GLSW_BPTCH(idx), I40E_GLSW_BPTCL(idx),
665669
veb->stat_offsets_loaded,
666670
&oes->tx_broadcast, &es->tx_broadcast);
671+
for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
672+
i40e_stat_update48(hw, I40E_GLVEBTC_RPCH(i, idx),
673+
I40E_GLVEBTC_RPCL(i, idx),
674+
veb->stat_offsets_loaded,
675+
&veb_oes->tc_rx_packets[i],
676+
&veb_es->tc_rx_packets[i]);
677+
i40e_stat_update48(hw, I40E_GLVEBTC_RBCH(i, idx),
678+
I40E_GLVEBTC_RBCL(i, idx),
679+
veb->stat_offsets_loaded,
680+
&veb_oes->tc_rx_bytes[i],
681+
&veb_es->tc_rx_bytes[i]);
682+
i40e_stat_update48(hw, I40E_GLVEBTC_TPCH(i, idx),
683+
I40E_GLVEBTC_TPCL(i, idx),
684+
veb->stat_offsets_loaded,
685+
&veb_oes->tc_tx_packets[i],
686+
&veb_es->tc_tx_packets[i]);
687+
i40e_stat_update48(hw, I40E_GLVEBTC_TBCH(i, idx),
688+
I40E_GLVEBTC_TBCL(i, idx),
689+
veb->stat_offsets_loaded,
690+
&veb_oes->tc_tx_bytes[i],
691+
&veb_es->tc_tx_bytes[i]);
692+
}
667693
veb->stat_offsets_loaded = true;
668694
}
669695

@@ -1255,6 +1281,8 @@ struct i40e_mac_filter *i40e_put_mac_in_vlan(struct i40e_vsi *vsi, u8 *macaddr,
12551281
struct i40e_mac_filter *f;
12561282

12571283
list_for_each_entry(f, &vsi->mac_filter_list, list) {
1284+
if (vsi->info.pvid)
1285+
f->vlan = le16_to_cpu(vsi->info.pvid);
12581286
if (!i40e_find_filter(vsi, macaddr, f->vlan,
12591287
is_vf, is_netdev)) {
12601288
if (!i40e_add_filter(vsi, macaddr, f->vlan,
@@ -1548,7 +1576,10 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi,
15481576
* vectors available and so we need to lower the used
15491577
* q count.
15501578
*/
1551-
qcount = min_t(int, vsi->alloc_queue_pairs, pf->num_lan_msix);
1579+
if (pf->flags & I40E_FLAG_MSIX_ENABLED)
1580+
qcount = min_t(int, vsi->alloc_queue_pairs, pf->num_lan_msix);
1581+
else
1582+
qcount = vsi->alloc_queue_pairs;
15521583
num_tc_qps = qcount / numtc;
15531584
num_tc_qps = min_t(int, num_tc_qps, i40e_pf_get_max_q_per_tc(pf));
15541585

@@ -1612,7 +1643,7 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi,
16121643
if ((vsi->type == I40E_VSI_MAIN) && (numtc == 1)) {
16131644
if (vsi->req_queue_pairs > 0)
16141645
vsi->num_queue_pairs = vsi->req_queue_pairs;
1615-
else
1646+
else if (pf->flags & I40E_FLAG_MSIX_ENABLED)
16161647
vsi->num_queue_pairs = pf->num_lan_msix;
16171648
}
16181649

@@ -3414,7 +3445,7 @@ static irqreturn_t i40e_fdir_clean_ring(int irq, void *data)
34143445
* @v_idx: vector index
34153446
* @qp_idx: queue pair index
34163447
**/
3417-
static void map_vector_to_qp(struct i40e_vsi *vsi, int v_idx, int qp_idx)
3448+
static void i40e_map_vector_to_qp(struct i40e_vsi *vsi, int v_idx, int qp_idx)
34183449
{
34193450
struct i40e_q_vector *q_vector = vsi->q_vectors[v_idx];
34203451
struct i40e_ring *tx_ring = vsi->tx_rings[qp_idx];
@@ -3468,7 +3499,7 @@ static void i40e_vsi_map_rings_to_vectors(struct i40e_vsi *vsi)
34683499
q_vector->tx.ring = NULL;
34693500

34703501
while (num_ringpairs--) {
3471-
map_vector_to_qp(vsi, v_start, qp_idx);
3502+
i40e_map_vector_to_qp(vsi, v_start, qp_idx);
34723503
qp_idx++;
34733504
qp_remaining--;
34743505
}
@@ -8037,8 +8068,6 @@ static void i40e_add_vxlan_port(struct net_device *netdev,
80378068
pf->vxlan_ports[next_idx] = port;
80388069
pf->pending_vxlan_bitmap |= BIT_ULL(next_idx);
80398070
pf->flags |= I40E_FLAG_VXLAN_FILTER_SYNC;
8040-
8041-
dev_info(&pf->pdev->dev, "adding vxlan port %d\n", ntohs(port));
80428071
}
80438072

80448073
/**
@@ -8796,6 +8825,11 @@ static int i40e_vsi_setup_vectors(struct i40e_vsi *vsi)
87968825
goto vector_setup_out;
87978826
}
87988827

8828+
/* In Legacy mode, we do not have to get any other vector since we
8829+
* piggyback on the misc/ICR0 for queue interrupts.
8830+
*/
8831+
if (!(pf->flags & I40E_FLAG_MSIX_ENABLED))
8832+
return ret;
87998833
if (vsi->num_q_vectors)
88008834
vsi->base_vector = i40e_get_lump(pf, pf->irq_pile,
88018835
vsi->num_q_vectors, vsi->idx);
@@ -10448,6 +10482,19 @@ static void i40e_shutdown(struct pci_dev *pdev)
1044810482
wr32(hw, I40E_PFPM_APM, (pf->wol_en ? I40E_PFPM_APM_APME_MASK : 0));
1044910483
wr32(hw, I40E_PFPM_WUFC, (pf->wol_en ? I40E_PFPM_WUFC_MAG_MASK : 0));
1045010484

10485+
del_timer_sync(&pf->service_timer);
10486+
cancel_work_sync(&pf->service_task);
10487+
i40e_fdir_teardown(pf);
10488+
10489+
rtnl_lock();
10490+
i40e_prep_for_reset(pf);
10491+
rtnl_unlock();
10492+
10493+
wr32(hw, I40E_PFPM_APM,
10494+
(pf->wol_en ? I40E_PFPM_APM_APME_MASK : 0));
10495+
wr32(hw, I40E_PFPM_WUFC,
10496+
(pf->wol_en ? I40E_PFPM_WUFC_MAG_MASK : 0));
10497+
1045110498
i40e_clear_interrupt_scheme(pf);
1045210499

1045310500
if (system_state == SYSTEM_POWER_OFF) {
@@ -10468,9 +10515,6 @@ static int i40e_suspend(struct pci_dev *pdev, pm_message_t state)
1046810515

1046910516
set_bit(__I40E_SUSPENDED, &pf->state);
1047010517
set_bit(__I40E_DOWN, &pf->state);
10471-
del_timer_sync(&pf->service_timer);
10472-
cancel_work_sync(&pf->service_task);
10473-
i40e_fdir_teardown(pf);
1047410518

1047510519
rtnl_lock();
1047610520
i40e_prep_for_reset(pf);

drivers/net/ethernet/intel/i40e/i40e_register.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,13 @@
873873
#define I40E_PFINT_CEQCTL_CAUSE_ENA_MASK I40E_MASK(0x1, I40E_PFINT_CEQCTL_CAUSE_ENA_SHIFT)
874874
#define I40E_PFINT_CEQCTL_INTEVENT_SHIFT 31
875875
#define I40E_PFINT_CEQCTL_INTEVENT_MASK I40E_MASK(0x1, I40E_PFINT_CEQCTL_INTEVENT_SHIFT)
876+
#define I40E_GLINT_CTL 0x0003F800 /* Reset: CORER */
877+
#define I40E_GLINT_CTL_DIS_AUTOMASK_PF0_SHIFT 0
878+
#define I40E_GLINT_CTL_DIS_AUTOMASK_PF0_MASK I40E_MASK(0x1, I40E_GLINT_CTL_DIS_AUTOMASK_PF0_SHIFT)
879+
#define I40E_GLINT_CTL_DIS_AUTOMASK_VF0_SHIFT 1
880+
#define I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK I40E_MASK(0x1, I40E_GLINT_CTL_DIS_AUTOMASK_VF0_SHIFT)
881+
#define I40E_GLINT_CTL_DIS_AUTOMASK_N_SHIFT 2
882+
#define I40E_GLINT_CTL_DIS_AUTOMASK_N_MASK I40E_MASK(0x1, I40E_GLINT_CTL_DIS_AUTOMASK_N_SHIFT)
876883
#define I40E_PFINT_DYN_CTL0 0x00038480 /* Reset: PFR */
877884
#define I40E_PFINT_DYN_CTL0_INTENA_SHIFT 0
878885
#define I40E_PFINT_DYN_CTL0_INTENA_MASK I40E_MASK(0x1, I40E_PFINT_DYN_CTL0_INTENA_SHIFT)

drivers/net/ethernet/intel/i40e/i40e_type.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ struct i40e_dcbx_config {
440440
#define I40E_DCBX_MODE_CEE 0x1
441441
#define I40E_DCBX_MODE_IEEE 0x2
442442
u32 numapps;
443+
u32 tlv_status; /* CEE mode TLV status */
443444
struct i40e_dcb_ets_config etscfg;
444445
struct i40e_dcb_ets_config etsrec;
445446
struct i40e_dcb_pfc_config pfc;
@@ -1105,6 +1106,14 @@ struct i40e_eth_stats {
11051106
u64 tx_errors; /* tepc */
11061107
};
11071108

1109+
/* Statistics collected per VEB per TC */
1110+
struct i40e_veb_tc_stats {
1111+
u64 tc_rx_packets[I40E_MAX_TRAFFIC_CLASS];
1112+
u64 tc_rx_bytes[I40E_MAX_TRAFFIC_CLASS];
1113+
u64 tc_tx_packets[I40E_MAX_TRAFFIC_CLASS];
1114+
u64 tc_tx_bytes[I40E_MAX_TRAFFIC_CLASS];
1115+
};
1116+
11081117
#ifdef I40E_FCOE
11091118
/* Statistics collected per function for FCoE */
11101119
struct i40e_fcoe_stats {

drivers/net/ethernet/intel/i40e/i40e_virtchnl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ struct i40e_virtchnl_vsi_resource {
152152
#define I40E_VIRTCHNL_VF_OFFLOAD_RSS_AQ 0x00000008
153153
#define I40E_VIRTCHNL_VF_OFFLOAD_RSS_REG 0x00000010
154154
#define I40E_VIRTCHNL_VF_OFFLOAD_VLAN 0x00010000
155+
#define I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING 0x00020000
155156

156157
struct i40e_virtchnl_vf_resource {
157158
u16 num_vsis;

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,18 @@ static void i40e_config_irq_link_list(struct i40e_vf *vf, u16 vsi_id,
335335
wr32(hw, reg_idx, reg);
336336
}
337337

338+
/* if the vf is running in polling mode and using interrupt zero,
339+
* need to disable auto-mask on enabling zero interrupt for VFs.
340+
*/
341+
if ((vf->driver_caps & I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING) &&
342+
(vector_id == 0)) {
343+
reg = rd32(hw, I40E_GLINT_CTL);
344+
if (!(reg & I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK)) {
345+
reg |= I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK;
346+
wr32(hw, I40E_GLINT_CTL, reg);
347+
}
348+
}
349+
338350
irq_list_done:
339351
i40e_flush(hw);
340352
}
@@ -921,8 +933,6 @@ int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs)
921933
if (pci_num_vf(pf->pdev) != num_alloc_vfs) {
922934
ret = pci_enable_sriov(pf->pdev, num_alloc_vfs);
923935
if (ret) {
924-
dev_err(&pf->pdev->dev,
925-
"Failed to enable SR-IOV, error %d.\n", ret);
926936
pf->num_alloc_vfs = 0;
927937
goto err_iov;
928938
}
@@ -2106,11 +2116,12 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,
21062116
goto error_pvid;
21072117
}
21082118

2109-
if (vsi->info.pvid == (vlan_id | (qos << I40E_VLAN_PRIORITY_SHIFT)))
2119+
if (le16_to_cpu(vsi->info.pvid) ==
2120+
(vlan_id | (qos << I40E_VLAN_PRIORITY_SHIFT)))
21102121
/* duplicate request, so just return success */
21112122
goto error_pvid;
21122123

2113-
if (vsi->info.pvid == 0 && i40e_is_vsi_in_vlan(vsi)) {
2124+
if (le16_to_cpu(vsi->info.pvid) == 0 && i40e_is_vsi_in_vlan(vsi)) {
21142125
dev_err(&pf->pdev->dev,
21152126
"VF %d has already configured VLAN filters and the administrator is requesting a port VLAN override.\nPlease unload and reload the VF driver for this change to take effect.\n",
21162127
vf_id);

0 commit comments

Comments
 (0)