Lines Matching defs:eswitch

18  * device's VSI index to the corresponding eswitch ctrl VSI queue.
25 xa_for_each(&pf->eswitch.reprs, id, repr) {
37 * device's VSI index to the corresponding eswitch ctrl VSI queue.
41 struct ice_vsi *ctrl_vsi = pf->eswitch.control_vsi;
67 dev_err(ice_pf_to_dev(pf), "Unable to add slow-path rule for eswitch for PR %d",
81 xa_for_each(&pf->eswitch.reprs, id, repr) {
93 * ice_eswitch_setup_env - configure eswitch HW filters
101 struct ice_vsi *uplink_vsi = pf->eswitch.uplink_vsi;
102 struct ice_vsi *ctrl_vsi = pf->eswitch.control_vsi;
155 * ice_eswitch_remap_rings_to_vectors - reconfigure rings of eswitch ctrl VSI
156 * @eswitch: pointer to eswitch struct
158 * In eswitch number of allocated Tx/Rx rings is equal.
165 static void ice_eswitch_remap_rings_to_vectors(struct ice_eswitch *eswitch)
167 struct ice_vsi *vsi = eswitch->control_vsi;
177 repr = xa_find(&eswitch->reprs, &repr_id, U32_MAX,
239 struct ice_vsi *ctrl_vsi = pf->eswitch.control_vsi;
292 repr = xa_load(&pf->eswitch.reprs, repr_id);
345 * ice_eswitch_set_target_vsi - set eswitch context in Tx context descriptor
368 * ice_eswitch_release_env - clear eswitch HW filters
376 struct ice_vsi *uplink_vsi = pf->eswitch.uplink_vsi;
377 struct ice_vsi *ctrl_vsi = pf->eswitch.control_vsi;
393 * ice_eswitch_vsi_setup - configure eswitch control VSI
436 * ice_eswitch_enable_switchdev - configure eswitch in switchdev mode
453 pf->eswitch.control_vsi = ice_eswitch_vsi_setup(pf, pf->hw.port_info);
454 if (!pf->eswitch.control_vsi)
457 ctrl_vsi = pf->eswitch.control_vsi;
459 pf->eswitch.qs.value = 1;
460 pf->eswitch.uplink_vsi = uplink_vsi;
468 pf->eswitch.is_running = true;
480 * ice_eswitch_disable_switchdev - disable eswitch resources
485 struct ice_vsi *ctrl_vsi = pf->eswitch.control_vsi;
491 pf->eswitch.is_running = false;
492 pf->eswitch.qs.is_reaching = false;
496 * ice_eswitch_mode_set - set new eswitch mode
498 * @mode: eswitch mode to switch to
511 dev_info(ice_pf_to_dev(pf), "Changing eswitch mode is allowed only if there is no VFs created");
512 NL_SET_ERR_MSG_MOD(extack, "Changing eswitch mode is allowed only if there is no VFs created");
518 dev_info(ice_pf_to_dev(pf), "PF %d changed eswitch mode to legacy",
520 xa_destroy(&pf->eswitch.reprs);
521 NL_SET_ERR_MSG_MOD(extack, "Changed eswitch mode to legacy");
526 dev_err(ice_pf_to_dev(pf), "Couldn't change eswitch mode to switchdev - ADQ is active. Delete ADQ configs and try again, e.g. tc qdisc del dev $PF root");
527 NL_SET_ERR_MSG_MOD(extack, "Couldn't change eswitch mode to switchdev - ADQ is active. Delete ADQ configs and try again, e.g. tc qdisc del dev $PF root");
531 dev_info(ice_pf_to_dev(pf), "PF %d changed eswitch mode to switchdev",
533 xa_init_flags(&pf->eswitch.reprs, XA_FLAGS_ALLOC);
534 NL_SET_ERR_MSG_MOD(extack, "Changed eswitch mode to switchdev");
538 NL_SET_ERR_MSG_MOD(extack, "Unknown eswitch mode");
547 * ice_eswitch_mode_get - get current eswitch mode
549 * @mode: output parameter for current eswitch mode
560 * ice_is_eswitch_mode_switchdev - check if eswitch mode is set to switchdev
563 * Returns true if eswitch mode is set to DEVLINK_ESWITCH_MODE_SWITCHDEV,
583 xa_for_each(&pf->eswitch.reprs, id, repr)
599 xa_for_each(&pf->eswitch.reprs, id, repr)
607 ice_eswitch_napi_disable(&pf->eswitch.reprs);
612 ice_eswitch_napi_enable(&pf->eswitch.reprs);
618 ice_eswitch_cp_change_queues(struct ice_eswitch *eswitch, int change)
620 struct ice_vsi *cp = eswitch->control_vsi;
623 if (eswitch->qs.is_reaching) {
624 if (eswitch->qs.to_reach >= eswitch->qs.value + change) {
625 queues = eswitch->qs.to_reach;
626 eswitch->qs.is_reaching = false;
630 } else if ((change > 0 && cp->alloc_txq <= eswitch->qs.value) ||
646 eswitch->qs.value += change;
647 ice_eswitch_remap_rings_to_vectors(eswitch);
660 if (xa_empty(&pf->eswitch.reprs)) {
665 pf->eswitch.qs.to_reach -= 1;
681 err = xa_alloc(&pf->eswitch.reprs, &repr->id, repr,
688 ice_eswitch_cp_change_queues(&pf->eswitch, change);
698 if (xa_empty(&pf->eswitch.reprs))
707 struct ice_repr *repr = xa_load(&pf->eswitch.reprs, vf->repr_id);
714 xa_erase(&pf->eswitch.reprs, repr->id);
716 if (xa_empty(&pf->eswitch.reprs))
719 ice_eswitch_cp_change_queues(&pf->eswitch, -1);
724 if (xa_empty(&pf->eswitch.reprs)) {
738 * ice_eswitch_rebuild - rebuild eswitch
750 err = ice_vsi_rebuild(pf->eswitch.control_vsi, ICE_VSI_FLAG_INIT);
754 xa_for_each(&pf->eswitch.reprs, id, repr)
769 if (pf->eswitch.qs.value + change < 0)
772 pf->eswitch.qs.to_reach = pf->eswitch.qs.value + change;
773 pf->eswitch.qs.is_reaching = true;