Re: [PATCH v3 net 1/1] net: fec: correct the counting of XDP sent frames

From: Leon Romanovsky
Date: Fri May 05 2023 - 06:23:18 EST


On Thu, May 04, 2023 at 10:35:17AM -0500, Shenwei Wang wrote:
> 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@xxxxxxx>
> Signed-off-by: Shenwei Wang <shenwei.wang@xxxxxxx>
> ---
> v3:
> - resend the v2 fix for "net" as the standalone patch.
>
> v2:
> - only keep the bug fix part of codes according to Horatiu's comments.
> - restructure the functions to avoid the forward declaration.
>
> drivers/net/ethernet/freescale/fec_main.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxx>