DPDK patches and discussions
 help / color / mirror / Atom feed
From: Sam Andrew <samandrew@microsoft.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Long Li <longli@microsoft.com>
Subject: RE: [EXTERNAL] Re: [PATCH] net/netvsc: add support for mtu_set
Date: Mon, 9 Oct 2023 16:41:38 +0000	[thread overview]
Message-ID: <MN0PR21MB31202578B9F2F32D78D14065B5CEA@MN0PR21MB3120.namprd21.prod.outlook.com> (raw)
In-Reply-To: <20231009081737.3b64131e@hermes.local>

Hi Stephen,

From: Stephen Hemminger <stephen@networkplumber.org> 
Sent: Monday, October 9, 2023 8:18 AM

> On Thu, 5 Oct 2023 23:17:28 +0000
> Sam Andrew <samandrew@microsoft.com> wrote:

> > +
> > +static int
> > +hn_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) {
> > +	struct hn_data *hv = dev->data->dev_private;
> > +	unsigned int orig_mtu = dev->data->mtu;
> > +	uint32_t rndis_mtu;
> > +	int ret = 0;
> > +	int i;
> > +
> > +	if (dev->data->dev_started) {
> > +		PMD_DRV_LOG(ERR, "Device must be stopped before changing MTU");
> > +		return -EIO;
> > +	}
> > +

> It looks like this proposed patch does not have the accelerated networking
> virtual device case.  The driver needs to first update the MTU of the underlying
> VF device (and handle errors), then reinit the vmbus device.

The following line should handle the AN virtual device case:

+	/* Change MTU of underlying VF dev first, if it exists */
+	ret = hn_vf_mtu_set(dev, mtu);
+	if (ret)
+		return ret;

This is the new method added in hn_vf.c:

--- a/drivers/net/netvsc/hn_vf.c
+++ b/drivers/net/netvsc/hn_vf.c
@@ -778,3 +784,18 @@ int hn_vf_reta_hash_update(struct rte_eth_dev *dev,
 
 	return ret;
 }
+
+int hn_vf_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) {
+	struct hn_data *hv = dev->data->dev_private;
+	struct rte_eth_dev *vf_dev;
+	int ret = 0;
+
+	rte_rwlock_read_lock(&hv->vf_lock);
+	vf_dev = hn_get_vf_dev(hv);
+	if (hv->vf_ctx.vf_vsc_switched && vf_dev)
+		ret = vf_dev->dev_ops->mtu_set(vf_dev, mtu);
+	rte_rwlock_read_unlock(&hv->vf_lock);
+
+	return ret;
+}

  reply	other threads:[~2023-10-09 16:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-05 23:17 Sam Andrew
2023-10-06 20:09 ` [PATCH v2] " Sam Andrew
2023-10-06 20:17   ` Stephen Hemminger
2023-10-06 20:22   ` Stephen Hemminger
2023-10-10 15:55   ` Stephen Hemminger
2023-10-10 18:41   ` [PATCH v3] " Sam Andrew
2023-10-10 19:08     ` Long Li
2023-10-11 11:03       ` Ferruh Yigit
2023-10-09 15:17 ` [PATCH] " Stephen Hemminger
2023-10-09 16:41   ` Sam Andrew [this message]
2023-10-10 15:55     ` [EXTERNAL] " Stephen Hemminger
2023-10-31  2:16   ` Rahul Gupta

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=MN0PR21MB31202578B9F2F32D78D14065B5CEA@MN0PR21MB3120.namprd21.prod.outlook.com \
    --to=samandrew@microsoft.com \
    --cc=dev@dpdk.org \
    --cc=longli@microsoft.com \
    --cc=stephen@networkplumber.org \
    /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).