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]
Message-ID: <20210115160608.GD2064789@shredder.lan>
Date:   Fri, 15 Jan 2021 18:06:08 +0200
From:   Ido Schimmel <idosch@...sch.org>
To:     Jiri Pirko <jiri@...nulli.us>
Cc:     netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
        jacob.e.keller@...el.com, roopa@...dia.com, mlxsw@...dia.com
Subject: Re: [patch net-next RFC 03/10] devlink: implement line card active
 state

On Wed, Jan 13, 2021 at 01:12:15PM +0100, Jiri Pirko wrote:
> +/**
> + *	devlink_linecard_deactivate - Set linecard deactive

Set linecard as inactive

> + *
> + *	@devlink_linecard: devlink linecard
> + */
> +void devlink_linecard_deactivate(struct devlink_linecard *linecard)
> +{
> +	mutex_lock(&linecard->devlink->lock);
> +	WARN_ON(linecard->state != DEVLINK_LINECARD_STATE_ACTIVE);
> +	linecard->state = DEVLINK_LINECARD_STATE_PROVISIONED;
> +	devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_NEW);
> +	mutex_unlock(&linecard->devlink->lock);
> +}
> +EXPORT_SYMBOL_GPL(devlink_linecard_deactivate);
> +
> +/**
> + *	devlink_linecard_is_active - Check if active
> + *
> + *	@devlink_linecard: devlink linecard
> + */
> +bool devlink_linecard_is_active(struct devlink_linecard *linecard)
> +{
> +	bool active;
> +
> +	mutex_lock(&linecard->devlink->lock);
> +	active = linecard->state == DEVLINK_LINECARD_STATE_ACTIVE;
> +	mutex_unlock(&linecard->devlink->lock);
> +	return active;
> +}
> +EXPORT_SYMBOL_GPL(devlink_linecard_is_active);
> +
>  int devlink_sb_register(struct devlink *devlink, unsigned int sb_index,
>  			u32 size, u16 ingress_pools_count,
>  			u16 egress_pools_count, u16 ingress_tc_count,
> -- 
> 2.26.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