Add support for AArch32
[vpp.git] / vnet / vnet / devices / ssvm / node.c
index fe53d11..3a5709d 100644 (file)
@@ -94,10 +94,11 @@ ssvm_eth_device_input (ssvm_eth_main_t * em,
   u32 trace_cnt __attribute__((unused)) = vlib_get_trace_count (vm, node);
   volatile u32 * lock;
   u32 * elt_indices;
+  uword n_trace = vlib_get_trace_count (vm, node);
 
   /* Either side down? buh-bye... */
-  if ((u64)(sh->opaque [MASTER_ADMIN_STATE_INDEX]) == 0 ||
-      (u64)(sh->opaque [SLAVE_ADMIN_STATE_INDEX]) == 0)
+  if (pointer_to_uword(sh->opaque [MASTER_ADMIN_STATE_INDEX]) == 0 ||
+      pointer_to_uword(sh->opaque [SLAVE_ADMIN_STATE_INDEX]) == 0)
     return 0;
 
   if (intfc->i_am_master)
@@ -236,7 +237,19 @@ ssvm_eth_device_input (ssvm_eth_main_t * em,
            */
           VLIB_BUFFER_TRACE_TRAJECTORY_INIT(b0);
 
-          /* $$$$ tracing */
+          if (PREDICT_FALSE(n_trace > 0))
+          {
+              ssvm_eth_input_trace_t *tr;
+              
+              vlib_trace_buffer (vm, node, next0,
+                                 b0, /* follow_chain */ 1);
+              vlib_set_trace_count (vm, node, --n_trace);
+
+              tr = vlib_add_trace (vm, node, b0, sizeof (*tr));
+
+              tr->next_index = next0;
+              tr->sw_if_index = intfc->vlib_hw_if_index;
+          }
 
           vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
                                            to_next, n_left_to_next,
@@ -258,14 +271,14 @@ ssvm_eth_device_input (ssvm_eth_main_t * em,
 
   ASSERT(vec_len(intfc->rx_queue) > 0);
 
-  n_available = (u32)(u64)(sh->opaque[CHUNK_POOL_NFREE]);
+  n_available = (u32)pointer_to_uword(sh->opaque[CHUNK_POOL_NFREE]);
   elt_indices = (u32 *)(sh->opaque[CHUNK_POOL_FREELIST_INDEX]);
 
   memcpy (&elt_indices[n_available], intfc->rx_queue, 
           vec_len (intfc->rx_queue) * sizeof (u32));
 
   n_available += vec_len (intfc->rx_queue);
-  sh->opaque[CHUNK_POOL_NFREE] = (void *) (u64) n_available;
+  sh->opaque[CHUNK_POOL_NFREE] = uword_to_pointer(n_available, void* );
 
   ssvm_unlock (sh);