[dpdk-dev] [PATCH] qos_meter: Incorrect value check in example file.

2016-08-08 Thread Dumitrescu, Cristian

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Sonnads,
> ShantkumarX
> Sent: Monday, August 8, 2016 7:53 AM
> To: 'dev at dpdk.org' 
> Subject: Re: [dpdk-dev] [PATCH] qos_meter: Incorrect value check in
> example file.
> 
> Sorry, Missed the attachment, resending email with attachment.
> 
> From: Sonnads, ShantkumarX
> Sent: Friday, August 05, 2016 4:21 PM
> To: dev at dpdk.org
> Subject: [PATCH] qos_meter: Incorrect value check in example file.
> 
> 
> Attached is patch for dpdk.org

Hi Sonnads,

If you have a patch, please send it using the rules documented on dpdk.org: 
http://www.dpdk.org/doc/guides/contributing/patches.html.

Regards,
Cristian



[dpdk-dev] [PATCH v4 3/3] lpm: remove redundant check when adding lpm rule

2016-08-08 Thread Wei Dai
When a rule with depth > 24 is added into an existing
rule with depth <=24, a new tbl8 is allocated, the existing
rule first fulfill whole new tbl8, so the filed valid of
each entry in this tbl8 is always true and depth of each
entry is always <= 24 before adding the new rule with depth > 24.

