Skip to content

Commit a66323e

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 2024-04-03 (ice, idpf) This series contains updates to ice and idpf drivers. Dan Carpenter initializes some pointer declarations to NULL as needed for resource cleanup on ice driver. Petr Oros corrects assignment of VLAN operators to fix Rx VLAN filtering in legacy mode for ice. Joshua calls eth_type_trans() on unknown packets to prevent possible kernel panic on idpf. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: idpf: fix kernel panic on unknown packet types ice: fix enabling RX VLAN filtering ice: Fix freeing uninitialized pointers ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents d313eb8 + dd19e82 commit a66323e

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,8 +1002,8 @@ static void ice_get_itr_intrl_gran(struct ice_hw *hw)
10021002
*/
10031003
int ice_init_hw(struct ice_hw *hw)
10041004
{
1005-
struct ice_aqc_get_phy_caps_data *pcaps __free(kfree);
1006-
void *mac_buf __free(kfree);
1005+
struct ice_aqc_get_phy_caps_data *pcaps __free(kfree) = NULL;
1006+
void *mac_buf __free(kfree) = NULL;
10071007
u16 mac_buf_len;
10081008
int status;
10091009

@@ -3272,7 +3272,7 @@ int ice_update_link_info(struct ice_port_info *pi)
32723272
return status;
32733273

32743274
if (li->link_info & ICE_AQ_MEDIA_AVAILABLE) {
3275-
struct ice_aqc_get_phy_caps_data *pcaps __free(kfree);
3275+
struct ice_aqc_get_phy_caps_data *pcaps __free(kfree) = NULL;
32763276

32773277
pcaps = kzalloc(sizeof(*pcaps), GFP_KERNEL);
32783278
if (!pcaps)
@@ -3420,7 +3420,7 @@ ice_cfg_phy_fc(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg,
34203420
int
34213421
ice_set_fc(struct ice_port_info *pi, u8 *aq_failures, bool ena_auto_link_update)
34223422
{
3423-
struct ice_aqc_get_phy_caps_data *pcaps __free(kfree);
3423+
struct ice_aqc_get_phy_caps_data *pcaps __free(kfree) = NULL;
34243424
struct ice_aqc_set_phy_cfg_data cfg = { 0 };
34253425
struct ice_hw *hw;
34263426
int status;
@@ -3561,7 +3561,7 @@ int
35613561
ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg,
35623562
enum ice_fec_mode fec)
35633563
{
3564-
struct ice_aqc_get_phy_caps_data *pcaps __free(kfree);
3564+
struct ice_aqc_get_phy_caps_data *pcaps __free(kfree) = NULL;
35653565
struct ice_hw *hw;
35663566
int status;
35673567

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,11 +941,11 @@ static u64 ice_loopback_test(struct net_device *netdev)
941941
struct ice_netdev_priv *np = netdev_priv(netdev);
942942
struct ice_vsi *orig_vsi = np->vsi, *test_vsi;
943943
struct ice_pf *pf = orig_vsi->back;
944+
u8 *tx_frame __free(kfree) = NULL;
944945
u8 broadcast[ETH_ALEN], ret = 0;
945946
int num_frames, valid_frames;
946947
struct ice_tx_ring *tx_ring;
947948
struct ice_rx_ring *rx_ring;
948-
u8 *tx_frame __free(kfree);
949949
int i;
950950

951951
netdev_info(netdev, "loopback test\n");

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,22 @@ static void ice_port_vlan_on(struct ice_vsi *vsi)
2626
struct ice_vsi_vlan_ops *vlan_ops;
2727
struct ice_pf *pf = vsi->back;
2828

29-
if (ice_is_dvm_ena(&pf->hw)) {
30-
vlan_ops = &vsi->outer_vlan_ops;
31-
32-
/* setup outer VLAN ops */
33-
vlan_ops->set_port_vlan = ice_vsi_set_outer_port_vlan;
34-
vlan_ops->clear_port_vlan = ice_vsi_clear_outer_port_vlan;
29+
/* setup inner VLAN ops */
30+
vlan_ops = &vsi->inner_vlan_ops;
3531

36-
/* setup inner VLAN ops */
37-
vlan_ops = &vsi->inner_vlan_ops;
32+
if (ice_is_dvm_ena(&pf->hw)) {
3833
vlan_ops->add_vlan = noop_vlan_arg;
3934
vlan_ops->del_vlan = noop_vlan_arg;
4035
vlan_ops->ena_stripping = ice_vsi_ena_inner_stripping;
4136
vlan_ops->dis_stripping = ice_vsi_dis_inner_stripping;
4237
vlan_ops->ena_insertion = ice_vsi_ena_inner_insertion;
4338
vlan_ops->dis_insertion = ice_vsi_dis_inner_insertion;
44-
} else {
45-
vlan_ops = &vsi->inner_vlan_ops;
4639

40+
/* setup outer VLAN ops */
41+
vlan_ops = &vsi->outer_vlan_ops;
42+
vlan_ops->set_port_vlan = ice_vsi_set_outer_port_vlan;
43+
vlan_ops->clear_port_vlan = ice_vsi_clear_outer_port_vlan;
44+
} else {
4745
vlan_ops->set_port_vlan = ice_vsi_set_inner_port_vlan;
4846
vlan_ops->clear_port_vlan = ice_vsi_clear_inner_port_vlan;
4947
}

drivers/net/ethernet/intel/idpf/idpf_txrx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2941,6 +2941,8 @@ static int idpf_rx_process_skb_fields(struct idpf_queue *rxq,
29412941
rx_ptype = le16_get_bits(rx_desc->ptype_err_fflags0,
29422942
VIRTCHNL2_RX_FLEX_DESC_ADV_PTYPE_M);
29432943

2944+
skb->protocol = eth_type_trans(skb, rxq->vport->netdev);
2945+
29442946
decoded = rxq->vport->rx_ptype_lkup[rx_ptype];
29452947
/* If we don't know the ptype we can't do anything else with it. Just
29462948
* pass it up the stack as-is.
@@ -2951,8 +2953,6 @@ static int idpf_rx_process_skb_fields(struct idpf_queue *rxq,
29512953
/* process RSS/hash */
29522954
idpf_rx_hash(rxq, skb, rx_desc, &decoded);
29532955

2954-
skb->protocol = eth_type_trans(skb, rxq->vport->netdev);
2955-
29562956
if (le16_get_bits(rx_desc->hdrlen_flags,
29572957
VIRTCHNL2_RX_FLEX_DESC_ADV_RSC_M))
29582958
return idpf_rx_rsc(rxq, skb, rx_desc, &decoded);

0 commit comments

Comments
 (0)