From: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>
To: Luca Boccassi <lboccass@Brocade.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v6 0/4] support reset of VF link
Date: Tue, 12 Jul 2016 01:19:39 +0000 [thread overview]
Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09090348F7CA@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1468251797.1762.47.camel@brocade.com>
> -----Original Message-----
> From: Luca Boccassi [mailto:lboccass@Brocade.com]
> Sent: Monday, July 11, 2016 11:43 PM
> To: Lu, Wenzhuo
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v6 0/4] support reset of VF link
>
> On Mon, 2016-07-11 at 13:02 +0100, Luca Boccassi wrote:
> > On Mon, 2016-07-11 at 01:32 +0000, Lu, Wenzhuo wrote:
> > > >
> > > > Unfortunately I found one issue: if PF is down, and then the VF on
> > > > the guest is down as well (ip link down) and then goes back up
> > > > before the PF, then calling rte_eth_dev_reset will return 0
> > > > (success), even though the PF is still down and it should fail. This is with
> ixgbe. Any idea what could be the problem?
> > > I've found this interesting thing. I believe it’s the HW difference between igb
> and ixgbe. When the link is down, ixgbe VF can be reset successfully but igb VF
> cannot. The expression is the registers of the ixgbe VF can be accessed when
> the PF link is down but igb VF cannot.
> > > It means, on ixgbe, when PF link is down, we reset the VF link. Then PF link is
> up, we receive the message again and reset the VF link again.
> >
> > What message do you refer to here? I am seeing the RESET callback only
> > when the PF goes down, not when it goes up.
> >
> > At the moment, with ixgbe, this happens:
> >
> > PF down -> reset notification, rte_eth_dev_reset keeps failing -> VF
> > down -> VF up -> rte_eth_dev_reset in a loop/timer succeeds -> PF up
> > -> VF link has no-carrier, and traffic does NOT go through
> >
> > The problem is that there is just no way of being notified that PF is
> > up, and if rte_eth_dev_reset succeeds I have no way of knowing that I
> > need to run it again.
>
> I was now able to solve this use case, by having the rte_eth_dev_reset
> implementations return -EAGAIN if the dev is not up. This way I know, in the
> application, that I have to try again. What do you think?
>
> IMHO it makes sense, as the reset does not actually succeeds, and the caller
> should try again. The diff is very trivial, and attached for reference.
Yes, I think the change is reasonable. Sorry, I didn’t realize you're talking about the code you have changed. Maybe we're not on the same page when discussing before :)
>
> --
> Kind regards,
> Luca Boccassi
>
>
> Make rte_eth_dev_reset return EAGAIN if VF down
>
> If VF is down the reset will not happen, so the driver should return
> EAGAIN to signal the application that it needs to call again
> rte_eth_dev_reset.
>
> Signed-off-by: Luca Boccassi <lboccass@brocade.com
> ---
> drivers/net/e1000/igb_ethdev.c | 2 +-
> drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
> drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -6235,7 +6235,7 @@ ixgbevf_dev_reset(struct rte_eth_dev *de
>
> /* Nothing needs to be done if the device is not started. */
> if (!dev->data->dev_started)
> - return 0;
> + return -EAGAIN;
>
> PMD_DRV_LOG(DEBUG, "Link up/down event detected.");
>
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -1504,7 +1504,7 @@ i40evf_handle_vf_reset(struct rte_eth_de
> I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
>
> if (!dev->data->dev_started)
> - return 0;
> + return -EAGAIN;
>
> adapter->reset_number = 1;
> i40e_vf_reset_dev(dev);
> --- a/drivers/net/e1000/igb_ethdev.c
> +++ b/drivers/net/e1000/igb_ethdev.c
> @@ -2609,7 +2609,7 @@ igbvf_dev_reset(struct rte_eth_dev *dev,
>
> /* Nothing needs to be done if the device is not started. */
> if (!dev->data->dev_started)
> - return 0;
> + return -EAGAIN;
>
> PMD_DRV_LOG(DEBUG, "Link up/down event detected.");
>
next prev parent reply other threads:[~2016-07-12 1:19 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-06 5:40 [dpdk-dev] [PATCH 0/8] " Wenzhuo Lu
2016-06-06 5:40 ` [dpdk-dev] [PATCH 1/8] lib/librte_ether: support device reset Wenzhuo Lu
2016-06-06 5:40 ` [dpdk-dev] [PATCH 2/8] lib/librte_ether: defind RX/TX lock mode Wenzhuo Lu
2016-06-08 2:15 ` Stephen Hemminger
2016-06-08 7:34 ` Lu, Wenzhuo
2016-06-09 7:50 ` Olivier Matz
2016-06-12 5:25 ` Lu, Wenzhuo
2016-06-10 18:12 ` Stephen Hemminger
2016-06-12 5:27 ` Lu, Wenzhuo
2016-06-06 5:40 ` [dpdk-dev] [PATCH 3/8] ixgbe: RX/TX with lock on VF Wenzhuo Lu
2016-06-06 5:40 ` [dpdk-dev] [PATCH 4/8] ixgbe: implement device reset " Wenzhuo Lu
2016-06-06 5:40 ` [dpdk-dev] [PATCH 5/8] igb: RX/TX with lock " Wenzhuo Lu
2016-06-06 5:40 ` [dpdk-dev] [PATCH 6/8] igb: implement device reset " Wenzhuo Lu
2016-06-06 5:40 ` [dpdk-dev] [PATCH 7/8] i40e:RX/TX with lock " Wenzhuo Lu
2016-06-06 5:40 ` [dpdk-dev] [PATCH 8/8] i40e: implement device reset " Wenzhuo Lu
2016-06-15 3:03 ` [dpdk-dev] [PATCH v5 0/4] support reset of VF link Wenzhuo Lu
2016-06-15 3:03 ` [dpdk-dev] [PATCH v5 1/4] lib/librte_ether: support device reset Wenzhuo Lu
2016-06-16 15:31 ` Bruce Richardson
2016-06-16 15:36 ` Thomas Monjalon
2016-06-15 3:03 ` [dpdk-dev] [PATCH v5 2/4] ixgbe: implement device reset on VF Wenzhuo Lu
2016-06-15 3:03 ` [dpdk-dev] [PATCH v5 3/4] igb: " Wenzhuo Lu
2016-06-15 3:03 ` [dpdk-dev] [PATCH v5 4/4] i40e: " Wenzhuo Lu
2016-06-20 6:24 ` [dpdk-dev] [PATCH v6 0/4] support reset of VF link Wenzhuo Lu
2016-06-20 6:24 ` [dpdk-dev] [PATCH v6 1/4] lib/librte_ether: support device reset Wenzhuo Lu
2016-06-20 9:14 ` Jerin Jacob
2016-06-20 16:17 ` Stephen Hemminger
2016-06-21 3:51 ` Jerin Jacob
2016-06-21 6:14 ` Lu, Wenzhuo
2016-06-21 7:37 ` Jerin Jacob
2016-06-21 8:24 ` Lu, Wenzhuo
2016-06-21 8:55 ` Jerin Jacob
2016-06-21 9:26 ` Ananyev, Konstantin
2016-06-21 10:57 ` Jerin Jacob
2016-06-21 13:10 ` Ananyev, Konstantin
2016-06-21 13:30 ` Jerin Jacob
2016-06-21 14:03 ` Ananyev, Konstantin
2016-06-21 14:29 ` Jerin Jacob
2016-06-22 1:35 ` Lu, Wenzhuo
2016-06-22 2:37 ` Jerin Jacob
2016-06-22 3:32 ` Lu, Wenzhuo
2016-06-22 4:14 ` Jerin Jacob
2016-06-22 5:05 ` Lu, Wenzhuo
2016-06-22 6:10 ` Jerin Jacob
2016-06-22 6:42 ` Lu, Wenzhuo
2016-06-22 7:59 ` Jerin Jacob
2016-06-22 8:17 ` Thomas Monjalon
2016-06-22 8:25 ` Lu, Wenzhuo
2016-06-22 9:18 ` Thomas Monjalon
2016-06-22 11:06 ` Jerin Jacob
2016-06-23 0:45 ` Lu, Wenzhuo
2016-06-23 0:39 ` Lu, Wenzhuo
2016-06-21 0:51 ` Lu, Wenzhuo
2016-06-20 6:24 ` [dpdk-dev] [PATCH v6 2/4] ixgbe: implement device reset on VF Wenzhuo Lu
2016-06-20 6:24 ` [dpdk-dev] [PATCH v6 3/4] igb: " Wenzhuo Lu
2016-06-20 6:24 ` [dpdk-dev] [PATCH v6 4/4] i40e: " Wenzhuo Lu
2016-07-04 15:48 ` [dpdk-dev] [PATCH v6 0/4] support reset of VF link Luca Boccassi
2016-07-05 0:52 ` Lu, Wenzhuo
2016-07-05 9:52 ` Luca Boccassi
2016-07-06 0:45 ` Lu, Wenzhuo
2016-07-06 16:26 ` Luca Boccassi
[not found] ` <1467822182.32466.34.camel@brocade.com>
2016-07-07 1:09 ` Lu, Wenzhuo
2016-07-07 10:20 ` Luca Boccassi
2016-07-07 13:12 ` Lu, Wenzhuo
2016-07-07 16:19 ` Luca Boccassi
2016-07-08 0:14 ` Lu, Wenzhuo
2016-07-08 17:15 ` Luca Boccassi
2016-07-11 1:32 ` Lu, Wenzhuo
2016-07-11 12:02 ` Luca Boccassi
2016-07-11 15:43 ` Luca Boccassi
2016-07-12 1:19 ` Lu, Wenzhuo [this message]
2016-08-26 12:58 ` Luca Boccassi
2016-08-29 1:04 ` Lu, Wenzhuo
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=6A0DE07E22DDAD4C9103DF62FEBC09090348F7CA@shsmsx102.ccr.corp.intel.com \
--to=wenzhuo.lu@intel.com \
--cc=dev@dpdk.org \
--cc=lboccass@Brocade.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).