DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: "Yang, Zhiyong" <zhiyong.yang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>
Subject: Re: [dpdk-dev] [PATCH 0/2] net/virtio: support to turn on/off the traffic flow
Date: Wed, 19 Apr 2017 10:03:19 +0800	[thread overview]
Message-ID: <20170419020319.GQ7333@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <E182254E98A5DA4EB1E657AC7CB9BD2A3EBA60BE@BGSMSX101.gar.corp.intel.com>

On Mon, Apr 17, 2017 at 08:50:52AM +0000, Yang, Zhiyong wrote:
> Hi, yuanhan:
> 	Sorry for the delay reply due to my annual leave.
> 
> > -----Original Message-----
> > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com]
> > Sent: Thursday, April 6, 2017 12:00 PM
> > To: Yang, Zhiyong <zhiyong.yang@intel.com>
> > Cc: dev@dpdk.org; maxime.coquelin@redhat.com
> > Subject: Re: [PATCH 0/2] net/virtio: support to turn on/off the traffic flow
> > 
> > On Fri, Mar 31, 2017 at 07:40:17PM +0800, Zhiyong Yang wrote:
> > > Current dpdk code virtio_dev_stop only disables interrupt and marks
> > > link down, When it is invoked, tx/rx traffic flows still work. This is a strange
> > behavior.
> > > The patchset supports the switch of flow by calling virtio_dev_start/stop.
> > >
> > > The implementation refers to vhost pmd.
> > 
> > That's a difference story. Vhost pmd uses 2 vars to track the status, whereas you
> > are using only one here. So why not setting/clearing "started" at dev_start/stop,
> > respectively?
> > Then we can check "started" at Rx/Tx functions.
> 
> Yes, I use only one var since I think vhost pmd using two is too complex and it is unnecessary.

No, it's needed. For vhost-user pmd, we can only do Rx when both below
items are met:

- port is started
- new_device() is invoked, aka, the device is connected

For that reason, two vars is used to track it.

> I'm setting/clearing started at virtio_dev_start/stop,  update_queuing_status is added to avoid
> duplicate code.

It's not about duplicate code. While we could make the var per-device,
you make it per-queue. That's complex and unnecessary.

> I don't understand your question.
> 
> > 
> > BTW, why does it have to be atomic?
> > 
> 
> Consider again. It is not necessary to use atomic here. But It seems that it doesn't  have an negative effect.

Hmm... that's a good reason to keep it, just because it has no negative
effect? Talking about the negative effect, badly, it really has. The
atomic is more expensive.

	--yliu

  reply	other threads:[~2017-04-19  2:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 11:40 Zhiyong Yang
2017-03-31 11:40 ` [dpdk-dev] [PATCH 1/2] net/virtio: add data elements to turn on/off " Zhiyong Yang
2017-04-19  6:29   ` [dpdk-dev] [PATCH v2] net/virtio: support " Zhiyong Yang
2017-04-26  7:45     ` Maxime Coquelin
2017-04-26  7:56       ` Yuanhan Liu
2017-04-26  8:02         ` Maxime Coquelin
2017-03-31 11:40 ` [dpdk-dev] [PATCH 2/2] net/virtio: support to turn on/off the " Zhiyong Yang
2017-04-06  3:59 ` [dpdk-dev] [PATCH 0/2] " Yuanhan Liu
2017-04-17  8:50   ` Yang, Zhiyong
2017-04-19  2:03     ` Yuanhan Liu [this message]
2017-04-19  2:31       ` Yang, Zhiyong
2017-04-19  2:58         ` Yuanhan Liu
2017-04-19  5:27           ` Yang, Zhiyong

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=20170419020319.GQ7333@yliu-dev.sh.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=zhiyong.yang@intel.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).