Hi Subrata, What exactly fails in segment_manager_add_segment? Memory for builtin app segments is not allocated in /dev/shm instead it’s mmaped. Does clib_mem_vm_map fail?
Regards, Florin > On Dec 12, 2021, at 7:52 AM, Subrata Nath <subratanat...@gmail.com> wrote: > > HI, > > I am trying to create a UDP transport socket using VPP host stack. > vnet_listen() fails. Error seems to coming from the following code which > tries to add segment in vnet/session/segment_manager.c - > segment_manager_alloc_session_fifos() > > if ((new_fs_index = segment_manager_add_segment (sm, 0, 1)) < 0) > { > return SESSION_E_SEG_CREATE; > } > > Following is my code snippet. VPP version v21.10-rc0~353-ge3cf4d0cf. Some of > relevant parameters are mentioned along with lines e.g. fifo size , segment > size. Other parameters like sw_infex, fib_index & ip all are fine. > > 1. Create the ns => This step is successful. > > u8 *appns_id = format (0, "myappns"); > vnet_app_namespace_add_del_args_t ns_args = { > .ns_id = appns_id, > .sw_if_index = sw_if_index, > .ip4_fib_id = fib_id, > .is_add = 1 > }; > > vnet_app_namespace_add_del (&ns_args); ==> Successful. > > 2. vnet_application_attach => This step is successful > myapp_server_main_t *myappsm = &myapp_server_main; > u64 options[APP_OPTIONS_N_OPTIONS]; > vnet_app_attach_args_t _a, *a = &_a; > > vnet_session_enable_disable (myappsm->vlib_main, 1); > > clib_memset (a, 0, sizeof (*a)); > clib_memset (options, 0, sizeof (options)); > > a->api_client_index = ~0; > a->name = format (0, "myapp-server"); > a->session_cb_vft = &myapp_server_session_cb_vft; > a->namespace_id = appns_id; > a->options = options; > a->options[APP_OPTIONS_SEGMENT_SIZE] = myappsm->private_segment_size; > //536870912 > a->options[APP_OPTIONS_ADD_SEGMENT_SIZE] = myappsm->private_segment_size; > //536870912 > a->options[APP_OPTIONS_RX_FIFO_SIZE] = myappsm->fifo_size; //65536 > a->options[APP_OPTIONS_TX_FIFO_SIZE] = myappsm->fifo_size; //65536 > a->options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN; > a->options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE; > a->options[APP_OPTIONS_PREALLOC_FIFO_PAIRS] = myappsm->prealloc_fifos; //1 > a->options[APP_OPTIONS_PCT_FIRST_ALLOC] = 100; > > vnet_application_attach(a) ==> Successful. > > 3. vnet_listen() => This step fails. > > vnet_listen_args_t _a, *a = &_a; > clib_memset (a, 0, sizeof (*a)); > a->app_index = myappsm->app_index; > a->sep_ext = (session_endpoint_cfg_t) SESSION_ENDPOINT_CFG_NULL; > a->sep_ext.fib_index = fib_index; > a->sep_ext.transport_proto = TRANSPORT_PROTO_UDP; > a->sep_ext.is_ip4 = ip46_address_is_ip4 (ip); > a->sep_ext.ip = *ip; > a->sep_ext.port = clib_host_to_net_u16 (UDP_DST_PORT); > a->sep_ext.sw_if_index = sw_index; > > vnet_listen (a)) => fails > > Can anyone please point me to what is missing here. > startup.conf is attached. > Note: it's running inside a K8s Pod with privilege access and there is enough > space for /dev/shm as shown below > > # df -h > Filesystem Size Used Avail Use% Mounted on > overlay 196G 63G 124G 34% / > tmpfs 64M 0 64M 0% /dev > tmpfs 126G 0 126G 0% /sys/fs/cgroup > /dev/mapper/ubuntu--vg-ubuntu--lv 196G 63G 124G 34% /tmp > tmpfs 126G 180K 126G 1% /dev/shm > tmpfs 126G 12K 126G 1% > /run/secrets/kubernetes.io/serviceaccount > <http://kubernetes.io/serviceaccount> > > Thanks & Regards, > Subrata > <startup.conf> > >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#20626): https://lists.fd.io/g/vpp-dev/message/20626 Mute This Topic: https://lists.fd.io/mt/87678394/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-