lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 17 Feb 2021 10:59:51 +0000
From:   Vladimir Oltean <vladimir.oltean@....com>
To:     Horatiu Vultur <horatiu.vultur@...rochip.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

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.

>  
>  	/* 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;
>  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