From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 97A472C6D for ; Tue, 8 May 2018 03:31:49 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 May 2018 18:31:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,376,1520924400"; d="scan'208";a="222426366" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga005.jf.intel.com with ESMTP; 07 May 2018 18:31:47 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 7 May 2018 18:31:47 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 7 May 2018 18:31:46 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.40]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.240]) with mapi id 14.03.0319.002; Tue, 8 May 2018 09:31:44 +0800 From: "Yao, Lei A" To: Chas Williams <3chas3@gmail.com>, "dev@dpdk.org" , "Jan Blunck" CC: "mtetsuyah@gmail.com" , "yliu@fridaylinux.org" , "maxime.coquelin@redhat.com" , "Bie, Tiwei" Thread-Topic: [dpdk-dev] [PATCH 2/2] net/vhost: insert/strip VLAN header in software Thread-Index: AQHTx3fVq9Q1kQWRmUGGzRehbM6Oh6QlR4yw Date: Tue, 8 May 2018 01:31:43 +0000 Message-ID: <2DBBFF226F7CF64BAFCA79B681719D953A43C40C@SHSMSX101.ccr.corp.intel.com> References: <20180329160507.25081-1-3chas3@gmail.com> <20180329160507.25081-2-3chas3@gmail.com> In-Reply-To: <20180329160507.25081-2-3chas3@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjA3MmJlOTQtMGU1OS00YjlmLWFiOTMtZjc2YjI3ZGIyYThlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjlrMzFcL2JLZE1saldKOVlYcEVRaHJOWTBJeGl0M2VmeE5GTTVQTEdOMkVFPSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 2/2] net/vhost: insert/strip VLAN header in software X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 May 2018 01:31:50 -0000 Hi, Jan For this patch, I find it will break the VM2VM Iperf test as it clear the of_flags. "bufs[i]->ol_flags =3D 0;" Could you have a check on this? The test step to reproduce this issue: 1. Lauch testpmd with two vhost-user port, using IO fwd mode testpmd -c 0xe -n 4 --socket-mem 1024,1024 \ --legacy-mem --vdev 'eth_vhost0,iface=3Dvhost-net,queues=3D1' \ --vdev 'eth_vhost1,iface=3Dvhost-net1,queues=3D1' --nb-cores=3D1 \ --tx-offloads=3D0x802a 2. Lauch 2 vms with virtio deivce 3. In the 2 vms, up the virtio device and run Iperf test between VMs The test result show that the Iperf traffic is broken but ping test can pas= s. > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Chas Williams > Sent: Friday, March 30, 2018 12:05 AM > To: dev@dpdk.org > Cc: mtetsuyah@gmail.com; yliu@fridaylinux.org; > maxime.coquelin@redhat.com; Jan Blunck > Subject: [dpdk-dev] [PATCH 2/2] net/vhost: insert/strip VLAN header in > software >=20 > From: Jan Blunck >=20 > This lets the vhost driver handle the VLAN header like the virtio driver > in software. >=20 > Signed-off-by: Jan Blunck > --- > drivers/net/vhost/rte_eth_vhost.c | 35 > ++++++++++++++++++++++++++++++++++- > 1 file changed, 34 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/vhost/rte_eth_vhost.c > b/drivers/net/vhost/rte_eth_vhost.c > index 453d9bee1..0beb28e94 100644 > --- a/drivers/net/vhost/rte_eth_vhost.c > +++ b/drivers/net/vhost/rte_eth_vhost.c > @@ -119,6 +119,7 @@ struct pmd_internal { > uint16_t max_queues; > rte_atomic32_t started; > int vid; > + uint8_t vlan_strip; > }; >=20 > struct internal_list { > @@ -422,6 +423,12 @@ eth_vhost_rx(void *q, struct rte_mbuf **bufs, > uint16_t nb_bufs) >=20 > for (i =3D 0; likely(i < nb_rx); i++) { > bufs[i]->port =3D r->port; > + bufs[i]->ol_flags =3D 0; > + bufs[i]->vlan_tci =3D 0; > + > + if (r->internal->vlan_strip) > + rte_vlan_strip(bufs[i]); > + > r->stats.bytes +=3D bufs[i]->pkt_len; > } >=20 > @@ -438,7 +445,7 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, > uint16_t nb_bufs) > { > struct vhost_queue *r =3D q; > uint16_t i, nb_tx =3D 0; > - uint16_t nb_send =3D nb_bufs; > + uint16_t nb_send =3D 0; >=20 > if (unlikely(rte_atomic32_read(&r->allow_queuing) =3D=3D 0)) > return 0; > @@ -448,6 +455,22 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, > uint16_t nb_bufs) > if (unlikely(rte_atomic32_read(&r->allow_queuing) =3D=3D 0)) > goto out; >=20 > + for (i =3D 0; i < nb_bufs; i++) { > + struct rte_mbuf *m =3D bufs[i]; > + > + /* Do VLAN tag insertion */ > + if (m->ol_flags & PKT_TX_VLAN_PKT) { > + int error =3D rte_vlan_insert(&m); > + if (unlikely(error)) { > + rte_pktmbuf_free(m); > + continue; > + } > + } > + > + bufs[nb_send] =3D m; > + ++nb_send; > + } > + > /* Enqueue packets to guest RX queue */ > while (nb_send) { > uint16_t nb_pkts; > @@ -489,6 +512,16 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, > uint16_t nb_bufs) > static int > eth_dev_configure(struct rte_eth_dev *dev __rte_unused) > { > + struct pmd_internal *internal =3D dev->data->dev_private; > + const struct rte_eth_rxmode *rxmode =3D &dev->data- > >dev_conf.rxmode; > + > + internal->vlan_strip =3D rxmode->hw_vlan_strip; > + > + if (rxmode->hw_vlan_filter) > + RTE_LOG(WARNING, PMD, > + "vhost(%s): vlan filtering not available\n", > + internal->dev_name); > + > return 0; > } >=20 > -- > 2.13.6