diff options
author | Horatiu Vultur <horatiu.vultur@microchip.com> | 2020-02-17 11:31:33 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-03-05 18:43:31 +0300 |
commit | 248b7751391f43465b3eed5d002824f5d37c0599 (patch) | |
tree | b764133b0c13e13e8cecec275b7c7dea8ccd74f9 /include | |
parent | e99e2f59d9a26c2e6872cdde7312742fe113f80c (diff) | |
download | linux-248b7751391f43465b3eed5d002824f5d37c0599.tar.xz |
net: mscc: fix in frame extraction
[ Upstream commit a81541041ceb55bcec9a8bb8ad3482263f0a205a ]
Each extracted frame on Ocelot has an IFH. The frame and IFH are extracted
by reading chuncks of 4 bytes from a register.
In case the IFH and frames were read corretly it would try to read the next
frame. In case there are no more frames in the queue, it checks if there
were any previous errors and in that case clear the queue. But this check
will always succeed also when there are no errors. Because when extracting
the IFH the error is checked against 4(number of bytes read) and then the
error is set only if the extraction of the frame failed. So in a happy case
where there are no errors the err variable is still 4. So it could be
a case where after the check that there are no more frames in the queue, a
frame will arrive in the queue but because the error is not reseted, it
would try to flush the queue. So the frame will be lost.
The fix consist in resetting the error after reading the IFH.
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions