summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOlivier Matz <olivier.matz@6wind.com>2014-01-28 17:06:42 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-02-04 15:41:01 +0100
commit760061ab7940c963d8fb7e7005298dd71ff5416d (patch)
tree34fd64bd949e6413ea5ba2cc28d7ea929f97a59a /lib
parent44d8528d4b7189f627f4a04acbda0ab84148a646 (diff)
downloaddpdk-760061ab7940c963d8fb7e7005298dd71ff5416d.zip
dpdk-760061ab7940c963d8fb7e7005298dd71ff5416d.tar.gz
dpdk-760061ab7940c963d8fb7e7005298dd71ff5416d.tar.xz
kvargs: add the key in handler pameters
This argument can be useful when rte_kvargs_process() is called with key=NULL, in this case the handler is invoked for all entries of the kvlist. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/librte_kvargs/rte_kvargs.c2
-rw-r--r--lib/librte_kvargs/rte_kvargs.h2
-rw-r--r--lib/librte_pmd_pcap/rte_eth_pcap.c10
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/librte_kvargs/rte_kvargs.c b/lib/librte_kvargs/rte_kvargs.c
index c7f626f..c41a016 100644
--- a/lib/librte_kvargs/rte_kvargs.c
+++ b/lib/librte_kvargs/rte_kvargs.c
@@ -161,7 +161,7 @@ rte_kvargs_process(const struct rte_kvargs *kvlist,
for (i = 0; i < kvlist->count; i++) {
pair = &kvlist->pairs[i];
if (strcmp(pair->key, key_match) == 0) {
- if ((*handler)(pair->value, opaque_arg) < 0)
+ if ((*handler)(pair->key, pair->value, opaque_arg) < 0)
return -1;
}
}
diff --git a/lib/librte_kvargs/rte_kvargs.h b/lib/librte_kvargs/rte_kvargs.h
index 98b8a7c..94003e2 100644
--- a/lib/librte_kvargs/rte_kvargs.h
+++ b/lib/librte_kvargs/rte_kvargs.h
@@ -64,7 +64,7 @@ extern "C" {
#define RTE_KVARGS_KV_DELIM "="
/** Type of callback function used by rte_kvargs_process() */
-typedef int (*arg_handler_t)(const char *value, void *opaque);
+typedef int (*arg_handler_t)(const char *key, const char *value, void *opaque);
/** A key/value association */
struct rte_kvargs_pair {
diff --git a/lib/librte_pmd_pcap/rte_eth_pcap.c b/lib/librte_pmd_pcap/rte_eth_pcap.c
index 8484497..6649f0f 100644
--- a/lib/librte_pmd_pcap/rte_eth_pcap.c
+++ b/lib/librte_pmd_pcap/rte_eth_pcap.c
@@ -419,7 +419,7 @@ static struct eth_dev_ops ops = {
* reference of it for use it later on.
*/
static int
-open_rx_pcap(const char *value, void *extra_args)
+open_rx_pcap(const char *key __rte_unused, const char *value, void *extra_args)
{
unsigned i;
const char *pcap_filename = value;
@@ -442,7 +442,7 @@ open_rx_pcap(const char *value, void *extra_args)
* for use it later on.
*/
static int
-open_tx_pcap(const char *value, void *extra_args)
+open_tx_pcap(const char *key __rte_unused, const char *value, void *extra_args)
{
unsigned i;
const char *pcap_filename = value;
@@ -492,7 +492,7 @@ open_iface_live(const char *iface, pcap_t **pcap) {
* Opens an interface for reading and writing
*/
static inline int
-open_rx_tx_iface(const char *value, void *extra_args)
+open_rx_tx_iface(const char *key __rte_unused, const char *value, void *extra_args)
{
const char *iface = value;
pcap_t **pcap = extra_args;
@@ -506,7 +506,7 @@ open_rx_tx_iface(const char *value, void *extra_args)
* Opens a NIC for reading packets from it
*/
static inline int
-open_rx_iface(const char *value, void *extra_args)
+open_rx_iface(const char *key __rte_unused, const char *value, void *extra_args)
{
unsigned i;
const char *iface = value;
@@ -526,7 +526,7 @@ open_rx_iface(const char *value, void *extra_args)
* Opens a NIC for writing packets to it
*/
static inline int
-open_tx_iface(const char *value, void *extra_args)
+open_tx_iface(const char *key __rte_unused, const char *value, void *extra_args)
{
unsigned i;
const char *iface = value;