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: <20200310144328.0db53c68@kicinski-fedora-PC1C0HJN>
Date:   Tue, 10 Mar 2020 14:43:28 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     sunil.kovvuri@...il.com
Cc:     netdev@...r.kernel.org, davem@...emloft.net,
        Geetha sowjanya <gakula@...vell.com>,
        Sunil Goutham <sgoutham@...vell.com>
Subject: Re: [PATCH net-next 2/6] octeontx2-pf: Handle VF function level
 reset

On Wed, 11 Mar 2020 00:17:21 +0530 sunil.kovvuri@...il.com wrote:
> +static int otx2_pf_flr_init(struct otx2_nic *pf, int num_vfs)
> +{
> +	int vf;
> +
> +	pf->flr_wq = alloc_workqueue("otx2_pf_flr_wq", WQ_UNBOUND | WQ_HIGHPRI
> +				     | WQ_MEM_RECLAIM, 1);

Are you sure WQ_MEM_RECLAIM is necessary? AFAIU sending FLRs is not part
of memory reclaim, and therefore this flag isn't needed?

> +	if (!pf->flr_wq)
> +		return -ENOMEM;
> +
> +	pf->flr_wrk = devm_kcalloc(pf->dev, num_vfs,
> +				   sizeof(struct flr_work), GFP_KERNEL);

Since SR-IOV can be enabled and disabled multiple times you should free
this memory explicitly when it's disabled. Otherwise the driver will
hold onto it until remove.

> +	if (!pf->flr_wrk) {
> +		destroy_workqueue(pf->flr_wq);
> +		return -ENOMEM;
> +	}
> +
> +	for (vf = 0; vf < num_vfs; vf++) {
> +		pf->flr_wrk[vf].pf = pf;
> +		INIT_WORK(&pf->flr_wrk[vf].work, otx2_flr_handler);
> +	}
> +
> +	return 0;
> +}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