OSDN Git Service

net: qrtr: Implement outgoing flow control
authorBjorn Andersson <bjorn.andersson@linaro.org>
Tue, 14 Jan 2020 07:57:00 +0000 (23:57 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Jan 2020 02:36:41 +0000 (18:36 -0800)
commit5fdeb0d372ab33b4175043a2a4a1730239a217f1
tree585b1c80d72a7f6d7ff55158fe511914669990f1
parentcb6530b99fafea6c0636c4640bd21301d12cdbc9
net: qrtr: Implement outgoing flow control

In order to prevent overconsumption of resources on the remote side QRTR
implements a flow control mechanism.

The mechanism works by the sender keeping track of the number of
outstanding unconfirmed messages that has been transmitted to a
particular node/port pair.

Upon count reaching a low watermark (L) the confirm_rx bit is set in the
outgoing message and when the count reaching a high watermark (H)
transmission will be blocked upon the reception of a resume_tx message
from the remote, that resets the counter to 0.

This guarantees that there will be at most 2H - L messages in flight.
Values chosen for L and H are 5 and 10 respectively.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/qrtr/qrtr.c