On 3/14/23, 6:52 PM, "Yunsheng Lin" <linyunsheng@huawei.com mailto:linyunsheng@huawei.com> wrote:
Does clearing the NETIF_F_GRO for netdev->features bring back the performance? If no, maybe there is something need investigating.
Yes, it does. Simply using netif_receive_skb works fine.
Checking rq->shared->updateRxProd in the driver to decide if gro is allow does not seems right to me, as the netstack has used the NETIF_F_GRO checking in netif_elide_gro().
updateRxProd is NOT being used to determine if GRO is allowed. It is being used to indicate UPT is active, so the driver should just use GRO callback. This is as good as having only GRO callback for UPT driver which you were suggesting earlier.
Does clearing NETIF_F_GRO for netdev->features during the driver init process works for your case?
No this does not work as UPT mode can be enabled/disabled at runtime without guest being informed. This is para-virtualized driver and does not know if the guest is being run in emulation or UPT.
As netdev->hw_features is for the driver to advertise the hw's capability, and the driver can enable/disable specific capability by setting netdev->features during the driver init process, and user can get to enable/disable specific capability using ethtool later if user need to.
As I mentioned above, guest is not informed at runtime about UPT status. So, we need this mechanism to avoid performance penalty.
Thanks, Ronak