netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ertman, David M" <david.m.ertman@intel.com>
To: Simon Horman <simon.horman@corigine.com>
Cc: "intel-wired-lan@lists.osuosl.org"
	<intel-wired-lan@lists.osuosl.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"daniel.machon@microchip.com" <daniel.machon@microchip.com>
Subject: RE: [PATCH iwl-next v3 06/10] ice: Flesh out implementation of support for SRIOV on bonded interface
Date: Fri, 9 Jun 2023 16:32:27 +0000	[thread overview]
Message-ID: <MW5PR11MB58110D453C6E6BB15AD4A53ADD51A@MW5PR11MB5811.namprd11.prod.outlook.com> (raw)
In-Reply-To: <ZILqX7x7RP/cN5+0@corigine.com>

> -----Original Message-----
> From: Simon Horman <simon.horman@corigine.com>
> Sent: Friday, June 9, 2023 2:01 AM
> To: Ertman, David M <david.m.ertman@intel.com>
> Cc: intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org;
> daniel.machon@microchip.com
> Subject: Re: [PATCH iwl-next v3 06/10] ice: Flesh out implementation of
> support for SRIOV on bonded interface
> 
> On Thu, Jun 08, 2023 at 11:06:14AM -0700, Dave Ertman wrote:
> 
> ...
> 

...

> > +
> > +	/* add parent if none were free */
> > +	if (!n_prt) {
> 
> Hi Dave,
> 
> I suppose this can't happen.
> But if aggnode->num_children is 0 then n_prt will be uninitialised here.

If aggnode->num_children is 0, something very wrong (to the point of the device failing probe)
would have to have happened.  But, you are correct, it would be better to initialize n_prt to NULL.
That is a nice catch!

> 
> > +		u16 num_nodes_added;
> > +		u32 first_teid;
> > +		int status;

...

> > +	/* find parent in primary tree */
> > +	pi = hw->port_info;
> > +	tc_node = ice_sched_get_tc_node(pi, tc);
> > +	if (!tc_node) {
> > +		dev_warn(dev, "Failure to find TC node in failover tree\n");
> > +		goto resume_reclaim;
> > +	}
> > +
> > +	aggnode = ice_sched_get_agg_node(pi, tc_node,
> ICE_DFLT_AGG_ID);
> > +	if (!aggnode) {
> > +		dev_warn(dev, "Failure to find aggreagte node in failover
> tree\n");
> > +		goto resume_reclaim;
> > +	}
> > +
> > +	aggl = ice_sched_get_agg_layer(hw);
> > +	vsil = ice_sched_get_vsi_layer(hw);
> > +
> > +	for (n = aggl + 1; n < vsil; n++)
> > +		num_nodes[n] = 1;
> > +
> > +	for (n = 0; n < aggnode->num_children; n++) {
> > +		n_prt = ice_sched_get_free_vsi_parent(hw, aggnode-
> >children[n],
> > +						      num_nodes);
> > +		if (n_prt)
> > +			break;
> > +	}
> > +
> > +	/* if no free parent found - add one */
> > +	if (!n_prt) {
> 
> Likewise, here too.

Actually, this code was refactored out into a subfunction in patch 10/10 for
this series.  In the subfunction, n_prt is initialized to NULL (for purposes of
using it as a return value.  I need to move that refactoring back into this
patch since there are multiple uses this far back.  Thanks for pointing this
one out to me!

I will send this change out in patch set v4!

DaveE

> 
> > +		u16 num_nodes_added;
> > +		u32 first_teid;


  reply	other threads:[~2023-06-09 16:32 UTC|newest]

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

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=MW5PR11MB58110D453C6E6BB15AD4A53ADD51A@MW5PR11MB5811.namprd11.prod.outlook.com \
    --to=david.m.ertman@intel.com \
    --cc=daniel.machon@microchip.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=netdev@vger.kernel.org \
    --cc=simon.horman@corigine.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).