Skip to content

Conversation

@AniruddhaKanhere
Copy link
Member

@AniruddhaKanhere AniruddhaKanhere commented Jul 30, 2021

Description

The macro ipconfigTCP_ACK_EARLIER_PACKET was added to allow users to determine if they want to acknowledge earlier packets or not in a TCP connection. But, this is not used except in testing - meaning, that the macro is defined as 1.

This PR removes the macro and the corresponding code where the macro value was 0.

Not sure why did uncrustify decide to modify the define s.

Test Steps

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@AniruddhaKanhere AniruddhaKanhere requested a review from a team as a code owner July 30, 2021 18:02
@htibosch
Copy link
Contributor

Thanks Aniruddha, for this PR, it looks good to me.

I will add some comments for those who wonder what this is all about: this code decides if an ACK should be delayed. When the device is receiving a continuous stream of data, it will only want to send an ACK when these conditions are all true:

● In case the peer has enough space in his TCP TX window
● Only when the TCP connection is established
● Only when a FIN has not yet been sent
● Our TX queue is empty
● We only need to send a pure ACK ( i.e. no other flags )

The removed macro was called ipconfigTCP_ACK_EARLIER_PACKET, meaning that when defined, an ACK will be sent earlier, as soon as the space drops below 2 x MSS (u.xTCP.usCurMSS).

@AniruddhaKanhere AniruddhaKanhere merged commit 1a24f31 into FreeRTOS:main Aug 2, 2021
@AniruddhaKanhere AniruddhaKanhere deleted the RemoveDeadCode branch September 20, 2021 23:53
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.

3 participants