[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210217161847.6ntm52kqk7ygata7@soft-dev3.localdomain>
Date: Wed, 17 Feb 2021 17:18:47 +0100
From: Horatiu Vultur <horatiu.vultur@...rochip.com>
To: Vladimir Oltean <vladimir.oltean@....com>
CC: "davem@...emloft.net" <davem@...emloft.net>,
"kuba@...nel.org" <kuba@...nel.org>,
"jiri@...nulli.us" <jiri@...nulli.us>,
"ivecera@...hat.com" <ivecera@...hat.com>,
"nikolay@...dia.com" <nikolay@...dia.com>,
"roopa@...dia.com" <roopa@...dia.com>,
Claudiu Manoil <claudiu.manoil@....com>,
"alexandre.belloni@...tlin.com" <alexandre.belloni@...tlin.com>,
"UNGLinuxDriver@...rochip.com" <UNGLinuxDriver@...rochip.com>,
"andrew@...n.ch" <andrew@...n.ch>,
"vivien.didelot@...il.com" <vivien.didelot@...il.com>,
"f.fainelli@...il.com" <f.fainelli@...il.com>,
"rasmus.villemoes@...vas.dk" <rasmus.villemoes@...vas.dk>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"bridge@...ts.linux-foundation.org"
<bridge@...ts.linux-foundation.org>
Subject: Re: [PATCH net-next v4 5/8] bridge: mrp: Update br_mrp to use new
return values of br_mrp_switchdev
The 02/17/2021 10:59, Vladimir Oltean wrote:
>
> On Tue, Feb 16, 2021 at 10:42:02PM +0100, Horatiu Vultur wrote:
> > diff --git a/net/bridge/br_mrp.c b/net/bridge/br_mrp.c
> > index 01c67ed727a9..12487f6fe9b4 100644
> > --- a/net/bridge/br_mrp.c
> > +++ b/net/bridge/br_mrp.c
> > @@ -639,7 +639,7 @@ int br_mrp_set_ring_role(struct net_bridge *br,
> > struct br_mrp_ring_role *role)
> > {
> > struct br_mrp *mrp = br_mrp_find_id(br, role->ring_id);
> > - int err;
> > + enum br_mrp_hw_support support;
> >
> > if (!mrp)
> > return -EINVAL;
> > @@ -647,9 +647,9 @@ int br_mrp_set_ring_role(struct net_bridge *br,
> > mrp->ring_role = role->ring_role;
> >
> > /* If there is an error just bailed out */
> > - err = br_mrp_switchdev_set_ring_role(br, mrp, role->ring_role);
> > - if (err && err != -EOPNOTSUPP)
> > - return err;
> > + support = br_mrp_switchdev_set_ring_role(br, mrp, role->ring_role);
> > + if (support == BR_MRP_NONE)
> > + return -EOPNOTSUPP;
>
> It is broken to update the return type and value of a function in one
> patch, and check for the updated return value in another patch.
>
Yes, I will be more careful next time. I have tried to compile between
the patches and I have not see any issues here so I though that
everything is good.
> >
> > /* Now detect if the HW actually applied the role or not. If the HW
> > * applied the role it means that the SW will not to do those operations
> > @@ -657,7 +657,7 @@ int br_mrp_set_ring_role(struct net_bridge *br,
> > * SW when ring is open, but if the is not pushed to the HW the SW will
> > * need to detect when the ring is open
> > */
> > - mrp->ring_role_offloaded = err == -EOPNOTSUPP ? 0 : 1;
> > + mrp->ring_role_offloaded = support == BR_MRP_SW ? 0 : 1;
> >
> > return 0;
> > }
--
/Horatiu
Powered by blists - more mailing lists