Skip to content

app: PPP fixes for recovery#304

Merged
SeppoTakalo merged 1 commit into
nrfconnect:mainfrom
SeppoTakalo:ppp_fixes
May 19, 2026
Merged

app: PPP fixes for recovery#304
SeppoTakalo merged 1 commit into
nrfconnect:mainfrom
SeppoTakalo:ppp_fixes

Conversation

@SeppoTakalo
Copy link
Copy Markdown
Contributor

@SeppoTakalo SeppoTakalo commented May 15, 2026

Decrease LCP timeouts to one second. We don't need to realistically wait for longer on the Serial Modem side. Max retransmits set to 5 times, so total timeout is 5 seconds.

Increase PPPD holdoff to twice of that, so it is 10 seconds. This allows enough time for Zephyr side to tear down the connection.

Retry the net_if_down() as the first attempt might fail when there is heavy traffic. The LCP packet is still queued, so the second retry just tears down the interface in dormant state, so it does not send the LCP anymore.

Jira: SM-326, SM-327

Comment thread app/scripts/sm2_start_ppp.sh Outdated
Copy link
Copy Markdown
Contributor

@MarkusLassila MarkusLassila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Some questions/suggestions

Comment thread app/src/sm_ppp.c
static void ppp_data_passing_thread(void*, void*, void*);
static void sm_ppp_activate_pdp_dwork_fn(struct k_work *work);
static int ppp_stop(enum ppp_reason reason);
static void ppp_cmd_fail_return_to_at_mode(void);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static void ppp_cmd_fail_return_to_at_mode(void);

Comment thread app/src/sm_ppp.c
}

ppp_state = PPP_STATE_STOPPING;
close_ppp_sockets();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason to make this earlier? To close them even if the interface closure fails?

Could there still be data coming when ppp_stop has been called?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was suspecting that these sockets would have been one reason why closing the interface fails.

They keep forwarding traffic, so it can cumulate data and block the LCP messages going through.

I'm unsure if there was any real effect of this after all, but it does not seem to break anything doing it in this order.

@SeppoTakalo SeppoTakalo force-pushed the ppp_fixes branch 2 times, most recently from fcc4e68 to abf87fa Compare May 18, 2026 12:19
Decrease LCP timeouts to one second. We don't need to realistically
wait for longer on the Serial Modem side. Max retransmits set
to 5 times, so total timeout is 5 seconds.

Increase PPPD holdoff to twice of that, so it is 10 seconds.
This allows enough time for Zephyr side to tear down the connection.

Retry the net_if_down() as the first attempt might fail when there is
heavy traffic. The LCP packet is still queued, so the second retry
just tears down the interface in dormant state, so it does not send
the LCP anymore.

Lower the PPP thread priority to K_LOWEST_APPLICATION_THREAD_PRIO
so it does not block any work queues.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
@SeppoTakalo SeppoTakalo merged commit 0577100 into nrfconnect:main May 19, 2026
2 checks passed
@SeppoTakalo SeppoTakalo deleted the ppp_fixes branch May 19, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants