RE: [PATCH v2] hv_netvsc: Fix netvsc_start_xmit's return type

From: Michael Kelley
Date: Wed Apr 29 2020 - 20:06:15 EST


From: Nathan Chancellor <natechancellor@xxxxxxxxx> Sent: Tuesday, April 28, 2020 10:55 AM
>
> Do note that netvsc_xmit still returns int because netvsc_xmit has a
> potential return from netvsc_vf_xmit, which does not return netdev_tx_t
> because of the call to dev_queue_xmit.
>
> I am not sure if that is an oversight that was introduced by
> commit 0c195567a8f6e ("netvsc: transparent VF management") or if
> everything works properly as it is now.
>
> My patch is purely concerned with making the definition match the
> prototype so it should be NFC aside from avoiding the CFI panic.
>

While it probably works correctly now, I'm not too keen on just
changing the return type for netvsc_start_xmit() and assuming the
'int' that is returned from netvsc_xmit() will be correctly mapped to
the netdev_tx_t enum type. While that mapping probably happens
correctly at the moment, this really should have a more holistic fix.

Nathan -- are you willing to look at doing the more holistic fix? Or
should we see about asking Haiyang Zhang to do it?

Michael