Hi All,

I am trying to do the following tasks while deleting the sa to handle
inflight packets.

1. sa delete event processed from main thread
2. I am trying to delay sa delete operation and queue this event to
maintenance list
3. There is a timer run in each worker thread which iterates through the
maintenance list upon timer expiry.
4. upon timer expiry, worker thread is trying to get the ipsec sa by doing
[ipsec_sa_t *sa = pool_elt_at_index (ipsec_sa_pool, sa_index);] (sa_index
is valid)
5. Now when I try to access the fields of sa, I see sa address is invalid
and got SIGABORT.

Please help me to know why my plugin is unable to get sa address unlike
esp_encrypt and esp_decrypt plugins as these plugins also run in worker
context.

Is there some criteria to access ipsec pool entries by non-ipsec plugins?

Note: Using GDB I have checked the contents of ipsec_sa_pool by offsetting
the sa_index and I see there are valid contents.

(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>,
signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007ffb1f6818f3 in __pthread_kill_internal (signo=6,
threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007ffb1f6346a6 in __GI_raise (sig=sig@entry=6) at
../sysdeps/posix/raise.c:26
#3  0x00007ffb1f61e865 in __GI_abort () at abort.c:100
#4  0x000055e3148a630a in os_exit (code=<optimized out>) at
/usr/src/debug/vpp-21.06.0-5~ga619cae67_dirty.x86_64/src/vpp/vnet/main.c:477
#5  <signal handler called>
#6  0x00007ff89ef90757 in ipasec_sa_process_tick
(time_now=290.00001059803714, wk_id=0)
    at
/src/cna/.build/opt/external-package/fdio/src/fdio.2106/src/an-plugins/an_ppe_pce-plugin/an_ppe_pce/an_ppe_pce_tw_node.c:921
#7  an_ppe_pce_timer_process_tick (tv_now=<optimized out>, wk_id=<optimized
out>)
    at
/src/cna/.build/opt/external-package/fdio/src/fdio.2106/src/an-plugins/an_ppe_pce-plugin/an_ppe_pce/an_ppe_pce_tw_node.c:1021
#8  0x00007ff89ef92353 in an_ppe_pce_tw (vm=<optimized out>,
node=<optimized out>, from_frame=<optimized out>)
    at
/src/cna/.build/opt/external-package/fdio/src/fdio.2106/src/an-plugins/an_ppe_pce-plugin/an_ppe_pce/an_ppe_pce_tw_node.c:1141
#9  0x00007ffb1f9c67ab in dispatch_node (last_time_stamp=<optimized out>,
frame=0x0, dispatch_state=VLIB_NODE_STATE_POLLING,
type=VLIB_NODE_TYPE_INPUT, node=0x7ff8a0bc8140, vm=0x7ff8a61f74c0)
    at
/usr/src/debug/vpp-21.06.0-5~ga619cae67_dirty.x86_64/src/vlib/main.c:1072
#10 vlib_main_or_worker_loop (is_main=0, vm=0x7ff8a61f74c0) at
/usr/src/debug/vpp-21.06.0-5~ga619cae67_dirty.x86_64/src/vlib/main.c:1810
#11 vlib_worker_loop (vm=0x7ff8a61f74c0) at
/usr/src/debug/vpp-21.06.0-5~ga619cae67_dirty.x86_64/src/vlib/main.c:1975
#12 0x00007ffb1f93b68c in clib_calljmp () at
/usr/src/debug/vpp-21.06.0-5~ga619cae67_dirty.x86_64/src/vppinfra/longjmp.S:123
#13 0x00007ff749932c80 in ?? ()
#14 0x00007ff89aa931f2 in eal_thread_loop.cold () from
/usr/lib/vpp_plugins/dpdk_plugin.so
#15 0x0000000000000000 in ?? ()
(gdb) f 6
#6  0x00007ff89ef90757 in ipasec_sa_process_tick
(time_now=290.00001059803714, wk_id=0)
    at
/src/cna/.build/opt/external-package/fdio/src/fdio.2106/src/an-plugins/an_ppe_pce-plugin/an_ppe_pce/an_ppe_pce_tw_node.c:921
921
/src/cna/.build/opt/external-package/fdio/src/fdio.2106/src/an-plugins/an_ppe_pce-plugin/an_ppe_pce/an_ppe_pce_tw_node.c:
Success.
(gdb) info locals
p_oldest_elt = 0x7ff8bb682dd4
sa = 0xffffffffbb67d440
oldest_index = 1
p_thread_data = 0x7ff8ae420bf0
delete_flag = true
delete_count = 0
said = 17220
p_thread_data = <optimized out>
delete_flag = <optimized out>
delete_count = <optimized out>
said = <optimized out>
__FUNCTION__ = {<optimized out> <repeats 23 times>}
oldest_index = <optimized out>
p_oldest_elt = <optimized out>
sa = <optimized out>
_pool_p__ = <optimized out>
_pool_e__ = <optimized out>
_pool_p = <optimized out>
_pool_l = <optimized out>
_vec_l = <optimized out>
_V = <optimized out>
_x = <optimized out>
_y = <optimized out>
(gdb) p *sa
Cannot access memory at address 0xffffffffbb67d440
(gdb)

Thanks,
Sagar
-- 
Regards,
sagar g
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#21914): https://lists.fd.io/g/vpp-dev/message/21914
Mute This Topic: https://lists.fd.io/mt/93853071/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to