host stack: update stale copyright
[vpp.git] / src / svm / svm_fifo_segment.c
index c72de40..e377160 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Cisco and/or its affiliates.
+ * Copyright (c) 2016-2019 Cisco and/or its affiliates.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
@@ -370,10 +370,6 @@ svm_fifo_segment_alloc_fifo (svm_fifo_segment_private_t * fs,
       f = fsh->free_fifos[freelist_index];
       if (PREDICT_FALSE (!f))
        {
-         /* Preallocated and no fifo left. Don't even try */
-         if (fsh->flags & FIFO_SEGMENT_F_IS_PREALLOCATED)
-           goto done;
-
          oldheap = ssvm_push_heap (sh);
          allocate_new_fifo_chunk (fsh, data_size_in_bytes,
                                   FIFO_SEGMENT_ALLOC_CHUNK_SIZE);
@@ -437,7 +433,6 @@ svm_fifo_segment_free_fifo (svm_fifo_segment_private_t * s, svm_fifo_t * f,
 {
   ssvm_shared_header_t *sh;
   svm_fifo_segment_header_t *fsh;
-  void *oldheap;
   int freelist_index;
 
   ASSERT (f->refcnt > 0);
@@ -453,7 +448,6 @@ svm_fifo_segment_free_fifo (svm_fifo_segment_private_t * s, svm_fifo_t * f,
   ASSERT (freelist_index < vec_len (fsh->free_fifos));
 
   ssvm_lock_non_recursive (sh, 2);
-  oldheap = ssvm_push_heap (sh);
 
   switch (list_index)
     {
@@ -487,7 +481,6 @@ svm_fifo_segment_free_fifo (svm_fifo_segment_private_t * s, svm_fifo_t * f,
     }
 
   fsh->n_active_fifos--;
-  ssvm_pop_heap (oldheap);
   ssvm_unlock_non_recursive (sh);
 }
 
@@ -575,8 +568,8 @@ svm_fifo_segment_num_free_fifos (svm_fifo_segment_private_t * fifo_segment,
 }
 
 void
-svm_fifo_segment_info (svm_fifo_segment_private_t * seg, uword * address,
-                      u64 * size)
+svm_fifo_segment_info (svm_fifo_segment_private_t * seg, char **address,
+                      size_t * size)
 {
   if (ssvm_type (&seg->ssvm) == SSVM_SEGMENT_PRIVATE)
     {
@@ -587,14 +580,12 @@ svm_fifo_segment_info (svm_fifo_segment_private_t * seg, uword * address,
       heap_header = mheap_header (seg->ssvm.sh->heap);
       *size = heap_header->max_size;
 #else
-      mspace_get_address_and_size (seg->ssvm.sh->heap,
-                                  (unsigned long long *) address,
-                                  (unsigned long long *) size);
+      mspace_get_address_and_size (seg->ssvm.sh->heap, address, size);
 #endif
     }
   else
     {
-      *address = seg->ssvm.sh->ssvm_va;
+      *address = (char *) seg->ssvm.sh->ssvm_va;
       *size = seg->ssvm.ssvm_size;
     }
 }