netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	edumazet@google.com, netdev@vger.kernel.org,
	Dave Ertman <david.m.ertman@intel.com>,
	daniel.machon@microchip.com,
	Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
Subject: Re: [PATCH net-next 06/10] ice: Flesh out implementation of support for SRIOV on bonded interface
Date: Thu, 27 Jul 2023 14:02:57 +0200	[thread overview]
Message-ID: <ZMJc8VeEogsI8aRF@corigine.com> (raw)
In-Reply-To: <20230726182141.3797928-7-anthony.l.nguyen@intel.com>

On Wed, Jul 26, 2023 at 11:21:37AM -0700, Tony Nguyen wrote:
> From: Dave Ertman <david.m.ertman@intel.com>
> 
> Add in the functions that will allow a VF created on the primary interface
> of a bond to "fail-over" to another PF interface in the bond and continue
> to Tx and Rx.
> 
> Add in an ordered take-down path for the bonded interface.
> 
> Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
> Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
> Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_lag.c | 822 ++++++++++++++++++++++-
>  1 file changed, 812 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_lag.c b/drivers/net/ethernet/intel/ice/ice_lag.c

...

> @@ -233,6 +303,119 @@ static void ice_display_lag_info(struct ice_lag *lag)
>  		upper, role, primary);
>  }
>  
> +/**
> + * ice_lag_qbuf_recfg - generate a buffer of queues for a reconfigure command
> + * @hw: HW struct that contains the queue contexts
> + * @qbuf: pointer to buffer to populate
> + * @vsi_num: index of the VSI in PF space
> + * @numq: number of queues to search for
> + * @tc: traffic class that contains the queues
> + *
> + * function returns the number of valid queues in buffer
> + */
> +static u16
> +ice_lag_qbuf_recfg(struct ice_hw *hw, struct ice_aqc_cfg_txqs_buf *qbuf,
> +		   u16 vsi_num, u16 numq, u8 tc)
> +{
> +	struct ice_q_ctx *q_ctx;
> +	u16 qid, count = 0;
> +	struct ice_pf *pf;
> +	int i;
> +
> +	pf = hw->back;
> +	for (i = 0; i < numq; i++) {
> +		q_ctx = ice_get_lan_q_ctx(hw, vsi_num, tc, i);
> +		if (q_ctx->q_teid == ICE_INVAL_TEID) {

Hi Tony and Dave,

sorry for not noticing this earlier.

Here q_ctx is dereferenced...

> +			dev_dbg(ice_hw_to_dev(hw), "%s queue %d INVAL TEID\n",
> +				__func__, i);
> +			continue;
> +		}
> +
> +		if (!q_ctx || q_ctx->q_handle == ICE_INVAL_Q_HANDLE) {

...but here it is assumed that q_ctx may be NULL.

Flagged by Smatch.

> +			dev_dbg(ice_hw_to_dev(hw), "%s queue %d %s\n", __func__,
> +				i, q_ctx ? "INVAL Q HANDLE" : "NO Q CONTEXT");
> +			continue;
> +		}
> +
> +		qid = pf->vsi[vsi_num]->txq_map[q_ctx->q_handle];
> +		qbuf->queue_info[count].q_handle = cpu_to_le16(qid);
> +		qbuf->queue_info[count].tc = tc;
> +		qbuf->queue_info[count].q_teid = cpu_to_le32(q_ctx->q_teid);
> +		count++;
> +	}
> +
> +	return count;
> +}

...

  reply	other threads:[~2023-07-27 12:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-26 18:21 [PATCH net-next 00/10][pull request] ice: Implement support for SRIOV + LAG Tony Nguyen
2023-07-26 18:21 ` [PATCH net-next 01/10] ice: Correctly initialize queue context values Tony Nguyen
2023-07-26 18:21 ` [PATCH net-next 02/10] ice: Add driver support for firmware changes for LAG Tony Nguyen
2023-07-26 18:21 ` [PATCH net-next 03/10] ice: changes to the interface with the HW and FW for SRIOV_VF+LAG Tony Nguyen
2023-07-26 18:21 ` [PATCH net-next 04/10] ice: implement lag netdev event handler Tony Nguyen
2023-07-26 18:21 ` [PATCH net-next 05/10] ice: process events created by " Tony Nguyen
2023-07-26 18:21 ` [PATCH net-next 06/10] ice: Flesh out implementation of support for SRIOV on bonded interface Tony Nguyen
2023-07-27 12:02   ` Simon Horman [this message]
2023-07-27 17:21     ` Ertman, David M
2023-07-26 18:21 ` [PATCH net-next 07/10] ice: support non-standard teardown of bond interface Tony Nguyen
2023-07-26 18:21 ` [PATCH net-next 08/10] ice: enforce interface eligibility and add messaging for SRIOV LAG Tony Nguyen
2023-07-26 18:21 ` [PATCH net-next 09/10] ice: enforce no DCB config changing when in bond Tony Nguyen
2023-07-26 18:21 ` [PATCH net-next 10/10] ice: update reset path for SRIOV LAG support Tony Nguyen

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=ZMJc8VeEogsI8aRF@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=daniel.machon@microchip.com \
    --cc=davem@davemloft.net \
    --cc=david.m.ertman@intel.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sujai.buvaneswaran@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).