]> git.hungrycats.org Git - linux/commit
net: fec: correct the counting of XDP sent frames
authorShenwei Wang <shenwei.wang@nxp.com>
Thu, 4 May 2023 15:35:17 +0000 (10:35 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 11:58:51 +0000 (13:58 +0200)
commit52edb767e6e837c8ea4aebfaa315986e22a6306f
treeb3af167aca782215c523c0f18d697dd75fab25b7
parent7484e72b92d6aa2a35336991a9917ef5f5fc459e
net: fec: correct the counting of XDP sent frames

[ Upstream commit 26312c685ae0bca61e06ac75ee158b1e69546415 ]

In the current xdp_xmit implementation, if any single frame fails to
transmit due to insufficient buffer descriptors, the function nevertheless
reports success in sending all frames. This results in erroneously
indicating that frames were transmitted when in fact they were dropped.

This patch fixes the issue by ensureing the return value properly
indicates the actual number of frames successfully transmitted, rather than
potentially reporting success for all frames when some could not transmit.

Fixes: 6d6b39f180b8 ("net: fec: add initial XDP support")
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/freescale/fec_main.c