net: Fix build for Linux v6.1

Upstream Linux kernel commit b48b89f9c189 ("net: drop the weight
argument from netif_napi_add") removes the weight argument from the
netif_napi_add() function and this is breaking the build of a few
drivers that use this function. Fix this by updating these drivers to
use the netif_napi_add_weight() function instead for Linux v6.1.

Bug 3831575

Change-Id: I5ab3c2380db75313f9226c68777e6245e9e9dad5
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2793511
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2022-10-17 20:01:59 +01:00
committed by mobile promotions
parent 3c38a2fe6f
commit 5cfa3e3c3f
3 changed files with 13 additions and 0 deletions

View File

@@ -9,6 +9,7 @@
#include <linux/netdevice.h>
#include <linux/pci.h>
#include <linux/tegra_vnet.h>
#include <linux/version.h>
struct tvnet_priv {
struct net_device *ndev;
@@ -792,7 +793,11 @@ static int tvnet_host_probe(struct pci_dev *pdev,
/* Setup BAR0 meta data */
tvnet_host_setup_bar0_md(tvnet);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
netif_napi_add_weight(ndev, &tvnet->napi, tvnet_host_poll, TVNET_NAPI_WEIGHT);
#else
netif_napi_add(ndev, &tvnet->napi, tvnet_host_poll, TVNET_NAPI_WEIGHT);
#endif
ndev->mtu = TVNET_DEFAULT_MTU;