[dpdk-dev] [PATCH 00/10] eal: rte_tailq api cleanup

2015-03-11 Thread David Marchand
Hello John,

On Wed, Mar 11, 2015 at 9:24 PM, Mcnamara, John 
wrote:

> > On Wed, Mar 11, 2015 at 9:47 AM, David Marchand <
> david.marchand at 6wind.com>
> > wrote:
> >
> > Just sent a fix : http://dpdk.org/dev/patchwork/patch/3976/
> > Can you try it ?
>
> I just tested the patch with testpmd and it fixes the previous issue.
>

Ok, thanks, just for the record, can you add your setup ?
linux / bsd, uio / vfio (if linux), which pmd ?


-- 
David Marchand


[dpdk-dev] [PATCH 00/10] eal: rte_tailq api cleanup

2015-03-11 Thread Mcnamara, John


From: David Marchand [mailto:david.march...@6wind.com] 
Sent: Wednesday, March 11, 2015 9:30 PM
To: Mcnamara, John
Cc: Tetsuya Mukawa; dev at dpdk.org
Subject: Re: [dpdk-dev] [PATCH 00/10] eal: rte_tailq api cleanup

>> I just tested the patch with testpmd and it fixes the previous issue.

> Ok, thanks, just for the record, can you add your setup ?
> linux / bsd, uio / vfio (if linux), which pmd ?


Hi David,

I always complain when people don't send enough details in bug reports or 
updates, so sorry about that.

Here we go, it is pretty vanilla but I sure you will get other data points by 
morning:

$ uname -a   
Linux sie-lab-214-036.ir.intel.com 3.6.10-4.fc18.x86_64
#1 SMP Tue Dec 11 18:01:27 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

UIO with testpmd and skeleton forwarding app

John.
--



[dpdk-dev] [PATCH 00/10] eal: rte_tailq api cleanup

2015-03-11 Thread Mcnamara, John
> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of David Marchand
> Sent: Wednesday, March 11, 2015 5:29 PM
> To: Tetsuya Mukawa
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 00/10] eal: rte_tailq api cleanup
> 
> On Wed, Mar 11, 2015 at 9:47 AM, David Marchand 
> wrote:
> 
> Just sent a fix : http://dpdk.org/dev/patchwork/patch/3976/
> Can you try it ?

Hi David,

I just tested the patch with testpmd and it fixes the previous issue.

John.
-- 




[dpdk-dev] [PATCH v2 3/3] ixgbe: Unify the rx_pkt_bulk callback initialization

2015-03-11 Thread Vlad Zolotarov


