[dpdk-dev] [PATCH 0/3] null driver improvements for testability

2016-02-23 Thread Paul Atkins


On 23/02/16 15:21, Bruce Richardson wrote:
> On Thu, Feb 18, 2016 at 12:19:58PM +0000, Paul Atkins wrote:
>>
>> On 17/02/16 17:23, Bruce Richardson wrote:
>>> On Fri, Jan 29, 2016 at 04:47:58PM +, Paul Atkins wrote:
>>>> Hi Thomas,
>>>>
>>>> On 29/01/16 16:31, Thomas Monjalon wrote:
>>>>> Hi Paul,
>>>>>
>>>>> 2016-01-29 16:18, Paul Atkins:
>>>>>> This patchset adds functionality to the null driver help when testing
>>>>>> a dataplane that uses dpdk.  The idea is that the the dataplane can
>>>>>> have multiple null interfaces attached, and each of theses can be
>>>>>> assigned a mac address. Packets can then be injected into the null
>>>>>> drivers by adding them to a ring, giving the application complete
>>>>>> control of the packets that arrive.  Packets that are sent by a null
>>>>>> driver can be stored on a ring, where the application can pick them up
>>>>>> and verify it is what was expected.  To allow the application to know
>>>>>> when packets have been pulled of the rx ring, counters of the number of
>>>>>> times an rx poll has been made are kept, and these can be retrieved via
>>>>>> the existing APIs.
>>>>> I have not read your code, just read this description.
>>>>> It sounds like being a ring PMD. Have you already checked it?
>>>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__dpdk.org_browse_dpdk_tree_drivers_net_ring_rte-5Feth-5Fring.c&d=CwICAg&c=IL_XqQWOjubgfqINi2jTzg&r=45ezphVDEm8OnEpH-fLWdXvR3RneLhhNZRDLQRgR6LY&m=wJLO24XFe_B0nZve6mkvocCt7fQWo3PULCTWxrC8rZk&s=bIWycJrY-PYgzkQsBeRfkl8JCHFcxRAHhHDrqRSzHYs&e=
>>>> I hadn't seen the ring PMD. I will have a look at it and see if I can make
>>>> it do what i need.
>>>>
>>>> thanks,
>>>> Paul
>>> Hi Paul,
>>>
>>> any update on this. Your patches are still showing as pending in patchwork, 
>>> but
>>> if ring pmd is more what need, we can set these patches aside as unneeded, 
>>> and
>>> remove them from the patchwork merge backlog.
>> Hi Bruce,
>>
>> Sorry for the delay.  The patchset adds 3 things: assigning a mac addr to
>> the null pmd, adding the rings to the null pmd and adding xstats for how
>> many times the null pmd has been polled.  I could move to using the ring
>> pmd, but I would still need the other 2 parts (mac addr and stats).  It
>> seems like the ring pmd shouldn't really have these two extra things added,
>> but i could do that if it that is preferred over what is in the current
>> patchset.
>>
> Adding a mac address to be reported by the ring PMD should not be a problem.
> Having a stat that tracks polls might be depending on how it is done - if it
> uses an atomic, as in this patchset, it would problematic as it would add a
> severe performance hit for the SP/SC ring case. However, you could get around
> that by copying what is already done in the PMD for tracking packet counts.
>
> Overall, though, it seems that it might be worthwhile doing the work to extend
> the ring pmd rather than turning the null pmd into a second ring one.

Ok, I will make those changes and resubmit - you can mark the current 
patches as unneeded.

thanks,
Paul

>
> Regards,
> /Bruce



[dpdk-dev] [PATCH 0/3] null driver improvements for testability

2016-01-29 Thread Paul Atkins
This patchset adds functionality to the null driver help when testing
a dataplane that uses dpdk.  The idea is that the the dataplane can
have multiple null interfaces attached, and each of theses can be
assigned a mac address. Packets can then be injected into the null
drivers by adding them to a ring, giving the application complete
control of the packets that arrive.  Packets that are sent by a null
driver can be stored on a ring, where the application can pick them up
and verify it is what was expected.  To allow the application to know
when packets have been pulled of the rx ring, counters of the number of
times an rx poll has been made are kept, and these can be retrieved via
the existing APIs.

All of these enhancements are using the existing APIs, and do not
modify the existing behaviour of the null driver if these features
are not configured.


