Skip to content

Commit 67eeadf

Browse files
author
Paolo Abeni
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-03-07 (ice) This series contains updates to ice driver only. Dave removes masking from pfcena field as it was incorrectly preventing valid traffic classes from being enabled. Michal resolves various smatch issues such as not propagating error codes and returning 0 explicitly. Arnd Bergmann resolves gcc-9 warning for integer overflow. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: ethernet: ice: avoid gcc-9 integer overflow warning ice: don't ignore return codes in VSI related code ice: Fix DSCP PFC TLV creation ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2 parents 2d8cb0b + 8f5c5a7 commit 67eeadf

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,7 @@ ice_add_dscp_pfc_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg)
14111411
tlv->ouisubtype = htonl(ouisubtype);
14121412

14131413
buf[0] = dcbcfg->pfc.pfccap & 0xF;
1414-
buf[1] = dcbcfg->pfc.pfcena & 0xF;
1414+
buf[1] = dcbcfg->pfc.pfcena;
14151415
}
14161416

14171417
/**

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2126,7 +2126,7 @@ int ice_vsi_cfg_xdp_txqs(struct ice_vsi *vsi)
21262126
ice_for_each_rxq(vsi, i)
21272127
ice_tx_xsk_pool(vsi, i);
21282128

2129-
return ret;
2129+
return 0;
21302130
}
21312131

21322132
/**
@@ -2693,12 +2693,14 @@ ice_vsi_cfg_def(struct ice_vsi *vsi, struct ice_vsi_cfg_params *params)
26932693
return ret;
26942694

26952695
/* allocate memory for Tx/Rx ring stat pointers */
2696-
if (ice_vsi_alloc_stat_arrays(vsi))
2696+
ret = ice_vsi_alloc_stat_arrays(vsi);
2697+
if (ret)
26972698
goto unroll_vsi_alloc;
26982699

26992700
ice_alloc_fd_res(vsi);
27002701

2701-
if (ice_vsi_get_qs(vsi)) {
2702+
ret = ice_vsi_get_qs(vsi);
2703+
if (ret) {
27022704
dev_err(dev, "Failed to allocate queues. vsi->idx = %d\n",
27032705
vsi->idx);
27042706
goto unroll_vsi_alloc_stat;
@@ -2811,6 +2813,7 @@ ice_vsi_cfg_def(struct ice_vsi *vsi, struct ice_vsi_cfg_params *params)
28112813
break;
28122814
default:
28132815
/* clean up the resources and exit */
2816+
ret = -EINVAL;
28142817
goto unroll_vsi_init;
28152818
}
28162819

@@ -3508,10 +3511,10 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags)
35083511
if (vsi_flags & ICE_VSI_FLAG_INIT) {
35093512
ret = -EIO;
35103513
goto err_vsi_cfg_tc_lan;
3511-
} else {
3512-
kfree(coalesce);
3513-
return ice_schedule_reset(pf, ICE_RESET_PFR);
35143514
}
3515+
3516+
kfree(coalesce);
3517+
return ice_schedule_reset(pf, ICE_RESET_PFR);
35153518
}
35163519

35173520
ice_vsi_realloc_stat_arrays(vsi, prev_txq, prev_rxq);
@@ -3759,7 +3762,7 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc)
37593762
dev = ice_pf_to_dev(pf);
37603763
if (vsi->tc_cfg.ena_tc == ena_tc &&
37613764
vsi->mqprio_qopt.mode != TC_MQPRIO_MODE_CHANNEL)
3762-
return ret;
3765+
return 0;
37633766

37643767
ice_for_each_traffic_class(i) {
37653768
/* build bitmap of enabled TCs */

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,8 +1455,8 @@ ice_parse_cls_flower(struct net_device *filter_dev, struct ice_vsi *vsi,
14551455
if (match.mask->vlan_priority) {
14561456
fltr->flags |= ICE_TC_FLWR_FIELD_VLAN_PRIO;
14571457
headers->vlan_hdr.vlan_prio =
1458-
cpu_to_be16((match.key->vlan_priority <<
1459-
VLAN_PRIO_SHIFT) & VLAN_PRIO_MASK);
1458+
be16_encode_bits(match.key->vlan_priority,
1459+
VLAN_PRIO_MASK);
14601460
}
14611461

14621462
if (match.mask->vlan_tpid)
@@ -1489,8 +1489,8 @@ ice_parse_cls_flower(struct net_device *filter_dev, struct ice_vsi *vsi,
14891489
if (match.mask->vlan_priority) {
14901490
fltr->flags |= ICE_TC_FLWR_FIELD_CVLAN_PRIO;
14911491
headers->cvlan_hdr.vlan_prio =
1492-
cpu_to_be16((match.key->vlan_priority <<
1493-
VLAN_PRIO_SHIFT) & VLAN_PRIO_MASK);
1492+
be16_encode_bits(match.key->vlan_priority,
1493+
VLAN_PRIO_MASK);
14941494
}
14951495
}
14961496

0 commit comments

Comments
 (0)