Fixes for buliding for 32bit targets:

* u32/u64/uword mismatches
  * pointer-to-int fixes
  * printf formatting issues
  * issues with incorrect "ULL" and related suffixes
  * structure alignment and padding issues

Change-Id: I70b989007758755fe8211c074f651150680f60b4
Signed-off-by: David Johnson <davijoh3@cisco.com>
This commit is contained in:
David Johnson
2018-12-14 14:53:41 -05:00
parent d6897c1597
commit d9818dd68c
33 changed files with 162 additions and 120 deletions

View File

@ -74,6 +74,7 @@ typedef struct
typedef struct
{
CLIB_ALIGN_MARK (pad, 8); /* align up to 8 bytes for 32bit builds */
char *name;
enum rte_crypto_sym_xform_type type;
u32 alg;
@ -83,7 +84,7 @@ typedef struct
u8 boundary;
u8 disabled;
u8 resources;
} crypto_alg_t __attribute__ ((aligned (8)));
} crypto_alg_t;
typedef struct
{
@ -128,6 +129,7 @@ typedef struct
typedef struct
{
CLIB_ALIGN_MARK (pad, 16); /* align up to 16 bytes for 32bit builds */
struct rte_cryptodev_sym_session *session;
u64 dev_mask;
} crypto_session_by_drv_t;

View File

@ -148,7 +148,7 @@ flowprobe_get_variant (flowprobe_variant_t which,
/*
* NTP rfc868 : 2 208 988 800 corresponds to 00:00 1 Jan 1970 GMT
*/
#define NTP_TIMESTAMP 2208988800L
#define NTP_TIMESTAMP 2208988800LU
static inline u32
flowprobe_common_add (vlib_buffer_t * to_b, flowprobe_entry_t * e, u16 offset)

View File

@ -84,7 +84,7 @@ lb_hash_t *lb_hash_alloc(u32 buckets, u32 timeout)
return NULL;
// Allocate 1 more bucket for prefetch
u32 size = ((u64)&((lb_hash_t *)(0))->buckets[0]) +
u32 size = ((uword)&((lb_hash_t *)(0))->buckets[0]) +
sizeof(lb_hash_bucket_t) * (buckets + 1);
u8 *mem = 0;
lb_hash_t *h;

View File

@ -113,6 +113,7 @@ typedef struct
typedef struct
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
/* ring data */
memif_ring_t *ring;
memif_log2_ring_size_t log2_ring_size;
@ -205,6 +206,7 @@ typedef struct
typedef struct
{
CLIB_ALIGN_MARK (pad, 16); /* align up to 16 bytes for 32bit builds */
void *data;
u32 data_len;
i16 buffer_offset;

View File

@ -99,7 +99,7 @@ test_bihash_thread_fn (void *arg)
BVT (clib_bihash_kv) kv;
bihash_test_main_t *tm = &bihash_test_main;
int i, j;
u32 my_thread_index = (u32) (u64) arg;
u32 my_thread_index = (uword) arg;
while (tm->thread_barrier)
;
@ -150,7 +150,7 @@ test_bihash_threads (bihash_test_main_t * tm)
for (i = 0; i < tm->nthreads; i++)
{
rv = pthread_create (&handle, NULL, test_bihash_thread_fn,
(void *) (u64) i);
(void *) (uword) i);
if (rv)
{
clib_unix_warning ("pthread_create returned %d", rv);

View File

@ -177,7 +177,7 @@ map_it:
return SSVM_API_ERROR_SLAVE_TIMEOUT;
re_map_it:
ssvm->requested_va = (u64) sh->ssvm_va;
ssvm->requested_va = sh->ssvm_va;
ssvm->ssvm_size = sh->ssvm_size;
munmap (sh, MMAP_PAGESIZE);

View File

@ -64,9 +64,9 @@ typedef struct
void *heap;
/* Segment must be mapped at this address, or no supper */
u64 ssvm_va;
uword ssvm_va;
/* The actual mmap size */
u64 ssvm_size;
uword ssvm_size;
u32 master_pid;
u32 slave_pid;
u8 *name;

View File

@ -66,7 +66,7 @@ typedef struct svm_map_region_args_
{
const char *root_path; /* NULL means use the truly global arena */
const char *name;
u64 baseva;
uword baseva;
u64 size;
u64 pvt_heap_size;
uword flags;
@ -77,6 +77,16 @@ typedef struct svm_map_region_args_
int gid;
} svm_map_region_args_t;
/*
* Memory mapped to high addresses for session/vppcom/vcl/etc...
*/
#if __WORDSIZE == 64
#define HIGH_SEGMENT_BASEVA (8ULL << 30) /* 8GB */
#elif __WORDSIZE == 32
#define HIGH_SEGMENT_BASEVA (3584UL << 20) /* 3.5GB */
#else
#error "unknown __WORDSIZE"
#endif
/*
* Memory shared across all router instances. Packet buffers, etc

View File

@ -575,8 +575,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 +587,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;
}
}

View File

@ -116,8 +116,8 @@ u32 svm_fifo_segment_index (svm_fifo_segment_main_t * sm,
u32 svm_fifo_segment_num_fifos (svm_fifo_segment_private_t * fifo_segment);
u32 svm_fifo_segment_num_free_fifos (svm_fifo_segment_private_t *
fifo_segment, u32 fifo_size_in_bytes);
void svm_fifo_segment_info (svm_fifo_segment_private_t * seg, uword * address,
u64 * size);
void svm_fifo_segment_info (svm_fifo_segment_private_t * seg, char **address,
size_t * size);
svm_fifo_segment_private_t
* svm_fifo_segment_segments_pool (svm_fifo_segment_main_t * sm);

View File

@ -281,7 +281,7 @@ test_ssvm_fifo1 (unformat_input_t * input)
int verbose = 0;
int test_id = 0;
svm_fifo_segment_main_init (sm, 0x200000000ULL, 20);
svm_fifo_segment_main_init (sm, HIGH_SEGMENT_BASEVA, 20);
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
{

View File

@ -1408,7 +1408,7 @@ main (int argc, char **argv)
clib_time_init (&em->clib_time);
init_error_string_table (em);
svm_fifo_segment_main_init (sm, 0x200000000ULL, 20);
svm_fifo_segment_main_init (sm, HIGH_SEGMENT_BASEVA, 20);
unformat_init_command_line (a, argv);
while (unformat_check_input (a) != UNFORMAT_END_OF_INPUT)

View File

@ -942,7 +942,8 @@ vl_api_unmap_segment_t_handler (vl_api_unmap_segment_t * mp)
udp_echo_main_t *utm = &udp_echo_main;
svm_fifo_segment_main_t *sm = &utm->segment_main;
svm_fifo_segment_private_t *seg;
u64 *seg_indexp, segment_handle;
uword *seg_indexp;
u64 segment_handle;
segment_handle = clib_net_to_host_u64 (mp->segment_handle);
seg_indexp = hash_get (utm->segments_table, segment_handle);
@ -1220,7 +1221,7 @@ main (int argc, char **argv)
clib_mem_init_thread_safe (0, 256 << 20);
svm_fifo_segment_main_init (sm, 0x200000000ULL, 20);
svm_fifo_segment_main_init (sm, HIGH_SEGMENT_BASEVA, 20);
vec_validate (utm->rx_buf, 128 << 10);
utm->session_index_by_vpp_handles = hash_create (0, sizeof (uword));

View File

@ -959,9 +959,12 @@ ldp_pselect (int nfds, fd_set * __restrict readfds,
sizeof (clib_bitmap_t));
rv = vppcom_select (sid_bits,
readfds ? ldpw->rd_bitmap : NULL,
writefds ? ldpw->wr_bitmap : NULL,
exceptfds ? ldpw->ex_bitmap : NULL, 0);
readfds ? (unsigned long *) ldpw->rd_bitmap
: NULL,
writefds ? (unsigned long *) ldpw->wr_bitmap
: NULL,
exceptfds ? (unsigned long *)
ldpw->ex_bitmap : NULL, 0);
if (rv < 0)
{
errno = -rv;

View File

@ -157,8 +157,9 @@ echo_test_client ()
_rfdset = rd_fdset;
#ifdef VCL_TEST
rv = vppcom_select (nfds, (uint64_t *) rfdset, (uint64_t *) wfdset,
NULL, 0);
rv =
vppcom_select (nfds, (unsigned long *) rfdset,
(unsigned long *) wfdset, NULL, 0);
#else
{
struct timeval timeout;
@ -417,8 +418,9 @@ stream_test_client (vcl_test_t test)
_rfdset = rd_fdset;
#ifdef VCL_TEST
rv = vppcom_select (nfds, (uint64_t *) rfdset, (uint64_t *) wfdset,
NULL, 0);
rv =
vppcom_select (nfds, (unsigned long *) rfdset,
(unsigned long *) wfdset, NULL, 0);
#else
{
struct timeval timeout;

View File

@ -751,7 +751,7 @@ main (int argc, char **argv)
_rfdset = ssm->rd_fdset;
#ifdef VCL_TEST
rv = vppcom_select (ssm->nfds, (uint64_t *) rfdset, NULL, NULL, 0);
rv = vppcom_select (ssm->nfds, (unsigned long *) rfdset, NULL, NULL, 0);
#else
{
struct timeval timeout;

View File

@ -35,7 +35,7 @@ vppcom_cfg_init (vppcom_cfg_t * vcl_cfg)
vcl_cfg->heapsize = (256ULL << 20);
vcl_cfg->max_workers = 16;
vcl_cfg->vpp_api_q_length = 1024;
vcl_cfg->segment_baseva = 0x200000000ULL;
vcl_cfg->segment_baseva = HIGH_SEGMENT_BASEVA;
vcl_cfg->segment_size = (256 << 20);
vcl_cfg->add_segment_size = (128 << 20);
vcl_cfg->preallocated_fifo_pairs = 8;
@ -75,7 +75,8 @@ vppcom_cfg_heapsize (char *conf_fname)
if (fp == NULL)
{
VCFG_DBG (0, "VCL<%d>: using default heapsize %lu (0x%lx)",
getpid (), vcl_cfg->heapsize, vcl_cfg->heapsize);
getpid (), (unsigned long) vcl_cfg->heapsize,
(unsigned long) vcl_cfg->heapsize);
goto defaulted;
}
@ -83,7 +84,8 @@ vppcom_cfg_heapsize (char *conf_fname)
if (argv == NULL)
{
VCFG_DBG (0, "VCL<%d>: calloc failed, using default heapsize %lu"
" (0x%lx)", getpid (), vcl_cfg->heapsize, vcl_cfg->heapsize);
" (0x%lx)", getpid (), (unsigned long) vcl_cfg->heapsize,
(unsigned long) vcl_cfg->heapsize);
goto defaulted;
}
@ -102,7 +104,8 @@ vppcom_cfg_heapsize (char *conf_fname)
{
VCFG_DBG (0, "VCL<%d>: realloc failed, using default "
"heapsize %lu (0x%lx)", getpid (),
vcl_cfg->heapsize, vcl_cfg->heapsize);
(unsigned long) vcl_cfg->heapsize,
(unsigned long) vcl_cfg->heapsize);
goto defaulted;
}
argv = tmp;
@ -110,8 +113,9 @@ vppcom_cfg_heapsize (char *conf_fname)
if (arg == NULL)
{
VCFG_DBG (0, "VCL<%d>: strndup failed, using default "
"heapsize %ld (0x%lx)", getpid (),
vcl_cfg->heapsize, vcl_cfg->heapsize);
"heapsize %lu (0x%lx)", getpid (),
(unsigned long) vcl_cfg->heapsize,
(unsigned long) vcl_cfg->heapsize);
goto defaulted;
}
argv[argc - 1] = arg;
@ -125,8 +129,9 @@ vppcom_cfg_heapsize (char *conf_fname)
char **tmp = realloc (argv, (argc + 1) * sizeof (char *));
if (tmp == NULL)
{
VCFG_DBG (0, "VCL<%d>: realloc failed, using default heapsize %ld "
"(0x%lx)", getpid (), vcl_cfg->heapsize, vcl_cfg->heapsize);
VCFG_DBG (0, "VCL<%d>: realloc failed, using default heapsize %lu "
"(0x%lx)", getpid (), (unsigned long) vcl_cfg->heapsize,
(unsigned long) vcl_cfg->heapsize);
goto defaulted;
}
argv = tmp;
@ -153,8 +158,9 @@ vppcom_cfg_heapsize (char *conf_fname)
if (size == 0)
{
VCFG_DBG (0, "VCL<%d>: parse error '%s %s', using default "
"heapsize %ld (0x%lx)", getpid (), argv[i],
argv[i + 1], vcl_cfg->heapsize, vcl_cfg->heapsize);
"heapsize %lu (0x%lx)", getpid (), argv[i],
argv[i + 1], (unsigned long) vcl_cfg->heapsize,
(unsigned long) vcl_cfg->heapsize);
goto defaulted;
}
@ -165,8 +171,9 @@ vppcom_cfg_heapsize (char *conf_fname)
else
{
VCFG_DBG (0, "VCL<%d>: parse error '%s %s', using default "
"heapsize %ld (0x%lx)", getpid (), argv[i],
argv[i + 1], vcl_cfg->heapsize, vcl_cfg->heapsize);
"heapsize %lu (0x%lx)", getpid (), argv[i],
argv[i + 1], (unsigned long) vcl_cfg->heapsize,
(unsigned long) vcl_cfg->heapsize);
goto defaulted;
}
}
@ -183,10 +190,11 @@ defaulted:
MAP_SHARED | MAP_ANONYMOUS, -1, 0);
if (vcl_mem == MAP_FAILED)
{
VCFG_DBG (0, "VCL<%d>: ERROR: mmap(0, %ld == 0x%lx, "
VCFG_DBG (0, "VCL<%d>: ERROR: mmap(0, %lu == 0x%lx, "
"PROT_READ | PROT_WRITE,MAP_SHARED | MAP_ANONYMOUS, "
"-1, 0) failed!", getpid (), vcl_cfg->heapsize,
vcl_cfg->heapsize);
"-1, 0) failed!", getpid (),
(unsigned long) vcl_cfg->heapsize,
(unsigned long) vcl_cfg->heapsize);
ASSERT (vcl_mem != MAP_FAILED);
return;
}
@ -208,8 +216,9 @@ defaulted:
clib_memcpy (vcl_mem, &_vppcom_main, sizeof (_vppcom_main));
vcm = vcl_mem;
VCFG_DBG (0, "VCL<%d>: allocated VCL heap = %p, size %ld (0x%lx)",
getpid (), heap, vcl_cfg->heapsize, vcl_cfg->heapsize);
VCFG_DBG (0, "VCL<%d>: allocated VCL heap = %p, size %lu (0x%lx)",
getpid (), heap, (unsigned long) vcl_cfg->heapsize,
(unsigned long) vcl_cfg->heapsize);
}
void
@ -264,7 +273,7 @@ vppcom_cfg_read_file (char *conf_fname)
&vcl_cfg->heapsize))
{
VCFG_DBG (0, "VCL<%d>: configured heapsize %lu", getpid (),
vcl_cfg->heapsize);
(unsigned long) vcl_cfg->heapsize);
}
else
if (unformat
@ -325,7 +334,7 @@ vppcom_cfg_read_file (char *conf_fname)
&vcl_cfg->segment_baseva))
{
VCFG_DBG (0, "VCL<%d>: configured segment_baseva 0x%lx",
getpid (), vcl_cfg->segment_baseva);
getpid (), (unsigned long) vcl_cfg->segment_baseva);
}
else if (unformat (line_input, "segment-size 0x%x",
&vcl_cfg->segment_size))
@ -463,9 +472,11 @@ vppcom_cfg_read_file (char *conf_fname)
else if (unformat (line_input, "namespace-secret %lu",
&vcl_cfg->namespace_secret))
{
VCFG_DBG (0, "VCL<%d>: configured namespace_secret %lu (0x%lx)",
getpid (), vcl_cfg->namespace_secret,
vcl_cfg->namespace_secret);
VCFG_DBG (0,
"VCL<%d>: configured namespace_secret %llu (0x%llx)",
getpid (),
(unsigned long long) vcl_cfg->namespace_secret,
(unsigned long long) vcl_cfg->namespace_secret);
}
else if (unformat (line_input, "namespace-id %v",
&vcl_cfg->namespace_id))
@ -576,7 +587,7 @@ vppcom_cfg (vppcom_cfg_t * vcl_cfg)
if (env_var_str)
{
u64 tmp;
if (sscanf (env_var_str, "%lu", &tmp) != 1)
if (sscanf (env_var_str, "%llu", (unsigned long long *) &tmp) != 1)
{
VCFG_DBG (0, "VCL<%d>: WARNING: Invalid namespace secret specified"
" in the environment variable "
@ -586,9 +597,9 @@ vppcom_cfg (vppcom_cfg_t * vcl_cfg)
else
{
vcm->cfg.namespace_secret = tmp;
VCFG_DBG (0, "VCL<%d>: configured namespace secret (%lu) from "
VCFG_DBG (0, "VCL<%d>: configured namespace secret (%llu) from "
VPPCOM_ENV_APP_NAMESPACE_SECRET "!", getpid (),
vcm->cfg.namespace_secret);
(unsigned long long) vcm->cfg.namespace_secret);
}
}
if (getenv (VPPCOM_ENV_APP_PROXY_TRANSPORT_TCP))

View File

@ -180,10 +180,10 @@ typedef struct
typedef struct vppcom_cfg_t_
{
u64 heapsize;
uword heapsize;
u32 max_workers;
u32 vpp_api_q_length;
u64 segment_baseva;
uword segment_baseva;
u32 segment_size;
u32 add_segment_size;
u32 preallocated_fifo_pairs;

View File

@ -350,8 +350,8 @@ vtc_worker_loop (void *arg)
_wfdset = wrk->wr_fdset;
_rfdset = wrk->rd_fdset;
rv = vppcom_select (wrk->max_fd_index, (uint64_t *) rfdset,
(uint64_t *) wfdset, NULL, 0);
rv = vppcom_select (wrk->max_fd_index, (unsigned long *) rfdset,
(unsigned long *) wfdset, NULL, 0);
if (rv < 0)
{
vterr ("vppcom_select()", rv);

View File

@ -1944,7 +1944,7 @@ vcl_select_handle_mq_event (vcl_worker_t * wrk, session_event_t * e,
break;
if (sid < n_bits && read_map)
{
clib_bitmap_set_no_check (read_map, sid, 1);
clib_bitmap_set_no_check ((uword *) read_map, sid, 1);
*bits_set += 1;
}
break;
@ -1955,7 +1955,7 @@ vcl_select_handle_mq_event (vcl_worker_t * wrk, session_event_t * e,
break;
if (sid < n_bits && write_map)
{
clib_bitmap_set_no_check (write_map, sid, 1);
clib_bitmap_set_no_check ((uword *) write_map, sid, 1);
*bits_set += 1;
}
break;
@ -1967,7 +1967,7 @@ vcl_select_handle_mq_event (vcl_worker_t * wrk, session_event_t * e,
sid = session->session_index;
if (sid < n_bits && read_map)
{
clib_bitmap_set_no_check (read_map, sid, 1);
clib_bitmap_set_no_check ((uword *) read_map, sid, 1);
*bits_set += 1;
}
break;
@ -1978,7 +1978,7 @@ vcl_select_handle_mq_event (vcl_worker_t * wrk, session_event_t * e,
sid = session->session_index;
if (sid < n_bits && write_map)
{
clib_bitmap_set_no_check (write_map, sid, 1);
clib_bitmap_set_no_check ((uword *) write_map, sid, 1);
*bits_set += 1;
}
break;
@ -1990,7 +1990,7 @@ vcl_select_handle_mq_event (vcl_worker_t * wrk, session_event_t * e,
sid = session->session_index;
if (sid < n_bits && read_map)
{
clib_bitmap_set_no_check (read_map, sid, 1);
clib_bitmap_set_no_check ((uword *) read_map, sid, 1);
*bits_set += 1;
}
break;
@ -2006,7 +2006,7 @@ vcl_select_handle_mq_event (vcl_worker_t * wrk, session_event_t * e,
sid = session->session_index;
if (sid < n_bits && except_map)
{
clib_bitmap_set_no_check (except_map, sid, 1);
clib_bitmap_set_no_check ((uword *) except_map, sid, 1);
*bits_set += 1;
}
break;
@ -2014,7 +2014,7 @@ vcl_select_handle_mq_event (vcl_worker_t * wrk, session_event_t * e,
sid = vcl_session_reset_handler (wrk, (session_reset_msg_t *) e->data);
if (sid < n_bits && except_map)
{
clib_bitmap_set_no_check (except_map, sid, 1);
clib_bitmap_set_no_check ((uword *) except_map, sid, 1);
*bits_set += 1;
}
break;
@ -2144,30 +2144,35 @@ vppcom_select (unsigned long n_bits, unsigned long *read_map,
vcl_session_t *session = 0;
int rv, i;
ASSERT (sizeof (clib_bitmap_t) == sizeof (long int));
STATIC_ASSERT (sizeof (clib_bitmap_t) == sizeof (unsigned long),
"vppcom bitmap size mismatch");
STATIC_ASSERT (sizeof (clib_bitmap_t) == sizeof (fd_mask),
"vppcom bitmap size mismatch");
STATIC_ASSERT (sizeof (clib_bitmap_t) == sizeof (uword),
"vppcom bitmap size mismatch");
if (n_bits && read_map)
{
clib_bitmap_validate (wrk->rd_bitmap, minbits);
clib_memcpy_fast (wrk->rd_bitmap, read_map,
vec_len (wrk->rd_bitmap) * sizeof (clib_bitmap_t));
memset (read_map, 0, vec_len (wrk->rd_bitmap) * sizeof (clib_bitmap_t));
vec_len (wrk->rd_bitmap) * sizeof (unsigned long));
memset (read_map, 0, vec_len (wrk->rd_bitmap) * sizeof (unsigned long));
}
if (n_bits && write_map)
{
clib_bitmap_validate (wrk->wr_bitmap, minbits);
clib_memcpy_fast (wrk->wr_bitmap, write_map,
vec_len (wrk->wr_bitmap) * sizeof (clib_bitmap_t));
vec_len (wrk->wr_bitmap) * sizeof (unsigned long));
memset (write_map, 0,
vec_len (wrk->wr_bitmap) * sizeof (clib_bitmap_t));
vec_len (wrk->wr_bitmap) * sizeof (unsigned long));
}
if (n_bits && except_map)
{
clib_bitmap_validate (wrk->ex_bitmap, minbits);
clib_memcpy_fast (wrk->ex_bitmap, except_map,
vec_len (wrk->ex_bitmap) * sizeof (clib_bitmap_t));
vec_len (wrk->ex_bitmap) * sizeof (unsigned long));
memset (except_map, 0,
vec_len (wrk->ex_bitmap) * sizeof (clib_bitmap_t));
vec_len (wrk->ex_bitmap) * sizeof (unsigned long));
}
if (!n_bits)
@ -2188,7 +2193,7 @@ vppcom_select (unsigned long n_bits, unsigned long *read_map,
rv = svm_fifo_is_full (session->tx_fifo);
if (!rv)
{
clib_bitmap_set_no_check (write_map, sid, 1);
clib_bitmap_set_no_check ((uword*)write_map, sid, 1);
bits_set++;
}
}));
@ -2208,7 +2213,7 @@ check_rd:
rv = vppcom_session_read_ready (session);
if (rv)
{
clib_bitmap_set_no_check (read_map, sid, 1);
clib_bitmap_set_no_check ((uword*)read_map, sid, 1);
bits_set++;
}
}));

View File

@ -326,8 +326,8 @@ vl_api_memclnt_delete_t_handler (vl_api_memclnt_delete_t * mp)
if (am->vlib_private_rps[i] == svm)
{
/* Note: account for the memfd header page */
u64 virtual_base = svm->virtual_base - MMAP_PAGESIZE;
u64 virtual_size = svm->virtual_size + MMAP_PAGESIZE;
uword virtual_base = svm->virtual_base - MMAP_PAGESIZE;
uword virtual_size = svm->virtual_size + MMAP_PAGESIZE;
/*
* Kill the registration pool element before we make
@ -650,8 +650,8 @@ vl_mem_api_dead_client_scan (api_main_t * am, vl_shmem_hdr_t * shm, f64 now)
int i;
svm_region_t *dead_rp = (*regpp)->vlib_rp;
/* Note: account for the memfd header page */
u64 virtual_base = dead_rp->virtual_base - MMAP_PAGESIZE;
u64 virtual_size = dead_rp->virtual_size + MMAP_PAGESIZE;
uword virtual_base = dead_rp->virtual_base - MMAP_PAGESIZE;
uword virtual_size = dead_rp->virtual_size + MMAP_PAGESIZE;
/* For horizontal scaling, add a hash table... */
for (i = 0; i < vec_len (am->vlib_private_rps); i++)

View File

@ -149,6 +149,7 @@ typedef struct
typedef struct
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
/* Mask to apply after skipping N vectors */
u32x4 *mask;
/* Buckets and entries */

View File

@ -73,6 +73,7 @@ typedef enum
typedef struct
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
struct vring_desc *desc;
struct vring_used *used;
struct vring_avail *avail;

View File

@ -2348,7 +2348,7 @@ create_buffer_for_rs (vlib_main_t * vm, ip6_radv_t * radv_info)
rh->ip.hop_limit = 255;
rh->ip.src_address = radv_info->link_local_address;
/* set address ff02::2 */
rh->ip.dst_address.as_u64[0] = clib_host_to_net_u64 (0xff02L << 48);
rh->ip.dst_address.as_u64[0] = clib_host_to_net_u64 (0xff02ULL << 48);
rh->ip.dst_address.as_u64[1] = clib_host_to_net_u64 (2);
rh->neighbor.icmp.checksum = ip6_tcp_udp_icmp_compute_checksum (vm, p0,

View File

@ -1695,14 +1695,14 @@ failed:
return rv;
}
static uword
static u64
application_client_local_connect_key (local_session_t * ls)
{
return ((uword) ls->app_wrk_index << 32 | (uword) ls->session_index);
return (((u64) ls->app_wrk_index) << 32 | (u64) ls->session_index);
}
static void
application_client_local_connect_key_parse (uword key, u32 * app_wrk_index,
application_client_local_connect_key_parse (u64 key, u32 * app_wrk_index,
u32 * session_index)
{
*app_wrk_index = key >> 32;
@ -1718,7 +1718,7 @@ application_local_session_connect_notify (local_session_t * ls)
application_t *client;
int rv, is_fail = 0;
u64 segment_handle;
uword client_key;
u64 client_key;
client_wrk = app_worker_get (ls->client_wrk_index);
server_wrk = app_worker_get (ls->app_wrk_index);
@ -1759,7 +1759,7 @@ application_local_session_cleanup (app_worker_t * client_wrk,
svm_fifo_segment_private_t *seg;
stream_session_t *listener;
segment_manager_t *sm;
uword client_key;
u64 client_key;
u8 has_transport;
/* Retrieve listener transport type as it is the one that decides where
@ -2179,7 +2179,7 @@ app_worker_format_local_connects (app_worker_t * app, int verbose)
u32 app_wrk_index, session_index;
app_worker_t *server_wrk;
local_session_t *ls;
uword client_key;
u64 client_key;
u64 value;
/* Header */

View File

@ -186,7 +186,7 @@ segment_manager_add_segment (segment_manager_t * sm, u32 segment_size)
segment_manager_main_t *smm = &segment_manager_main;
u32 rnd_margin = 128 << 10, seg_index, page_size;
segment_manager_properties_t *props;
uword baseva = (u64) ~ 0, alloc_size;
uword baseva = (uword) ~ 0ULL, alloc_size;
svm_fifo_segment_private_t *seg;
u8 *seg_name;
int rv;
@ -735,8 +735,8 @@ segment_manager_show_fn (vlib_main_t * vm, unformat_input_t * input,
svm_fifo_segment_private_t *seg;
segment_manager_t *sm;
u8 show_segments = 0, verbose = 0;
uword address;
u64 size;
char *address;
size_t size;
u32 active_fifos;
u32 free_fifos;

View File

@ -1539,9 +1539,14 @@ clib_error_t *
session_manager_main_init (vlib_main_t * vm)
{
session_manager_main_t *smm = &session_manager_main;
smm->session_baseva = 0x200000000ULL;
smm->session_va_space_size = (u64) 128 << 30;
smm->session_baseva = HIGH_SEGMENT_BASEVA;
#if (HIGH_SEGMENT_BASEVA > (4ULL << 30))
smm->session_va_space_size = 128ULL << 30;
smm->evt_qs_segment_size = 64 << 20;
#else
smm->session_va_space_size = 128 << 20;
smm->evt_qs_segment_size = 1 << 20;
#endif
smm->is_enabled = 0;
return 0;
}

View File

@ -589,8 +589,8 @@ session_tx_fifo_read_and_snd_i (vlib_main_t * vm, vlib_node_runtime_t * node,
}
ctx->snd_space = transport_connection_snd_space (ctx->tc,
vm->
clib_time.last_cpu_time,
vm->clib_time.
last_cpu_time,
ctx->snd_mss);
if (ctx->snd_space == 0 || ctx->snd_mss == 0)
{
@ -1008,7 +1008,8 @@ dump_thread_0_event_queue (void)
case FIFO_EVENT_RPC:
fformat (stdout, "[%04d] RPC call %llx with %llx\n",
i, (u64) (e->rpc_args.fp), (u64) (e->rpc_args.arg));
i, (u64) (uword) (e->rpc_args.fp),
(u64) (uword) (e->rpc_args.arg));
break;
default:

View File

@ -81,6 +81,9 @@
#define CLIB_PACKED(x) x __attribute__ ((packed))
#define CLIB_UNUSED(x) x __attribute__ ((unused))
/* similar to CLIB_CACHE_LINE_ALIGN_MARK() but with arbitrary alignment */
#define CLIB_ALIGN_MARK(name, alignment) u8 name[0] __attribute__((aligned(alignment)))
/* Make a string from the macro's argument */
#define CLIB_STRING_MACRO(x) #x

View File

@ -30,14 +30,14 @@ clib_crc32c (u8 * s, int len)
{
u32 v = 0;
#if __x86_64__
#if defined(__x86_64__)
for (; len >= 8; len -= 8, s += 8)
v = _mm_crc32_u64 (v, *((u64 *) s));
#else
/* workaround weird GCC bug when using _mm_crc32_u32
which happens with -O2 optimization */
#if !defined (__i686__)
volatile ("":::"memory");
asm volatile ("":::"memory");
#endif
#endif

Some files were not shown because too many files have changed in this diff Show More