git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ethdev: fix missing imissed counter in xstats
[dpdk.git]
/
lib
/
librte_distributor
/
rte_distributor.h
diff --git
a/lib/librte_distributor/rte_distributor.h
b/lib/librte_distributor/rte_distributor.h
index
cc1d559
..
cbeed04
100644
(file)
--- a/
lib/librte_distributor/rte_distributor.h
+++ b/
lib/librte_distributor/rte_distributor.h
@@
-1,8
+1,7
@@
/*-
* BSD LICENSE
*
/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
- * All rights reserved.
+ * Copyright(c) 2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@
-31,8
+30,8
@@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef _RTE_DISTRIBUT
E
_H_
-#define _RTE_DISTRIBUT
E
_H_
+#ifndef _RTE_DISTRIBUT
OR
_H_
+#define _RTE_DISTRIBUT
OR
_H_
/**
* @file
/**
* @file
@@
-46,11
+45,15
@@
extern "C" {
#endif
extern "C" {
#endif
-#include <rte_mbuf.h>
-
-#define RTE_DISTRIBUTOR_NAMESIZE 32 /**< Length of name for instance */
+/* Type of distribution (burst/single) */
+enum rte_distributor_alg_type {
+ RTE_DIST_ALG_BURST = 0,
+ RTE_DIST_ALG_SINGLE,
+ RTE_DIST_NUM_ALG_TYPES
+};
struct rte_distributor;
struct rte_distributor;
+struct rte_mbuf;
/**
* Function to create a new distributor instance
/**
* Function to create a new distributor instance
@@
-65,12
+68,17
@@
struct rte_distributor;
* @param num_workers
* The maximum number of workers that will request packets from this
* distributor
* @param num_workers
* The maximum number of workers that will request packets from this
* distributor
+ * @param alg_type
+ * Call the legacy API, or use the new burst API. legacy uses 32-bit
+ * flow ID, and works on a single packet at a time. Latest uses 15-
+ * bit flow ID and works on up to 8 packets at a time to workers.
* @return
* The newly created distributor instance
*/
struct rte_distributor *
* @return
* The newly created distributor instance
*/
struct rte_distributor *
-rte_distributor_create(const char *name, unsigned socket_id,
- unsigned num_workers);
+rte_distributor_create(const char *name, unsigned int socket_id,
+ unsigned int num_workers,
+ unsigned int alg_type);
/* *** APIS to be called on the distributor lcore *** */
/*
/* *** APIS to be called on the distributor lcore *** */
/*
@@
-86,7
+94,8
@@
rte_distributor_create(const char *name, unsigned socket_id,
/**
* Process a set of packets by distributing them among workers that request
* packets. The distributor will ensure that no two packets that have the
/**
* Process a set of packets by distributing them among workers that request
* packets. The distributor will ensure that no two packets that have the
- * same flow id, or tag, in the mbuf will be procesed at the same time.
+ * same flow id, or tag, in the mbuf will be processed on different cores at
+ * the same time.
*
* The user is advocated to set tag for each mbuf before calling this function.
* If user doesn't set the tag, the tag value can be various values depending on
*
* The user is advocated to set tag for each mbuf before calling this function.
* If user doesn't set the tag, the tag value can be various values depending on
@@
-105,7
+114,7
@@
rte_distributor_create(const char *name, unsigned socket_id,
*/
int
rte_distributor_process(struct rte_distributor *d,
*/
int
rte_distributor_process(struct rte_distributor *d,
- struct rte_mbuf **mbufs, unsigned num_mbufs);
+ struct rte_mbuf **mbufs, unsigned
int
num_mbufs);
/**
* Get a set of mbufs that have been returned to the distributor by workers
/**
* Get a set of mbufs that have been returned to the distributor by workers
@@
-123,7
+132,7
@@
rte_distributor_process(struct rte_distributor *d,
*/
int
rte_distributor_returned_pkts(struct rte_distributor *d,
*/
int
rte_distributor_returned_pkts(struct rte_distributor *d,
- struct rte_mbuf **mbufs, unsigned max_mbufs);
+ struct rte_mbuf **mbufs, unsigned
int
max_mbufs);
/**
* Flush the distributor component, so that there are no in-flight or
/**
* Flush the distributor component, so that there are no in-flight or
@@
-162,7
+171,7
@@
rte_distributor_clear_returns(struct rte_distributor *d);
*/
/**
*/
/**
- * API called by a worker to get
a new packet to process. Any previous packet
+ * API called by a worker to get
new packets to process. Any previous packets
* given to the worker is assumed to have completed processing, and may be
* optionally returned to the distributor via the oldpkt parameter.
*
* given to the worker is assumed to have completed processing, and may be
* optionally returned to the distributor via the oldpkt parameter.
*
@@
-171,15
+180,20
@@
rte_distributor_clear_returns(struct rte_distributor *d);
* @param worker_id
* The worker instance number to use - must be less that num_workers passed
* at distributor creation time.
* @param worker_id
* The worker instance number to use - must be less that num_workers passed
* at distributor creation time.
+ * @param pkts
+ * The mbufs pointer array to be filled in (up to 8 packets)
* @param oldpkt
* The previous packet, if any, being processed by the worker
* @param oldpkt
* The previous packet, if any, being processed by the worker
+ * @param retcount
+ * The number of packets being returned
*
* @return
*
* @return
- *
A new packet to be processed by the worker thread.
+ *
The number of packets in the pkts array
*/
*/
-struct rte_mbuf *
+int
rte_distributor_get_pkt(struct rte_distributor *d,
rte_distributor_get_pkt(struct rte_distributor *d,
- unsigned worker_id, struct rte_mbuf *oldpkt);
+ unsigned int worker_id, struct rte_mbuf **pkts,
+ struct rte_mbuf **oldpkt, unsigned int retcount);
/**
* API called by a worker to return a completed packet without requesting a
/**
* API called by a worker to return a completed packet without requesting a
@@
-190,23
+204,25
@@
rte_distributor_get_pkt(struct rte_distributor *d,
* @param worker_id
* The worker instance number to use - must be less that num_workers passed
* at distributor creation time.
* @param worker_id
* The worker instance number to use - must be less that num_workers passed
* at distributor creation time.
- * @param mbuf
- * The previous packet being processed by the worker
+ * @param oldpkt
+ * The previous packets being processed by the worker
+ * @param num
+ * The number of packets in the oldpkt array
*/
int
*/
int
-rte_distributor_return_pkt(struct rte_distributor *d,
unsigned worker_id,
-
struct rte_mbuf *mbuf
);
+rte_distributor_return_pkt(struct rte_distributor *d,
+
unsigned int worker_id, struct rte_mbuf **oldpkt, int num
);
/**
* API called by a worker to request a new packet to process.
* Any previous packet given to the worker is assumed to have completed
* processing, and may be optionally returned to the distributor via
* the oldpkt parameter.
/**
* API called by a worker to request a new packet to process.
* Any previous packet given to the worker is assumed to have completed
* processing, and may be optionally returned to the distributor via
* the oldpkt parameter.
- * Unlike rte_distributor_get_pkt
(), this function does not wait for a new
- * packet to be provided by the distributor.
+ * Unlike rte_distributor_get_pkt
_burst(), this function does not wait for a
+ *
new
packet to be provided by the distributor.
*
*
- * NOTE: after calling this function, rte_distributor_poll_pkt() should
- * be used to poll for the packet requested. The rte_distributor_get_pkt()
+ * NOTE: after calling this function, rte_distributor_poll_pkt
_burst
() should
+ * be used to poll for the packet requested. The rte_distributor_get_pkt
_burst
()
* API should *not* be used to try and retrieve the new packet.
*
* @param d
* API should *not* be used to try and retrieve the new packet.
*
* @param d
@@
-215,11
+231,14
@@
rte_distributor_return_pkt(struct rte_distributor *d, unsigned worker_id,
* The worker instance number to use - must be less that num_workers passed
* at distributor creation time.
* @param oldpkt
* The worker instance number to use - must be less that num_workers passed
* at distributor creation time.
* @param oldpkt
- * The previous packet, if any, being processed by the worker
+ * The returning packets, if any, processed by the worker
+ * @param count
+ * The number of returning packets
*/
void
rte_distributor_request_pkt(struct rte_distributor *d,
*/
void
rte_distributor_request_pkt(struct rte_distributor *d,
- unsigned worker_id, struct rte_mbuf *oldpkt);
+ unsigned int worker_id, struct rte_mbuf **oldpkt,
+ unsigned int count);
/**
* API called by a worker to check for a new packet that was previously
/**
* API called by a worker to check for a new packet that was previously
@@
-232,14
+251,16
@@
rte_distributor_request_pkt(struct rte_distributor *d,
* @param worker_id
* The worker instance number to use - must be less that num_workers passed
* at distributor creation time.
* @param worker_id
* The worker instance number to use - must be less that num_workers passed
* at distributor creation time.
+ * @param mbufs
+ * The array of mbufs being given to the worker
*
* @return
*
* @return
- *
A new packet to be processed by the worker thread, or NULL
if no
+ *
The number of packets being given to the worker thread, zero
if no
* packet is yet available.
*/
* packet is yet available.
*/
-struct rte_mbuf *
+int
rte_distributor_poll_pkt(struct rte_distributor *d,
rte_distributor_poll_pkt(struct rte_distributor *d,
- unsigned
worker_id
);
+ unsigned
int worker_id, struct rte_mbuf **mbufs
);
#ifdef __cplusplus
}
#ifdef __cplusplus
}