net: Use conftest

Instead of relying on kernel version to determine if functions or
specific versions of functions are present in the kernel, add compile
time tests to the conftest.sh script to determine this at compile time
for the kernel being used. This is beneficial for working with 3rd party
Linux kernels that may have back-ported upstream changes into their
kernel and so the kernel version checks do not work.

Bug 4119327

Change-Id: I79e701940ca70ca4d66500c75b5992f9d92b54b0
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2985744
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2023-09-26 11:26:03 +01:00
committed by mobile promotions
parent 3dbf9a344e
commit ece68dd0d1
9 changed files with 125 additions and 23 deletions

View File

@@ -32,6 +32,8 @@
* US6,570,884, US6,115,776, and US6,327,625.
***********************************************************************************/
#include <nvidia/conftest.h>
#include <linux/ethtool.h>
#include "r8168_dash.h"
#include "r8168_realwow.h"
@@ -566,7 +568,7 @@ typedef int *napi_budget;
typedef struct napi_struct *napi_ptr;
typedef int napi_budget;
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
#if defined(NV_NETIF_NAPI_ADD_WEIGHT_PRESENT) /* Linux v6.1 */
#define RTL_NAPI_CONFIG(ndev, priv, function, weight) \
netif_napi_add_weight(ndev, &priv->napi, function, weight)
#else