DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: "Xie, Huawei" <huawei.xie@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] virtio: split virtio rx/tx queue
Date: Wed, 4 May 2016 20:50:00 -0700	[thread overview]
Message-ID: <20160505035000.GY5641@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <C37D651A908B024F974696C65296B57B4C74C7E4@SHSMSX101.ccr.corp.intel.com>

On Thu, May 05, 2016 at 03:29:44AM +0000, Xie, Huawei wrote:
> On 5/5/2016 11:03 AM, Yuanhan Liu wrote:
> > On Thu, May 05, 2016 at 01:54:25AM +0000, Xie, Huawei wrote:
> >> On 5/5/2016 7:59 AM, Yuanhan Liu wrote:
> >>> On Wed, May 04, 2016 at 08:50:27AM +0800, Huawei Xie wrote:
> >>>> -int virtio_dev_queue_setup(struct rte_eth_dev *dev,
> >>>> -			int queue_type,
> >>>> -			uint16_t queue_idx,
> >>>> +static int
> >>>> +virtio_dev_cq_queue_setup(struct rte_eth_dev *dev,
> >>> While it's good to split Rx/Tx specific stuff, but why are you trying to
> >>> remove a common queue_setup function that does common setups, such as vring
> >>> memory allocation.
> >>>
> >>> This results to much duplicated code: following diff summary also shows
> >>> it clearly:
> >> The motivation to do this is we need separate RX/TX queue setup.
> > We actually have done that. If you look at current rx/tx/ctrl_queue_setup()
> > code, we invoked the common function; we also did some queue specific
> > settings. It has not been done in a very clean way though: there are quite
> > many "if .. else .." as you stated. And that's what you are going to resolve,
> > but IMO, you went far: you made __same__ code 3 copies, one for rx, tx and
> > ctrl queue, respectively.
> >
> >> The switch/case in the common queue setup looks bad.
> > Assuming you are talking about the "if .. else .." ...
> >
> > While I agree with you on that, introducing so many duplicated code is worse.
> >
> >> I am aware of the common operations, and i had planned to extract them,
> >> maybe i could do this in this patchset.
> > If you meant to do in another patch on top of this patch, then it looks
> > like the wrong way to go: breaking something first and then fixing it
> > later does not sound a good practice to me.
> 
> To your later comment, we could split first, then do the queue setup rework.

Well, if you insist, I'm Okay. But please don't do it in the way this
patch does, that introduces quite many duplicated codes.

	--yliu

  reply	other threads:[~2016-05-05  3:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-04  0:50 Huawei Xie
2016-05-05  0:03 ` Yuanhan Liu
2016-05-05  1:54   ` Xie, Huawei
2016-05-05  3:07     ` Yuanhan Liu
2016-05-05  3:29       ` Xie, Huawei
2016-05-05  3:50         ` Yuanhan Liu [this message]
2016-05-05  5:29           ` Xie, Huawei
2016-05-09  5:14             ` Yuanhan Liu
2016-05-09  5:44               ` Xie, Huawei
2016-05-09 16:02                 ` Yuanhan Liu
2016-05-24 13:38 ` Huawei Xie
2016-05-25 10:07   ` Thomas Monjalon
2016-05-25 15:01     ` Xie, Huawei
2016-05-27  9:07   ` Yuanhan Liu
2016-05-30  2:40     ` Xie, Huawei
2016-05-30  3:03       ` Yuanhan Liu
2016-05-30  8:17         ` Xie, Huawei
2016-05-30  9:06 ` [dpdk-dev] [PATCH v3] " Huawei Xie
2016-06-01  7:15   ` Yuanhan Liu
2016-06-02  6:38     ` Xie, Huawei
2016-06-02  6:43       ` Yuanhan Liu
2016-06-01 16:12   ` Huawei Xie
2016-06-02  8:09     ` Xie, Huawei
2016-06-03  2:53     ` Yuanhan Liu

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=20160505035000.GY5641@yliu-dev.sh.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=dev@dpdk.org \
    --cc=huawei.xie@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).