Paul Atkins (3):
  null: add a new arg to allow users to specify ether address
  null: add rings to allow user to provide the mbufs for rx/tx
  null: add xstats to provide the number of rx polls

 drivers/net/null/rte_eth_null.c |  214 +--
 1 file changed, 203 insertions(+), 11 deletions(-)

-- 
1.7.10.4



[dpdk-dev] [PATCH 1/3] null: add a new arg to allow users to specify ether address

2016-01-29 Thread Paul Atkins
Add a new argument to the null driver to allow the user to
specify the ether address to be used instead of the default
which is all zeroes. This also allows the user to specify
an address per device instead of them all using the same
default one.

Signed-off-by: Paul Atkins 
---
 drivers/net/null/rte_eth_null.c |   59 +++
 1 file changed, 48 insertions(+), 11 deletions(-)

diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 77fc988..9483d6a 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -41,15 +41,21 @@

 #include "rte_eth_null.h"

+#include 
+#include 
+
 #define ETH_NULL_PACKET_SIZE_ARG   "size"
 #define ETH_NULL_PACKET_COPY_ARG   "copy"
+#define ETH_NULL_ETH_ADDR_ARG  "eth_addr"

 static unsigned default_packet_size = 64;
 static unsigned default_packet_copy;
+static struct ether_addr default_eth_addr = { .addr_bytes = {0} };

 static const char *valid_arguments[] = {
ETH_NULL_PACKET_SIZE_ARG,
ETH_NULL_PACKET_COPY_ARG,
+   ETH_NULL_ETH_ADDR_ARG,
NULL
 };

