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: <20231214112352.iaomw3apleewkdfz@skbuf>
Date: Thu, 14 Dec 2023 13:23:52 +0200
From: Vladimir Oltean <vladimir.oltean@....com>
To: Roger Quadros <rogerq@...nel.org>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
	pabeni@...hat.com, shuah@...nel.org, s-vadapalli@...com,
	r-gunasekaran@...com, vigneshr@...com, srk@...com, horms@...nel.org,
	p-varis@...com, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v8 net-next 05/11] net: ethernet: am65-cpsw: cleanup
 TAPRIO handling

On Wed, Dec 13, 2023 at 01:07:15PM +0200, Roger Quadros wrote:
> +static int am65_cpsw_taprio_replace(struct net_device *ndev,
> +				    struct tc_taprio_qopt_offload *taprio)
>  {
>  	struct am65_cpsw_common *common = am65_ndev_to_common(ndev);
> +	struct netlink_ext_ack *extack = taprio->mqprio.extack;
> +	struct am65_cpsw_port *port = am65_ndev_to_port(ndev);
>  	struct am65_cpts *cpts = common->cpts;
> -	int ret = 0, tact = TACT_PROG;
> +	struct am65_cpsw_est *est_new;
> +	int ret, tact;
>  
> -	am65_cpsw_est_update_state(ndev);
> +	if (!netif_running(ndev)) {
> +		NL_SET_ERR_MSG_MOD(extack, "interface is down, link speed unknown");
> +		return -ENETDOWN;
> +	}

I haven't used the runtime PM API that this driver uses. I don't know
much about how it works. What are the rules here? By checking for
netif_running(), are you intending to rely on the pm_runtime_resume_and_get()
call from ndo_open(), which is released with pm_runtime_put() at
ndo_stop() time?

I see some inconsistencies I don't quite understand.

am65_cpsw_nuss_ndo_slave_add_vid() checks for netif_running() then calls
pm_runtime_resume_and_get() anyway.

am65_cpsw_setup_mqprio() allows changing the offload even when the link
is down (which is more user-friendly anyway) and performs the pm_runtime_get_sync()
call itself.

> -}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