On Thu, Oct 17, 2019 at 8:45 PM Neale Ranns (nranns) <nra...@cisco.com> wrote: > I think your analysis is spot on. Thank you! > How you're a VPP PPPoE expert __ do you have some suggestions on a fix?
Thanks for taking a look at this Neale! I have some ideas for a fix to this problem. Alternative 1. During the packet processing time, get the session information by using the adj->rewrite_header.sw_if_index . With this approach fixup_data need not be passed. + pppoe_main_t *pem = &pppoe_main; + + u32 sw_if_index = adj->rewrite_header.sw_if_index; + u32 session_id = pem->session_index_by_sw_if_index[sw_if_index]; + t = pool_elt_at_index (pem->sessions, session_id); Pros : Without any functin prototype change we can arrive at the solution. Cons : While processing every pppoe packet, we have to get the session data. Alternative 2. pppoe build rewrite is done based on rewrite data(adj->rewrite_header). Here we have a sw_if_index(adj->rewrite_header.sw_if_index). How is this is different from the session's encap_if_index? I tried to understand this from code, but couldn't figure out, if both are the same. If both are same: Fix would be : At the time processing pppoe packet, just use the 'adj->rewrite_header.sw_if_index'. Alternative 3. As Neale suggested, just push the session's encap_if_index, instead of passing the const void *. But this requires some architectural changes, I believe. Because const void *fixup_data is depended on the function pointer 'adj->sub_type.midchain.fixup_func'. This can bind only during the run time. I have one question regarding pool memory creation: On each pppoe session addition VPP is resizing the vector pool pem->sessions. Is it ok if I allocate a fixed number of session initially? I am trying to understand the architectural rational behind adding one element to the vector pool at a time, as opposed to allocating a bulk number initially. If it is ok to allocate a large pool initially (preferably taking the max_sessions from a conf file), we can side step this issue. Thanks and Regards, Raj
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#14232): https://lists.fd.io/g/vpp-dev/message/14232 Mute This Topic: https://lists.fd.io/mt/34298895/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-