@@ -69,6 +75,7 @@ struct null_queue {
 struct pmd_internals {
unsigned packet_size;
unsigned packet_copy;
+   struct ether_addr eth_addr;
unsigned numa_node;

unsigned nb_rx_queues;
@@ -89,8 +96,6 @@ struct pmd_internals {
uint8_t rss_key[40];/**< 40-byte hash key. */
 };

-
-static struct ether_addr eth_addr = { .addr_bytes = {0} };
 static const char *drivername = "Null PMD";
 static struct rte_eth_link pmd_link = {
.link_speed = 1,
@@ -485,11 +490,12 @@ static const struct eth_dev_ops ops = {
.rss_hash_conf_get = eth_rss_hash_conf_get
 };

-int
-eth_dev_null_create(const char *name,
-   const unsigned numa_node,
-   unsigned packet_size,
-   unsigned packet_copy)
+static int
+eth_dev_null_create_internal(const char *name,
+const unsigned numa_node,
+unsigned packet_size,
+unsigned packet_copy,
+struct ether_addr eth_addr)
 {
const unsigned nb_rx_queues = 1;
const unsigned nb_tx_queues = 1;
@@ -539,6 +545,7 @@ eth_dev_null_create(const char *name,
internals->nb_tx_queues = nb_tx_queues;
internals->packet_size = packet_size;
internals->packet_copy = packet_copy;
+   internals->eth_addr = eth_addr;
internals->numa_node = numa_node;

internals->flow_type_rss_offloads =  ETH_RSS_PROTO_MASK;
@@ -551,7 +558,7 @@ eth_dev_null_create(const char *name,
data->nb_rx_queues = (uint16_t)nb_rx_queues;
data->nb_tx_queues = (uint16_t)nb_tx_queues;
data->dev_link = pmd_link;
-   data->mac_addrs = ð_addr;
+   data->mac_addrs = &internals->eth_addr;
strncpy(data->name, eth_dev->data->name, strlen(eth_dev->data->name));

eth_dev->data = data;
@@ -583,6 +590,16 @@ error:
return -1;
 }

+int
+eth_dev_null_create(const char *name,
+   const unsigned numa_node,
+   unsigned packet_size,
+   unsigned packet_copy)
+{
+   return eth_dev_null_create_internal(name, numa_node, packet_size,
+   packet_copy, default_eth_addr);
+}
+
 static inline int
 get_packet_size_arg(const char *key __rte_unused,
const char *value, void *extra_args)
@@ -617,12 +634,24 @@ get_packet_copy_arg(const char *key __rte_unused,
return 0;
 }

+static inline int
+get_eth_addr_arg(const char *key __rte_unused,
+const char *value, void *extra_args)
+{
+   if (value == NULL || extra_args == NULL)
+   return -EINVAL;
+
+   return cmdline_parse_etheraddr(NULL, value, extra_args,
+  sizeof(struct ether_addr));
+}
+
 static int
 rte_pmd_null_devinit(const char *name, const char *params)
 {
unsigned numa_node;
unsigned packet_size = default_packet_size;
unsigned packet_copy = default_packet_copy;
+   struct ether_addr eth_addr = default_eth_addr;
struct rte_kvargs *kvlist = NULL;
int ret;

@@ -639,7 +668,6 @@ rte_pmd_null_devinit(const char *name, const char *params)
return -1;

if (rte_kvargs_count(kvlist, ETH_NULL_PACKET_SIZE_ARG) == 1) {
-
ret = rte_kvargs_process(kvlist,
ETH_NULL_PACKET_SIZE_ARG,
&get_packet_size_arg, &packet_size);
@@ -648,20 +676,29 @@ rte_pmd_null_devinit(const char *name, const char *params)
}

if (rte_kvargs_count(kvlist, ETH_NULL_PACKET_COPY_ARG) == 1) {
-
  

[dpdk-dev] [PATCH 2/3] null: add rings to allow user to provide the mbufs for rx/tx

2016-01-29 Thread Paul Atkins
When using the null driver it is useful to be able to
provide a set of mbufs to be received on the interface.
Add an option to specify a ring that the driver can poll to
provide the set of packets that have been received.  Add a
similar ring for the tx side where the packets that are being
transmitted can be stored, so the user can see what was sent.

Signed-off-by: Paul Atkins 
---
 drivers/net/null/rte_eth_null.c |   91 +--
 1 file changed, 88 insertions(+), 3 deletions(-)

diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 9483d6a..176f477 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -47,6 +47,8 @@
 #define ETH_NULL_PACKET_SIZE_ARG   "size"
 #define ETH_NULL_PACKET_COPY_ARG   "copy"
 #define ETH_NULL_ETH_ADDR_ARG  "eth_addr"
+#define ETH_NULL_RX_RING   "rx_ring"
+#define ETH_NULL_TX_RING   "tx_ring"

 static unsigned default_packet_size = 64;
 static unsigned default_packet_copy;
@@ -56,6 +58,8 @@ static const char *valid_arguments[] = {
ETH_NULL_PACKET_SIZE_ARG,
ETH_NULL_PACKET_COPY_ARG,
ETH_NULL_ETH_ADDR_ARG,
+   ETH_NULL_RX_RING,
+   ETH_NULL_TX_RING,
NULL
 };

@@ -76,6 +80,8 @@ struct pmd_internals {
unsigned packet_size;
unsigned packet_copy;
struct ether_addr eth_addr;
+   struct rte_ring *rx_ring;
+   struct rte_ring *tx_ring;
unsigned numa_node;

unsigned nb_rx_queues;
@@ -158,6 +164,22 @@ eth_null_copy_rx(void *q, struct rte_mbuf **bufs, uint16_t 
nb_bufs)
 }

 static uint16_t
+eth_null_copy_rx_from_ring(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
+{
+   int i;
+   struct null_queue *h = q;
+
+   if ((q == NULL) || (bufs == NULL) || (nb_bufs == 0))
+   return 0;
+
+   i = rte_ring_mc_dequeue_burst(h->internals->rx_ring, (void **)bufs,
+ nb_bufs);
+   rte_atomic64_add(&h->rx_pkts, 1);
+
+   return i;
+}
+
+static uint16_t
 eth_null_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 {
int i;
@@ -196,6 +218,23 @@ eth_null_copy_tx(void *q, struct rte_mbuf **bufs, uint16_t 
nb_bufs)
return i;
 }

+static uint16_t
+eth_null_copy_tx_to_ring(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
+{
+   int i;
+   struct null_queue *h = q;
+
+   if ((q == NULL) || (bufs == NULL) || (nb_bufs == 0))
+   return 0;
+
+   i = rte_ring_enqueue_burst(h->internals->tx_ring, (void **)bufs,
+  nb_bufs);
+
+   rte_atomic64_add(&h->tx_pkts, 1);
+
+   return i;
+}
+
 static int
 eth_dev_configure(struct rte_eth_dev *dev) {
struct pmd_internals *internals;
@@ -495,7 +534,11 @@ eth_dev_null_create_internal(const char *name,
 const unsigned numa_node,
 unsigned packet_size,
 unsigned packet_copy,
-struct ether_addr eth_addr)
+struct ether_addr eth_addr,
+struct rte_ring *rx_ring,
+struct rte_ring *tx_ring
+
+   )
 {
const unsigned nb_rx_queues = 1;
const unsigned nb_tx_queues = 1;
@@ -546,6 +589,8 @@ eth_dev_null_create_internal(const char *name,
internals->packet_size = packet_size;
internals->packet_copy = packet_copy;
internals->eth_addr = eth_addr;
+   internals->rx_ring = rx_ring;
+   internals->tx_ring = tx_ring;
internals->numa_node = numa_node;

internals->flow_type_rss_offloads =  ETH_RSS_PROTO_MASK;
@@ -580,6 +625,10 @@ eth_dev_null_create_internal(const char *name,
eth_dev->rx_pkt_burst = eth_null_rx;
eth_dev->tx_pkt_burst = eth_null_tx;
}
+   if (rx_ring)
+   eth_dev->rx_pkt_burst = eth_null_copy_rx_from_ring;
+   if (tx_ring)
+   eth_dev->tx_pkt_burst = eth_null_copy_tx_to_ring;

return 0;

@@ -597,7 +646,8 @@ eth_dev_null_create(const char *name,
unsigned packet_copy)
 {
return eth_dev_null_create_internal(name, numa_node, packet_size,
-   packet_copy, default_eth_addr);
+   packet_copy, default_eth_addr,
+   NULL, NULL);
 }

 static inline int
@@ -645,6 +695,23 @@ get_eth_addr_arg(const char *key __rte_unused,
   sizeof(struct ether_addr));
 }

+static inline int
+get_ring_arg(const char *key __rte_unused,
+const char *value, void *extra_args)
+{
+   const char *a = value;
+   struct rte_ring **ring = extra_args;
+
+   if ((value == NULL) || (extra_args == 

[dpdk-dev] [PATCH 3/3] null: add xstats to provide the number of rx polls

2016-01-29 Thread Paul Atkins
When using the null driver and passing in packets via
the rx ring, it is useful to know that the driver has
polled the ring. Add a count of rx polls to the xstats
to provide this information.

Signed-off-by: Paul Atkins 
---
 drivers/net/null/rte_eth_null.c |   70 +++
 1 file changed, 70 insertions(+)

diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 176f477..3feab44 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -65,6 +65,15 @@ static const char *valid_arguments[] = {

 struct pmd_internals;

+struct eth_null_xstats {
+   rte_atomic64_t rx_polls;
+   rte_atomic64_t tx_polls;
+};
+
+struct eth_null_hw_stats {
+   uint64_t rx_polls;
+};
+
 struct null_queue {
struct pmd_internals *internals;

@@ -74,6 +83,7 @@ struct null_queue {
rte_atomic64_t rx_pkts;
rte_atomic64_t tx_pkts;
rte_atomic64_t err_pkts;
+   struct eth_null_xstats xstats;
 };

 struct pmd_internals {
@@ -109,6 +119,19 @@ static struct rte_eth_link pmd_link = {
.link_status = 0
 };

+/* store statistics names and its offset in stats structure */
+struct eth_null_xstats_name_off {
+   char name[RTE_ETH_XSTATS_NAME_SIZE];
+   unsigned offset;
+};
+
+static const struct eth_null_xstats_name_off eth_null_stats_strings[] = {
+   {"rx_polls", offsetof(struct eth_null_xstats, rx_polls)},
+};
+
+#define ETH_NULL_NB_XSTATS_PER_Q (sizeof(eth_null_stats_strings) / \
+ sizeof(eth_null_stats_strings[0]))
+
 static uint16_t
 eth_null_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 {
@@ -175,6 +198,7 @@ eth_null_copy_rx_from_ring(void *q, struct rte_mbuf **bufs, 
uint16_t nb_bufs)
i = rte_ring_mc_dequeue_burst(h->internals->rx_ring, (void **)bufs,
  nb_bufs);
rte_atomic64_add(&h->rx_pkts, 1);
+   rte_atomic64_add(&h->xstats.rx_polls, 1);

return i;
 }
@@ -231,6 +255,7 @@ eth_null_copy_tx_to_ring(void *q, struct rte_mbuf **bufs, 
uint16_t nb_bufs)
   nb_bufs);

rte_atomic64_add(&h->tx_pkts, 1);
+   rte_atomic64_add(&h->tx_pkts, i);

return i;
 }
@@ -410,6 +435,49 @@ eth_stats_reset(struct rte_eth_dev *dev)
}
 }

+static int
+eth_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,
+  unsigned n)
+{
+   struct pmd_internals *internal;
+   unsigned count = ETH_NULL_NB_XSTATS_PER_Q * dev->data->nb_rx_queues;
+   unsigned q, i = 0;
+   uint64_t val, *stats_ptr;
+
+   if (n < count)
+   return count;
+
+   internal = dev->data->dev_private;
+
+   /* Extended stats */
+   count = 0;
+   for (q = 0; q < ETH_NULL_NB_XSTATS_PER_Q; q++) {
+   for (i = 0; i < dev->data->nb_rx_queues; i++) {
+   stats_ptr = RTE_PTR_ADD(
+   &internal->rx_null_queues[q].xstats,
+   eth_null_stats_strings[i].offset +
+   q * sizeof(uint64_t));
+   val = *stats_ptr;
+   snprintf(xstats[count].name, sizeof(xstats[count].name),
+"rx_queue_%u_%s", q,
+eth_null_stats_strings[count].name);
+   xstats[count++].value = val;
+   }
+   }
+   return count;
+}
+
+static void
+eth_xstats_reset(struct rte_eth_dev *dev)
+{
+   struct pmd_internals *internal;
+   unsigned i;
+
+   internal = dev->data->dev_private;
+   for (i = 0; i < dev->data->nb_rx_queues; i++)
+   internal->rx_null_queues[i].xstats.rx_polls.cnt = 0;
+}
+
 static void
 eth_queue_release(void *q)
 {
@@ -523,6 +591,8 @@ static const struct eth_dev_ops ops = {
.link_update = eth_link_update,
.stats_get = eth_stats_get,
.stats_reset = eth_stats_reset,
+   .xstats_get = eth_xstats_get,
+   .xstats_reset = eth_xstats_reset,
.reta_update = eth_rss_reta_update,
.reta_query = eth_rss_reta_query,
.rss_hash_update = eth_rss_hash_update,
-- 
1.7.10.4



[dpdk-dev] [PATCH 0/3] null driver improvements for testability

2016-01-29 Thread Paul Atkins
Hi Thomas,

On 29/01/16 16:31, Thomas Monjalon wrote:
> Hi Paul,
>
> 2016-01-29 16:18, Paul Atkins:
>> This patchset adds functionality to the null driver help when testing
>> a dataplane that uses dpdk.  The idea is that the the dataplane can
>> have multiple null interfaces attached, and each of theses can be
>> assigned a mac address. Packets can then be injected into the null
>> drivers by adding them to a ring, giving the application complete
>> control of the packets that arrive.  Packets that are sent by a null
>> driver can be stored on a ring, where the application can pick them up
>> and verify it is what was expected.  To allow the application to know
>> when packets have been pulled of the rx ring, counters of the number of
>> times an rx poll has been made are kept, and these can be retrieved via
>> the existing APIs.
> I have not read your code, just read this description.
> It sounds like being a ring PMD. Have you already checked it?
> https://urldefense.proofpoint.com/v2/url?u=http-3A__dpdk.org_browse_dpdk_tree_drivers_net_ring_rte-5Feth-5Fring.c&d=CwICAg&c=IL_XqQWOjubgfqINi2jTzg&r=45ezphVDEm8OnEpH-fLWdXvR3RneLhhNZRDLQRgR6LY&m=wJLO24XFe_B0nZve6mkvocCt7fQWo3PULCTWxrC8rZk&s=bIWycJrY-PYgzkQsBeRfkl8JCHFcxRAHhHDrqRSzHYs&e=

I hadn't seen the ring PMD. I will have a look at it and see if I can 
make it do what i need.

thanks,
Paul


[dpdk-dev] [PATCH] mem: allow mem size to be specified when no hugetblfs

2015-05-29 Thread Paul Atkins
The config option to turn off huge table support does not work with
the existing -m option to specify the amount of memory to use.  Add
a new option --no-huge-mem-size  that takes a paramater
to use as the heap size instead of the value specified by
MEMSIZE_IF_NO_HUGE_PAGE.

Signed-off-by: Paul Atkins 
---
 lib/librte_eal/common/eal_common_options.c |7 +++
 lib/librte_eal/common/eal_internal_cfg.h   |1 +
 lib/librte_eal/common/eal_options.h|2 ++
 lib/librte_eal/linuxapp/eal/eal.c  |6 +-
 4 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/eal_common_options.c 
b/lib/librte_eal/common/eal_common_options.c
index 8fcb1ab..8b1f9f0 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -79,6 +79,7 @@ eal_long_options[] = {
{OPT_MASTER_LCORE,  1, NULL, OPT_MASTER_LCORE_NUM },
{OPT_NO_HPET,   0, NULL, OPT_NO_HPET_NUM  },
{OPT_NO_HUGE,   0, NULL, OPT_NO_HUGE_NUM  },
+   {OPT_NO_HUGE_MEM_SIZE,  1, NULL, OPT_NO_HUGE_MEM_SIZE_NUM },
{OPT_NO_PCI,0, NULL, OPT_NO_PCI_NUM   },
{OPT_NO_SHCONF, 0, NULL, OPT_NO_SHCONF_NUM},
{OPT_PCI_BLACKLIST, 1, NULL, OPT_PCI_BLACKLIST_NUM},
@@ -722,6 +723,11 @@ eal_parse_common_option(int opt, const char *optarg,
conf->no_hugetlbfs = 1;
break;

+   case OPT_NO_HUGE_MEM_SIZE_NUM:
+   conf->no_hugetlbfs_mem_size = atoi(optarg);
+   conf->no_hugetlbfs_mem_size *= 1024ULL * 1024ULL;
+   break;
+
case OPT_NO_PCI_NUM:
conf->no_pci = 1;
break;
@@ -907,6 +913,7 @@ eal_common_usage(void)
   "  -h, --help  This help\n"
   "\nEAL options for DEBUG use only:\n"
   "  --"OPT_NO_HUGE"   Use malloc instead of hugetlbfs\n"
+  "  --"OPT_NO_HUGE_MEM_SIZE"  Heap size when no hugetblfs\n"
   "  --"OPT_NO_PCI"Disable PCI\n"
   "  --"OPT_NO_HPET"   Disable HPET\n"
   "  --"OPT_NO_SHCONF" No shared config (mmap'd files)\n"
diff --git a/lib/librte_eal/common/eal_internal_cfg.h 
b/lib/librte_eal/common/eal_internal_cfg.h
index e2ecb0d..f1a2a7d 100644
--- a/lib/librte_eal/common/eal_internal_cfg.h
+++ b/lib/librte_eal/common/eal_internal_cfg.h
@@ -64,6 +64,7 @@ struct internal_config {
volatile unsigned force_nchannel; /**< force number of channels */
volatile unsigned force_nrank;/**< force number of ranks */
volatile unsigned no_hugetlbfs;   /**< true to disable hugetlbfs */
+   volatile unsigned no_hugetlbfs_mem_size; /**< mem size without 
hugetlbfs  */
volatile unsigned xen_dom0_support; /**< support app running on Xen 
Dom0*/
volatile unsigned no_pci; /**< true to disable PCI */
volatile unsigned no_hpet;/**< true to disable HPET */
diff --git a/lib/librte_eal/common/eal_options.h 
b/lib/librte_eal/common/eal_options.h
index f6714d9..39a0b94 100644
--- a/lib/librte_eal/common/eal_options.h
+++ b/lib/librte_eal/common/eal_options.h
@@ -65,6 +65,8 @@ enum {
OPT_NO_HPET_NUM,
 #define OPT_NO_HUGE   "no-huge"
OPT_NO_HUGE_NUM,
+#define OPT_NO_HUGE_MEM_SIZE  "no-huge-mem-size"
+   OPT_NO_HUGE_MEM_SIZE_NUM,
 #define OPT_NO_PCI"no-pci"
OPT_NO_PCI_NUM,
 #define OPT_NO_SHCONF "no-shconf"
diff --git a/lib/librte_eal/linuxapp/eal/eal.c 
b/lib/librte_eal/linuxapp/eal/eal.c
index bd770cf..3528a0e 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -735,7 +735,11 @@ rte_eal_init(int argc, char **argv)

if (internal_config.memory == 0 && internal_config.force_sockets == 0) {
if (internal_config.no_hugetlbfs)
-   internal_config.memory = MEMSIZE_IF_NO_HUGE_PAGE;
+   if (internal_config.no_hugetlbfs_mem_size)
+   internal_config.memory =
+   internal_config.no_hugetlbfs_mem_size;
+   else
+   internal_config.memory = 
MEMSIZE_IF_NO_HUGE_PAGE;
else
internal_config.memory = eal_get_hugepage_mem_size();
}
-- 
1.7.10.4



[dpdk-dev] [PATCH] af_packet: advertise offload capabilities that code already supports

2019-11-13 Thread Paul Atkins
The af_packet pmd already supports MULTI_SEG tx packets, and tx
VLAN_INSERT so advertise these capabilities.

Signed-off-by: Paul Atkins 
---
 drivers/net/af_packet/rte_eth_af_packet.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/af_packet/rte_eth_af_packet.c 
b/drivers/net/af_packet/rte_eth_af_packet.c
index 5b71db707..f5806bf42 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -316,6 +316,8 @@ eth_dev_info(struct rte_eth_dev *dev, struct 
rte_eth_dev_info *dev_info)
dev_info->max_rx_queues = (uint16_t)internals->nb_queues;
dev_info->max_tx_queues = (uint16_t)internals->nb_queues;
dev_info->min_rx_bufsize = 0;
+   dev_info->tx_offload_capa = DEV_TX_OFFLOAD_MULTI_SEGS |
+   DEV_TX_OFFLOAD_VLAN_INSERT;
 
return 0;
 }
-- 
2.11.0



[dpdk-dev] [PATCH 0/3] null driver improvements for testability

2016-02-18 Thread Paul Atkins


On 17/02/16 17:23, Bruce Richardson wrote:
> On Fri, Jan 29, 2016 at 04:47:58PM +0000, Paul Atkins wrote:
>> Hi Thomas,
>>
>> On 29/01/16 16:31, Thomas Monjalon wrote:
>>> Hi Paul,
>>>
>>> 2016-01-29 16:18, Paul Atkins:
>>>> This patchset adds functionality to the null driver help when testing
>>>> a dataplane that uses dpdk.  The idea is that the the dataplane can
>>>> have multiple null interfaces attached, and each of theses can be
>>>> assigned a mac address. Packets can then be injected into the null
>>>> drivers by adding them to a ring, giving the application complete
>>>> control of the packets that arrive.  Packets that are sent by a null
>>>> driver can be stored on a ring, where the application can pick them up
>>>> and verify it is what was expected.  To allow the application to know
>>>> when packets have been pulled of the rx ring, counters of the number of
>>>> times an rx poll has been made are kept, and these can be retrieved via
>>>> the existing APIs.
>>> I have not read your code, just read this description.
>>> It sounds like being a ring PMD. Have you already checked it?
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__dpdk.org_browse_dpdk_tree_drivers_net_ring_rte-5Feth-5Fring.c&d=CwICAg&c=IL_XqQWOjubgfqINi2jTzg&r=45ezphVDEm8OnEpH-fLWdXvR3RneLhhNZRDLQRgR6LY&m=wJLO24XFe_B0nZve6mkvocCt7fQWo3PULCTWxrC8rZk&s=bIWycJrY-PYgzkQsBeRfkl8JCHFcxRAHhHDrqRSzHYs&e=
>> I hadn't seen the ring PMD. I will have a look at it and see if I can make
>> it do what i need.
>>
>> thanks,
>> Paul
> Hi Paul,
>
> any update on this. Your patches are still showing as pending in patchwork, 
> but
> if ring pmd is more what need, we can set these patches aside as unneeded, and
> remove them from the patchwork merge backlog.

Hi Bruce,

Sorry for the delay.  The patchset adds 3 things: assigning a mac addr 
to the null pmd, adding the rings to the null pmd and adding xstats for 
how many times the null pmd has been polled.  I could move to using the 
ring pmd, but I would still need the other 2 parts (mac addr and 
stats).  It seems like the ring pmd shouldn't really have these two 
extra things added, but i could do that if it that is preferred over 
what is in the current patchset.

thanks,
Paul
>
> thanks,
> /Bruce