hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/net/ethernet/intel/i40e/i40e_main.c
....@@ -2788,7 +2788,7 @@
27882788 struct i40e_pf *pf = vsi->back;
27892789
27902790 if (i40e_enabled_xdp_vsi(vsi)) {
2791
- int frame_size = new_mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN;
2791
+ int frame_size = new_mtu + I40E_PACKET_HDR_PAD;
27922792
27932793 if (frame_size > i40e_max_xdp_frame_size(vsi))
27942794 return -EINVAL;
....@@ -10448,8 +10448,11 @@
1044810448 pf->hw.aq.asq_last_status));
1044910449 }
1045010450 /* reinit the misc interrupt */
10451
- if (pf->flags & I40E_FLAG_MSIX_ENABLED)
10451
+ if (pf->flags & I40E_FLAG_MSIX_ENABLED) {
1045210452 ret = i40e_setup_misc_vector(pf);
10453
+ if (ret)
10454
+ goto end_unlock;
10455
+ }
1045310456
1045410457 /* Add a filter to drop all Flow control frames from any VSI from being
1045510458 * transmitted. By doing so we stop a malicious VF from sending out
....@@ -12520,6 +12523,8 @@
1252012523 }
1252112524
1252212525 br_spec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), IFLA_AF_SPEC);
12526
+ if (!br_spec)
12527
+ return -EINVAL;
1252312528
1252412529 nla_for_each_nested(attr, br_spec, rem) {
1252512530 __u16 mode;
....@@ -13456,15 +13461,15 @@
1345613461 vsi->id = ctxt.vsi_number;
1345713462 }
1345813463
13459
- vsi->active_filters = 0;
13460
- clear_bit(__I40E_VSI_OVERFLOW_PROMISC, vsi->state);
1346113464 spin_lock_bh(&vsi->mac_filter_hash_lock);
13465
+ vsi->active_filters = 0;
1346213466 /* If macvlan filters already exist, force them to get loaded */
1346313467 hash_for_each_safe(vsi->mac_filter_hash, bkt, h, f, hlist) {
1346413468 f->state = I40E_FILTER_NEW;
1346513469 f_count++;
1346613470 }
1346713471 spin_unlock_bh(&vsi->mac_filter_hash_lock);
13472
+ clear_bit(__I40E_VSI_OVERFLOW_PROMISC, vsi->state);
1346813473
1346913474 if (f_count) {
1347013475 vsi->flags |= I40E_VSI_FLAG_FILTER_CHANGED;
....@@ -14849,6 +14854,7 @@
1484914854 int err;
1485014855 int v_idx;
1485114856
14857
+ pci_set_drvdata(pf->pdev, pf);
1485214858 pci_save_state(pf->pdev);
1485314859
1485414860 /* set up periodic task facility */