Skip to content

Commit 803a809

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-12-05 (ice, i40e, iavf) This series contains updates to ice, i40e and iavf drivers. Michal fixes incorrect usage of VF MSIX value and index calculation for ice. Marcin restores disabling of Rx VLAN filtering which was inadvertently removed for ice. Ivan Vecera corrects improper messaging of MFS port for i40e. Jake fixes incorrect checking of coalesce values on iavf. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: iavf: validate tx_coalesce_usecs even if rx_coalesce_usecs is zero i40e: Fix unexpected MFS warning message ice: Restore fix disabling RX VLAN filtering ice: change vfs.num_msix_per to vf->num_msix ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 0c7ed1f + a206d99 commit 803a809

File tree

6 files changed

+14
-24
lines changed

6 files changed

+14
-24
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16224,7 +16224,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1622416224
I40E_PRTGL_SAH_MFS_MASK) >> I40E_PRTGL_SAH_MFS_SHIFT;
1622516225
if (val < MAX_FRAME_SIZE_DEFAULT)
1622616226
dev_warn(&pdev->dev, "MFS for port %x has been set below the default: %x\n",
16227-
i, val);
16227+
pf->hw.port, val);
1622816228

1622916229
/* Add a filter to drop all Flow control frames from any VSI from being
1623016230
* transmitted. By doing so we stop a malicious VF from sending out

drivers/net/ethernet/intel/iavf/iavf_ethtool.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -827,18 +827,10 @@ static int __iavf_set_coalesce(struct net_device *netdev,
827827
struct iavf_adapter *adapter = netdev_priv(netdev);
828828
int i;
829829

830-
if (ec->rx_coalesce_usecs == 0) {
831-
if (ec->use_adaptive_rx_coalesce)
832-
netif_info(adapter, drv, netdev, "rx-usecs=0, need to disable adaptive-rx for a complete disable\n");
833-
} else if ((ec->rx_coalesce_usecs < IAVF_MIN_ITR) ||
834-
(ec->rx_coalesce_usecs > IAVF_MAX_ITR)) {
830+
if (ec->rx_coalesce_usecs > IAVF_MAX_ITR) {
835831
netif_info(adapter, drv, netdev, "Invalid value, rx-usecs range is 0-8160\n");
836832
return -EINVAL;
837-
} else if (ec->tx_coalesce_usecs == 0) {
838-
if (ec->use_adaptive_tx_coalesce)
839-
netif_info(adapter, drv, netdev, "tx-usecs=0, need to disable adaptive-tx for a complete disable\n");
840-
} else if ((ec->tx_coalesce_usecs < IAVF_MIN_ITR) ||
841-
(ec->tx_coalesce_usecs > IAVF_MAX_ITR)) {
833+
} else if (ec->tx_coalesce_usecs > IAVF_MAX_ITR) {
842834
netif_info(adapter, drv, netdev, "Invalid value, tx-usecs range is 0-8160\n");
843835
return -EINVAL;
844836
}

drivers/net/ethernet/intel/iavf/iavf_txrx.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
#define IAVF_ITR_DYNAMIC 0x8000 /* use top bit as a flag */
1717
#define IAVF_ITR_MASK 0x1FFE /* mask for ITR register value */
18-
#define IAVF_MIN_ITR 2 /* reg uses 2 usec resolution */
1918
#define IAVF_ITR_100K 10 /* all values below must be even */
2019
#define IAVF_ITR_50K 20
2120
#define IAVF_ITR_20K 50

drivers/net/ethernet/intel/ice/ice_sriov.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,16 +374,11 @@ static void ice_ena_vf_mappings(struct ice_vf *vf)
374374
*/
375375
int ice_calc_vf_reg_idx(struct ice_vf *vf, struct ice_q_vector *q_vector)
376376
{
377-
struct ice_pf *pf;
378-
379377
if (!vf || !q_vector)
380378
return -EINVAL;
381379

382-
pf = vf->pf;
383-
384380
/* always add one to account for the OICR being the first MSIX */
385-
return pf->sriov_base_vector + pf->vfs.num_msix_per * vf->vf_id +
386-
q_vector->v_idx + 1;
381+
return vf->first_vector_idx + q_vector->v_idx + 1;
387382
}
388383

