[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <MW5PR11MB58110D453C6E6BB15AD4A53ADD51A@MW5PR11MB5811.namprd11.prod.outlook.com>
Date: Fri, 9 Jun 2023 16:32:27 +0000
From: "Ertman, David M" <david.m.ertman@...el.com>
To: Simon Horman <simon.horman@...igine.com>
CC: "intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"daniel.machon@...rochip.com" <daniel.machon@...rochip.com>
Subject: RE: [PATCH iwl-next v3 06/10] ice: Flesh out implementation of
support for SRIOV on bonded interface
> -----Original Message-----
> From: Simon Horman <simon.horman@...igine.com>
> Sent: Friday, June 9, 2023 2:01 AM
> To: Ertman, David M <david.m.ertman@...el.com>
> Cc: intel-wired-lan@...ts.osuosl.org; netdev@...r.kernel.org;
> daniel.machon@...rochip.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;
Powered by blists - more mailing lists