Glad I could help. I have never used gerrit so please go ahead and submit the patch.
Thanks, -Bill On Wed, Nov 11, 2020 at 2:09 PM Florin Coras <[email protected]> wrote: > Hi Bill, > > Welcome to the project and thanks for the report! Agreed, that is a bug in > non-default scenarios like yours where custom fifo tuning is required. > Would you be willing to push a patch or should I do it? > > Regards, > Florin > > > On Nov 11, 2020, at 10:33 AM, Bill Vaughan <[email protected]> wrote: > > Hi all, > > I am working on a custom VPP plugin and found what I think may be a bug in > application_worker.c. I don't really have a question, just wanted to point > this out in case it really is a bug. There is always a chance I am doing > something wrong, but everything seems to be working fine with the fix. I > am running the latest 2009. > > My plugin, among other things, accepts and initiates TCP connections (it > has client and server functionality). I am using vnet directly > via vnet_application_attach() , vnet_connect(), etc. > > Development is going great so far but one of the things I wanted to do on > the client and server side is custom fifo handling (via the custom fifo > callback). That works fine on the server side, but I was never getting the > callback on the client side. I am registering both the client and server > as a builtin app (APP_OPTIONS_FLAGS_IS_BUILTIN), but not using the proxy > flag. > > To get the client side to call my custom fifo handler, I had to make the > following change. application_is_builtin_proxy() returns false so the fifo > callback flag was never getting set. > > > >git diff -U7 ../../src/vnet/session/application_worker.c > diff --git a/src/vnet/session/application_worker.c > b/src/vnet/session/application_worker.c > index 17aeb57d4..ec4a97852 100644 > --- a/src/vnet/session/application_worker.c > +++ b/src/vnet/session/application_worker.c > @@ -383,24 +383,27 @@ app_worker_accept_notify (app_worker_t * app_wrk, > session_t * s) > > int > app_worker_init_connected (app_worker_t * app_wrk, session_t * s) > { > application_t *app = application_get (app_wrk->app_index); > segment_manager_t *sm; > > + > + if ( app->cb_fns.fifo_tuning_callback ) > + { > + s->flags |= SESSION_F_CUSTOM_FIFO_TUNING; > + } > + > /* Allocate fifos for session, unless the app is a builtin proxy */ > if (!application_is_builtin_proxy (app)) > { > sm = app_worker_get_connect_segment_manager (app_wrk); > return app_worker_alloc_session_fifos (sm, s); > } > > - if (app->cb_fns.fifo_tuning_callback) > - s->flags |= SESSION_F_CUSTOM_FIFO_TUNING; > - > return 0; > } > > Thanks for maintaining a great project. > > -Bill > > > > >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#17999): https://lists.fd.io/g/vpp-dev/message/17999 Mute This Topic: https://lists.fd.io/mt/78189700/21656 Group Owner: [email protected] Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