389384
/**

drivers/net/ethernet/intel/ice/ice_vf_vsi_vlan_ops.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ static void ice_port_vlan_on(struct ice_vsi *vsi)
3232
/* setup outer VLAN ops */
3333
vlan_ops->set_port_vlan = ice_vsi_set_outer_port_vlan;
3434
vlan_ops->clear_port_vlan = ice_vsi_clear_outer_port_vlan;
35-
vlan_ops->clear_port_vlan = ice_vsi_clear_outer_port_vlan;
3635

3736
/* setup inner VLAN ops */
3837
vlan_ops = &vsi->inner_vlan_ops;
@@ -47,8 +46,13 @@ static void ice_port_vlan_on(struct ice_vsi *vsi)
4746

4847
vlan_ops->set_port_vlan = ice_vsi_set_inner_port_vlan;
4948
vlan_ops->clear_port_vlan = ice_vsi_clear_inner_port_vlan;
50-
vlan_ops->clear_port_vlan = ice_vsi_clear_inner_port_vlan;
5149
}
50+
51+
/* all Rx traffic should be in the domain of the assigned port VLAN,
52+
* so prevent disabling Rx VLAN filtering
53+
*/
54+
vlan_ops->dis_rx_filtering = noop_vlan;
55+
5256
vlan_ops->ena_rx_filtering = ice_vsi_ena_rx_vlan_filtering;
5357
}
5458

@@ -77,6 +81,8 @@ static void ice_port_vlan_off(struct ice_vsi *vsi)
7781
vlan_ops->del_vlan = ice_vsi_del_vlan;
7882
}
7983

84+
vlan_ops->dis_rx_filtering = ice_vsi_dis_rx_vlan_filtering;
85+
8086
if (!test_bit(ICE_FLAG_VF_VLAN_PRUNING, pf->flags))
8187
vlan_ops->ena_rx_filtering = noop_vlan;
8288
else
@@ -141,7 +147,6 @@ void ice_vf_vsi_init_vlan_ops(struct ice_vsi *vsi)
141147
&vsi->outer_vlan_ops : &vsi->inner_vlan_ops;
142148

143149
vlan_ops->add_vlan = ice_vsi_add_vlan;
144-
vlan_ops->dis_rx_filtering = ice_vsi_dis_rx_vlan_filtering;
145150
vlan_ops->ena_tx_filtering = ice_vsi_ena_tx_vlan_filtering;
146151
vlan_ops->dis_tx_filtering = ice_vsi_dis_tx_vlan_filtering;
147152
}

drivers/net/ethernet/intel/ice/ice_virtchnl.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,6 @@ static int ice_vc_cfg_irq_map_msg(struct ice_vf *vf, u8 *msg)
15231523
u16 num_q_vectors_mapped, vsi_id, vector_id;
15241524
struct virtchnl_irq_map_info *irqmap_info;
15251525
struct virtchnl_vector_map *map;
1526-
struct ice_pf *pf = vf->pf;
15271526
struct ice_vsi *vsi;
15281527
int i;
15291528

@@ -1535,7 +1534,7 @@ static int ice_vc_cfg_irq_map_msg(struct ice_vf *vf, u8 *msg)
15351534
* there is actually at least a single VF queue vector mapped
15361535
*/
15371536
if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states) ||
1538-
pf->vfs.num_msix_per < num_q_vectors_mapped ||
1537+
vf->num_msix < num_q_vectors_mapped ||
15391538
!num_q_vectors_mapped) {
15401539
v_ret = VIRTCHNL_STATUS_ERR_PARAM;
15411540
goto error_param;
@@ -1557,7 +1556,7 @@ static int ice_vc_cfg_irq_map_msg(struct ice_vf *vf, u8 *msg)
15571556
/* vector_id is always 0-based for each VF, and can never be
15581557
* larger than or equal to the max allowed interrupts per VF
15591558
*/
1560-
if (!(vector_id < pf->vfs.num_msix_per) ||
1559+
if (!(vector_id < vf->num_msix) ||
15611560
!ice_vc_isvalid_vsi_id(vf, vsi_id) ||
15621561
(!vector_id && (map->rxq_map || map->txq_map))) {
15631562
v_ret = VIRTCHNL_STATUS_ERR_PARAM;

0 commit comments

Comments
 (0)