Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

nx_ppp_delete leaks packet pool packets through nx_ppp_receive_partial_packet #274

Open
BarryAndrews opened this issue May 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@BarryAndrews
Copy link

I am developing a cellular modem interface using renesas RX processor RX72N.
I need to start and stop the PPP interface for each session and have followed the recommended guide.

First I stop the PPP

nx_ppp_stop(pModem->pPPP); // Now wait until the PPP thread goes to a closed state before proceeding with the delete. // This will give PPP the opportunity to properly release all packets being worked on. while (pModem->pPPP->nx_ppp_state != NX_PPP_STOPPED) { // Sleep for a tick. tx_thread_sleep(1); }
Next I delete the associated IP interface

if (NX_SUCCESS == nx_ip_delete(pModem->pIP)) { if (pModem->device.DiagsOn) { LogDiagMessage("%s: IP Interface deleted", ID); } }
Finally I delete the PPP interface itself

if (NX_SUCCESS == nx_ppp_delete(pModem->pPPP)) { if (pModem->device.DiagsOn) { LogDiagMessage("%s: PPP Interface deleted", ID); } }

However, I am finding that the nx_ppp_delete, does not always release the partial receive packet and I need to add this code before I delete the PPP interface to avoid my packet pool running out.

// Check if partial Rx packet needs releasing if (pModem->pPPP->nx_ppp_receive_partial_packet) { LogDiagMessage("%s: PPP Partial Receive Packet Released", ID); nx_packet_release(pModem->pPPP->nx_ppp_receive_partial_packet); pModem->pPPP->nx_ppp_receive_partial_packet = NX_NULL; }
I have tried this with ip thread higher priority than ppp thread, and ip thread same priority as ppp thread. Regardless of priority, most times there is a partial receive packet allocated when I call nx_ppp_delete and this only checks the partial receive packet if the PPP isn't already stopped.

@BarryAndrews BarryAndrews added the bug Something isn't working label May 28, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant