netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: sunil.kovvuri@gmail.com
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	Geetha sowjanya <gakula@marvell.com>,
	Sunil Goutham <sgoutham@marvell.com>
Subject: Re: [PATCH net-next 2/6] octeontx2-pf: Handle VF function level reset
Date: Tue, 10 Mar 2020 14:43:28 -0700	[thread overview]
Message-ID: <20200310144328.0db53c68@kicinski-fedora-PC1C0HJN> (raw)
In-Reply-To: <1583866045-7129-3-git-send-email-sunil.kovvuri@gmail.com>

On Wed, 11 Mar 2020 00:17:21 +0530 sunil.kovvuri@gmail.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;
> +}

  reply	other threads:[~2020-03-10 21:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-10 18:47 [PATCH net-next 0/6] octeontx2-vf: Add network driver for virtual function sunil.kovvuri
2020-03-10 18:47 ` [PATCH net-next 1/6] octeontx2-pf: Enable SRIOV and added VF mbox handling sunil.kovvuri
2020-03-10 21:43   ` Jakub Kicinski
2020-03-10 18:47 ` [PATCH net-next 2/6] octeontx2-pf: Handle VF function level reset sunil.kovvuri
2020-03-10 21:43   ` Jakub Kicinski [this message]
2020-03-10 18:47 ` [PATCH net-next 3/6] octeontx2-vf: Virtual function driver dupport sunil.kovvuri
2020-03-10 21:43   ` Jakub Kicinski
2020-03-11  7:14     ` Sunil Kovvuri
2020-03-11 10:16       ` Leon Romanovsky
2020-03-11 21:24         ` Jakub Kicinski
2020-03-10 18:47 ` [PATCH net-next 4/6] octeontx2-vf: Ethtool support sunil.kovvuri
2020-03-10 19:21   ` Andrew Lunn
2020-03-11  6:39     ` Sunil Kovvuri
2020-03-11  7:05       ` Leon Romanovsky
2020-03-11  7:18         ` Sunil Kovvuri
2020-03-11 10:12           ` Leon Romanovsky
2020-03-10 21:45   ` Jakub Kicinski
2020-03-11  6:40     ` Sunil Kovvuri
2020-03-10 18:47 ` [PATCH net-next 5/6] octeontx2-vf: Link event notification support sunil.kovvuri
2020-03-10 18:47 ` [PATCH net-next 6/6] octeontx2-pf: Cleanup all receive buffers in SG descriptor sunil.kovvuri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200310144328.0db53c68@kicinski-fedora-PC1C0HJN \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=gakula@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=sgoutham@marvell.com \
    --cc=sunil.kovvuri@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).