From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 106976CBC for ; Tue, 13 Sep 2016 14:13:57 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP; 13 Sep 2016 05:13:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,328,1470726000"; d="scan'208";a="8225524" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga004.jf.intel.com with ESMTP; 13 Sep 2016 05:13:51 -0700 Date: Tue, 13 Sep 2016 20:14:23 +0800 From: Yuanhan Liu To: Pankaj Chauhan Cc: dev@dpdk.org, hemant.agrawal@nxp.com, jianfeng.tan@intel.com, maxime.coquelin@redhat.com Message-ID: <20160913121423.GT23158@yliu-dev.sh.intel.com> References: <1473072871-16108-1-git-send-email-pankaj.chauhan@nxp.com> <1473072871-16108-3-git-send-email-pankaj.chauhan@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1473072871-16108-3-git-send-email-pankaj.chauhan@nxp.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [RFC][PATCH V2 2/3] examples/vhost: Add vswitch command line options X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 12:13:58 -0000 On Mon, Sep 05, 2016 at 04:24:30PM +0530, Pankaj Chauhan wrote: > Add command line options for selecting switch implementation > and maximum ports for the vswitch.following are two new command > line options: > > --switch [char string, Selects the switch imlementation] > --max-ports [int, selects maximum number of ports to support] > > For example: > > $ ./vhost-switch -c 3 -n 2 --socket-mem 1024 --huge-dir /hugetlbfs -- -p > 0x1 --dev-basename sock1 That means you were basing on the master branch. You should base on next-virtio instead: http://dpdk.org/browse/next/dpdk-next-virtio/ > --switch "vmdq" --max-ports 3 Normally, we should keep the old behaviour first. Say, making the vmdq as the default switch mode. However, actually, I don't quite like to make the vhost-switch to bind to a hardare feature that tightly, that you may want to make a standalone patch as the last one in this patchset to make the "switch" mode be the default one. > > Signed-off-by: Pankaj Chauhan > --- > examples/vhost/main.c | 43 +++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 43 insertions(+) > > diff --git a/examples/vhost/main.c b/examples/vhost/main.c > index c949df4..a4e51ae 100644 > --- a/examples/vhost/main.c > +++ b/examples/vhost/main.c > @@ -142,6 +142,10 @@ static uint32_t burst_rx_retry_num = BURST_RX_RETRIES; > /* Character device basename. Can be set by user. */ > static char dev_basename[MAX_BASENAME_SZ] = "vhost-net"; > > +/* vswitch device name and maximum number of ports */ > +static char switch_dev[MAX_BASENAME_SZ] = "vmdq"; First of all, limiting it with MAX_BASENAME_SZ makes no sense here. Secondly, you don't have to represent the switch mode with string, you could simply use some numeric macros, or enum. Besides, I just had a quick glimplse of your patches (still couldn't make a detailed look so far), and I'd ask you to do few more things for v3: - I'm hoping you could split this patchset further, say **maybe** one patch to introduce vswitch_port, one to introduce vswitch_ops and another one to introduce vswitch_dev. This helps review. - make sure each commit is buldable. And few more generic comments to the whole set: - use "__rte_unused" but not "__attribute__((unused))" And we normally use it after but not before the key word. - follow the DPDK prefered way to define a function, the return type and function name takes two lines. - run scripts/{checkpatches.sh,check-git-log.sh} and fix real warnings if any before sending them out. This would at least help you catch "line over 80 chars" issue. Thanks. --yliu