aboutsummaryrefslogtreecommitdiffstats
path: root/vnet/vnet/devices/ssvm/ssvm_eth.h
diff options
context:
space:
mode:
Diffstat (limited to 'vnet/vnet/devices/ssvm/ssvm_eth.h')
-rw-r--r--vnet/vnet/devices/ssvm/ssvm_eth.h56
1 files changed, 34 insertions, 22 deletions
diff --git a/vnet/vnet/devices/ssvm/ssvm_eth.h b/vnet/vnet/devices/ssvm/ssvm_eth.h
index 23af7ed5ae8..f4156e3ae70 100644
--- a/vnet/vnet/devices/ssvm/ssvm_eth.h
+++ b/vnet/vnet/devices/ssvm/ssvm_eth.h
@@ -38,7 +38,8 @@ extern vlib_node_registration_t ssvm_eth_input_node;
(VLIB_BUFFER_DATA_SIZE + VLIB_BUFFER_PRE_DATA_SIZE)
#define SSVM_PACKET_TYPE 1
-typedef struct {
+typedef struct
+{
/* Type of queue element */
u8 type;
u8 flags;
@@ -51,17 +52,18 @@ typedef struct {
u16 pad;
u32 next_index;
/* offset 16 */
- u8 data [SSVM_BUFFER_SIZE];
+ u8 data[SSVM_BUFFER_SIZE];
/* pad to an even multiple of 64 octets */
u8 pad2[CLIB_CACHE_LINE_BYTES - 16];
} ssvm_eth_queue_elt_t;
-typedef struct {
+typedef struct
+{
/* vector of point-to-point connections */
- ssvm_private_t * intfcs;
+ ssvm_private_t *intfcs;
- u32 * buffer_cache;
- u32 * chunk_cache;
+ u32 *buffer_cache;
+ u32 *chunk_cache;
/* Configurable parameters */
/* base address for next placement */
@@ -71,19 +73,20 @@ typedef struct {
u64 queue_elts;
/* Segment names */
- u8 ** names;
+ u8 **names;
/* convenience */
- vlib_main_t * vlib_main;
- vnet_main_t * vnet_main;
- elog_main_t * elog_main;
+ vlib_main_t *vlib_main;
+ vnet_main_t *vnet_main;
+ elog_main_t *elog_main;
} ssvm_eth_main_t;
ssvm_eth_main_t ssvm_eth_main;
-typedef enum {
+typedef enum
+{
CHUNK_POOL_FREELIST_INDEX = 0,
- CHUNK_POOL_INDEX,
+ CHUNK_POOL_INDEX,
CHUNK_POOL_NFREE,
TO_MASTER_Q_INDEX,
TO_SLAVE_Q_INDEX,
@@ -94,13 +97,14 @@ typedef enum {
/*
* debug scaffolding.
*/
-static inline void ssvm_eth_validate_freelists (int need_lock)
+static inline void
+ssvm_eth_validate_freelists (int need_lock)
{
#if CLIB_DEBUG > 0
- ssvm_eth_main_t * em = &ssvm_eth_main;
- ssvm_private_t * intfc;
- ssvm_shared_header_t * sh;
- u32 * elt_indices;
+ ssvm_eth_main_t *em = &ssvm_eth_main;
+ ssvm_private_t *intfc;
+ ssvm_shared_header_t *sh;
+ u32 *elt_indices;
u32 n_available;
int i;
@@ -109,20 +113,28 @@ static inline void ssvm_eth_validate_freelists (int need_lock)
intfc = em->intfcs + i;
sh = intfc->sh;
u32 my_pid = intfc->my_pid;
-
+
if (need_lock)
- ssvm_lock (sh, my_pid, 15);
+ ssvm_lock (sh, my_pid, 15);
- elt_indices = (u32 *) (sh->opaque [CHUNK_POOL_FREELIST_INDEX]);
- n_available = (u32) (uword) (sh->opaque [CHUNK_POOL_NFREE]);
+ elt_indices = (u32 *) (sh->opaque[CHUNK_POOL_FREELIST_INDEX]);
+ n_available = (u32) (uword) (sh->opaque[CHUNK_POOL_NFREE]);
for (i = 0; i < n_available; i++)
ASSERT (elt_indices[i] < 2048);
if (need_lock)
- ssvm_unlock (sh);
+ ssvm_unlock (sh);
}
#endif
}
#endif /* __included_ssvm_eth_h__ */
+
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Variables:
+ * eval: (c-set-style "gnu")
+ * End:
+ */