-
Notifications
You must be signed in to change notification settings - Fork 202
Let the TCP timer become expired in stead of active #481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
CBMC_RETRY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@htibosch thank you for finding the bug and the raising the PR to fix it.
I just have one question. Grateful if you can answer that.
Thanks
void vIPSetTCPTimerExpiredState( BaseType_t xExpiredState ) | ||
{ | ||
if( xEnableState != pdFALSE ) | ||
xTCPTimer.bActive = pdTRUE_UNSIGNED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the timer is just being marked as expired, why do we need to mark it as active?
Is there any place where we will mark it as inactive thus potentially requiring the timer to be set as active again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AniruddhaKanhere wrote:
If the timer is just being marked as expired, why do we need to mark it as active?
Because when a timer is inactive, it will be ignored by the function prvIPTimerCheck()
:
static BaseType_t prvIPTimerCheck( IPTimer_t * pxTimer )
{
BaseType_t xReturn;
if( pxTimer->bActive == pdFALSE_UNSIGNED )
{
/* The timer is not enabled. */
xReturn = pdFALSE;
}
else
and so prvIPTimerCheck()
will never see the expired flag :-(
Is there any place where we will mark it as inactive thus potentially requiring the timer to be set as active again?
The flag bActive
is set during every call to vIPSetTCPTimerExpiredState()
, while nobody will ever clear it. It would be enough to set it once at start-up.
At the other hand, that would require a new function vIPSetTCPTimerEnableState()
and an extra function-call at start-up, and one more unit test... without a measurable performance gain.
Description
The timer
xTCPTimer
is a timer that tells when the TCP engine must become active by callingxTCPTimerCheck()
. In some occasions, the timer is forced to expire, for instance whenrecv()
was called and created enough space in the reception stream: a WIN update shall be sent immediately.However, after a certain commit to the branch
IntegrationTesting1
, the TCP timer was set as enabled, instead of expired.This PR makes the following change:
and
Test Steps
Send a constant stream of TCP data and look at the performance. There will be periods of inactivity.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.