From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stephen@networkplumber.org>
Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com
 [209.85.192.175]) by dpdk.org (Postfix) with ESMTP id 585E7B36D
 for <dev@dpdk.org>; Tue, 26 Aug 2014 03:22:11 +0200 (CEST)
Received: by mail-pd0-f175.google.com with SMTP id r10so20996592pdi.6
 for <dev@dpdk.org>; Mon, 25 Aug 2014 18:26:07 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to
 :references:mime-version:content-type:content-transfer-encoding;
 bh=oBD3f0XqWC13caYmsLR94VV5WHBf2Wm6ecTuvtPFb6I=;
 b=atub3XIj7WeSGP4E4CVBJChKuzf+nYbScnNTpl5UD2ik2OC1rmSG/3x/c6T863TOFL
 7Ycu5TtggujtVJWWHO+cK8qHNajNgQ3qcd1X7UOQJGj4SMx+SRc7mMSgcYqn1pZBi+H0
 0uBSbOORgzdm//3WrRt75CRXohc/sTIvtuOtimooIlpkUCChPd0n5kJkF0LVXRiShOza
 gL6Yvsl70npqWgyqjSSVoL/gHZ4Ji96bq2WIYdzUf/0xFiC90Qp70EQpoGvuR35Ds1ZO
 Oz409jOllYnGmzaxjgcIckvOYzmPgTJ86Ub83a6RTuRnYA3m8RpEofXAq0nRadFCsYNl
 OsRA==
X-Gm-Message-State: ALoCoQmS4pjJbh703torc1fg4nj13YIqw2Mql8StbUk83WD5AgulH6oXX8FadYlaiffB4SGY8t02
X-Received: by 10.68.223.138 with SMTP id qu10mr32849887pbc.45.1409016367783; 
 Mon, 25 Aug 2014 18:26:07 -0700 (PDT)
Received: from urahara (static-50-53-65-80.bvtn.or.frontiernet.net.
 [50.53.65.80])
 by mx.google.com with ESMTPSA id fk5sm1095097pbc.53.2014.08.25.18.26.07
 for <multiple recipients>
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 25 Aug 2014 18:26:07 -0700 (PDT)
Date: Mon, 25 Aug 2014 18:26:04 -0700
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Ouyang, Changchun" <changchun.ouyang@intel.com>
Message-ID: <20140825182604.7a8ab935@urahara>
In-Reply-To: <F52918179C57134FAEC9EA62FA2F96251183AFD6@shsmsx102.ccr.corp.intel.com>
References: <1408932572-10343-1-git-send-email-changchun.ouyang@intel.com>
 <1408932572-10343-5-git-send-email-changchun.ouyang@intel.com>
 <20140825171303.21e20d8b@uryu.home.lan>
 <F52918179C57134FAEC9EA62FA2F96251183AFD6@shsmsx102.ccr.corp.intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 4/5] virtio: New API to enable/disable
 multicast and promisc mode
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Aug 2014 01:22:11 -0000

On Tue, 26 Aug 2014 01:05:16 +0000
"Ouyang, Changchun" <changchun.ouyang@intel.com> wrote:

