Skip to content

Commit 6235cb6

Browse files
Michal Swiatkowskianguy11
authored andcommitted
ice: change repr::id values
Instead of getting repr::id from xa_alloc() value, set it to the src_vsi::num_vsi value. It is unique for each PR. Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com> Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 33bf1e8 commit 6235cb6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ ice_eswitch_mode_set(struct devlink *devlink, u16 mode,
319319

320320
dev_info(ice_pf_to_dev(pf), "PF %d changed eswitch mode to switchdev",
321321
pf->hw.pf_id);
322-
xa_init_flags(&pf->eswitch.reprs, XA_FLAGS_ALLOC);
322+
xa_init(&pf->eswitch.reprs);
323323
NL_SET_ERR_MSG_MOD(extack, "Changed eswitch mode to switchdev");
324324
break;
325325
}
@@ -426,8 +426,7 @@ ice_eswitch_attach(struct ice_pf *pf, struct ice_vf *vf)
426426
if (err)
427427
goto err_setup_repr;
428428

429-
err = xa_alloc(&pf->eswitch.reprs, &repr->id, repr,
430-
XA_LIMIT(1, INT_MAX), GFP_KERNEL);
429+
err = xa_insert(&pf->eswitch.reprs, repr->id, repr, GFP_KERNEL);
431430
if (err)
432431
goto err_xa_alloc;
433432

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ ice_repr_add(struct ice_pf *pf, struct ice_vsi *src_vsi, const u8 *parent_mac)
345345
}
346346

347347
repr->src_vsi = src_vsi;
348+
repr->id = src_vsi->vsi_num;
348349
np = netdev_priv(repr->netdev);
349350
np->repr = repr;
350351

0 commit comments

Comments
 (0)