All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcin Szycik <marcin.szycik@linux.intel.com>
To: Dave Ertman <david.m.ertman@intel.com>, intel-wired-lan@lists.osuosl.org
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v3 8/8] ice: Implement support for SRIOV VFs across Active/Active bonds
Date: Wed, 11 Jun 2025 15:10:00 +0200	[thread overview]
Message-ID: <f64586a7-2201-4416-8aa0-96d43ecc7c67@linux.intel.com> (raw)
In-Reply-To: <20250609131141.758051-9-david.m.ertman@intel.com>

On 09.06.2025 15:11, Dave Ertman wrote:

(...)

> +static void ice_lag_aa_move_vf_qs(struct ice_lag *lag, u8 dest, u16 vsi_num,
> +				  bool all, bool *odd, struct ice_pf *e_pf)
> +{
> +	DEFINE_RAW_FLEX(struct ice_aqc_cfg_txqs_buf, qbuf, queue_info, 1);
> +	struct ice_hw *old_hw, *new_hw, *pri_hw, *sec_hw;
> +	struct device *dev = ice_pf_to_dev(lag->pf);
> +	struct ice_vsi_ctx *pv_ctx, *sv_ctx;
> +	struct ice_lag_netdev_list ndlist;
> +	u16 num_q, qbuf_size, sec_vsi_num;
> +	u8 pri_lport, sec_lport;
> +	u32 pvf_teid, svf_teid;
> +	u16 vf_id;
> +
> +	vf_id = lag->pf->vsi[vsi_num]->vf->vf_id;
> +	/* If sec_vf[] not defined, then no second interface to share with */
> +	if (lag->sec_vf[vf_id])
> +		sec_vsi_num = lag->sec_vf[vf_id]->idx;
> +	else
> +		return;
> +
> +	pri_lport = lag->bond_lport_pri;
> +	sec_lport = lag->bond_lport_sec;
> +
> +	if (pri_lport == ICE_LAG_INVALID_PORT ||
> +	    sec_lport == ICE_LAG_INVALID_PORT)
> +		return;
> +
> +	if (!e_pf)
> +		ice_lag_build_netdev_list(lag, &ndlist);
> +
> +	pri_hw = &lag->pf->hw;
> +	if (e_pf && lag->pf != e_pf)
> +		sec_hw = &e_pf->hw;
> +	else
> +		sec_hw = ice_lag_find_hw_by_lport(lag, sec_lport);
> +
> +	if (!pri_hw || !sec_hw)
> +		return;
> +
> +	if (dest == ICE_LAGP_IDX) {
> +		old_hw = sec_hw;
> +		new_hw = pri_hw;
> +		ice_lag_config_eswitch(lag, lag->pf->vsi[0]->netdev);

ice_get_main_vsi(lag->pf)->netdev should probably be used instead for clarity.
Actually now that I look at it, pf->vsi[0] is used multiple times in ice_lag.c,
might be a case for a small refactor at some point later.

> +	} else {
> +		struct ice_pf *sec_pf = sec_hw->back;
> +
> +		old_hw = pri_hw;
> +		new_hw = sec_hw;
> +		ice_lag_config_eswitch(lag, sec_pf->vsi[0]->netdev);

Same

(...)

>  /**
> - * ice_lag_config_eswitch - configure eswitch to work with LAG
> - * @lag: lag info struct
> - * @netdev: active network interface device struct
> - *
> - * Updates all port representors in eswitch to use @netdev for Tx.
> - *
> - * Configures the netdev to keep dst metadata (also used in representor Tx).
> - * This is required for an uplink without switchdev mode configured.
> - */
> -static void ice_lag_config_eswitch(struct ice_lag *lag,
> -				   struct net_device *netdev)
> -{
> -	struct ice_repr *repr;
> -	unsigned long id;
> -
> -	xa_for_each(&lag->pf->eswitch.reprs, id, repr)
> -		repr->dst->u.port_info.lower_dev = netdev;
> -
> -	netif_keep_dst(netdev);
> -}

There's already patch 4/8 that moves a function with no changes, this should be
a part of it.

Thanks,
Marcin

      reply	other threads:[~2025-06-11 13:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-09 13:11 [Intel-wired-lan] [PATCH iwl-next v3 0/8] ice: implement SRIOV VF Active-Active LAG Dave Ertman
2025-06-09 13:11 ` [Intel-wired-lan] [PATCH iwl-next v3 1/8] ice: Remove casts on void pointers in LAG code Dave Ertman
2025-06-09 13:11 ` [Intel-wired-lan] [PATCH iwl-next v3 2/8] ice: replace u8 elements with bool where Dave Ertman
2025-06-09 13:11 ` [Intel-wired-lan] [PATCH iwl-next v3 3/8] ice: Add driver specific prefix to LAG defines Dave Ertman
2025-06-09 13:11 ` [Intel-wired-lan] [PATCH iwl-next v3 4/8] ice: move LAG function in code to prepare for Dave Ertman
2025-06-09 13:11 ` [Intel-wired-lan] [PATCH iwl-next v3 5/8] ice: Cleanup variable initialization in LAG code Dave Ertman
2025-06-09 13:11 ` [Intel-wired-lan] [PATCH iwl-next v3 6/8] ice: cleanup capabilities evaluation Dave Ertman
2025-06-09 13:11 ` [Intel-wired-lan] [PATCH iwl-next v3 7/8] ice: breakout common LAG code into helpers Dave Ertman
2025-06-09 13:11 ` [Intel-wired-lan] [PATCH iwl-next v3 8/8] ice: Implement support for SRIOV VFs across Active/Active bonds Dave Ertman
2025-06-11 13:10   ` Marcin Szycik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f64586a7-2201-4416-8aa0-96d43ecc7c67@linux.intel.com \
    --to=marcin.szycik@linux.intel.com \
    --cc=david.m.ertman@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.