On 03/11/15 14:45, Ananyev, Konstantin wrote:
>
>> -Original Message-
>> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Vlad Zolotarov
>> Sent: Monday, March 09, 2015 4:29 PM
>> To: dev at dpdk.org
>> Subject: [dpdk-dev] [PATCH v2 3/3] ixgbe: Unify the rx_pkt_bulk callback 
>> initialization
>>
>> - Set the callback in a single function that is called from
>>   ixgbe_dev_rx_init() for a primary process and from eth_ixgbe_dev_init()
>>   for a secondary processes. This is instead of multiple, hard to track 
>> places.
>> - Added ixgbe_hw.rx_bulk_alloc_allowed - see ixgbe_hw.rx_vec_allowed 
>> description below.
>> - Added ixgbe_hw.rx_vec_allowed: like with Bulk Allocation, Vector Rx is
>>   enabled or disabled on a per-port level. All queues have to meet the 
>> appropriate
>>   preconditions and if any of them doesn't - the feature has to be 
>> disabled.
>>   Therefore ixgbe_hw.rx_vec_allowed will be updated during each queues 
>> configuration
>>   (rte_eth_rx_queue_setup()) and then used in rte_eth_dev_start() to 
>> configure the
>>   appropriate callbacks. The same happens with ixgbe_hw.rx_vec_allowed 
>> in a Bulk Allocation
>>   context.
>> - Bugs fixed:
>>- Vector scattered packets callback was called regardless the 
>> appropriate
>>  preconditions:
>>   - Vector Rx specific preconditions.
>>   - Bulk Allocation preconditions.
>>- Vector Rx was enabled/disabled according to the last queue setting 
>> and not
>>  based on all queues setting (which may be different for each queue).
>>
>> Signed-off-by: Vlad Zolotarov 
>> ---
>> New in v2:
>> - Fixed an broken compilation.
>> ---
>>   lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h |   2 +
>>   lib/librte_pmd_ixgbe/ixgbe_ethdev.c |  13 ++-
>>   lib/librte_pmd_ixgbe/ixgbe_rxtx.c   | 183 
>> +---
>>   lib/librte_pmd_ixgbe/ixgbe_rxtx.h   |  22 +++-
>>   4 files changed, 152 insertions(+), 68 deletions(-)
>>
>> diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h 
>> b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h
>> index c67d462..9a66370 100644
>> --- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h
>> +++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h
>> @@ -3657,6 +3657,8 @@ struct ixgbe_hw {
>>  bool force_full_reset;
>>  bool allow_unsupported_sfp;
>>  bool wol_enabled;
>> +bool rx_bulk_alloc_allowed;
>> +bool rx_vec_allowed;
>>   };
>>
>>   #define ixgbe_call_func(hw, func, params, error) \
>> diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c 
>> b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
>> index 9bdc046..9d3de1a 100644
>> --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
>> +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
>> @@ -760,8 +760,8 @@ eth_ixgbe_dev_init(__attribute__((unused)) struct 
>> eth_driver *eth_drv,
>> "Using default TX function.");
>>  }
>>
>> -if (eth_dev->data->scattered_rx)
>> -eth_dev->rx_pkt_burst = ixgbe_recv_scattered_pkts;
>> +set_rx_function(eth_dev);
>> +
>>  return 0;
>>  }
>>  pci_dev = eth_dev->pci_dev;
>> @@ -772,6 +772,13 @@ eth_ixgbe_dev_init(__attribute__((unused)) struct 
>> eth_driver *eth_drv,
>>  hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
>>  hw->allow_unsupported_sfp = 1;
>>
>> +/*
>> + * Initialize to TRUE. If any of Rx queues doesn't meet the bulk
>> + * allocation or vector Rx preconditions we will reset it.
>> + */
>> +hw->rx_bulk_alloc_allowed = true;
>> +hw->rx_vec_allowed = true;
>> +
>>  /* Initialize the shared code (base driver) */
>>   #ifdef RTE_NIC_BYPASS
>>  diag = ixgbe_bypass_init_shared_code(hw);
>> @@ -1641,6 +1648,8 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
>>
>>  /* Clear stored conf */
>>  dev->data->scattered_rx = 0;
>> +hw->rx_bulk_alloc_allowed = false;
>> +hw->rx_vec_allowed = false;
> If dev_stop() sets it to 'false', who will reset it back to 'true' then?
>
>>  /* Clear recorded link status */
>>  memset(, 0, sizeof(link));
>> diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c 
>> b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
>> index ce9658e..a00f5c9 100644
>> --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
>> +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
>> @@ -2074,12 +2074,12 @@ check_rx_burst_bulk_alloc_preconditions(__rte_unused 
>> struct igb_rx_queue *rxq)
>>
>>   /* Reset dynamic igb_rx_queue fields back to defaults */
>>   static void
>> -ixgbe_reset_rx_queue(struct igb_rx_queue *rxq)
>> +ixgbe_reset_rx_queue(struct ixgbe_hw *hw, struct igb_rx_queue *rxq)
>>   {
>>  static const union ixgbe_adv_rx_desc zeroed_desc = { .read = {
>>  .pkt_addr = 0}};
>>  unsigned i;
>> -uint16_t len;
>> +uint16_t len = rxq->nb_rx_desc;
>>
>>  /*
>>   * By default, the Rx queue setup function allocates enough memory for
>> @@ -2091,14 +2091,9 @@ 

[dpdk-dev] [PATCH v6 3/3] ixgbe: Add LRO support

2015-03-11 Thread Vlad Zolotarov


On 03/11/15 18:32, Ananyev, Konstantin wrote:
>
>> -Original Message-
>> From: Vlad Zolotarov [mailto:vladz at cloudius-systems.com]
>> Sent: Tuesday, March 10, 2015 9:36 PM
>> To: Ananyev, Konstantin; dev at dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH v6 3/3] ixgbe: Add LRO support
>>
>>
>>
>> On 03/10/15 22:09, Ananyev, Konstantin wrote:
> Hi Vlad,
>
>> -Original Message-
>> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Vlad Zolotarov
>> Sent: Monday, March 09, 2015 7:07 PM
>> To: dev at dpdk.org
>> Subject: [dpdk-dev] [PATCH v6 3/3] ixgbe: Add LRO support
>>
>>- Only x540 and 82599 devices support LRO.
>>- Add the appropriate HW configuration.
>>- Add RSC aware rx_pkt_burst() handlers:
>>   - Implemented bulk allocation and non-bulk allocation versions.
>>   - Add LRO-specific fields to rte_eth_rxmode, to 
>> rte_eth_dev_data
>> and to igb_rx_queue.
>>   - Use the appropriate handler when LRO is requested.
>>
>> Signed-off-by: Vlad Zolotarov 
>> ---
>> New in v5:
>>   - Put the RTE_ETHDEV_HAS_LRO_SUPPORT definition at the beginning 
>> of rte_ethdev.h.
>>   - Removed the "TODO: Remove me" comment near 
>> RTE_ETHDEV_HAS_LRO_SUPPORT.
>>
>> New in v4:
>>   - Define RTE_ETHDEV_HAS_LRO_SUPPORT in rte_ethdev.h instead of
>> RTE_ETHDEV_LRO_SUPPORT defined in config/common_linuxapp.
>>
>> New in v2:
>>   - Removed rte_eth_dev_data.lro_bulk_alloc.
>>   - Fixed a few styling and spelling issues.
>> ---
>> lib/librte_ether/rte_ethdev.h   |   9 +-
>> lib/librte_pmd_ixgbe/ixgbe_ethdev.c |   6 +
>> lib/librte_pmd_ixgbe/ixgbe_ethdev.h |   5 +
>> lib/librte_pmd_ixgbe/ixgbe_rxtx.c   | 562 
>> +++-
>> lib/librte_pmd_ixgbe/ixgbe_rxtx.h   |   6 +
>> 5 files changed, 581 insertions(+), 7 deletions(-)
>>
>> diff --git a/lib/librte_ether/rte_ethdev.h 
>> b/lib/librte_ether/rte_ethdev.h
>> index 8db3127..44f081f 100644
>> --- a/lib/librte_ether/rte_ethdev.h
>> +++ b/lib/librte_ether/rte_ethdev.h
>> @@ -172,6 +172,9 @@ extern "C" {
>>
>> #include 
>>
>> +/* Use this macro to check if LRO API is supported */
>> +#define RTE_ETHDEV_HAS_LRO_SUPPORT
>> +
>> #include 
>> #include 
>> #include 
>> @@ -320,14 +323,15 @@ struct rte_eth_rxmode {
>>  enum rte_eth_rx_mq_mode mq_mode;
>>  uint32_t max_rx_pkt_len;  /**< Only used if jumbo_frame 
>> enabled. */
>>  uint16_t split_hdr_size;  /**< hdr buf size (header_split 
>> enabled).*/
>> -uint8_t header_split : 1, /**< Header Split enable. */
>> +uint16_t header_split : 1, /**< Header Split enable. */
>>  hw_ip_checksum   : 1, /**< IP/UDP/TCP checksum offload 
>> enable. */
>>  hw_vlan_filter   : 1, /**< VLAN filter enable. */
>>  hw_vlan_strip: 1, /**< VLAN strip enable. */
>>  hw_vlan_extend   : 1, /**< Extended VLAN enable. */
>>  jumbo_frame  : 1, /**< Jumbo Frame Receipt enable. 
>> */
>>  hw_strip_crc : 1, /**< Enable CRC stripping by 
>> hardware. */
>> -enable_scatter   : 1; /**< Enable scatter packets rx 
>> handler */
>> +enable_scatter   : 1, /**< Enable scatter packets rx 
>> handler */
>> +enable_lro   : 1; /**< Enable LRO */
>> };
>>
>> /**
>> @@ -1515,6 +1519,7 @@ struct rte_eth_dev_data {
>>  uint8_t port_id;   /**< Device [external] port 
>> identifier. */
>>  uint8_t promiscuous   : 1, /**< RX promiscuous mode ON(1) / 
>> OFF(0). */
>>  scattered_rx : 1,  /**< RX of scattered packets is 
>> ON(1) / OFF(0) */
>> +lro  : 1,  /**< RX LRO is ON(1) / OFF(0) */
>>  all_multicast : 1, /**< RX all multicast mode ON(1) / 
>> OFF(0). */
>>  dev_started : 1;   /**< Device state: STARTED(1) / 
>> STOPPED(0). */
>> };
>> diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c 
>> b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
>> index 9d3de1a..765174d 100644
>> --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
>> +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
>> @@ -1648,6 +1648,7 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
>>
>>  /* Clear stored conf */
>>  dev->data->scattered_rx = 0;
>> +dev->data->lro = 0;
>>  hw->rx_bulk_alloc_allowed = false;
>>  hw->rx_vec_allowed = false;
>>
>> @@ -2018,6 +2019,11 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, 
>> 

[dpdk-dev] [PATCH 00/10] eal: rte_tailq api cleanup

2015-03-11 Thread David Marchand
On Wed, Mar 11, 2015 at 9:47 AM, David Marchand 
wrote:

> On Wed, Mar 11, 2015 at 8:44 AM, Tetsuya Mukawa  wrote:
>
>>
>> $ T=x86_64-native-linuxapp-gcc make install
>> $ sudo ./tools/dpdk_nic_bind.py -b igb_uio 
>> $ sudo ./x86_64-native-linuxapp-gcc/app/testpmd -c f -n 1 -- -i
>> EAL: Detected lcore 0 as core 0 on socket 0
>>
>> (snip)
>>
>> EAL: PCI device :84:00.0 on NUMA socket 1
>> EAL:   probe driver: 8086:1521 rte_igb_pmd
>> EAL:   PCI memory mapped at 0x7fffc000
>> EAL:   PCI memory mapped at 0x7fffc010
>> $
>>
>> As a result of bisecting, it seems one of following commits may cause
>> the issue.
>>
>> 95b6a46 tailq: remove static slots
>> a234816 tailq: move to dynamic tailq
>>
>
> Hum, ok, there is something wrong with my commit...
> It can't work, because pci_init is called before tailqs_init.
> Weird, I really should have seen this before.
>

Just sent a fix : http://dpdk.org/dev/patchwork/patch/3976/
Can you try it ?

Thanks.

-- 
David Marchand


[dpdk-dev] [PATCH] app/test-pmd: fix rte_pci_tailq not initialized before used

2015-03-11 Thread David Marchand
On Wed, Mar 11, 2015 at 9:59 AM, David Marchand 
wrote:

> Hello Marvin,
>
> I think this fix will break ivshmem init.
> pci_init was moved when introducing ivshmem_init.
>
> If you have a setup for this, can you check ivshmem init with your fix ?
>
> Thanks.
>

I just posted a different fix.
If yours breaks ivshmem, please test mine.

Thanks.


-- 
David Marchand


[dpdk-dev] failed to build latest dpdk 1.8.0 on kvm virtual machine

2015-03-11 Thread Vasiliy Tolstov
2015-03-11 17:14 GMT+03:00 Mcnamara, John :
> Hi,
>
> CFLAGS for DPDK are usually set via EXTRA_CFLAGS. Try the following as a 
> final set after the other config above:
>
> EXTRA_CFLAGS="-march=core2 -mtune=generic -pipe -O2" 
> MACHINE_CFLAGS=$EXTRA_CFLAGS make V=1
>
> It compiles DPDK 1.8.0 from source on my test env.


Thanks, this works fine.

-- 
Vasiliy Tolstov,
e-mail: v.tolstov at selfip.ru
jabber: vase at selfip.ru


[dpdk-dev] [PATCH] eal: fix tailq init for uio/vfio resources

2015-03-11 Thread David Marchand
Commit a2348166ea18 ("tailq: move to dynamic tailq") introduced a bug in
uio/vfio resources list init.

These resources list were pointed at through a pointer initialised only once but
too early in the eal init (before tailqs init).

Fix this by "resolving" this pointer when used (which is well after tailqs
init).

Fixes: a2348166ea18 ("tailq: move to dynamic tailq")
Reported-by: Marvin Liu 
Reported-by: Tetsuya Mukawa 
Signed-off-by: David Marchand 
---

This patch is an alternative to the patch proposed by Marvin.
It has been tested only on Linux and with uio driver.

 lib/librte_eal/bsdapp/eal/eal_pci.c|   11 +--
 lib/librte_eal/linuxapp/eal/eal_pci.c  |8 
 lib/librte_eal/linuxapp/eal/eal_pci_init.h |1 -
 lib/librte_eal/linuxapp/eal/eal_pci_uio.c  |   17 +
 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c |   11 +--
 5 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c 
b/lib/librte_eal/bsdapp/eal/eal_pci.c
index 3a0fda5..fe3ef86 100644
--- a/lib/librte_eal/bsdapp/eal/eal_pci.c
+++ b/lib/librte_eal/bsdapp/eal/eal_pci.c
@@ -105,12 +105,10 @@ struct uio_resource {

 TAILQ_HEAD(uio_res_list, uio_resource);

-static struct uio_res_list *uio_res_list = NULL;
-
-static struct rte_tailq_elem rte_pci_tailq = {
-   .name = "PCI_RESOURCE_LIST",
+static struct rte_tailq_elem rte_uio_tailq = {
+   .name = "UIO_RESOURCE_LIST",
 };
-EAL_REGISTER_TAILQ(rte_pci_tailq)
+EAL_REGISTER_TAILQ(rte_uio_tailq)

 /* unbind kernel driver for this device */
 static int
@@ -165,6 +163,7 @@ pci_uio_map_secondary(struct rte_pci_device *dev)
 {
 size_t i;
 struct uio_resource *uio_res;
+   struct uio_res_list *uio_res_list = RTE_TAILQ_CAST(rte_uio_tailq.head, 
uio_res_list);

TAILQ_FOREACH(uio_res, uio_res_list, next) {

@@ -202,6 +201,7 @@ pci_uio_map_resource(struct rte_pci_device *dev)
uint64_t pagesz;
struct rte_pci_addr *loc = >addr;
struct uio_resource *uio_res;
+   struct uio_res_list *uio_res_list = RTE_TAILQ_CAST(rte_uio_tailq.head, 
uio_res_list);
struct uio_map *maps;

dev->intr_handle.fd = -1;
@@ -497,7 +497,6 @@ rte_eal_pci_init(void)
 {
TAILQ_INIT(_driver_list);
TAILQ_INIT(_device_list);
-   uio_res_list = RTE_TAILQ_CAST(rte_pci_tailq.head, uio_res_list);

/* for debug purposes, PCI can be disabled */
if (internal_config.no_pci)
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c 
b/lib/librte_eal/linuxapp/eal/eal_pci.c
index c42e843..83c589e 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -56,13 +56,6 @@
  * IGB_UIO driver (or doesn't initialize, if the device wasn't bound to it).
  */

-struct mapped_pci_res_list *pci_res_list = NULL;
-
-static struct rte_tailq_elem rte_pci_tailq = {
-   .name = "PCI_RESOURCE_LIST",
-};
-EAL_REGISTER_TAILQ(rte_pci_tailq)
-
 /* unbind kernel driver for this device */
 static int
 pci_unbind_kernel_driver(struct rte_pci_device *dev)
@@ -770,7 +763,6 @@ rte_eal_pci_init(void)
 {
TAILQ_INIT(_driver_list);
TAILQ_INIT(_device_list);
-   pci_res_list = RTE_TAILQ_CAST(rte_pci_tailq.head, mapped_pci_res_list);

/* for debug purposes, PCI can be disabled */
if (internal_config.no_pci)
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_init.h 
b/lib/librte_eal/linuxapp/eal/eal_pci_init.h
index 6af84d1..aa7b755 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci_init.h
+++ b/lib/librte_eal/linuxapp/eal/eal_pci_init.h
@@ -58,7 +58,6 @@ struct mapped_pci_resource {
 };

 TAILQ_HEAD(mapped_pci_res_list, mapped_pci_resource);
-extern struct mapped_pci_res_list *pci_res_list;

 /*
  * Helper function to map PCI resources right after hugepages in virtual memory
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c 
b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
index ebbc2d3..2d1c69b 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
@@ -41,6 +41,7 @@

 #include 
 #include 
+#include 
 #include 
 #include 

@@ -50,6 +51,10 @@

 void *pci_map_addr = NULL;

+static struct rte_tailq_elem rte_uio_tailq = {
+   .name = "UIO_RESOURCE_LIST",
+};
+EAL_REGISTER_TAILQ(rte_uio_tailq)

 #define OFF_MAX  ((uint64_t)(off_t)-1)

@@ -87,8 +92,9 @@ pci_uio_map_secondary(struct rte_pci_device *dev)
 {
int fd, i;
struct mapped_pci_resource *uio_res;
+   struct mapped_pci_res_list *uio_res_list = 
RTE_TAILQ_CAST(rte_uio_tailq.head, mapped_pci_res_list);

-   TAILQ_FOREACH(uio_res, pci_res_list, next) {
+   TAILQ_FOREACH(uio_res, uio_res_list, next) {

/* skip this element if it doesn't match our PCI address */
if (rte_eal_compare_pci_addr(_res->pci_addr, >addr))
@@ -266,6 +272,7 @@ pci_uio_map_resource(struct rte_pci_device *dev)
uint64_t phaddr;
struct rte_pci_addr *loc = >addr;
  

[dpdk-dev] [PATCH v7 0/3]: Add LRO support to ixgbe PMD

2015-03-11 Thread Vlad Zolotarov


On 03/11/15 16:13, Ananyev, Konstantin wrote:
>
>> -Original Message-
>> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Vlad Zolotarov
>> Sent: Tuesday, March 10, 2015 7:31 PM
>> To: dev at dpdk.org
>> Subject: [dpdk-dev] [PATCH v7 0/3]: Add LRO support to ixgbe PMD
>>
>> This series adds the missing flow for enabling the LRO in the ethdev and
>> adds a support for this feature in the ixgbe PMD. There is a big hope that 
>> this
>> initiative is going to be picked up by some Intel developer that would add 
>> the LRO support
>> to other Intel PMDs.
>>
>> The series starts with some cleanup work in the code the final patch (the 
>> actual adding of
>> the LRO support) is going to touch/use/change. There are still quite a few 
>> issues in the ixgbe
>> PMD code left but they have to be a matter of a different series and I've 
>> left a few "TODO"
>> remarks in the code.
>>
>> The LRO ("RSC" in Intel's context) PMD completion handling code follows the 
>> same design as the
>> corresponding Linux and FreeBSD implementation: pass the aggregation's 
>> cluster HEAD buffer to
>> the NEXTP entry of the software ring till EOP is met.
>>
>> HW configuration follows the corresponding specs: this feature is supported 
>> only by x540 and
>> 82599 PF devices.
>>
>> The feature has been tested with seastar TCP stack with the following 
>> configuration on Tx side:
>> - MTU: 400B
>> - 100 concurrent TCP connections.
>>
>> The results were:
>> - Without LRO: total throughput: 0.12Gbps, coefficient of variance: 1.41%
>> - With LRO:total throughput: 8.21Gbps, coefficient of variance: 0.59%
>>
>> This is an almost factor 80 improvement.
>>
>> New in v7:
>> - Free not-yet-completed RSC aggregations in rte_eth_dev_stop() flow.
>> - Fixed rx_bulk_alloc_allowed and rx_vec_allowed initialization:
>>- Don't set them to FALSE in rte_eth_dev_stop() flow - the following
>>  rte_eth_dev_start() will need them.
>>- Reset them to TRUE in rte_eth_dev_configure() and not in a probe() 
>> flow.
>>  This will ensure the proper behaviour if port is re-configured.
> That changes probably should be part of another patch you submitted:
> [PATCH v2 3/3] ixgbe: Unify the rx_pkt_bulk callbackinitialization
> ?
> Konstantin

Yeah ;)

>
>> - Reset the sw_ring[].mbuf entry in a bulk allocation case.
>>   This is needed for ixgbe_rx_queue_release_mbufs().
>> - _recv_pkts_lro(): added the missing memory barrier before RDT update 
>> in a
>>   non-bulk allocation case.
>> - Don't allow RSC when device is configured in an SR-IOV mode.
>>
>> New in v6:
>> - Fix of the typo in the "bug fixes" series that broke the compilation 
>> caused a
>>   minor change in this follow-up series.
>>
>> New in v5:
>> - Split the series into "bug fixes" and "all the rest" so that the 
>> former could be
>>   integrated into a 2.0 release.
>> - Put the RTE_ETHDEV_HAS_LRO_SUPPORT definition at the beginning of 
>> rte_ethdev.h.
>> - Removed the "TODO: Remove me" comment near RTE_ETHDEV_HAS_LRO_SUPPORT.
>>
>> New in v4:
>> - Remove CONFIG_RTE_ETHDEV_LRO_SUPPORT from config/common_linuxapp.
>> - Define RTE_ETHDEV_HAS_LRO_SUPPORT in rte_ethdev.h.
>> - As a result of "ixgbe: check rxd number to avoid mbuf leak" 
>> (352078e8e) Vector Rx
>>   had to get the same treatment as Rx Bulk Alloc (see PATCH4 for more 
>> details).
>>
>> New in v3:
>> - ixgbe_rx_alloc_bufs(): Always reset refcnt of the buffers to 1. 
>> Otherwise rte_pktmbuf_free()
>>   won't free them.
>>
>> New in v2:
>> - Removed rte_eth_dev_data.lro_bulk_alloc and added 
>> ixgbe_hw.rx_bulk_alloc_allowed
>>   instead.
>> - Unified the rx_pkt_bulk callback setting (a separate new patch).
>> - Fixed a few styling and spelling issues.
>>
>> Vlad Zolotarov (3):
>>ixgbe: Cleanups
>>ixgbe: Code refactoring
>>ixgbe: Add LRO support
>>
>>   lib/librte_ether/rte_ethdev.h   |   9 +-
>>   lib/librte_pmd_ixgbe/ixgbe_ethdev.c |  29 +-
>>   lib/librte_pmd_ixgbe/ixgbe_ethdev.h |   5 +
>>   lib/librte_pmd_ixgbe/ixgbe_rxtx.c   | 738 
>> 
>>   lib/librte_pmd_ixgbe/ixgbe_rxtx.h   |   6 +
>>   5 files changed, 710 insertions(+), 77 deletions(-)
>>
>> --
>> 2.1.0



[dpdk-dev] [PATCH v7 3/3] ixgbe: Add LRO support

2015-03-11 Thread Vlad Zolotarov


On 03/11/15 17:02, Ananyev, Konstantin wrote:
>
>> -Original Message-
>> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Vlad Zolotarov
>> Sent: Tuesday, March 10, 2015 7:32 PM
>> To: dev at dpdk.org
>> Subject: [dpdk-dev] [PATCH v7 3/3] ixgbe: Add LRO support
>>
>>  - Only x540 and 82599 devices support LRO.
>>  - Add the appropriate HW configuration.
>>  - Add RSC aware rx_pkt_burst() handlers:
>> - Implemented bulk allocation and non-bulk allocation versions.
>> - Add LRO-specific fields to rte_eth_rxmode, to rte_eth_dev_data
>>   and to igb_rx_queue.
>> - Use the appropriate handler when LRO is requested.
>>
>> Signed-off-by: Vlad Zolotarov 
>> ---
>> New in v7:
>> - Free not-yet-completed RSC aggregations in rte_eth_dev_stop() flow.
>> - Fixed rx_bulk_alloc_allowed and rx_vec_allowed initialization:
>>- Don't set them to FALSE in rte_eth_dev_stop() flow - the following
>>  rte_eth_dev_start() will need them.
>>- Reset them to TRUE in rte_eth_dev_configure() and not in a probe() 
>> flow.
>>  This will ensure the proper behaviour if port is re-configured.
>> - Reset the sw_ring[].mbuf entry in a bulk allocation case.
>>   This is needed for ixgbe_rx_queue_release_mbufs().
>> - _recv_pkts_lro(): added the missing memory barrier before RDT update 
>> in a
>>   non-bulk allocation case.
>> - Don't allow RSC when device is configured in an SR-IOV mode.
>>
>> New in v5:
>> - Put the RTE_ETHDEV_HAS_LRO_SUPPORT definition at the beginning of 
>> rte_ethdev.h.
>> - Removed the "TODO: Remove me" comment near RTE_ETHDEV_HAS_LRO_SUPPORT.
>>
>> New in v4:
>> - Define RTE_ETHDEV_HAS_LRO_SUPPORT in rte_ethdev.h instead of
>>   RTE_ETHDEV_LRO_SUPPORT defined in config/common_linuxapp.
>>
>> New in v2:
>> - Removed rte_eth_dev_data.lro_bulk_alloc.
>> - Fixed a few styling and spelling issues.
>>
>> ixgbe: Fixed rx_bulk_alloc_allowed and rx_vec_allowed initialization
>>
>> - Don't set them to FALSE in rte_eth_dev_stop() flow - the following
>>   rte_eth_dev_start() will need them.
>> - Reset them to TRUE in rte_eth_dev_configure() and not in a probe() 
>> flow.
>>   This will ensure the proper behaviour if port is re-configured.
>> ---
>>   lib/librte_ether/rte_ethdev.h   |   9 +-
>>   lib/librte_pmd_ixgbe/ixgbe_ethdev.c |  29 +-
>>   lib/librte_pmd_ixgbe/ixgbe_ethdev.h |   5 +
>>   lib/librte_pmd_ixgbe/ixgbe_rxtx.c   | 595 
>> +++-
>>   lib/librte_pmd_ixgbe/ixgbe_rxtx.h   |   6 +
>>   5 files changed, 628 insertions(+), 16 deletions(-)
>>
>> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
>> index 8db3127..44f081f 100644
>> --- a/lib/librte_ether/rte_ethdev.h
>> +++ b/lib/librte_ether/rte_ethdev.h
>> @@ -172,6 +172,9 @@ extern "C" {
>>
>>   #include 
>>
>> +/* Use this macro to check if LRO API is supported */
>> +#define RTE_ETHDEV_HAS_LRO_SUPPORT
>> +
>>   #include 
>>   #include 
>>   #include 
>> @@ -320,14 +323,15 @@ struct rte_eth_rxmode {
>>  enum rte_eth_rx_mq_mode mq_mode;
>>  uint32_t max_rx_pkt_len;  /**< Only used if jumbo_frame enabled. */
>>  uint16_t split_hdr_size;  /**< hdr buf size (header_split enabled).*/
>> -uint8_t header_split : 1, /**< Header Split enable. */
>> +uint16_t header_split : 1, /**< Header Split enable. */
>>  hw_ip_checksum   : 1, /**< IP/UDP/TCP checksum offload enable. 
>> */
>>  hw_vlan_filter   : 1, /**< VLAN filter enable. */
>>  hw_vlan_strip: 1, /**< VLAN strip enable. */
>>  hw_vlan_extend   : 1, /**< Extended VLAN enable. */
>>  jumbo_frame  : 1, /**< Jumbo Frame Receipt enable. */
>>  hw_strip_crc : 1, /**< Enable CRC stripping by hardware. */
>> -enable_scatter   : 1; /**< Enable scatter packets rx handler */
>> +enable_scatter   : 1, /**< Enable scatter packets rx handler */
>> +enable_lro   : 1; /**< Enable LRO */
>>   };
>>
>>   /**
>> @@ -1515,6 +1519,7 @@ struct rte_eth_dev_data {
>>  uint8_t port_id;   /**< Device [external] port identifier. */
>>  uint8_t promiscuous   : 1, /**< RX promiscuous mode ON(1) / OFF(0). */
>>  scattered_rx : 1,  /**< RX of scattered packets is ON(1) / 
>> OFF(0) */
>> +lro  : 1,  /**< RX LRO is ON(1) / OFF(0) */
>>  all_multicast : 1, /**< RX all multicast mode ON(1) / OFF(0). */
>>  dev_started : 1;   /**< Device state: STARTED(1) / STOPPED(0). 
>> */
>>   };
>> diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c 
>> b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
>> index 9d3de1a..f0a3100 100644
>> --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
>> +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
>> @@ -772,13 +772,6 @@ eth_ixgbe_dev_init(__attribute__((unused)) struct 
>> eth_driver *eth_drv,
>>  hw->hw_addr = (void 

[dpdk-dev] [PATCH v2 3/3] ixgbe: Unify the rx_pkt_bulk callback initialization

2015-03-11 Thread Vlad Zolotarov


On 03/11/15 14:45, Ananyev, Konstantin wrote:
>
>> -Original Message-
>> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Vlad Zolotarov
>> Sent: Monday, March 09, 2015 4:29 PM
>> To: dev at dpdk.org
>> Subject: [dpdk-dev] [PATCH v2 3/3] ixgbe: Unify the rx_pkt_bulk callback 
>> initialization
>>
>> - Set the callback in a single function that is called from
>>   ixgbe_dev_rx_init() for a primary process and from eth_ixgbe_dev_init()
>>   for a secondary processes. This is instead of multiple, hard to track 
>> places.
>> - Added ixgbe_hw.rx_bulk_alloc_allowed - see ixgbe_hw.rx_vec_allowed 
>> description below.
>> - Added ixgbe_hw.rx_vec_allowed: like with Bulk Allocation, Vector Rx is
>>   enabled or disabled on a per-port level. All queues have to meet the 
>> appropriate
>>   preconditions and if any of them doesn't - the feature has to be 
>> disabled.
>>   Therefore ixgbe_hw.rx_vec_allowed will be updated during each queues 
>> configuration
>>   (rte_eth_rx_queue_setup()) and then used in rte_eth_dev_start() to 
>> configure the
>>   appropriate callbacks. The same happens with ixgbe_hw.rx_vec_allowed 
>> in a Bulk Allocation
>>   context.
>> - Bugs fixed:
>>- Vector scattered packets callback was called regardless the 
>> appropriate
>>  preconditions:
>>   - Vector Rx specific preconditions.
>>   - Bulk Allocation preconditions.
>>- Vector Rx was enabled/disabled according to the last queue setting 
>> and not
>>  based on all queues setting (which may be different for each queue).
>>
>> Signed-off-by: Vlad Zolotarov 
>> ---
>> New in v2:
>> - Fixed an broken compilation.
>> ---
>>   lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h |   2 +
>>   lib/librte_pmd_ixgbe/ixgbe_ethdev.c |  13 ++-
>>   lib/librte_pmd_ixgbe/ixgbe_rxtx.c   | 183 
>> +---
>>   lib/librte_pmd_ixgbe/ixgbe_rxtx.h   |  22 +++-
>>   4 files changed, 152 insertions(+), 68 deletions(-)
>>
>> diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h 
>> b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h
>> index c67d462..9a66370 100644
>> --- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h
>> +++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h
>> @@ -3657,6 +3657,8 @@ struct ixgbe_hw {
>>  bool force_full_reset;
>>  bool allow_unsupported_sfp;
>>  bool wol_enabled;
>> +bool rx_bulk_alloc_allowed;
>> +bool rx_vec_allowed;
>>   };
>>
>>   #define ixgbe_call_func(hw, func, params, error) \
>> diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c 
>> b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
>> index 9bdc046..9d3de1a 100644
>> --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
>> +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
>> @@ -760,8 +760,8 @@ eth_ixgbe_dev_init(__attribute__((unused)) struct 
>> eth_driver *eth_drv,
>> "Using default TX function.");
>>  }
>>
>> -if (eth_dev->data->scattered_rx)
>> -eth_dev->rx_pkt_burst = ixgbe_recv_scattered_pkts;
>> +set_rx_function(eth_dev);
>> +
>>  return 0;
>>  }
>>  pci_dev = eth_dev->pci_dev;
>> @@ -772,6 +772,13 @@ eth_ixgbe_dev_init(__attribute__((unused)) struct 
>> eth_driver *eth_drv,
>>  hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
>>  hw->allow_unsupported_sfp = 1;
>>
>> +/*
>> + * Initialize to TRUE. If any of Rx queues doesn't meet the bulk
>> + * allocation or vector Rx preconditions we will reset it.
>> + */
>> +hw->rx_bulk_alloc_allowed = true;
>> +hw->rx_vec_allowed = true;
>> +
>>  /* Initialize the shared code (base driver) */
>>   #ifdef RTE_NIC_BYPASS
>>  diag = ixgbe_bypass_init_shared_code(hw);
>> @@ -1641,6 +1648,8 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
>>
>>  /* Clear stored conf */
>>  dev->data->scattered_rx = 0;
>> +hw->rx_bulk_alloc_allowed = false;
>> +hw->rx_vec_allowed = false;
> If dev_stop() sets it to 'false', who will reset it back to 'true' then?
>
>>  /* Clear recorded link status */
>>  memset(, 0, sizeof(link));
>> diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c 
>> b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
>> index ce9658e..a00f5c9 100644
>> --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
>> +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
>> @@ -2074,12 +2074,12 @@ check_rx_burst_bulk_alloc_preconditions(__rte_unused 
>> struct igb_rx_queue *rxq)
>>
>>   /* Reset dynamic igb_rx_queue fields back to defaults */
>>   static void
>> -ixgbe_reset_rx_queue(struct igb_rx_queue *rxq)
>> +ixgbe_reset_rx_queue(struct ixgbe_hw *hw, struct igb_rx_queue *rxq)
>>   {
>>  static const union ixgbe_adv_rx_desc zeroed_desc = { .read = {
>>  .pkt_addr = 0}};
>>  unsigned i;
>> -uint16_t len;
>> +uint16_t len = rxq->nb_rx_desc;
>>
>>  /*
>>   * By default, the Rx queue setup function allocates enough memory for
>> @@ -2091,14 +2091,9 @@ 

[dpdk-dev] [PATCH v2 3/3] ixgbe: Unify the rx_pkt_bulk callback initialization

2015-03-11 Thread Vlad Zolotarov


On 03/11/15 14:45, Ananyev, Konstantin wrote:
>
>> -Original Message-
>> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Vlad Zolotarov
>> Sent: Monday, March 09, 2015 4:29 PM
>> To: dev at dpdk.org
>> Subject: [dpdk-dev] [PATCH v2 3/3] ixgbe: Unify the rx_pkt_bulk callback 
>> initialization
>>
>> - Set the callback in a single function that is called from
>>   ixgbe_dev_rx_init() for a primary process and from eth_ixgbe_dev_init()
>>   for a secondary processes. This is instead of multiple, hard to track 
>> places.
>> - Added ixgbe_hw.rx_bulk_alloc_allowed - see ixgbe_hw.rx_vec_allowed 
>> description below.
>> - Added ixgbe_hw.rx_vec_allowed: like with Bulk Allocation, Vector Rx is
>>   enabled or disabled on a per-port level. All queues have to meet the 
>> appropriate
>>   preconditions and if any of them doesn't - the feature has to be 
>> disabled.
>>   Therefore ixgbe_hw.rx_vec_allowed will be updated during each queues 
>> configuration
>>   (rte_eth_rx_queue_setup()) and then used in rte_eth_dev_start() to 
>> configure the
>>   appropriate callbacks. The same happens with ixgbe_hw.rx_vec_allowed 
>> in a Bulk Allocation
>>   context.
>> - Bugs fixed:
>>- Vector scattered packets callback was called regardless the 
>> appropriate
>>  preconditions:
>>   - Vector Rx specific preconditions.
>>   - Bulk Allocation preconditions.
>>- Vector Rx was enabled/disabled according to the last queue setting 
>> and not
>>  based on all queues setting (which may be different for each queue).
>>
>> Signed-off-by: Vlad Zolotarov 
>> ---
>> New in v2:
>> - Fixed an broken compilation.
>> ---
>>   lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h |   2 +
>>   lib/librte_pmd_ixgbe/ixgbe_ethdev.c |  13 ++-
>>   lib/librte_pmd_ixgbe/ixgbe_rxtx.c   | 183 
>> +---
>>   lib/librte_pmd_ixgbe/ixgbe_rxtx.h   |  22 +++-
>>   4 files changed, 152 insertions(+), 68 deletions(-)
>>
>> diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h 
>> b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h
>> index c67d462..9a66370 100644
>> --- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h
>> +++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h
>> @@ -3657,6 +3657,8 @@ struct ixgbe_hw {
>>  bool force_full_reset;
>>  bool allow_unsupported_sfp;
>>  bool wol_enabled;
>> +bool rx_bulk_alloc_allowed;
>> +bool rx_vec_allowed;
>>   };
>>
>>   #define ixgbe_call_func(hw, func, params, error) \
>> diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c 
>> b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
>> index 9bdc046..9d3de1a 100644
>> --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
>> +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
>> @@ -760,8 +760,8 @@ eth_ixgbe_dev_init(__attribute__((unused)) struct 
>> eth_driver *eth_drv,
>> "Using default TX function.");
>>  }
>>
>> -if (eth_dev->data->scattered_rx)
>> -eth_dev->rx_pkt_burst = ixgbe_recv_scattered_pkts;
>> +set_rx_function(eth_dev);
>> +
>>  return 0;
>>  }
>>  pci_dev = eth_dev->pci_dev;
>> @@ -772,6 +772,13 @@ eth_ixgbe_dev_init(__attribute__((unused)) struct 
>> eth_driver *eth_drv,
>>  hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
>>  hw->allow_unsupported_sfp = 1;
>>
>> +/*
>> + * Initialize to TRUE. If any of Rx queues doesn't meet the bulk
>> + * allocation or vector Rx preconditions we will reset it.
>> + */
>> +hw->rx_bulk_alloc_allowed = true;
>> +hw->rx_vec_allowed = true;
>> +
>>  /* Initialize the shared code (base driver) */
>>   #ifdef RTE_NIC_BYPASS
>>  diag = ixgbe_bypass_init_shared_code(hw);
>> @@ -1641,6 +1648,8 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
>>
>>  /* Clear stored conf */
>>  dev->data->scattered_rx = 0;
>> +hw->rx_bulk_alloc_allowed = false;
>> +hw->rx_vec_allowed = false;
> If dev_stop() sets it to 'false', who will reset it back to 'true' then?

Oops. I'm afraid I've messed the things up a bit... ;) I've seen this 
issue when I checked the fix for the dev_stop()->dev_start() issue in 
the LRO patch. To remind, u have noticed that I wasn't freeing the 
not-yet-completed RSC aggregations in ixgbe_rx_queue_release_mbufs(). So 
when I was verifying the fix I've noticed the issue with the flags above 
and fixed it. But I've put the fix in the PATCH3 v7 of LRO series 
instead of putting it here... ;) I think I'll have to respin both series 
again... Ufff :(

>
>>  /* Clear recorded link status */
>>  memset(, 0, sizeof(link));
>> diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c 
>> b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
>> index ce9658e..a00f5c9 100644
>> --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
>> +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
>> @@ -2074,12 +2074,12 @@ check_rx_burst_bulk_alloc_preconditions(__rte_unused 
>> struct igb_rx_queue *rxq)
>>
>>   /* 

[dpdk-dev] [PATCH v2 3/3] ixgbe: Unify the rx_pkt_bulk callback initialization

2015-03-11 Thread Ananyev, Konstantin


> -Original Message-
> From: Vlad Zolotarov [mailto:vladz at cloudius-systems.com]
> Sent: Wednesday, March 11, 2015 3:40 PM
> To: Ananyev, Konstantin; dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2 3/3] ixgbe: Unify the rx_pkt_bulk callback 
> initialization
> 
> 
> 
> On 03/11/15 14:45, Ananyev, Konstantin wrote:
> >
> >> -Original Message-
> >> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Vlad Zolotarov
> >> Sent: Monday, March 09, 2015 4:29 PM
> >> To: dev at dpdk.org
> >> Subject: [dpdk-dev] [PATCH v2 3/3] ixgbe: Unify the rx_pkt_bulk callback 
> >> initialization
> >>
> >> - Set the callback in a single function that is called from
> >>   ixgbe_dev_rx_init() for a primary process and from 
> >> eth_ixgbe_dev_init()
> >>   for a secondary processes. This is instead of multiple, hard to 
> >> track places.
> >> - Added ixgbe_hw.rx_bulk_alloc_allowed - see ixgbe_hw.rx_vec_allowed 
> >> description below.
> >> - Added ixgbe_hw.rx_vec_allowed: like with Bulk Allocation, Vector Rx 
> >> is
> >>   enabled or disabled on a per-port level. All queues have to meet the 
> >> appropriate
> >>   preconditions and if any of them doesn't - the feature has to be 
> >> disabled.
> >>   Therefore ixgbe_hw.rx_vec_allowed will be updated during each queues 
> >> configuration
> >>   (rte_eth_rx_queue_setup()) and then used in rte_eth_dev_start() to 
> >> configure the
> >>   appropriate callbacks. The same happens with ixgbe_hw.rx_vec_allowed 
> >> in a Bulk Allocation
> >>   context.
> >> - Bugs fixed:
> >>- Vector scattered packets callback was called regardless the 
> >> appropriate
> >>  preconditions:
> >>   - Vector Rx specific preconditions.
> >>   - Bulk Allocation preconditions.
> >>- Vector Rx was enabled/disabled according to the last queue 
> >> setting and not
> >>  based on all queues setting (which may be different for each 
> >> queue).
> >>
> >> Signed-off-by: Vlad Zolotarov 
> >> ---
> >> New in v2:
> >> - Fixed an broken compilation.
> >> ---
> >>   lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h |   2 +
> >>   lib/librte_pmd_ixgbe/ixgbe_ethdev.c |  13 ++-
> >>   lib/librte_pmd_ixgbe/ixgbe_rxtx.c   | 183 
> >> +---
> >>   lib/librte_pmd_ixgbe/ixgbe_rxtx.h   |  22 +++-
> >>   4 files changed, 152 insertions(+), 68 deletions(-)
> >>
> >> diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h 
> >> b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h
> >> index c67d462..9a66370 100644
> >> --- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h
> >> +++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h
> >> @@ -3657,6 +3657,8 @@ struct ixgbe_hw {
> >>bool force_full_reset;
> >>bool allow_unsupported_sfp;
> >>bool wol_enabled;
> >> +  bool rx_bulk_alloc_allowed;
> >> +  bool rx_vec_allowed;
> >>   };
> >>
> >>   #define ixgbe_call_func(hw, func, params, error) \
> >> diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c 
> >> b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
> >> index 9bdc046..9d3de1a 100644
> >> --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
> >> +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
> >> @@ -760,8 +760,8 @@ eth_ixgbe_dev_init(__attribute__((unused)) struct 
> >> eth_driver *eth_drv,
> >>   "Using default TX function.");
> >>}
> >>
> >> -  if (eth_dev->data->scattered_rx)
> >> -  eth_dev->rx_pkt_burst = ixgbe_recv_scattered_pkts;
> >> +  set_rx_function(eth_dev);
> >> +
> >>return 0;
> >>}
> >>pci_dev = eth_dev->pci_dev;
> >> @@ -772,6 +772,13 @@ eth_ixgbe_dev_init(__attribute__((unused)) struct 
> >> eth_driver *eth_drv,
> >>hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
> >>hw->allow_unsupported_sfp = 1;
> >>
> >> +  /*
> >> +   * Initialize to TRUE. If any of Rx queues doesn't meet the bulk
> >> +   * allocation or vector Rx preconditions we will reset it.
> >> +   */
> >> +  hw->rx_bulk_alloc_allowed = true;
> >> +  hw->rx_vec_allowed = true;
> >> +
> >>/* Initialize the shared code (base driver) */
> >>   #ifdef RTE_NIC_BYPASS
> >>diag = ixgbe_bypass_init_shared_code(hw);
> >> @@ -1641,6 +1648,8 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
> >>
> >>/* Clear stored conf */
> >>dev->data->scattered_rx = 0;
> >> +  hw->rx_bulk_alloc_allowed = false;
> >> +  hw->rx_vec_allowed = false;
> > If dev_stop() sets it to 'false', who will reset it back to 'true' then?
> 
> Oops. I'm afraid I've messed the things up a bit... ;) I've seen this
> issue when I checked the fix for the dev_stop()->dev_start() issue in
> the LRO patch. To remind, u have noticed that I wasn't freeing the
> not-yet-completed RSC aggregations in ixgbe_rx_queue_release_mbufs(). So
> when I was verifying the fix I've noticed the issue with the flags above
> and fixed it. But I've put the fix in the PATCH3 v7 of LRO series
> instead of putting it here... ;) I think 

[dpdk-dev] failed to build latest dpdk 1.8.0 on kvm virtual machine

2015-03-11 Thread Vasiliy Tolstov
I'm try to build dpdk 1.8.0

unpack sources
sed -i 's|CONFIG_RTE_MACHINE="native"|CONFIG_RTE_MACHINE="default"|g'
config/defconfig_x86_64-native-linuxapp-gcc
export CFLAGS="-march=core2 -mtune=generic -pipe -O2"
make V=1 config T=x86_64-native-linuxapp-gcc
make V=1 MACHINE_CFLAGS="${CFLAGS}"


/var/tmp/paludis/build/net-dpdk-1.8.0/work/dpdk-1.8.0/mk/internal/rte.compile-pre.mk:126:
recipe for target 'eal_common_cpuflags.o' failed
/var/tmp/paludis/build/net-dpdk-1.8.0/work/dpdk-1.8.0/lib/librte_eal/common/eal_common_cpuflags.c:
In function 'rte_cpu_check_supported':
/var/tmp/paludis/build/net-dpdk-1.8.0/work/dpdk-1.8.0/lib/librte_eal/common/eal_common_cpuflags.c:63:4:
error: 'RTE_COMPILE_TIME_CPUFLAGS' undeclared (first use in this
function)
RTE_COMPILE_TIME_CPUFLAGS
^



-- 
Vasiliy Tolstov,
e-mail: v.tolstov at selfip.ru
jabber: vase at selfip.ru


[dpdk-dev] [PATCH 00/10] eal: rte_tailq api cleanup

2015-03-11 Thread Tetsuya Mukawa
On 2015/03/10 20:20, Thomas Monjalon wrote:
> 2015-03-05 19:26, Neil Horman:
>> On Wed, Mar 04, 2015 at 10:50:00PM +0100, David Marchand wrote:
>>> This is a first cleanup at trying to remove references to other dpdk 
>>> libraries
>>> from eal.
>>>
>>> This cleanup is focused on rte_tailq api which has been marked as "for 
>>> internal
>>> use" for quite some time now.
>>> Rather than have a static list in eal for all users of rte_tailq, a new 
>>> register
>>> system is introduced.
>>> This register system uses constructors which have no access to dpdk shared
>>> memory, so a two step registration is done: first step inserts the requested
>>> tailq in a local list ("local" in multi process context), then in second 
>>> step,
>>> eal init allocates/looks up for a real tailq from shared memory for all 
>>> elements
>>> of this local list.
>>>
>>> I have tried to think of different cases (libraries loaded before/after eal
>>> init...). The unit tests have been updated accordingly.
>>>
>>>
>> This all seems pretty reasonable.
>>
>> It might make sense to add a deprecation notice for this, since its removing
>> public macros, but since we're not really doing that until the 2.0 release is
>> out, I think we can skip it
>>
>> For the series
>> Acked-by: Neil Horman 
> Applied, thanks

Hi David,

It seems I cannot invoke testpmd with igb_uio device using latest master
branch.
Here are steps I did.

$ T=x86_64-native-linuxapp-gcc make install
$ sudo ./tools/dpdk_nic_bind.py -b igb_uio 
$ sudo ./x86_64-native-linuxapp-gcc/app/testpmd -c f -n 1 -- -i
EAL: Detected lcore 0 as core 0 on socket 0

(snip)

EAL: PCI device :84:00.0 on NUMA socket 1
EAL:   probe driver: 8086:1521 rte_igb_pmd
EAL:   PCI memory mapped at 0x7fffc000
EAL:   PCI memory mapped at 0x7fffc010
$

As a result of bisecting, it seems one of following commits may cause
the issue.

95b6a46 tailq: remove static slots
a234816 tailq: move to dynamic tailq

Could you please check it?

Thanks,
Tetsuya


[dpdk-dev] [PATCH] app/test-pmd: fix rte_pci_tailq not initialized before used

2015-03-11 Thread Yong Liu
Function rte_eal_pci_init will cast pci resource list and used for insert
probed device later. But all tailq initialized in function
rte_eal_tailqs_init, so rte_eal_pci_init must be called after it.

Signed-off-by: Marvin Liu 

diff --git a/lib/librte_eal/linuxapp/eal/eal.c 
b/lib/librte_eal/linuxapp/eal/eal.c
index bd770cf..576f9f8 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -755,9 +755,6 @@ rte_eal_init(int argc, char **argv)

rte_config_init();

-   if (rte_eal_pci_init() < 0)
-   rte_panic("Cannot init PCI\n");
-
 #ifdef RTE_LIBRTE_IVSHMEM
if (rte_eal_ivshmem_init() < 0)
rte_panic("Cannot init IVSHMEM\n");
@@ -792,6 +789,9 @@ rte_eal_init(int argc, char **argv)
if (rte_eal_timer_init() < 0)
rte_panic("Cannot init HPET or TSC timers\n");

+   if (rte_eal_pci_init() < 0)
+   rte_panic("Cannot init PCI\n");
+
eal_check_mem_on_local_socket();

rte_eal_mcfg_complete();
-- 
1.9.3



[dpdk-dev] [PATCH v6 3/3] ixgbe: Add LRO support

2015-03-11 Thread Ananyev, Konstantin


> -Original Message-
> From: Vlad Zolotarov [mailto:vladz at cloudius-systems.com]
> Sent: Tuesday, March 10, 2015 9:36 PM
> To: Ananyev, Konstantin; dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v6 3/3] ixgbe: Add LRO support
> 
> 
> 
> On 03/10/15 22:09, Ananyev, Konstantin wrote:
> >>> Hi Vlad,
> >>>
>  -Original Message-
>  From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Vlad Zolotarov
>  Sent: Monday, March 09, 2015 7:07 PM
>  To: dev at dpdk.org
>  Subject: [dpdk-dev] [PATCH v6 3/3] ixgbe: Add LRO support
> 
>    - Only x540 and 82599 devices support LRO.
>    - Add the appropriate HW configuration.
>    - Add RSC aware rx_pkt_burst() handlers:
>   - Implemented bulk allocation and non-bulk allocation versions.
>   - Add LRO-specific fields to rte_eth_rxmode, to rte_eth_dev_data
> and to igb_rx_queue.
>   - Use the appropriate handler when LRO is requested.
> 
>  Signed-off-by: Vlad Zolotarov 
>  ---
>  New in v5:
>   - Put the RTE_ETHDEV_HAS_LRO_SUPPORT definition at the beginning of 
>  rte_ethdev.h.
>   - Removed the "TODO: Remove me" comment near 
>  RTE_ETHDEV_HAS_LRO_SUPPORT.
> 
>  New in v4:
>   - Define RTE_ETHDEV_HAS_LRO_SUPPORT in rte_ethdev.h instead of
> RTE_ETHDEV_LRO_SUPPORT defined in config/common_linuxapp.
> 
>  New in v2:
>   - Removed rte_eth_dev_data.lro_bulk_alloc.
>   - Fixed a few styling and spelling issues.
>  ---
> lib/librte_ether/rte_ethdev.h   |   9 +-
> lib/librte_pmd_ixgbe/ixgbe_ethdev.c |   6 +
> lib/librte_pmd_ixgbe/ixgbe_ethdev.h |   5 +
> lib/librte_pmd_ixgbe/ixgbe_rxtx.c   | 562 
>  +++-
> lib/librte_pmd_ixgbe/ixgbe_rxtx.h   |   6 +
> 5 files changed, 581 insertions(+), 7 deletions(-)
> 
>  diff --git a/lib/librte_ether/rte_ethdev.h 
>  b/lib/librte_ether/rte_ethdev.h
>  index 8db3127..44f081f 100644
>  --- a/lib/librte_ether/rte_ethdev.h
>  +++ b/lib/librte_ether/rte_ethdev.h
>  @@ -172,6 +172,9 @@ extern "C" {
> 
> #include 
> 
>  +/* Use this macro to check if LRO API is supported */
>  +#define RTE_ETHDEV_HAS_LRO_SUPPORT
>  +
> #include 
> #include 
> #include 
>  @@ -320,14 +323,15 @@ struct rte_eth_rxmode {
>   enum rte_eth_rx_mq_mode mq_mode;
>   uint32_t max_rx_pkt_len;  /**< Only used if jumbo_frame 
>  enabled. */
>   uint16_t split_hdr_size;  /**< hdr buf size (header_split 
>  enabled).*/
>  -uint8_t header_split : 1, /**< Header Split enable. */
>  +uint16_t header_split : 1, /**< Header Split enable. */
>   hw_ip_checksum   : 1, /**< IP/UDP/TCP checksum offload 
>  enable. */
>   hw_vlan_filter   : 1, /**< VLAN filter enable. */
>   hw_vlan_strip: 1, /**< VLAN strip enable. */
>   hw_vlan_extend   : 1, /**< Extended VLAN enable. */
>   jumbo_frame  : 1, /**< Jumbo Frame Receipt enable. 
>  */
>   hw_strip_crc : 1, /**< Enable CRC stripping by 
>  hardware. */
>  -enable_scatter   : 1; /**< Enable scatter packets rx 
>  handler */
>  +enable_scatter   : 1, /**< Enable scatter packets rx 
>  handler */
>  +enable_lro   : 1; /**< Enable LRO */
> };
> 
> /**
>  @@ -1515,6 +1519,7 @@ struct rte_eth_dev_data {
>   uint8_t port_id;   /**< Device [external] port 
>  identifier. */
>   uint8_t promiscuous   : 1, /**< RX promiscuous mode ON(1) / 
>  OFF(0). */
>   scattered_rx : 1,  /**< RX of scattered packets is 
>  ON(1) / OFF(0) */
>  +lro  : 1,  /**< RX LRO is ON(1) / OFF(0) */
>   all_multicast : 1, /**< RX all multicast mode ON(1) / 
>  OFF(0). */
>   dev_started : 1;   /**< Device state: STARTED(1) / 
>  STOPPED(0). */
> };
>  diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c 
>  b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
>  index 9d3de1a..765174d 100644
>  --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
>  +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
>  @@ -1648,6 +1648,7 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
> 
>   /* Clear stored conf */
>   dev->data->scattered_rx = 0;
>  +dev->data->lro = 0;
>   hw->rx_bulk_alloc_allowed = false;
>   hw->rx_vec_allowed = false;
> 
>  @@ -2018,6 +2019,11 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, 
>  struct rte_eth_dev_info *dev_info)
>   DEV_RX_OFFLOAD_IPV4_CKSUM |

[dpdk-dev] [PATCH v3] ABI: Add abi checking utility

2015-03-11 Thread Neil Horman
On Thu, Mar 05, 2015 at 11:57:27AM -0500, Neil Horman wrote:
> On Wed, Mar 04, 2015 at 05:49:50PM +0100, Thomas Monjalon wrote:
> > 2015-03-04 11:26, Neil Horman:
> > > +#trap on ctrl-c to clean up
> > > +trap cleanup_and_exit SIGINT
> > 
> > I think INT is preffered over SIGINT.
> > You may also add QUIT and TERM.
> > With QUIT, you can replace cleanup_and_exit calls by a simple exit.
> > 
> > > + CURRENT_BRANCH=`git log --pretty=format:%H HEAD~1..HEAD`
> > 
> > May be simpler "git log -1 --format=%H"
> > 
> It might be, but the above is equivalent, and --format is a more recent 
> git-log
> feature.  Older versions still require --pretty=format
> 
> > > +log "INFO" "We're going to check and make sure that applications built"
> > > +log "INFO" "against DPDK DSOs from tag $TAG1 will still run when 
> > > executed"
> > > +log "INFO" "against DPDK DSOs built from tag $TAG2."
> > 
> > I think it may be removed as no app is run.
> > 
> The above doesn't indicate that an application will be run, only that the
> purpose of this script is to ensure that older applications will still run,
> which I think is appropriate.
> 
> > > +# Make sure we configure SHARED libraries
> > > +# Also turn off IGB and KNI as those require kernel headers to build
> > > +sed -i -e"$ a\CONFIG_RTE_BUILD_SHARED_LIB=y" config/defconfig_$TARGET
> > > +sed -i -e"$ a\CONFIG_RTE_EAL_IGB_UIO=n" config/defconfig_$TARGET
> > > +sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" config/defconfig_$TARGET
> > 
> > So you prefer modifying defconfig instead of .config, right?
> > (you sent it while I was answering on v2)
> > 
> Yes, correct.
> 
> > > +# Checking abi compliance relies on using the dwarf information in
> > > +# The shared objects.  Thats only included in the DSO's if we build
> > > +# with -g
> > > +export EXTRA_CFLAGS=-g
> > > +export EXTRA_LDFLAGS=-g
> > [...]
> > > +export EXTRA_CFLAGS=-g
> > > +export EXTRA_LDFLAGS=-g
> > 
> > Already exported.
> > 
> Yeah, I'll clean that up later.
> 
> > > + OLDNAME=`basename $i | sed -e"s/1.dump/0.dump/"`
> > 
> > Could be OLDNAME=$(basename $i 1.dump)0.dump
> > 
> > > + LIBNAME=`basename $i | sed -e"s/-ABI-1.dump//"`
> > 
> > Could be LIBNAME=$(basename $i -ABI-1.dump)
> > 
> It could be, but I prefer the clarity of the sed replacement.
> 
> Neil
> 
> > Thanks
> > 
> > 
> 

Ping Thomas, is this going to make 2.0?

Thanks
Neil



[dpdk-dev] filtering traffic and forward to os

2015-03-11 Thread Vasiliy Tolstov
I'm interesting in dpdk to filter traffic.
My use-case - i have server with 10Gbit uplink and i want to add it
port via dpdk to ovs, filter traffic and forward it to OS (i need to
able to ssh in this port :( )
Does it possible after processing packet in dpdk forward it to kernel ?

-- 
Vasiliy Tolstov,
e-mail: v.tolstov at selfip.ru
jabber: vase at selfip.ru


[dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check

2015-03-11 Thread Yong Liu
testpmd parameter "nb-port" mean the number of forwarding port.
It's incorrect to use function port_id_is_invalid to check number of ports.

Signed-off-by: Marvin Liu 

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 11d9af0..f1daa6e 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -628,8 +628,7 @@ launch_args_parse(int argc, char** argv)
 #endif
if (!strcmp(lgopts[opt_idx].name, "nb-ports")) {
n = atoi(optarg);
-   if (n > 0 &&
-   !port_id_is_invalid(n, DISABLED_WARN))
+   if (n > 0 && n <= nb_ports)
nb_fwd_ports = (uint8_t) n;
else
rte_exit(EXIT_FAILURE,
-- 
1.9.3



[dpdk-dev] [PATCH v7 3/3] ixgbe: Add LRO support

2015-03-11 Thread Ananyev, Konstantin


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Vlad Zolotarov
> Sent: Tuesday, March 10, 2015 7:32 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v7 3/3] ixgbe: Add LRO support
> 
> - Only x540 and 82599 devices support LRO.
> - Add the appropriate HW configuration.
> - Add RSC aware rx_pkt_burst() handlers:
>- Implemented bulk allocation and non-bulk allocation versions.
>- Add LRO-specific fields to rte_eth_rxmode, to rte_eth_dev_data
>  and to igb_rx_queue.
>- Use the appropriate handler when LRO is requested.
> 
> Signed-off-by: Vlad Zolotarov 
> ---
> New in v7:
>- Free not-yet-completed RSC aggregations in rte_eth_dev_stop() flow.
>- Fixed rx_bulk_alloc_allowed and rx_vec_allowed initialization:
>   - Don't set them to FALSE in rte_eth_dev_stop() flow - the following
> rte_eth_dev_start() will need them.
>   - Reset them to TRUE in rte_eth_dev_configure() and not in a probe() 
> flow.
> This will ensure the proper behaviour if port is re-configured.
>- Reset the sw_ring[].mbuf entry in a bulk allocation case.
>  This is needed for ixgbe_rx_queue_release_mbufs().
>- _recv_pkts_lro(): added the missing memory barrier before RDT update in a
>  non-bulk allocation case.
>- Don't allow RSC when device is configured in an SR-IOV mode.
> 
> New in v5:
>- Put the RTE_ETHDEV_HAS_LRO_SUPPORT definition at the beginning of 
> rte_ethdev.h.
>- Removed the "TODO: Remove me" comment near RTE_ETHDEV_HAS_LRO_SUPPORT.
> 
> New in v4:
>- Define RTE_ETHDEV_HAS_LRO_SUPPORT in rte_ethdev.h instead of
>  RTE_ETHDEV_LRO_SUPPORT defined in config/common_linuxapp.
> 
> New in v2:
>- Removed rte_eth_dev_data.lro_bulk_alloc.
>- Fixed a few styling and spelling issues.
> 
> ixgbe: Fixed rx_bulk_alloc_allowed and rx_vec_allowed initialization
> 
>- Don't set them to FALSE in rte_eth_dev_stop() flow - the following
>  rte_eth_dev_start() will need them.
>- Reset them to TRUE in rte_eth_dev_configure() and not in a probe() flow.
>  This will ensure the proper behaviour if port is re-configured.
> ---
>  lib/librte_ether/rte_ethdev.h   |   9 +-
>  lib/librte_pmd_ixgbe/ixgbe_ethdev.c |  29 +-
>  lib/librte_pmd_ixgbe/ixgbe_ethdev.h |   5 +
>  lib/librte_pmd_ixgbe/ixgbe_rxtx.c   | 595 
> +++-
>  lib/librte_pmd_ixgbe/ixgbe_rxtx.h   |   6 +
>  5 files changed, 628 insertions(+), 16 deletions(-)
> 
> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
> index 8db3127..44f081f 100644
> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
> @@ -172,6 +172,9 @@ extern "C" {
> 
>  #include 
> 
> +/* Use this macro to check if LRO API is supported */
> +#define RTE_ETHDEV_HAS_LRO_SUPPORT
> +
>  #include 
>  #include 
>  #include 
> @@ -320,14 +323,15 @@ struct rte_eth_rxmode {
>   enum rte_eth_rx_mq_mode mq_mode;
>   uint32_t max_rx_pkt_len;  /**< Only used if jumbo_frame enabled. */
>   uint16_t split_hdr_size;  /**< hdr buf size (header_split enabled).*/
> - uint8_t header_split : 1, /**< Header Split enable. */
> + uint16_t header_split : 1, /**< Header Split enable. */
>   hw_ip_checksum   : 1, /**< IP/UDP/TCP checksum offload enable. 
> */
>   hw_vlan_filter   : 1, /**< VLAN filter enable. */
>   hw_vlan_strip: 1, /**< VLAN strip enable. */
>   hw_vlan_extend   : 1, /**< Extended VLAN enable. */
>   jumbo_frame  : 1, /**< Jumbo Frame Receipt enable. */
>   hw_strip_crc : 1, /**< Enable CRC stripping by hardware. */
> - enable_scatter   : 1; /**< Enable scatter packets rx handler */
> + enable_scatter   : 1, /**< Enable scatter packets rx handler */
> + enable_lro   : 1; /**< Enable LRO */
>  };
> 
>  /**
> @@ -1515,6 +1519,7 @@ struct rte_eth_dev_data {
>   uint8_t port_id;   /**< Device [external] port identifier. */
>   uint8_t promiscuous   : 1, /**< RX promiscuous mode ON(1) / OFF(0). */
>   scattered_rx : 1,  /**< RX of scattered packets is ON(1) / 
> OFF(0) */
> + lro  : 1,  /**< RX LRO is ON(1) / OFF(0) */
>   all_multicast : 1, /**< RX all multicast mode ON(1) / OFF(0). */
>   dev_started : 1;   /**< Device state: STARTED(1) / STOPPED(0). 
> */
>  };
> diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c 
> b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
> index 9d3de1a..f0a3100 100644
> --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
> +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
> @@ -772,13 +772,6 @@ eth_ixgbe_dev_init(__attribute__((unused)) struct 
> eth_driver *eth_drv,
>   hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
>   hw->allow_unsupported_sfp = 1;
> 
> - /*
> -  * Initialize to TRUE. If any of Rx queues doesn't meet the bulk
> -  * 

[dpdk-dev] failed to build latest dpdk 1.8.0 on kvm virtual machine

2015-03-11 Thread Mcnamara, John


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Vasiliy Tolstov
> Sent: Wednesday, March 11, 2015 1:47 PM
> To: dev
> Subject: [dpdk-dev] failed to build latest dpdk 1.8.0 on kvm virtual
> machine
> 
> I'm try to build dpdk 1.8.0
> 
> unpack sources
> sed -i 's|CONFIG_RTE_MACHINE="native"|CONFIG_RTE_MACHINE="default"|g'
> config/defconfig_x86_64-native-linuxapp-gcc
> export CFLAGS="-march=core2 -mtune=generic -pipe -O2"
> make V=1 config T=x86_64-native-linuxapp-gcc make V=1
> MACHINE_CFLAGS="${CFLAGS}"
> 

Hi,

CFLAGS for DPDK are usually set via EXTRA_CFLAGS. Try the following as a final 
set after the other config above:

EXTRA_CFLAGS="-march=core2 -mtune=generic -pipe -O2" 
MACHINE_CFLAGS=$EXTRA_CFLAGS make V=1

It compiles DPDK 1.8.0 from source on my test env.

John


[dpdk-dev] [PATCH v7 0/3]: Add LRO support to ixgbe PMD

2015-03-11 Thread Ananyev, Konstantin


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Vlad Zolotarov
> Sent: Tuesday, March 10, 2015 7:31 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v7 0/3]: Add LRO support to ixgbe PMD
> 
> This series adds the missing flow for enabling the LRO in the ethdev and
> adds a support for this feature in the ixgbe PMD. There is a big hope that 
> this
> initiative is going to be picked up by some Intel developer that would add 
> the LRO support
> to other Intel PMDs.
> 
> The series starts with some cleanup work in the code the final patch (the 
> actual adding of
> the LRO support) is going to touch/use/change. There are still quite a few 
> issues in the ixgbe
> PMD code left but they have to be a matter of a different series and I've 
> left a few "TODO"
> remarks in the code.
> 
> The LRO ("RSC" in Intel's context) PMD completion handling code follows the 
> same design as the
> corresponding Linux and FreeBSD implementation: pass the aggregation's 
> cluster HEAD buffer to
> the NEXTP entry of the software ring till EOP is met.
> 
> HW configuration follows the corresponding specs: this feature is supported 
> only by x540 and
> 82599 PF devices.
> 
> The feature has been tested with seastar TCP stack with the following 
> configuration on Tx side:
>- MTU: 400B
>- 100 concurrent TCP connections.
> 
> The results were:
>- Without LRO: total throughput: 0.12Gbps, coefficient of variance: 1.41%
>- With LRO:total throughput: 8.21Gbps, coefficient of variance: 0.59%
> 
> This is an almost factor 80 improvement.
> 
> New in v7:
>- Free not-yet-completed RSC aggregations in rte_eth_dev_stop() flow.
>- Fixed rx_bulk_alloc_allowed and rx_vec_allowed initialization:
>   - Don't set them to FALSE in rte_eth_dev_stop() flow - the following
> rte_eth_dev_start() will need them.
>   - Reset them to TRUE in rte_eth_dev_configure() and not in a probe() 
> flow.
> This will ensure the proper behaviour if port is re-configured.

That changes probably should be part of another patch you submitted:
[PATCH v2 3/3] ixgbe: Unify the rx_pkt_bulk callbackinitialization
?
Konstantin

>- Reset the sw_ring[].mbuf entry in a bulk allocation case.
>  This is needed for ixgbe_rx_queue_release_mbufs().
>- _recv_pkts_lro(): added the missing memory barrier before RDT update in a
>  non-bulk allocation case.
>- Don't allow RSC when device is configured in an SR-IOV mode.
> 
> New in v6:
>- Fix of the typo in the "bug fixes" series that broke the compilation 
> caused a
>  minor change in this follow-up series.
> 
> New in v5:
>- Split the series into "bug fixes" and "all the rest" so that the former 
> could be
>  integrated into a 2.0 release.
>- Put the RTE_ETHDEV_HAS_LRO_SUPPORT definition at the beginning of 
> rte_ethdev.h.
>- Removed the "TODO: Remove me" comment near RTE_ETHDEV_HAS_LRO_SUPPORT.
> 
> New in v4:
>- Remove CONFIG_RTE_ETHDEV_LRO_SUPPORT from config/common_linuxapp.
>- Define RTE_ETHDEV_HAS_LRO_SUPPORT in rte_ethdev.h.
>- As a result of "ixgbe: check rxd number to avoid mbuf leak" (352078e8e) 
> Vector Rx
>  had to get the same treatment as Rx Bulk Alloc (see PATCH4 for more 
> details).
> 
> New in v3:
>- ixgbe_rx_alloc_bufs(): Always reset refcnt of the buffers to 1. 
> Otherwise rte_pktmbuf_free()
>  won't free them.
> 
> New in v2:
>- Removed rte_eth_dev_data.lro_bulk_alloc and added 
> ixgbe_hw.rx_bulk_alloc_allowed
>  instead.
>- Unified the rx_pkt_bulk callback setting (a separate new patch).
>- Fixed a few styling and spelling issues.
> 
> Vlad Zolotarov (3):
>   ixgbe: Cleanups
>   ixgbe: Code refactoring
>   ixgbe: Add LRO support
> 
>  lib/librte_ether/rte_ethdev.h   |   9 +-
>  lib/librte_pmd_ixgbe/ixgbe_ethdev.c |  29 +-
>  lib/librte_pmd_ixgbe/ixgbe_ethdev.h |   5 +
>  lib/librte_pmd_ixgbe/ixgbe_rxtx.c   | 738 
> 
>  lib/librte_pmd_ixgbe/ixgbe_rxtx.h   |   6 +
>  5 files changed, 710 insertions(+), 77 deletions(-)
> 
> --
> 2.1.0



[dpdk-dev] filtering traffic and forward to os

2015-03-11 Thread Bruce Richardson
On Wed, Mar 11, 2015 at 03:35:44PM +0300, Vasiliy Tolstov wrote:
> I'm interesting in dpdk to filter traffic.
> My use-case - i have server with 10Gbit uplink and i want to add it
> port via dpdk to ovs, filter traffic and forward it to OS (i need to
> able to ssh in this port :( )
> Does it possible after processing packet in dpdk forward it to kernel ?

To forward packets from DPDK into kernel, look at the KNI library. (For a more
standard, but lower performing option, TUN/TAP might be an option, see the 
exception path example.)

Regards,
/Bruce

> 
> -- 
> Vasiliy Tolstov,
> e-mail: v.tolstov at selfip.ru
> jabber: vase at selfip.ru


[dpdk-dev] Filtration Statistics for VLAN filters(ixgbe)

2015-03-11 Thread Kamraan Nasim
Hello,

I am trying to implement VLAN filters in DPDK on 82599 NIC(Niantic)

I've been using *rte_eth_dev_vlan_filter(port, vlanID, 1)* which seems to
be working however I would like to see some actual packet filtration
statistics.

 In the case of 5tuple IPv4 filters where I was redirecting to queueX, I
could see the filter working by looking at q_errors[X} in rte_eth_stats
struct.

Is there anything in *rte_eth_stats* that can be used to see VLAN filtering
stats or anything else out there?

Greatly appreciate any help in this department :)


Thanks,
Kam


[dpdk-dev] [PATCH v2 3/3] ixgbe: Unify the rx_pkt_bulk callback initialization

2015-03-11 Thread Ananyev, Konstantin


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Vlad Zolotarov
> Sent: Monday, March 09, 2015 4:29 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v2 3/3] ixgbe: Unify the rx_pkt_bulk callback 
> initialization
> 
>- Set the callback in a single function that is called from
>  ixgbe_dev_rx_init() for a primary process and from eth_ixgbe_dev_init()
>  for a secondary processes. This is instead of multiple, hard to track 
> places.
>- Added ixgbe_hw.rx_bulk_alloc_allowed - see ixgbe_hw.rx_vec_allowed 
> description below.
>- Added ixgbe_hw.rx_vec_allowed: like with Bulk Allocation, Vector Rx is
>  enabled or disabled on a per-port level. All queues have to meet the 
> appropriate
>  preconditions and if any of them doesn't - the feature has to be 
> disabled.
>  Therefore ixgbe_hw.rx_vec_allowed will be updated during each queues 
> configuration
>  (rte_eth_rx_queue_setup()) and then used in rte_eth_dev_start() to 
> configure the
>  appropriate callbacks. The same happens with ixgbe_hw.rx_vec_allowed in 
> a Bulk Allocation
>  context.
>- Bugs fixed:
>   - Vector scattered packets callback was called regardless the 
> appropriate
> preconditions:
>  - Vector Rx specific preconditions.
>  - Bulk Allocation preconditions.
>   - Vector Rx was enabled/disabled according to the last queue setting 
> and not
> based on all queues setting (which may be different for each queue).
> 
> Signed-off-by: Vlad Zolotarov 
> ---
> New in v2:
>- Fixed an broken compilation.
> ---
>  lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h |   2 +
>  lib/librte_pmd_ixgbe/ixgbe_ethdev.c |  13 ++-
>  lib/librte_pmd_ixgbe/ixgbe_rxtx.c   | 183 
> +---
>  lib/librte_pmd_ixgbe/ixgbe_rxtx.h   |  22 +++-
>  4 files changed, 152 insertions(+), 68 deletions(-)
> 
> diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h 
> b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h
> index c67d462..9a66370 100644
> --- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h
> +++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h
> @@ -3657,6 +3657,8 @@ struct ixgbe_hw {
>   bool force_full_reset;
>   bool allow_unsupported_sfp;
>   bool wol_enabled;
> + bool rx_bulk_alloc_allowed;
> + bool rx_vec_allowed;
>  };
> 
>  #define ixgbe_call_func(hw, func, params, error) \
> diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c 
> b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
> index 9bdc046..9d3de1a 100644
> --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
> +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
> @@ -760,8 +760,8 @@ eth_ixgbe_dev_init(__attribute__((unused)) struct 
> eth_driver *eth_drv,
>  "Using default TX function.");
>   }
> 
> - if (eth_dev->data->scattered_rx)
> - eth_dev->rx_pkt_burst = ixgbe_recv_scattered_pkts;
> + set_rx_function(eth_dev);
> +
>   return 0;
>   }
>   pci_dev = eth_dev->pci_dev;
> @@ -772,6 +772,13 @@ eth_ixgbe_dev_init(__attribute__((unused)) struct 
> eth_driver *eth_drv,
>   hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
>   hw->allow_unsupported_sfp = 1;
> 
> + /*
> +  * Initialize to TRUE. If any of Rx queues doesn't meet the bulk
> +  * allocation or vector Rx preconditions we will reset it.
> +  */
> + hw->rx_bulk_alloc_allowed = true;
> + hw->rx_vec_allowed = true;
> +
>   /* Initialize the shared code (base driver) */
>  #ifdef RTE_NIC_BYPASS
>   diag = ixgbe_bypass_init_shared_code(hw);
> @@ -1641,6 +1648,8 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
> 
>   /* Clear stored conf */
>   dev->data->scattered_rx = 0;
> + hw->rx_bulk_alloc_allowed = false;
> + hw->rx_vec_allowed = false;

If dev_stop() sets it to 'false', who will reset it back to 'true' then?

> 
>   /* Clear recorded link status */
>   memset(, 0, sizeof(link));
> diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c 
> b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
> index ce9658e..a00f5c9 100644
> --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
> +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
> @@ -2074,12 +2074,12 @@ check_rx_burst_bulk_alloc_preconditions(__rte_unused 
> struct igb_rx_queue *rxq)
> 
>  /* Reset dynamic igb_rx_queue fields back to defaults */
>  static void
> -ixgbe_reset_rx_queue(struct igb_rx_queue *rxq)
> +ixgbe_reset_rx_queue(struct ixgbe_hw *hw, struct igb_rx_queue *rxq)
>  {
>   static const union ixgbe_adv_rx_desc zeroed_desc = { .read = {
>   .pkt_addr = 0}};
>   unsigned i;
> - uint16_t len;
> + uint16_t len = rxq->nb_rx_desc;
> 
>   /*
>* By default, the Rx queue setup function allocates enough memory for
> @@ -2091,14 +2091,9 @@ ixgbe_reset_rx_queue(struct igb_rx_queue *rxq)
>* constraints here to see if we need to zero out memory after the end
>* of the H/W descriptor 

[dpdk-dev] How can I recover from CONFIG_RTE_MAX_MEMSEG overrun?

2015-03-11 Thread Dennis Montgomery
Hello,

I?m running into an occasional problem where rte_eal_init() returns -ENOMEM and 
the following error is logged:

EAL: Can only reserve 991 pages from 1024 requested
Current CONFIG_RTE_MAX_MEMSEG=256 is not enough

When this happens a reboot will take care of it, but I?m hoping for a more 
elegant solution. I don?t have much direct experience with hugetlbfs so I?m 
hoping someone on this list can suggest something.

I did boost max-memseg and it works, but I?m worried that it will just crop up 
again - I instrumented rte_eal_hugepage_init() and found that the number of 
segments used slowly creeps up as I cycle my application (i.e. repeated 
rte_eal_init() invocations with process-type == primary). I?m theorizing that 
hugetlbfs fragments (for lack of a better phrase) over time. Does anyone on the 
list know of a way to reset hugetlbfs short of rebooting?

DPDK version:
EAL: RTE Version: 'RTE 1.8.0-rc0'
Linux version 3.16.6-200.fc20.x86_64 (mockbuild at 
bkernel01.phx2.fedoraproject.org) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-7) 
(GCC) ) #1 SMP Wed Oct 15 13:06:51 UTC 2014


Thank you,

Dennis Montgomery

PS this is my first post to this list; apologies if I?m violating any protocols.


[dpdk-dev] [PATCH v2 2/3] ixgbe: Bug fix: Properly configure Rx CRC stripping for x540 devices

2015-03-11 Thread Ananyev, Konstantin


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Vlad Zolotarov
> Sent: Monday, March 09, 2015 4:29 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v2 2/3] ixgbe: Bug fix: Properly configure Rx CRC 
> stripping for x540 devices
> 
> According to x540 spec chapter 8.2.4.8.9 CRCSTRIP field of RDRXCTL should
> be configured to the same value as HLREG0.RXCRCSTRP.
> 
> Clearing the RDRXCTL.RSCFRSTSIZE field for x540 is not required by the spec
> but seems harmless.

Acked-by: Konstantin Ananyev 

> 
> Signed-off-by: Vlad Zolotarov 
> ---
>  lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c 
> b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
> index b033e04..ce9658e 100644
> --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
> +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
> @@ -3677,7 +3677,8 @@ ixgbe_dev_rx_init(struct rte_eth_dev *dev)
> 
>   IXGBE_WRITE_REG(hw, IXGBE_RXCSUM, rxcsum);
> 
> - if (hw->mac.type == ixgbe_mac_82599EB) {
> + if (hw->mac.type == ixgbe_mac_82599EB ||
> + hw->mac.type == ixgbe_mac_X540) {
>   rdrxctl = IXGBE_READ_REG(hw, IXGBE_RDRXCTL);
>   if (dev->data->dev_conf.rxmode.hw_strip_crc)
>   rdrxctl |= IXGBE_RDRXCTL_CRCSTRIP;
> --
> 2.1.0



[dpdk-dev] [PATCH] maintainers: claim EAL Intel x86

2015-03-11 Thread Konstantin Ananyev
Signed-off-by: Konstantin Ananyev 
---
 MAINTAINERS | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index ac46299..f10a457 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -106,6 +106,8 @@ IBM Power
 F: lib/librte_eal/common/include/arch/ppc_64/

 Intel x86
+M: Bruce Richardson 
+M: Konstantin Ananyev 
 F: lib/librte_eal/common/include/arch/x86/

 Linux EAL (with overlaps)
-- 
1.8.5.3



[dpdk-dev] [PATCH v2 0/3]: bug fixes in the ixgbe PF PMD Rx flow

2015-03-11 Thread Vlad Zolotarov
Ping. ;)

On 03/09/15 18:28, Vlad Zolotarov wrote:
> This series contains some bug fixes that were found during my work on the 
> ixgbe LRO
> patches. Sending this series separately on Thomas request so that it may be 
> integrated
> into the 2.0 release.
>
> New in v2:
> - Fixed a compilation failure.
>
> Vlad Zolotarov (3):
>ixgbe: Use the rte_le_to_cpu_xx()/rte_cpu_to_le_xx() when
>  reading/setting HW ring descriptor fields
>ixgbe: Bug fix: Properly configure Rx CRC stripping for x540 devices
>ixgbe: Unify the rx_pkt_bulk callback initialization
>
>   lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h |   2 +
>   lib/librte_pmd_ixgbe/ixgbe_ethdev.c |  13 ++-
>   lib/librte_pmd_ixgbe/ixgbe_rxtx.c   | 199 
> +---
>   lib/librte_pmd_ixgbe/ixgbe_rxtx.h   |  22 +++-
>   4 files changed, 161 insertions(+), 75 deletions(-)
>



[dpdk-dev] [PATCH] maintainers: claim misc sample applications

2015-03-11 Thread Bruce Richardson
Claim the following sample applications:
* dpdk_qat
* helloworld
* l2fwd
* skeleton

Signed-off-by: Bruce Richardson 
---
 MAINTAINERS | 4 
 1 file changed, 4 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index fe9512d..87089e5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -422,18 +422,21 @@ F: doc/guides/testpmd_app_ug/
 Other Example Applications
 --

+M: Bruce Richardson 
 F: examples/dpdk_qat/
 F: doc/guides/sample_app_ug/intel_quickassist.rst

 F: examples/exception_path/
 F: doc/guides/sample_app_ug/exception_path.rst

+M: Bruce Richardson 
 F: examples/helloworld/
 F: doc/guides/sample_app_ug/hello_world.rst

 F: examples/ipv4_multicast/
 F: doc/guides/sample_app_ug/ipv4_multicast.rst

+M: Bruce Richardson 
 F: examples/l2fwd/
 F: doc/guides/sample_app_ug/l2_forward_real_virtual.rst

@@ -459,6 +462,7 @@ M: Bruce Richardson 
 M: John McNamara 
 F: examples/rxtx_callbacks/

+M: Bruce Richardson 
 F: examples/skeleton/

 F: examples/vmdq/
-- 
2.1.0



[dpdk-dev] [PATCH] doc: add l2fwd-jobstats user guide

2015-03-11 Thread Pawel Wodkowski
Signed-off-by: Pawel Wodkowski 
---
 doc/guides/sample_app_ug/index.rst|   1 +
 doc/guides/sample_app_ug/l2_forward_job_stats.rst | 637 ++
 2 files changed, 638 insertions(+)
 create mode 100644 doc/guides/sample_app_ug/l2_forward_job_stats.rst

diff --git a/doc/guides/sample_app_ug/index.rst 
b/doc/guides/sample_app_ug/index.rst
index 5720181..c89a2f0 100644
--- a/doc/guides/sample_app_ug/index.rst
+++ b/doc/guides/sample_app_ug/index.rst
@@ -47,6 +47,7 @@ Sample Applications User Guide
 ipv4_multicast
 ip_reassembly
 kernel_nic_interface
+l2_forward_job_stats
 l2_forward_real_virtual
 l3_forward
 l3_forward_power_man
diff --git a/doc/guides/sample_app_ug/l2_forward_job_stats.rst 
b/doc/guides/sample_app_ug/l2_forward_job_stats.rst
new file mode 100644
index 000..76cea71
--- /dev/null
+++ b/doc/guides/sample_app_ug/l2_forward_job_stats.rst
@@ -0,0 +1,637 @@
+..  BSD LICENSE
+Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+* Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in
+the documentation and/or other materials provided with the
+distribution.
+* Neither the name of Intel Corporation nor the names of its
+contributors may be used to endorse or promote products derived
+from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+L2 Forwarding Sample Application (in Real and Virtualized Environments) with 
core load statistics.
+==
+
+The L2 Forwarding sample application is a simple example of packet processing 
using
+the Data Plane Development Kit (DPDK) which
+also takes advantage of Single Root I/O Virtualization (SR-IOV) features in a 
virtualized environment.
+
+.. note::
+
+This application is a variation of L2 Forwarding sample application. It 
demonstrate possible
+scheme of job stats library usage therefore some parts of this document is 
identical with original
+L2 forwarding application.
+
+Overview
+
+
+The L2 Forwarding sample application, which can operate in real and 
virtualized environments,
+performs L2 forwarding for each packet that is received.
+The destination port is the adjacent port from the enabled portmask, that is,
+if the first four ports are enabled (portmask 0xf),
+ports 1 and 2 forward into each other, and ports 3 and 4 forward into each 
other.
+Also, the MAC addresses are affected as follows:
+
+*   The source MAC address is replaced by the TX port MAC address
+
+*   The destination MAC address is replaced by  02:00:00:00:00:TX_PORT_ID
+
+This application can be used to benchmark performance using a 
traffic-generator, as shown in the Figure 3.
+
+The application can also be used in a virtualized environment as shown in 
Figure 4.
+
+The L2 Forwarding application can also be used as a starting point for 
developing a new application based on the DPDK.
+
+.. _figure_3:
+
+**Figure 3. Performance Benchmark Setup (Basic Environment)**
+
+.. image4_png has been replaced
+
+|l2_fwd_benchmark_setup|
+
+.. _figure_4:
+
+**Figure 4. Performance Benchmark Setup (Virtualized Environment)**
+
+.. image5_png has been renamed
+
+|l2_fwd_virtenv_benchmark_setup|
+
+Virtual Function Setup Instructions
+~~~
+
+This application can use the virtual function available in the system and
+therefore can be used in a virtual machine without passing through
+the whole Network Device into a guest machine in a virtualized scenario.
+The virtual functions can be enabled in the host machine or the hypervisor 
with the respective physical function driver.
+
+For example, in a Linux* host machine, it is possible to enable a virtual 

[dpdk-dev] [PATCH] MAINTAINERS: claim ring pmd library

2015-03-11 Thread Bruce Richardson
Signed-off-by: Bruce Richardson 

---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index ac46299..fe9512d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -247,6 +247,7 @@ F: lib/librte_pmd_pcap/
 F: doc/guides/prog_guide/libpcap_ring_based_poll_mode_drv.rst

 Ring PMD
+M: Bruce Richardson 
 F: lib/librte_pmd_ring/
 F: doc/guides/prog_guide/ring_lib.rst
 F: app/test/test_pmd_ring.c
-- 
2.1.0



[dpdk-dev] [PATCH v4] pci: save list of detached devices, and re-probe during driver unload

2015-03-11 Thread Bruce Richardson
On Thu, Mar 05, 2015 at 06:24:23PM +0200, Raz Amir wrote:
> Added code that saves the pointers to the detached devices, during
> driver loading, and during driver unloading, go over the list,
> and re-attach them by calling device_probe_and_attach
> on each device.
> 
> Signed-off-by: Raz Amir 
Acked-by: Bruce Richardson 

> ---
>  lib/librte_eal/bsdapp/nic_uio/nic_uio.c | 34 
> -
>  1 file changed, 29 insertions(+), 5 deletions(-)
> 
> diff --git a/lib/librte_eal/bsdapp/nic_uio/nic_uio.c 
> b/lib/librte_eal/bsdapp/nic_uio/nic_uio.c
> index 5ae8560..7a4ed5d 100644
> --- a/lib/librte_eal/bsdapp/nic_uio/nic_uio.c
> +++ b/lib/librte_eal/bsdapp/nic_uio/nic_uio.c
> @@ -55,6 +55,9 @@ __FBSDID("$FreeBSD$");
>  
>  #define MAX_BARS (PCIR_MAX_BAR_0 + 1)
>  
> +#define MAX_DETACHED_DEVICES 128
> +static device_t detached_devices[MAX_DETACHED_DEVICES] = {};
> +static int num_detached = 0;
>  
>  struct nic_uio_softc {
>   device_tdev_t;
> @@ -288,17 +291,38 @@ nic_uio_load(void)
>   function = strtol(token, NULL, 10);
>  
>   dev = pci_find_bsf(bus, device, function);
> - if (dev != NULL)
> - for (i = 0; i < NUM_DEVICES; i++)
> - if (pci_get_vendor(dev) == devices[i].vend &&
> - pci_get_device(dev) == 
> devices[i].dev)
> - device_detach(dev);
> + if (dev == NULL)
> + continue;
> + 
> + for (i = 0; i < NUM_DEVICES; i++)
> + if (pci_get_vendor(dev) == devices[i].vend &&
> + pci_get_device(dev) == devices[i].dev) {
> + if (num_detached < 
> MAX_DETACHED_DEVICES) {
> + printf("nic_uio_load: 
> detaching and storing dev=%p\n", dev);
> + 
> detached_devices[num_detached++] = dev;
> + }
> + else
> + printf("nic_uio_load: 
> reached MAX_DETACHED_DEVICES=%d. dev=%p won't be reattached\n",
> + 
> MAX_DETACHED_DEVICES, dev);
> + device_detach(dev);
> + }
>   }
>  }
>  
>  static void
>  nic_uio_unload(void)
>  {
> + int i;
> + printf("nic_uio_unload: entered ... \n");
> +
> + for (i = 0; i < num_detached; i++) {
> + printf("nic_uio_unload: calling to device_probe_and_attach for 
> dev=%p...\n",
> + detached_devices[i]);
> + device_probe_and_attach(detached_devices[i]);
> + printf("nic_uio_unload: done.\n");
> + }
> +
> + printf("nic_uio_unload: leaving ... \n");
>  }
>  
>  static int
> -- 
> 2.1.2
> 


[dpdk-dev] [PATCH] app/test-pmd: fix rte_pci_tailq not initialized before used

2015-03-11 Thread David Marchand
Hello Marvin,

I think this fix will break ivshmem init.
pci_init was moved when introducing ivshmem_init.

If you have a setup for this, can you check ivshmem init with your fix ?

Thanks.

-- 
David Marchand

On Wed, Mar 11, 2015 at 9:43 AM, Yong Liu  wrote:

> Function rte_eal_pci_init will cast pci resource list and used for insert
> probed device later. But all tailq initialized in function
> rte_eal_tailqs_init, so rte_eal_pci_init must be called after it.
>
> Signed-off-by: Marvin Liu 
>
> diff --git a/lib/librte_eal/linuxapp/eal/eal.c
> b/lib/librte_eal/linuxapp/eal/eal.c
> index bd770cf..576f9f8 100644
> --- a/lib/librte_eal/linuxapp/eal/eal.c
> +++ b/lib/librte_eal/linuxapp/eal/eal.c
> @@ -755,9 +755,6 @@ rte_eal_init(int argc, char **argv)
>
> rte_config_init();
>
> -   if (rte_eal_pci_init() < 0)
> -   rte_panic("Cannot init PCI\n");
> -
>  #ifdef RTE_LIBRTE_IVSHMEM
> if (rte_eal_ivshmem_init() < 0)
> rte_panic("Cannot init IVSHMEM\n");
> @@ -792,6 +789,9 @@ rte_eal_init(int argc, char **argv)
> if (rte_eal_timer_init() < 0)
> rte_panic("Cannot init HPET or TSC timers\n");
>
> +   if (rte_eal_pci_init() < 0)
> +   rte_panic("Cannot init PCI\n");
> +
> eal_check_mem_on_local_socket();
>
> rte_eal_mcfg_complete();
> --
> 1.9.3
>
>


[dpdk-dev] [PATCH 00/10] eal: rte_tailq api cleanup

2015-03-11 Thread David Marchand
Hello Tetsuya,

On Wed, Mar 11, 2015 at 8:44 AM, Tetsuya Mukawa  wrote:

>
> $ T=x86_64-native-linuxapp-gcc make install
> $ sudo ./tools/dpdk_nic_bind.py -b igb_uio 
> $ sudo ./x86_64-native-linuxapp-gcc/app/testpmd -c f -n 1 -- -i
> EAL: Detected lcore 0 as core 0 on socket 0
>
> (snip)
>
> EAL: PCI device :84:00.0 on NUMA socket 1
> EAL:   probe driver: 8086:1521 rte_igb_pmd
> EAL:   PCI memory mapped at 0x7fffc000
> EAL:   PCI memory mapped at 0x7fffc010
> $
>
> As a result of bisecting, it seems one of following commits may cause
> the issue.
>
> 95b6a46 tailq: remove static slots
> a234816 tailq: move to dynamic tailq
>

Hum, ok, there is something wrong with my commit...
It can't work, because pci_init is called before tailqs_init.
Weird, I really should have seen this before.

Will send a fix.

-- 
David Marchand


[dpdk-dev] [PATCH v7] af_packet: Fix some klocwork errors

2015-03-11 Thread Ouyang Changchun
Fix possible memory leak issue: free kvlist before return;
Fix possible resource lost issue: close qssockfd before return;

Signed-off-by: Changchun Ouyang 
---
Change in v7:
  - Remove unnecessary '!= NULL' check before freeing it; 

Change in v6:
  - Refine exit point;

Change in v5:
  - Initialize qsockfd with -1;

Change in v4:
  - Check sockfd in internals->rx_queue against 0;

Change in v3:
  - Also close sockets for all queues;

Change in v2:
  - Make the error exit point a common path.

 lib/librte_pmd_af_packet/rte_eth_af_packet.c | 25 -
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/lib/librte_pmd_af_packet/rte_eth_af_packet.c 
b/lib/librte_pmd_af_packet/rte_eth_af_packet.c
index 80e9bdf..2ac50ba 100644
--- a/lib/librte_pmd_af_packet/rte_eth_af_packet.c
+++ b/lib/librte_pmd_af_packet/rte_eth_af_packet.c
@@ -442,7 +442,8 @@ rte_pmd_init_internals(const char *name,
struct tpacket_req *req;
struct pkt_rx_queue *rx_queue;
struct pkt_tx_queue *tx_queue;
-   int rc, qsockfd, tpver, discard;
+   int rc, tpver, discard;
+   int qsockfd = -1;
unsigned int i, q, rdsize;
int fanout_arg __rte_unused, bypass __rte_unused;

@@ -691,9 +692,14 @@ error:
rte_free((*internals)->rx_queue[q].rd);
if ((*internals)->tx_queue[q].rd)
rte_free((*internals)->tx_queue[q].rd);
+   if (((*internals)->rx_queue[q].sockfd != 0) &&
+   ((*internals)->rx_queue[q].sockfd != qsockfd))
+   close((*internals)->rx_queue[q].sockfd);
}
rte_free(*internals);
}
+   if (qsockfd != -1)
+   close(qsockfd);
return -1;
 }

@@ -802,7 +808,7 @@ int
 rte_pmd_af_packet_devinit(const char *name, const char *params)
 {
unsigned numa_node;
-   int ret;
+   int ret = 0;
struct rte_kvargs *kvlist;
int sockfd = -1;

@@ -811,8 +817,10 @@ rte_pmd_af_packet_devinit(const char *name, const char 
*params)
numa_node = rte_socket_id();

kvlist = rte_kvargs_parse(params, valid_arguments);
-   if (kvlist == NULL)
-   return -1;
+   if (kvlist == NULL) {
+   ret = -1;
+   goto exit;
+   }

/*
 * If iface argument is passed we open the NICs and use them for
@@ -823,16 +831,15 @@ rte_pmd_af_packet_devinit(const char *name, const char 
*params)
ret = rte_kvargs_process(kvlist, ETH_AF_PACKET_IFACE_ARG,
 _packet_iface, );
if (ret < 0)
-   return -1;
+   goto exit;
}

ret = rte_eth_from_packet(name, , numa_node, kvlist);
close(sockfd); /* no longer needed */

-   if (ret < 0)
-   return -1;
-
-   return 0;
+exit:
+   rte_kvargs_free(kvlist);
+   return ret;
 }

 static struct rte_driver pmd_af_packet_drv = {
-- 
1.8.4.2



[dpdk-dev] [PATCH v6 0/6] enicpmd: Cisco Systems Inc. VIC Ethernet PMD

2015-03-11 Thread Sujith Sankar (ssujith)


On 27/02/15 4:16 pm, "Thomas Monjalon"  wrote:

>2015-02-27 08:09, Sujith Sankar:
>> Hi Thomas,
>> 
>> No update on it from my side :-(
>> It would take some more time for me to start working on it (and flow
>> director api) as a few other things are keeping me busy.
>
>It's unfortunate.
>We now have a PMD without documentation and blocking the removal of the
>old flow director API.
>Is there someone else at Cisco able to work on it?
>I think the first priority should be on the flow director API as it has a
>wider impact.

Sure Thomas.  I shall pick it up as soon as possible.

Thanks.

>
>Thanks



[dpdk-dev] rte_memcpy.h: additional cflags required with OVS

2015-03-11 Thread Mcnamara, John
> -Original Message-
> From: Wang, Zhihong
> Sent: Wednesday, March 11, 2015 4:38 AM
> To: Kavanagh, Mark B; Mcnamara, John; Qiu, Michael; dev at dpdk.org; Panu
> Matilainen
> Subject: RE: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
> 
> 
> Add the "-mssse3" flag should be able to solve the 'implicit definition of
> function' error.
> BTW, current dpdk should compile with gcc 4.7.2, anything changed there
> that makes this flag mandatory?

H John,

DPDK does compile with gcc 4.7.2. The issue here is compiling OVS against DPDK 
HEAD. Passing -msse N to the OVS configure does fix the issue. 

John



[dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check

2015-03-11 Thread Thomas Monjalon
2015-03-11 15:23, Yong Liu:
> testpmd parameter "nb-port" mean the number of forwarding port.
> It's incorrect to use function port_id_is_invalid to check number of ports.
> 
> Signed-off-by: Marvin Liu 

Acked-by: Thomas Monjalon 

Fixes: edab33b1c01d ("app/testpmd: support port hotplug")

Applied, thanks


[dpdk-dev] rte_kni and support of jumbo frames

2015-03-11 Thread Dey, Souvik
Hi,
Does the rte_kni kernel module support multi-segment mbufs ? If 
not is there any plan to do so ? Also I see that the pmds are supporting jumbo 
frames but if kni does not support multi-segment mbufs then how the jumbo 
frames will be given up to the kernel ?

--
Regards,
Souvik


[dpdk-dev] rte_memcpy.h: additional cflags required with OVS

2015-03-11 Thread Wang, Zhihong

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Kavanagh, Mark B  
> Sent: Tuesday, March 10, 2015 6:04 PM
> To: Mcnamara, John; Qiu, Michael; dev at dpdk.org; Panu Matilainen
> Subject: Re: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
> 
> 
> 
> >-Original Message-
> >From: Mcnamara, John
> >Sent: Tuesday, March 10, 2015 8:27 AM
> >To: Qiu, Michael; Kavanagh, Mark B; dev at dpdk.org; Panu Matilainen
> >Subject: RE: [dpdk-dev] rte_memcpy.h: additional cflags required with
> >OVS
> >
> >> -Original Message-
> >> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Qiu, Michael
> >> Sent: Tuesday, March 10, 2015 3:05 AM
> >> To: Kavanagh, Mark B; dev at dpdk.org
> >> Subject: Re: [dpdk-dev] rte_memcpy.h: additional cflags required with
> >> OVS
> >>
> >
> >> What's your gcc version? this should be an issue with old version
> >> gcc, and I'm working on this to solve this issue now.
> >
> >
> >Hi Michael,
> >
> >I see the issue with gcc 4.7.2 but not with 4.9.2.
> 
> I'm using gcc v4.8.3.
> 
> Just to clarify my initial post, there are two issues related to gcc intrinsic
> headers emmintrin.h, and tmmintrin.h:
>   - in former, a difference in parameter types for _mm_storeu_si128 is
> the issue. This is the primary issue observed.
>   - in tmmintrin.h, when __OPTIMIZE__ is not defined, function
> _mm_alignr_epi8 is also not defined, leading to an 'implicit definition of
> function' error.

Add the "-mssse3" flag should be able to solve the 'implicit definition of 
function' error.
BTW, current dpdk should compile with gcc 4.7.2, anything changed there that 
makes this flag mandatory?

Zhihong (John)

> I've only noticed this intermittently (even though I compile OVS with
> -O2 CFLAGS)
> 
> >
> >John


[dpdk-dev] [PATCH v6] af_packet: Fix some klocwork errors

2015-03-11 Thread Ouyang, Changchun

> -Original Message-
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Tuesday, March 10, 2015 6:20 PM
> To: Ouyang, Changchun
> Cc: dev at dpdk.org; Wodkowski, PawelX
> Subject: Re: [dpdk-dev] [PATCH v6] af_packet: Fix some klocwork errors
> 
> 2015-03-10 08:49, Ouyang, Changchun:
> > From: Wodkowski, PawelX
> > > > +   if (kvlist != NULL)
> > >
> > > No need for if(). This part was fine previous patch.
> > >
> >
> > If kvlist is NULL, no reason to call rte_kvargs_free to free it.
> > So, adding this test is better.
> 
> No, we don't need to double check.
> 1/ it's already checked in rte_kvargs_free() 2/ less lines you write, better 
> it is
> 

At least 2 guys vote for removing the check, then 2 vs. 1, you win :-)
Will update it in v7

Thanks for comments!
Changchun



[dpdk-dev] [PATCH v3 07/10] vmxnet3: support jumbo frames

2015-03-11 Thread Yong Wang
On 3/10/15, 11:35 AM, "Stephen Hemminger" 
wrote:

>On Mon, 9 Mar 2015 23:32:48 +
>Yong Wang  wrote:
>
>> >
>> >I didn?t see where mtu is used to calculate how many rx descriptors
>>will
>> >be needed for each packet.  Furthermore, as pointed out by the
>>following
>> >code comments, the device requires the first rx buffer of a packet be
>>of
>> >type VMXNET3_RXD_BTYPE_HEAD with the remaining buffers of type
>> >VMXNET3_RXD_BTYPE_NODY.  This needs to be taken care of when
>>populating rx
>> >rings in vmxnet3_post_rx_bufs(). Currently we don?t do this because no
>> >scatter-rx is supported and only one descriptor is needed for a packet
>> >(thus all types should be HEAD). Otherwise, the device will complain
>>with  
>> 
>> To clarify, in this case only the 1st ring will be used and thus all
>>types
>> will be HEAD.
>> 
>> >error returned.  For the 2nd rx ring, type needs to be BODY for all
>> >descriptors still.
>
>Looking in more detail, the code as submitted looks fine:
>
>* The # of rx descriptors needed for each packet is responsibility of
>  the application. Before and after this patch the # of Rx descriptors
>  for each ring (head/body) is determined by vmxnet3_rx_queue_setup.
>  And the driver always allocates the same number of descriptors
>  for both Rx rings.

Where is vmxnet3_rx_queue_setup? It?s not in the current code base nor in
your patch and I failed to see how rx descriptors are populated.

Could you explain what do you mean by responsibility of the application?
If mtu is set to 9000, the driver needs to make sure rx buf per packet is
set to the correct size with proper type set, right?

>
>  One could argue that was a bug in the original driver, since it
>needlessly
>  allocated mbufs for the second ring and never used them. I suppose
>  as a optimization in future, the second ring could be sized as 0
>  and no buffers allocated unless doing rx-scatter (this is what the
>  Linux driver does. But that change is independent of this.

We can just keep it as is as we will need it if someone decides to support
LRO for vmxnet3.

>
>* Buffers are correctly reallocated as needed when consumed.
>
>* The code works for bulk transfer and performance tests in jumbo mode.

You mean the standalone patch you posted without the
vmxnet3_rx_queue_setup you mentioned?

>
>I see no requirement to change this patch.
>  



[dpdk-dev] [PATCH v3 07/10] vmxnet3: support jumbo frames

2015-03-11 Thread Stephen Hemminger
On Wed, 11 Mar 2015 01:03:37 +
Yong Wang  wrote:

> >Looking in more detail, the code as submitted looks fine:
> >
> >* The # of rx descriptors needed for each packet is responsibility of
> >  the application. Before and after this patch the # of Rx descriptors
> >  for each ring (head/body) is determined by vmxnet3_rx_queue_setup.
> >  And the driver always allocates the same number of descriptors
> >  for both Rx rings.  
> 
> Where is vmxnet3_rx_queue_setup? It?s not in the current code base nor in
> your patch and I failed to see how rx descriptors are populated.



> Could you explain what do you mean by responsibility of the application?
> If mtu is set to 9000, the driver needs to make sure rx buf per packet is
> set to the correct size with proper type set, right?

vmxnet3_dev_rx_queue_setup is unchanged from original Intel code.

But you are right there is a bug there since it will error out
if max_rx_pkt_len > bufsize.  That error check should have been removed.
That was an oversight from the merge of our code with the DPDK/Intel
code. Just removing the check and surrounding code is all that is necessary.

After that driver will receive scattered mbufs.

None of the DPDK drivers do a good job of checking all the possible
misconfiguration of rxmode, jumbo and scattered flags. There is room
for improvement in all drivers around that.


> >  One could argue that was a bug in the original driver, since it
> >needlessly
> >  allocated mbufs for the second ring and never used them. I suppose
> >  as a optimization in future, the second ring could be sized as 0
> >  and no buffers allocated unless doing rx-scatter (this is what the
> >  Linux driver does. But that change is independent of this.  
> 
> We can just keep it as is as we will need it if someone decides to support
> LRO for vmxnet3.

But LRO must be optional since LRO is broken for the case of forwarding.
Linux driver handles the case of only allocating second ring if necessary.
Although the Linux vmxnet3 driver was broken about LRO setting for
several years, it is fixed now.


> >
> >* Buffers are correctly reallocated as needed when consumed.
> >
> >* The code works for bulk transfer and performance tests in jumbo mode.  
> 
> You mean the standalone patch you posted without the
> vmxnet3_rx_queue_setup you mentioned?

The code in recv that calls vmxnet3_post_rx_bufs works for both rings
already. It was just until the scattered logic was engaged the second
ring was never used.



[dpdk-dev] [PATCH v6 3/3] ixgbe: Add LRO support

2015-03-11 Thread Vlad Zolotarov


On 03/10/15 22:09, Ananyev, Konstantin wrote:
>>> Hi Vlad,
>>>
 -Original Message-
 From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Vlad Zolotarov
 Sent: Monday, March 09, 2015 7:07 PM
 To: dev at dpdk.org
 Subject: [dpdk-dev] [PATCH v6 3/3] ixgbe: Add LRO support

   - Only x540 and 82599 devices support LRO.
   - Add the appropriate HW configuration.
   - Add RSC aware rx_pkt_burst() handlers:
  - Implemented bulk allocation and non-bulk allocation versions.
  - Add LRO-specific fields to rte_eth_rxmode, to rte_eth_dev_data
and to igb_rx_queue.
  - Use the appropriate handler when LRO is requested.

 Signed-off-by: Vlad Zolotarov 
 ---
 New in v5:
  - Put the RTE_ETHDEV_HAS_LRO_SUPPORT definition at the beginning of 
 rte_ethdev.h.
  - Removed the "TODO: Remove me" comment near 
 RTE_ETHDEV_HAS_LRO_SUPPORT.

 New in v4:
  - Define RTE_ETHDEV_HAS_LRO_SUPPORT in rte_ethdev.h instead of
RTE_ETHDEV_LRO_SUPPORT defined in config/common_linuxapp.

 New in v2:
  - Removed rte_eth_dev_data.lro_bulk_alloc.
  - Fixed a few styling and spelling issues.
 ---
lib/librte_ether/rte_ethdev.h   |   9 +-
lib/librte_pmd_ixgbe/ixgbe_ethdev.c |   6 +
lib/librte_pmd_ixgbe/ixgbe_ethdev.h |   5 +
lib/librte_pmd_ixgbe/ixgbe_rxtx.c   | 562 
 +++-
lib/librte_pmd_ixgbe/ixgbe_rxtx.h   |   6 +
5 files changed, 581 insertions(+), 7 deletions(-)

 diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
 index 8db3127..44f081f 100644
 --- a/lib/librte_ether/rte_ethdev.h
 +++ b/lib/librte_ether/rte_ethdev.h
 @@ -172,6 +172,9 @@ extern "C" {

#include 

 +/* Use this macro to check if LRO API is supported */
 +#define RTE_ETHDEV_HAS_LRO_SUPPORT
 +
#include 
#include 
#include 
 @@ -320,14 +323,15 @@ struct rte_eth_rxmode {
enum rte_eth_rx_mq_mode mq_mode;
uint32_t max_rx_pkt_len;  /**< Only used if jumbo_frame 
 enabled. */
uint16_t split_hdr_size;  /**< hdr buf size (header_split 
 enabled).*/
 -  uint8_t header_split : 1, /**< Header Split enable. */
 +  uint16_t header_split : 1, /**< Header Split enable. */
hw_ip_checksum   : 1, /**< IP/UDP/TCP checksum offload 
 enable. */
hw_vlan_filter   : 1, /**< VLAN filter enable. */
hw_vlan_strip: 1, /**< VLAN strip enable. */
hw_vlan_extend   : 1, /**< Extended VLAN enable. */
jumbo_frame  : 1, /**< Jumbo Frame Receipt enable. 
 */
hw_strip_crc : 1, /**< Enable CRC stripping by 
 hardware. */
 -  enable_scatter   : 1; /**< Enable scatter packets rx handler */
 +  enable_scatter   : 1, /**< Enable scatter packets rx handler */
 +  enable_lro   : 1; /**< Enable LRO */
};

/**
 @@ -1515,6 +1519,7 @@ struct rte_eth_dev_data {
uint8_t port_id;   /**< Device [external] port 
 identifier. */
uint8_t promiscuous   : 1, /**< RX promiscuous mode ON(1) / 
 OFF(0). */
scattered_rx : 1,  /**< RX of scattered packets is 
 ON(1) / OFF(0) */
 +  lro  : 1,  /**< RX LRO is ON(1) / OFF(0) */
all_multicast : 1, /**< RX all multicast mode ON(1) / 
 OFF(0). */
dev_started : 1;   /**< Device state: STARTED(1) / 
 STOPPED(0). */
};
 diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c 
 b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
 index 9d3de1a..765174d 100644
 --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
 +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
 @@ -1648,6 +1648,7 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)

/* Clear stored conf */
dev->data->scattered_rx = 0;
 +  dev->data->lro = 0;
hw->rx_bulk_alloc_allowed = false;
hw->rx_vec_allowed = false;

 @@ -2018,6 +2019,11 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct 
 rte_eth_dev_info *dev_info)
DEV_RX_OFFLOAD_IPV4_CKSUM |
DEV_RX_OFFLOAD_UDP_CKSUM  |
DEV_RX_OFFLOAD_TCP_CKSUM;
 +
 +  if (hw->mac.type == ixgbe_mac_82599EB ||
 +  hw->mac.type == ixgbe_mac_X540)
 +  dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_TCP_LRO;
 +
dev_info->tx_offload_capa =
DEV_TX_OFFLOAD_VLAN_INSERT |
DEV_TX_OFFLOAD_IPV4_CKSUM  |
 diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.h