Signed-off-by: Wei Dai 
Acked-by: Bruce Richardson 
---
 lib/librte_lpm/rte_lpm.c | 22 ++
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c
index 24fec4b..ec67765 100644
--- a/lib/librte_lpm/rte_lpm.c
+++ b/lib/librte_lpm/rte_lpm.c
@@ -940,14 +940,9 @@ add_depth_big_v20(struct rte_lpm_v20 *lpm, uint32_t 
ip_masked, uint8_t depth,

/* Insert new rule into the tbl8 entry. */
for (i = tbl8_index; i < tbl8_index + tbl8_range; i++) {
-   if (!lpm->tbl8[i].valid ||
-   lpm->tbl8[i].depth <= depth) {
-   lpm->tbl8[i].valid = VALID;
-   lpm->tbl8[i].depth = depth;
-   lpm->tbl8[i].next_hop = next_hop;
-
-   continue;
-   }
+   lpm->tbl8[i].valid = VALID;
+   lpm->tbl8[i].depth = depth;
+   lpm->tbl8[i].next_hop = next_hop;
}

/*
@@ -1071,14 +1066,9 @@ add_depth_big_v1604(struct rte_lpm *lpm, uint32_t 
ip_masked, uint8_t depth,

/* Insert new rule into the tbl8 entry. */
for (i = tbl8_index; i < tbl8_index + tbl8_range; i++) {
-   if (!lpm->tbl8[i].valid ||
-   lpm->tbl8[i].depth <= depth) {
-   lpm->tbl8[i].valid = VALID;
-   lpm->tbl8[i].depth = depth;
-   lpm->tbl8[i].next_hop = next_hop;
-
-   continue;
-   }
+   lpm->tbl8[i].valid = VALID;
+   lpm->tbl8[i].depth = depth;
+   lpm->tbl8[i].next_hop = next_hop;
}

/*
-- 
2.5.5



[dpdk-dev] [PATCH v4 2/3] app/test: add a case to verify lpm tlb8 recycle

2016-08-08 Thread Wei Dai
As a bug-fix for lpm tlb8 recycle is introduced,
add a test case to verify tlb8 group is correctly
freed when it only includes a rule with depth=24.

Signed-off-by: Wei Dai 
Acked-by: Bruce Richardson 
---
 app/test/test_lpm.c | 80 -
 1 file changed, 79 insertions(+), 1 deletion(-)

diff --git a/app/test/test_lpm.c b/app/test/test_lpm.c
index b6ad2eb..ad12846 100644
--- a/app/test/test_lpm.c
+++ b/app/test/test_lpm.c
@@ -68,6 +68,7 @@ static int32_t test14(void);
 static int32_t test15(void);
 static int32_t test16(void);
 static int32_t test17(void);
+static int32_t test18(void);

 rte_lpm_test tests[] = {
 /* Test Cases */
@@ -89,6 +90,7 @@ rte_lpm_test tests[] = {
test15,
test16,
test17,
+   test18
 };

 #define NUM_LPM_TESTS (sizeof(tests)/sizeof(tests[0]))
@@ -1218,6 +1220,82 @@ test17(void)
 }

 /*
+ * Test for recycle of tlb8
+ *  - step 1: add a rule with depth=28 (> 24)
+ *  - step 2: add a rule with same 24-bit prefix and depth=23 (< 24)
+ *  - step 3: delete the first rule
+ *  - step 4: check tlb8 is freed
+ *  - step 5: add a rule same as the first one (depth=28)
+ *  - step 6: check same tlb8 is allocated
+ *  - step 7: add a rule with same 24-bit prefix and depth=24
+ *  - step 8: delete the rule (depth=28) added in step 5
+ *  - step 9: check tlb8 is freed
+ *  - step 10: add a rule with same 24-bit prefix and depth = 28
+ *  - setp 11: check same tlb8 is allocated again
+ */
+int32_t
+test18(void)
+{
+#define group_idx next_hop
+   struct rte_lpm *lpm = NULL;
+   struct rte_lpm_config config;
+   uint32_t ip, next_hop;
+   uint8_t depth;
+   uint32_t tbl8_group_index;
+
+   config.max_rules = MAX_RULES;
+   config.number_tbl8s = NUMBER_TBL8S;
+   config.flags = 0;
+
+   lpm = rte_lpm_create(__func__, SOCKET_ID_ANY, );
+   TEST_LPM_ASSERT(lpm != NULL);
+
+   ip = IPv4(192, 168, 100, 100);
+   depth = 28;
+   next_hop = 1;
+   rte_lpm_add(lpm, ip, depth, next_hop);
+
+   TEST_LPM_ASSERT(lpm->tbl24[ip>>8].valid_group);
+   tbl8_group_index = lpm->tbl8[ip>>8].group_idx;
+
+   depth = 23;
+   next_hop = 2;
+   rte_lpm_add(lpm, ip, depth, next_hop);
+   TEST_LPM_ASSERT(lpm->tbl24[ip>>8].valid_group);
+
+   depth = 28;
+   rte_lpm_delete(lpm, ip, depth);
+
+   TEST_LPM_ASSERT(!lpm->tbl24[ip>>8].valid_group);
+
+   next_hop = 3;
+   rte_lpm_add(lpm, ip, depth, next_hop);
+
+   TEST_LPM_ASSERT(lpm->tbl24[ip>>8].valid_group);
+   TEST_LPM_ASSERT(tbl8_group_index == lpm->tbl8[ip>>8].group_idx);
+
+   depth = 24;
+   next_hop = 4;
+   rte_lpm_add(lpm, ip, depth, next_hop);
+   TEST_LPM_ASSERT(lpm->tbl24[ip>>8].valid_group);
+
+   depth = 28;
+   rte_lpm_delete(lpm, ip, depth);
+
+   TEST_LPM_ASSERT(!lpm->tbl24[ip>>8].valid_group);
+
+   next_hop = 5;
+   rte_lpm_add(lpm, ip, depth, next_hop);
+
+   TEST_LPM_ASSERT(lpm->tbl24[ip>>8].valid_group);
+   TEST_LPM_ASSERT(tbl8_group_index == lpm->tbl8[ip>>8].group_idx);
+
+   rte_lpm_free(lpm);
+#undef group_idx
+   return PASS;
+}
+
+/*
  * Do all unit tests.
  */

@@ -1230,7 +1308,7 @@ test_lpm(void)
for (i = 0; i < NUM_LPM_TESTS; i++) {
status = tests[i]();
if (status < 0) {
-   printf("ERROR: LPM Test %s: FAIL\n", RTE_STR(tests[i]));
+   printf("ERROR: LPM Test %u: FAIL\n", i);
global_status = status;
}
}
-- 
2.5.5



[dpdk-dev] [PATCH v4 1/3] lpm: fix freeing unused sub-table on rule delete

2016-08-08 Thread Wei Dai
When all rules with depth > 24 are deleted in a same sub-table
(tlb8 group) and only a rule with depth <=24 is left in it,
this sub-table (tlb8 group) should be recycled.

Fixes: dc81ebbacaeb ("lpm: extend IPv4 next hop field")
Fixes: af75078fece3 ("first public release")

Signed-off-by: Wei Dai 
Acked-by: Bruce Richardson 
---
 lib/librte_lpm/rte_lpm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c