> Hi  Stephen,
> 
> My response below.
> 
> Thanks 
> Changchun
> 
> 
> > -----Original Message-----
> > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > Sent: Tuesday, August 26, 2014 8:13 AM
> > To: Ouyang, Changchun
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH 4/5] virtio: New API to enable/disable
> > multicast and promisc mode
> > 
> > On Mon, 25 Aug 2014 10:09:31 +0800
> > Ouyang Changchun <changchun.ouyang@intel.com> wrote:
> > 
> > > This patch adds new API in virtio for supporting promiscuous and
> > allmulticast enabling and disabling.
> > >
> > > Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
> > > Acked-by: Huawei Xie <huawei.xie@intel.com>
> > > Acked-by: Cunming Liang <cunming.liang@intel.com>
> > >
> > > ---
> > >  lib/librte_pmd_virtio/virtio_ethdev.c | 98
> > > ++++++++++++++++++++++++++++++++++-
> > >  1 file changed, 97 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/lib/librte_pmd_virtio/virtio_ethdev.c
> > > b/lib/librte_pmd_virtio/virtio_ethdev.c
> > > index 6293ac6..c7f874a 100644
> > > --- a/lib/librte_pmd_virtio/virtio_ethdev.c
> > > +++ b/lib/librte_pmd_virtio/virtio_ethdev.c
> > > @@ -66,6 +66,10 @@ static int eth_virtio_dev_init(struct eth_driver
> > > *eth_drv,  static int  virtio_dev_configure(struct rte_eth_dev *dev);
> > > static int  virtio_dev_start(struct rte_eth_dev *dev);  static void
> > > virtio_dev_stop(struct rte_eth_dev *dev);
> > > +static void virtio_dev_promiscuous_enable(struct rte_eth_dev *dev);
> > > +static void virtio_dev_promiscuous_disable(struct rte_eth_dev *dev);
> > > +static void virtio_dev_allmulticast_enable(struct rte_eth_dev *dev);
> > > +static void virtio_dev_allmulticast_disable(struct rte_eth_dev *dev);
> > >  static void virtio_dev_info_get(struct rte_eth_dev *dev,
> > >  				struct rte_eth_dev_info *dev_info);  static
> > int
> > > virtio_dev_link_update(struct rte_eth_dev *dev, @@ -403,6 +407,94 @@
> > > virtio_dev_close(struct rte_eth_dev *dev)
> > >  	virtio_dev_stop(dev);
> > >  }
> > >
> > > +static void
> > > +virtio_dev_promiscuous_enable(struct rte_eth_dev *dev) {
> > > +	struct virtio_hw *hw
> > > +		= VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> > > +	struct virtio_pmd_ctrl ctrl;
> > > +	int dlen[1];
> > > +	int ret;
> > > +
> > > +	ctrl.hdr.class = VIRTIO_NET_CTRL_RX;
> > > +	ctrl.hdr.cmd = VIRTIO_NET_CTRL_RX_PROMISC;
> > > +	ctrl.data[0] = 1;
> > > +	dlen[0] = 1;
> > > +
> > > +	ret = virtio_send_command(hw->cvq, &ctrl, dlen, 1);
> > > +
> > > +	if (ret) {
> > > +		PMD_INIT_LOG(ERR, "Promisc enabling but send command "
> > > +			  "failed, this is too late now...\n");
> > > +	}
> > > +}
> > > +
> > > +static void
> > > +virtio_dev_promiscuous_disable(struct rte_eth_dev *dev) {
> > > +	struct virtio_hw *hw
> > > +		= VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> > > +	struct virtio_pmd_ctrl ctrl;
> > > +	int dlen[1];
> > > +	int ret;
> > > +
> > > +	ctrl.hdr.class = VIRTIO_NET_CTRL_RX;
> > > +	ctrl.hdr.cmd = VIRTIO_NET_CTRL_RX_PROMISC;
> > > +	ctrl.data[0] = 0;
> > > +	dlen[0] = 1;
> > > +
> > > +	ret = virtio_send_command(hw->cvq, &ctrl, dlen, 1);
> > > +
> > > +	if (ret) {
> > > +		PMD_INIT_LOG(ERR, "Promisc disabling but send command "
> > > +			  "failed, this is too late now...\n");
> > > +	}
> > > +}
> > > +
> > > +static void
> > > +virtio_dev_allmulticast_enable(struct rte_eth_dev *dev) {
> > > +	struct virtio_hw *hw
> > > +		= VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> > > +	struct virtio_pmd_ctrl ctrl;
> > > +	int dlen[1];
> > > +	int ret;
> > > +
> > > +	ctrl.hdr.class = VIRTIO_NET_CTRL_RX;
> > > +	ctrl.hdr.cmd = VIRTIO_NET_CTRL_RX_ALLMULTI;
> > > +	ctrl.data[0] = 1;
> > > +	dlen[0] = 1;
> > > +
> > > +	ret = virtio_send_command(hw->cvq, &ctrl, dlen, 1);
> > > +
> > > +	if (ret) {
> > > +		PMD_INIT_LOG(ERR, "Promisc enabling but send command "
> > > +			  "failed, this is too late now...\n");
> > > +	}
> > > +}
> > > +
> > > +static void
> > > +virtio_dev_allmulticast_disable(struct rte_eth_dev *dev) {
> > > +	struct virtio_hw *hw
> > > +		= VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> > > +	struct virtio_pmd_ctrl ctrl;
> > > +	int dlen[1];
> > > +	int ret;
> > > +
> > > +	ctrl.hdr.class = VIRTIO_NET_CTRL_RX;
> > > +	ctrl.hdr.cmd = VIRTIO_NET_CTRL_RX_ALLMULTI;
> > > +	ctrl.data[0] = 0;
> > > +	dlen[0] = 1;
> > > +
> > > +	ret = virtio_send_command(hw->cvq, &ctrl, dlen, 1);
> > > +
> > > +	if (ret) {
> > > +		PMD_INIT_LOG(ERR, "Promisc disabling but send command "
> > > +			  "failed, this is too late now...\n");
> > > +	}
> > > +}
> > > +
> > >  /*
> > >   * dev_ops for virtio, bare necessities for basic operation
> > >   */
> > > @@ -411,6 +503,10 @@ static struct eth_dev_ops virtio_eth_dev_ops = {
> > >  	.dev_start               = virtio_dev_start,
> > >  	.dev_stop                = virtio_dev_stop,
> > >  	.dev_close               = virtio_dev_close,
> > > +	.promiscuous_enable      = virtio_dev_promiscuous_enable,
> > > +	.promiscuous_disable     = virtio_dev_promiscuous_disable,
> > > +	.allmulticast_enable     = virtio_dev_allmulticast_enable,
> > > +	.allmulticast_disable    = virtio_dev_allmulticast_disable,
> > >
> > >  	.dev_infos_get           = virtio_dev_info_get,
> > >  	.stats_get               = virtio_dev_stats_get,
> > > @@ -561,7 +657,7 @@ virtio_negotiate_features(struct virtio_hw *hw)  {
> > >  	uint32_t host_features, mask;
> > >
> > > -	mask = VIRTIO_NET_F_CTRL_RX | VIRTIO_NET_F_CTRL_VLAN;
> > > +	mask = VIRTIO_NET_F_CTRL_VLAN;
> > >  	mask |= VIRTIO_NET_F_CSUM | VIRTIO_NET_F_GUEST_CSUM;
> > >
> > >  	/* TSO and LRO are only available when their corresponding
> > 
> > I have similar patches, but you really need to fix the driver so that control
> > queue is brought up on dev_init, not start.
> > It makes sense to allow code to change modes independent of whether
> > driver has been started or not.
> > 
> > Also, the virtio driver is doing reset on stop. This may not be best solution
> > because it conflicts with what Linux driver is doing.
> > 
> Yes, agree with you on these 2 existing issues, but I'd like to use a separate patch to fix them,
> And let this patch focus on multicast feature.
> 
> If you have already a patch to fix them, that's great.
> 
> > Another current bug is that virtio DPDK driver is broken on latest KVM. It
> > works with Debian stable, but not with Debian testing.
> > Too busy to investigate further.
> 
> Is this bug introduced by this patch or it is an existing bug?
> If it is introduced by this patch, a v2 patch is necessary,
> Otherwise, a separate patch is suggested.

It is an existing bug (in KVM). Not getting warm response from upstream.