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:   Mon, 19 Jul 2021 10:22:51 +0300
From:   Vladimir Oltean <olteanv@...il.com>
To:     Vladimir Oltean <vladimir.oltean@....com>
Cc:     netdev@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Andrew Lunn <andrew@...n.ch>,
        Florian Fainelli <f.fainelli@...il.com>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Jiri Pirko <jiri@...nulli.us>,
        Ido Schimmel <idosch@...sch.org>,
        Tobias Waldekranz <tobias@...dekranz.com>,
        Roopa Prabhu <roopa@...dia.com>,
        Nikolay Aleksandrov <nikolay@...dia.com>,
        Stephen Hemminger <stephen@...workplumber.org>,
        bridge@...ts.linux-foundation.org,
        Grygorii Strashko <grygorii.strashko@...com>,
        Marek Behun <kabel@...ckhole.sk>,
        DENG Qingfang <dqfext@...il.com>
Subject: Re: [PATCH v4 net-next 11/15] net: bridge: switchdev: allow the TX
 data plane forwarding to be offloaded

On Mon, Jul 19, 2021 at 12:44:30AM +0300, Vladimir Oltean wrote:
>  static int nbp_switchdev_add(struct net_bridge_port *p,
>  			     struct netdev_phys_item_id ppid,
> +			     bool tx_fwd_offload,
>  			     struct netlink_ext_ack *extack)
>  {
> +	int err;
> +
>  	if (p->offload_count) {
>  		/* Prevent unsupported configurations such as a bridge port
>  		 * which is a bonding interface, and the member ports are from
> @@ -189,7 +228,16 @@ static int nbp_switchdev_add(struct net_bridge_port *p,
>  	p->ppid = ppid;
>  	p->offload_count = 1;
>  
> -	return nbp_switchdev_hwdom_set(p);
> +	err = nbp_switchdev_hwdom_set(p);
> +	if (err)
> +		return err;
> +
> +	if (tx_fwd_offload) {
> +		p->flags |= BR_TX_FWD_OFFLOAD;
> +		static_branch_inc(&br_switchdev_fwd_offload_used);
> +	}
> +
> +	return 0;
>  }
>  
>  static void nbp_switchdev_del(struct net_bridge_port *p,
> @@ -210,6 +258,8 @@ static void nbp_switchdev_del(struct net_bridge_port *p,
>  
>  	if (p->hwdom)
>  		nbp_switchdev_hwdom_put(p);
> +
> +	p->flags &= ~BR_TX_FWD_OFFLOAD;
>  }

Not the end of the world, but the static_branch_dec(&br_switchdev_fwd_offload_used)
was lost here in a rebase. Not a functional issue per se, but it is on
my list of things I would like to fix when I resend.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