From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <rashmin.n.patel@intel.com>
Received: from mga03.intel.com (mga03.intel.com [134.134.136.65])
 by dpdk.org (Postfix) with ESMTP id A56DA7F2D
 for <dev@dpdk.org>; Thu,  9 Oct 2014 23:59:11 +0200 (CEST)
Received: from orsmga001.jf.intel.com ([10.7.209.18])
 by orsmga103.jf.intel.com with ESMTP; 09 Oct 2014 15:03:51 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.04,687,1406617200"; d="scan'208";a="586332681"
Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202])
 by orsmga001.jf.intel.com with ESMTP; 09 Oct 2014 15:06:31 -0700
Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by
 fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS)
 id 14.3.195.1; Thu, 9 Oct 2014 15:06:30 -0700
Received: from fmsmsx105.amr.corp.intel.com ([169.254.5.219]) by
 FMSMSX102.amr.corp.intel.com ([169.254.2.30]) with mapi id 14.03.0195.001;
 Thu, 9 Oct 2014 15:06:30 -0700
From: "Patel, Rashmin N" <rashmin.n.patel@intel.com>
To: Navakanth M <navakanthdev@gmail.com>, "stephen@networkplumber.org"
 <stephen@networkplumber.org>, "Cao, Waterman" <waterman.cao@intel.com>
Thread-Topic: vmxnet3 pmd dev restart
Thread-Index: AQHP4ukG8tZvnTyGGE6g0M3eoyvQDpwmkVaggAEdAYCAAKRNsA==
Date: Thu, 9 Oct 2014 22:06:30 +0000
Message-ID: <C68F1134885B32458704E1E4DA3E34F341A5E69B@FMSMSX105.amr.corp.intel.com>
References: <CAJuW35gvYkzOBE7PtOepj0YDGwb79OWGB_Bp1fo6vD5if+BEDQ@mail.gmail.com>
 <CAJuW35iS3s7yZai9Vqt7sycA7W8MNmBhe7fezq74wC3q9beQpQ@mail.gmail.com>
 <C68F1134885B32458704E1E4DA3E34F341A5ABE7@FMSMSX105.amr.corp.intel.com>
 <CAJuW35ib2CGvDvPctXPV6EkyLy-ZZuQ5sPSbGYYe8TbyDxwQeQ@mail.gmail.com>
In-Reply-To: <CAJuW35ib2CGvDvPctXPV6EkyLy-ZZuQ5sPSbGYYe8TbyDxwQeQ@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.34.78.61]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] vmxnet3 pmd dev restart
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: Thu, 09 Oct 2014 21:59:12 -0000

I just quickly looked into the code and instead of releasing memory or simp=
ly set it to NULL (patch:=20
 http://thread.gmane.org/gmane.comp.networking.dpdk.devel/4683), you can ze=
ro it out and it should work perfectly, you can give it a quick try.

//rte_free(ring->buf_info);
memset(ring->buf_info, 0x0, ring->size*sizeof(vmxnet3_buf_info_t));

This will not free the memory from heap but just wipe it out to 0x0, provid=
ed that we freed all the mbuf(s) pointed by each buf_info->m pointers. Henc=
e you won't need to reallocate it when you start device after this stop.

Thanks,
Rashmin

-----Original Message-----
From: Navakanth M [mailto:navakanthdev@gmail.com]=20
Sent: Wednesday, October 08, 2014 10:11 PM
To: stephen@networkplumber.org; Patel, Rashmin N; Cao, Waterman
Cc: dev@dpdk.org
Subject: Re: vmxnet3 pmd dev restart

I had tried with Stephen's patch but after stop is done and when we call st=
art it crashed at vmxnet3_dev_start()->
vmxnet3_dev_rxtx_init()->vmxnet3_post_rx_bufs() as buf_info is freed and is=
 not allocated again. buf_info is allocated in
vmxnet3_dev_rx_queue_setup() which would be called once at the initializati=
on only.
I also tried not freeing buf_info in stop but then i see different issue af=
ter start, packets are not received due to check while (rcd->gen =3D=3D rxq=
->comp_ring.gen) { in vmxnet3_recv_pkts()

Waterman, Have you got chance to test stop and start of vmnet dev if so did=
 you notice any issue similar to this?

Thanks
Navakanth

On Thu, Oct 9, 2014 at 12:46 AM, Patel, Rashmin N <rashmin.n.patel@intel.co=
m> wrote:
> Yes I had a local copy working with couple of lines fix. But someone else=
, I think Stephen added a fix patch for the same, and I assume if it's been=
 merged, should be working, so did not follow up later.
>
> I don't have a VMware setup handy at moment but I think Waterman would ha=
ve more information about testing that patch if he has found any issue with=
 it.
>
> Thanks,
> Rashmin
>
> -----Original Message-----
> From: Navakanth M [mailto:navakanthdev@gmail.com]
> Sent: Wednesday, October 08, 2014 4:14 AM
> To: dev@dpdk.org; Patel, Rashmin N
> Subject: Re: vmxnet3 pmd dev restart
>
> Hi Rashmin
>
> I have come across your reply in following post that you have worked on t=
his problem and would submit the patch for it.
> Can you please share information on the changes you worked on or patch lo=
g if you had submitted any for it?
> http://thread.gmane.org/gmane.comp.networking.dpdk.devel/4683
>
> Thanks
> Navakanth
>
> On Tue, Sep 30, 2014 at 1:44 PM, Navakanth M <navakanthdev@gmail.com> wro=
te:
>> Hi
>>
>> I am using DPDKv1.7.0 running on Vmware Esxi 5.1 and am trying to=20
>> reset the port which uses pmd_vmnet3 library functions from below=20
>> function calls.
>> rte_eth_dev_stop
>> rte_eth_dev_start
>>
>> Doing this, i face panic while rte_free(ring->buf_info) in=20
>> Vmxnet3_cmd_ring_release().
>> I have gone through following thread but the patch mentioned didn't=20
>> help rather it crashed in start function while accessing buf_info in=20
>> vmxnet3_post_rx_bufs. I see this buf_info is allocated in queue setup=20
>> functions which are called at initialization.
>> http://thread.gmane.org/gmane.comp.networking.dpdk.devel/4683
>>
>> I tried not freeing it and then rx packets are not received due to=20
>> mismatch in while (rcd->gen =3D=3D rxq->comp_ring.gen) in
>> vmxnet3_recv_pkts()
>>
>> To reset the device port, is this the right way what i am doing?
>> Or do I have to call vmxnet3_dev_tx_queue_setup()
>> vmxnet3_dev_rx_queue_setup() once stop is called? I have checked=20
>> recent patches and threads but did not get much information on this.
>>
>> Thanks
>> Navakanth