index 6f65d1c..24fec4b 100644
--- a/lib/librte_lpm/rte_lpm.c
+++ b/lib/librte_lpm/rte_lpm.c
@@ -1533,7 +1533,7 @@ tbl8_recycle_check_v20(struct rte_lpm_tbl_entry_v20 *tbl8,
 * and if so check the rest of the entries to verify that they
 * are all of this depth.
 */
-   if (tbl8[tbl8_group_start].depth < MAX_DEPTH_TBL24) {
+   if (tbl8[tbl8_group_start].depth <= MAX_DEPTH_TBL24) {
for (i = (tbl8_group_start + 1); i < tbl8_group_end;
i++) {

@@ -1580,7 +1580,7 @@ tbl8_recycle_check_v1604(struct rte_lpm_tbl_entry *tbl8,
 * and if so check the rest of the entries to verify that they
 * are all of this depth.
 */
-   if (tbl8[tbl8_group_start].depth < MAX_DEPTH_TBL24) {
+   if (tbl8[tbl8_group_start].depth <= MAX_DEPTH_TBL24) {
for (i = (tbl8_group_start + 1); i < tbl8_group_end;
i++) {

-- 
2.5.5



[dpdk-dev] [PATCH] kni: error release device list head could cause a kernel crash.

2016-08-08 Thread Ferruh Yigit
Hi,

On 8/6/2016 12:19 PM, ??? wrote:
> From 3edca1e3194959ba26a6c36143f8423009661b11 Mon Sep 17 00:00:00 2001
> From: zhouyangchao 
> Date: Sat, 6 Aug 2016 19:14:51 +0800
> Subject: [PATCH] kni: error release device list head could cause a kernel 
> crash.
> 
> Signed-off-by: zhouyangchao 
> ---
>  lib/librte_eal/linuxapp/kni/kni_misc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c
> b/lib/librte_eal/linuxapp/kni/kni_misc.c
> index ae8133f..a49924b 100644
> --- a/lib/librte_eal/linuxapp/kni/kni_misc.c
> +++ b/lib/librte_eal/linuxapp/kni/kni_misc.c
> @@ -276,8 +276,8 @@ kni_release(struct inode *inode, struct file *file)
>  #ifdef RTE_KNI_VHOST
>   kni_vhost_backend_release(dev);
>  #endif
> - kni_dev_remove(dev);
>   list_del(>list);
> + kni_dev_remove(dev);
>   }
>   up_write(>kni_list_lock);
> 
> @@ -613,8 +613,8 @@ kni_ioctl_release(struct net *net,
>  #ifdef RTE_KNI_VHOST
>   kni_vhost_backend_release(dev);
>  #endif
> - kni_dev_remove(dev);
>   list_del(>list);
> + kni_dev_remove(dev);
>   ret = 0;
>   break;
>   }
> --
> 

Can you please describe how crash can occur?
And if you have a crash log, can you include it?

Access to device via list, removing device from list and adding device
to list all are protected by lock (kni_list_lock), so as far as I can
see the order of removing device and removing it from list shouldn't be
a problem.

Thanks,
ferruh


[dpdk-dev] [PATCH] doc: fix a typo in intel_vf.rst.

2016-08-08 Thread Ferruh Yigit
On 8/6/2016 7:16 AM, Rami Rosen wrote:
> This patch fixes a typo in doc/guides/nics/intel_vf.rst.
> 
> Signed-off-by: Rami Rosen 

Acked-by: Ferruh Yigit 



[dpdk-dev] test: failed to clone dpdk source in windows

2016-08-08 Thread linhaifeng
? 2016/8/7 4:33, Jan Viktorin ??:
> On Fri, 05 Aug 2016 09:51:06 +0200
> Thomas Monjalon  wrote:
> 
>> 2016-08-05 09:44, Thomas Monjalon:
>>> 2016-08-05 10:09, linhaifeng:  
 hi,thomas

 Could you change the name of file in directory 
 app/test/test_pci_sysfs/bus/pci/devices/ ?
 I think somebody like us also cann't access internet in liunux.Windows not 
 support file name
 include ':'. 
> 
> Hello,
> 
> I am sorry for this situation but (as Thomas mentioned below) Windows is
> not considered as a supported platform. If you have issues with this
> approach you are welcome to prepare some patch changing this to do
> the same thing in another way.
> 
> There was a discussion when accepting the fake sysfs into DPDK on the
> public mailing list. I did not received any serious complaints at that
> time.
> 
> Regards
> Jan
>  
>>>
>>> Not sure to understand the use case.
>>> This is a fake sysfs, we cannot change the names.  
>>
>> In other words, Windows is not supported, neither for runtime
>> nor for development.
>> For information, which filesystem do not support ':'?
>>
>> If someone wants to add this support, the fake sysfs could have slightly
>> different names and rightly renamed during compilation.
> 

I just want to edit code in windows and compile in linux,so i want to clone it 
in windows,but
it's not support.The message in win7 is :
$ git clone http://dpdk.org/git/dpdk
Cloning into 'dpdk'...
remote: Counting objects: 51912, done.
remote: Compressing objects: 100% (10331/10331), done.
rRemote: Total 51912 (delta 41342), reused 51808 (delta 41eceiving objects: 100%
 (51271)912/519   MiB |
Receiving objects: 100% (51912/51912), 25.99 MiB | 1.99 MiB/s, done.
Resolving deltas: 100% (41342/41342), done.
Checking connectivity... done.
fatal: cannot create directory at 'app/test/test_pci_sysfs/bus/pci/devices/:
01:00.0': Invalid argument
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

If everyone edit codes in linux there is no need to fix it.




[dpdk-dev] rte_eth_rx bug? duplicate message bufs

2016-08-08 Thread Lavanya Jose
Hi,

I was wondering if anyone on this list has come across this problem of
rte_eth_rx_burst returning the same mbuf contents multiple times especially
during congestion. I notice this problem after some number of calls to
rte_eth_rx_burst when I set the nb_pkts argument to anything more than 5. I
did confirm that the contents (random payloads) in the duplicate packets
are identical.

I looked at the corresponding ixgbe driver code that gets packets from the
rx ring.

It looks like the driver doesn't drop packets if an mbuf allocation fails.
I'm not sure if this is the root cause of the bug I'm seeing?

I'm also curious about whether I need to set rx_descs and tx_descs to 40
when I'm setting up the Intel 82599 device? The datasheet says there's 40
descriptors per TX queue though default values I've seen in code are much
larger..

Thanks,
Lavanya


[dpdk-dev] Announcement: Registration for DPDK Userspace Summit 2016 - Dublin Ireland IS NOW OPEN

2016-08-08 Thread Butler, Siobhan A
Hi all,

Congratulations on a successful DPDK 16.07 release! It is wonderful to see the 
community continue to grow and develop with each release.

Following the success of DPDK Userspace Summit last October in Dublin we are 
delighted to invite you back to Userspace Summit October 2016! The two day, 
developer centric event will be run in a similar format to last year (see 
www.dpdksummit.com for past agenda and videos) and 
we hope that we will have many returning guests and many new guests at this 
event. Registration is now open at 
www.dpdksummit.com, get you're registration in early 
as places are limited to maintain the discussion and collaboration at the event 
again this year. If you have topic ideas or would like to put yourself forward 
as a speaker please don't hesitate to contact me (siobhan.a.butler at 
intel.com) or Tim O'Driscoll 
(tim.odriscoll at intel.com)
Can't wait to see you there!!

DPDK Userspace Summit 2016:

The Clayton Hotel
Ballsbridge,
 Dublin, Ireland
October 20th - 21st, 2016
9:00am - 5:30pm

Many Thanks,
Siobhan

P.S. there will be DPDKake :)


[dpdk-dev] [PATCH 1/3] net/ixgbe: move PCI device ids to the driver

2016-08-08 Thread Ferruh Yigit
On 8/8/2016 7:36 AM, David Marchand wrote:
> Hello Ferruh,
> 
> On Fri, Aug 5, 2016 at 4:09 PM, Ferruh Yigit  
> wrote:
>> PCI device ids moved from common header into ixgbe driver itself.
>>
>> KNI starts using pci_device_id from kni/ethtool/ixgbe driver, this is
>> only for KNI ethtool support, KNI data path is not effected.
>>
>> Signed-off-by: Ferruh Yigit 
> 
> Thanks for working on this.
> 
> The only thing that bothers me using this ("unsynchronised") internal
> pci device list is that, if people were using the ethtool part of kni,
> there would now be devices that won't be recognised anymore.
> Is it intentional ?

I am aware that the list changed, but wasn't sure about updating the
list in drivers or not.

If a device is not listed in driver's pci device id table, it may not be
supported, so ethtool may give wrong output, or it may just be missing,
this is hard to know without testing (although this was the case before
this patch)

Since it is easy to add new id, and we are at the beginning of the
release, I was thinking if somebody reports KNI ethotool support is
missing for a specific device, we can add it instead of adding all by
default.

> If so, we should explain why in the documentation.
> 
> Same comment for the igb patch.
> 
> 



[dpdk-dev] Mbuf leak issue with IXGBE in vector mod

2016-08-08 Thread Ori Zakin
Hi,


  1.  I?m seeing 128 mbufs leaked on each stop/start cycle when polling is 
stopped, you?re right that the leak is more severe when the device is polled 
while calling rte_eh_dev_stop.
  2.  Maybe the limitations per each function should be moved in the rte_eh_dev 
documentation from the header to each of the functions so that they?re more 
accessible when using a specific function.

Thanks,
Ori





On 5 Aug 2016, at 4:00 AM, Lu, Wenzhuo mailto:wenzhuo.lu at intel.com>> wrote:

Hi Ori,

-Original Message-
From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Ori Zakin
Sent: Thursday, August 4, 2016 11:38 PM
To: Zhang, Helin; Ananyev, Konstantin; dev at dpdk.org
Subject: [dpdk-dev] Mbuf leak issue with IXGBE in vector mod

Hi,


 1.  When calling rte_eth_dev_stop mbuf pool is depleted.
There appears to be a race condition that occurs when RTE_IXGBE_INC_VECTOR
is defined:
ixgbe_reset_rx_queue(struct ixgbe_adapter *adapter, struct ixgbe_rx_queue
*rxq) { ??.

#ifdef RTE_IXGBE_INC_VECTOR
rxq->rxrearm_start = 0;
sleep here appears to solve
rxq->rxrearm_nb = 0;
#endif


Behaviour also described here:
http://dpdk.org/ml/archives/users/2016-April/000488.html


 2.  Steps to recreate issue:
*   rte_mempool_free_count
*   rte_eth_dev_stop
*   rte_mempool_free_count - should see a spike in allocated mbufs from
mempool.
Have you stopped the rx/tx before do this stop/start? I think we'll hit this 
memory leak problem if the traffic is not stopped. There's an assumption that 
it?s APP's responsibility to stop rx/tx before operating the ports as we know 
dpdk is lockless.


 3.  2 workarounds that appear to work:
*   Set CONFIG_RTE_IXGBE_INC_VECTOR=n.
*   Add sleep in ixgbe_reset_rx_queue


Regards.
Ori Zakin



[dpdk-dev] [PATCH 1/3] net/ixgbe: move PCI device ids to the driver

2016-08-08 Thread David Marchand
Hello Ferruh,

On Fri, Aug 5, 2016 at 4:09 PM, Ferruh Yigit  wrote:
> PCI device ids moved from common header into ixgbe driver itself.
>
> KNI starts using pci_device_id from kni/ethtool/ixgbe driver, this is
> only for KNI ethtool support, KNI data path is not effected.
>
> Signed-off-by: Ferruh Yigit 

Thanks for working on this.

The only thing that bothers me using this ("unsynchronised") internal
pci device list is that, if people were using the ethtool part of kni,
there would now be devices that won't be recognised anymore.
Is it intentional ?
If so, we should explain why in the documentation.

Same comment for the igb patch.


-- 
David Marchand


[dpdk-dev] [PATCH 3/3] eal: remove rte_pci_dev_ids.h

2016-08-08 Thread David Marchand
On Sat, Aug 6, 2016 at 2:55 PM, Thomas Monjalon
 wrote:
> What do you think about this list? I would say we can remove it.

Yes, we already discussed this with John.
http://dpdk.org/ml/archives/dev/2016-January/031595.html


-- 
David Marchand


[dpdk-dev] [PATCH] qos_meter: Incorrect value check in example file.

2016-08-08 Thread Sonnads, ShantkumarX
Sorry, Missed the attachment, resending email with attachment.

From: Sonnads, ShantkumarX
Sent: Friday, August 05, 2016 4:21 PM
To: dev at dpdk.org
Subject: [PATCH] qos_meter: Incorrect value check in example file.


Attached is patch for dpdk.org


[dpdk-dev] [PATCH] qos_meter: Incorrect value check in example file.

2016-08-08 Thread Sonnads, ShantkumarX
Attached is patch for dpdk.org


[dpdk-dev] [PATCH 2/3] net/virtio_user: fix wrong sequence of messages

2016-08-08 Thread Tan, Jianfeng
Hi Stephen,

> -Original Message-
> From: Stephen Hemminger [mailto:stephen at networkplumber.org]
> Sent: Saturday, August 6, 2016 12:36 AM
> To: Tan, Jianfeng
> Cc: dev at dpdk.org; yuanhan.liu at linux.intel.com; Wang, Zhihong;
> lining18 at jd.com
> Subject: Re: [dpdk-dev] [PATCH 2/3] net/virtio_user: fix wrong sequence of
> messages
> 
> On Fri,  5 Aug 2016 11:36:42 +
> Jianfeng Tan  wrote:
> 
> > When virtio_user is used with VPP's native vhost user, it cannot
> > send/receive any packets.
> >
> > The root cause is that vpp-vhost-user translates the message
> > VHOST_USER_SET_FEATURES as puting this device into init state,
> > aka, zero all related structures. However, previous code
> > puts this message at last in the whole initialization process,
> > which leads to all previous information are zeroed.
> 
> Not sure what correct behavior is here.  It could be that VPP native
> vhost user is broken.  What does QEMU/KVM vhost do in this case?
> I would take that as the authoritative source for semantics.

Below corrective message sequence is as per QEMU's behavior. One more thing, 
QEMU does not have any docs for this, and it's figured out through how the 
vhost receives messages from QEMU.

Thanks,
Jianfeng

> 
> > To fix this issue, we rearrange the sequence of those messages.
> >   - step 0, send VHOST_USER_SET_VRING_CALL so that vhost allocates
> > virtqueue structures;
> >   - step 1, send VHOST_USER_SET_FEATURES to confirm the features;
> >   - step 2, send VHOST_USER_SET_MEM_TABLE to share mem regions;
> >   - step 3, send VHOST_USER_SET_VRING_NUM,
> VHOST_USER_SET_VRING_BASE,
> > VHOST_USER_SET_VRING_ADDR, VHOST_USER_SET_VRING_KICK for
> each
> > queue;
> >   - ...
> >
> > Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer")



[dpdk-dev] [PATCH 3/3] net/virtio_user: fix dev not freed after init error

2016-08-08 Thread Tan, Jianfeng
Hi Stephen,

> -Original Message-
> From: Stephen Hemminger [mailto:stephen at networkplumber.org]
> Sent: Saturday, August 6, 2016 12:34 AM
> To: Tan, Jianfeng
> Cc: dev at dpdk.org; yuanhan.liu at linux.intel.com; Wang, Zhihong;
> lining18 at jd.com
> Subject: Re: [dpdk-dev] [PATCH 3/3] net/virtio_user: fix dev not freed after
> init error
> 
> On Fri,  5 Aug 2016 11:36:43 +
> Jianfeng Tan  wrote:
> 
> > diff --git a/drivers/net/virtio/virtio_user_ethdev.c
> b/drivers/net/virtio/virtio_user_ethdev.c
> > index daef09b..62ccb0b 100644
> > --- a/drivers/net/virtio/virtio_user_ethdev.c
> > +++ b/drivers/net/virtio/virtio_user_ethdev.c
> > @@ -313,6 +313,17 @@ virtio_user_eth_dev_alloc(const char *name)
> > return eth_dev;
> >  }
> >
> > +static void
> > +virtio_user_eth_dev_free(struct rte_eth_dev *eth_dev)
> > +{
> > +   struct rte_eth_dev_data *data = eth_dev->data;
> > +   struct virtio_hw *hw = data->dev_private;
> > +
> > +   rte_free(hw->virtio_user_dev);
> > +   rte_free(hw);
> > +   rte_eth_dev_release_port(eth_dev);
> > +}
> > +
> >  /* Dev initialization routine. Invoked once for each virtio vdev at
> >   * EAL init time, see rte_eal_dev_init().
> >   * Returns 0 on success.
> > @@ -328,7 +339,7 @@ virtio_user_pmd_devinit(const char *name, const
> char *params)
> > uint64_t queue_size = VIRTIO_USER_DEF_Q_SZ;
> > char *path = NULL;
> > char *mac_addr = NULL;
> > -   int ret = -1;
> > +   int result = -1, ret;
> 
> It is not clear why two return value variables are needed?

My purpose was to make "ret" to record the return value of intermediate 
functions, and "result" to record that of current method. Any convention to do 
that?

If it introduces confusions, I'll change to use only one return value variables.


> >
> > if (!params || params[0] == '\0') {
> > PMD_INIT_LOG(ERR, "arg %s is mandatory for virtio_user",
> > @@ -411,15 +422,19 @@ virtio_user_pmd_devinit(const char *name,
> const char *params)
> >
> > hw = eth_dev->data->dev_private;
> > if (virtio_user_dev_init(hw->virtio_user_dev, path, queues, cq,
> > -queue_size, mac_addr) < 0)
> > +queue_size, mac_addr) < 0) {
> > +   PMD_INIT_LOG(ERR, "virtio_user_dev_init fails");
> > +   virtio_user_eth_dev_free(eth_dev);
> > goto end;
> > +   }
> >
> > /* previously called by rte_eal_pci_probe() for physical dev */
> > if (eth_virtio_dev_init(eth_dev) < 0) {
> > PMD_INIT_LOG(ERR, "eth_virtio_dev_init fails");
> > +   virtio_user_eth_dev_free(eth_dev);
> > goto end;
> > }
> > -   ret = 0;
> > +   result = 0;
> >
> >  end:
> > if (kvlist)
> > @@ -428,7 +443,7 @@ end:
> > free(path);
> > if (mac_addr)
> > free(mac_addr);
> 
> Unrelated, but this code could eliminate those if () tests.

Thanks for the hint. Yes, as manual says, "If ptr is NULL, no operation is 
performed". "if"s can be eliminated.

Thanks,
Jianfeng

> 
> > -   return ret;
> > +   return result;
> >  }


[dpdk-dev] test: failed to clone dpdk source in windows

2016-08-08 Thread Burt Silverman
Oddly enough, it seems to work fine under cygwin. That should solve your
issue.

On Sun, Aug 7, 2016 at 11:50 PM, linhaifeng  wrote:

> ? 2016/8/7 4:33, Jan Viktorin ??:
> > On Fri, 05 Aug 2016 09:51:06 +0200
> > Thomas Monjalon  wrote:
> >
> >> 2016-08-05 09:44, Thomas Monjalon:
> >>> 2016-08-05 10:09, linhaifeng:
>  hi,thomas
> 
>  Could you change the name of file in directory
> app/test/test_pci_sysfs/bus/pci/devices/ ?
>  I think somebody like us also cann't access internet in
> liunux.Windows not support file name
>  include ':'.
> >
> > Hello,
> >
> > I am sorry for this situation but (as Thomas mentioned below) Windows is
> > not considered as a supported platform. If you have issues with this
> > approach you are welcome to prepare some patch changing this to do
> > the same thing in another way.
> >
> > There was a discussion when accepting the fake sysfs into DPDK on the
> > public mailing list. I did not received any serious complaints at that
> > time.
> >
> > Regards
> > Jan
> >
> >>>
> >>> Not sure to understand the use case.
> >>> This is a fake sysfs, we cannot change the names.
> >>
> >> In other words, Windows is not supported, neither for runtime
> >> nor for development.
> >> For information, which filesystem do not support ':'?
> >>
> >> If someone wants to add this support, the fake sysfs could have slightly
> >> different names and rightly renamed during compilation.
> >
>
> I just want to edit code in windows and compile in linux,so i want to
> clone it in windows,but
> it's not support.The message in win7 is :
> $ git clone http://dpdk.org/git/dpdk
> Cloning into 'dpdk'...
> remote: Counting objects: 51912, done.
> remote: Compressing objects: 100% (10331/10331), done.
> rRemote: Total 51912 (delta 41342), reused 51808 (delta 41eceiving
> objects: 100%
>  (51271)912/519   MiB |
> Receiving objects: 100% (51912/51912), 25.99 MiB | 1.99 MiB/s, done.
> Resolving deltas: 100% (41342/41342), done.
> Checking connectivity... done.
> fatal: cannot create directory at 'app/test/test_pci_sysfs/bus/
> pci/devices/:
> 01:00.0': Invalid argument
> warning: Clone succeeded, but checkout failed.
> You can inspect what was checked out with 'git status'
> and retry the checkout with 'git checkout -f HEAD'
>
> If everyone edit codes in linux there is no need to fix it.
>
>
>