Hi, florin
About this question, i compare c++ code with jvpp code, then i found that
jvpp maybe have a bug and even if update vpp also cannot resolve it
jvpp code according to vpp version 1901, that has jvpp example
vpp-1901/extras/japi/java/jvpp-core/io/fd/vpp/jvpp/core/examples/CreateSubInterfaceExample.java
has jvpp example and our code according to it
now vpp version is 2101
then when java code connected to vpp and then use "close“ function it will
hint "peer unresponsive, give up"
this error from src/vlibmemory/memory_client.c vl_client_disconnect function
why this error is that svm_queue_sub always return -2 until timeout
this is code , the reason is that "vl_input_queue->cursize == 0 " and
vl_input_queue->head == vl_input_queue->tail
int
vl_client_disconnect (void)
{
vl_api_memclnt_delete_reply_t *rp;
svm_queue_t *vl_input_queue;
api_main_t *am = vlibapi_get_main ();
time_t begin;
vl_input_queue = am->vl_input_queue;
vl_client_send_disconnect (0 /* wait for reply */ );
/*
* Have to be careful here, in case the client is disconnecting
* because e.g. the vlib process died, or is unresponsive.
*/
begin = time (0);
while (1)
{
time_t now;
now = time (0);
if (now >= (begin + 2))
{
clib_warning ("peer unresponsive, give up");
am->my_client_index = ~0;
am->my_registration = 0;
am->shmem_hdr = 0;
return -1;
}
/* this error because vl_input_queue->cursize == 0 */
if (svm_queue_sub (vl_input_queue, (u8 *) & rp, SVM_Q_NOWAIT, 0) < 0)
continue;
VL_MSG_API_UNPOISON (rp);
/* drain the queue */
if (ntohs (rp->_vl_msg_id) != VL_API_MEMCLNT_DELETE_REPLY)
{
clib_warning ("queue drain: %d", ntohs (rp->_vl_msg_id));
vl_msg_api_handler ((void *) rp);
continue;
}
vl_msg_api_handler ((void *) rp);
break;
}
vl_api_name_and_crc_free ();
return 0;
}
when i use c++ for vpp binary api, vl_input_queue->cursize == 1 and
vl_input_queue->head != vl_input_queue->tail
so c++ use binary api is correct that about svm_queue_* series functions
Although JVpp is no longer supported, but this is important for me!
Can you give a patch for jvpp? Thanks
Best regards
Wanghe
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#21500): https://lists.fd.io/g/vpp-dev/message/21500
Mute This Topic: https://lists.fd.io/mt/91372330/21656
Group Owner: [email protected]
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-