Skip to content

Commit

Permalink
Update kernel APIs for ubuntu 22 kernel 6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cardigliano committed Aug 7, 2023
1 parent 2c296ef commit c0af55a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 2 additions & 0 deletions drivers/intel/ice/ice-1.9.11-zc/src/ice_devlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,13 @@ static int ice_devlink_info_get(struct devlink *devlink,
}
}

#ifndef NO_DEVLINK_INFO_DRIVER_NAME_PUT
err = devlink_info_driver_name_put(req, KBUILD_MODNAME);
if (err) {
NL_SET_ERR_MSG_MOD(extack, "Unable to set driver name");
goto out_free_ctx;
}
#endif

ice_info_get_dsn(pf, ctx);

Expand Down
6 changes: 5 additions & 1 deletion drivers/intel/ice/ice-1.9.11-zc/src/ice_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5783,7 +5783,11 @@ static int ice_register_netdev(struct ice_pf *pf)
if (err)
goto err_devlink_create;

devlink_port_type_eth_set(&pf->devlink_port, vsi->netdev);
devlink_port_type_eth_set(&pf->devlink_port
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,2,0))
, vsi->netdev
#endif
);
#endif /* CONFIG_NET_DEVLINK */

return 0;
Expand Down
8 changes: 7 additions & 1 deletion drivers/intel/ice/ice-1.9.11-zc/src/ice_repr.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ static const struct net_device_ops ice_repr_netdev_ops = {
.ndo_change_mtu = ice_repr_change_mtu,
#endif /* HAVE_RHEL7_EXTENDED_MIN_MAX_MTU */
#ifdef HAVE_DEVLINK_PORT_ATTR_PCI_VF
#ifdef HAVE_NDO_GET_DEVLINK_PORT
.ndo_get_devlink_port = ice_repr_get_devlink_port,
#endif
#endif /* HAVE_DEVLINK_PORT_ATTR_PCI_VF */
#ifdef HAVE_TC_SETUP_CLSFLOWER
#ifdef HAVE_RHEL7_NETDEV_OPS_EXT_NDO_SETUP_TC
Expand Down Expand Up @@ -443,7 +445,11 @@ static int ice_repr_add(struct ice_vf *vf)

#if IS_ENABLED(CONFIG_NET_DEVLINK)
#ifdef HAVE_DEVLINK_PORT_ATTR_PCI_VF
devlink_port_type_eth_set(&vf->devlink_port, repr->netdev);
devlink_port_type_eth_set(&vf->devlink_port
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,2,0))
, repr->netdev
#endif
);
#endif /* HAVE_DEVLINK_PORT_ATTR_PCI_VF */
#endif /* CONFIG_NET_DEVLINK */

Expand Down
8 changes: 8 additions & 0 deletions drivers/intel/ice/ice-1.9.11-zc/src/kcompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -3545,6 +3545,14 @@ _kc_netif_napi_add(struct net_device *dev, struct napi_struct *napi,

#endif

/*****************************************************************************/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,2,0))
#ifdef HAVE_NDO_GET_DEVLINK_PORT
#undef HAVE_NDO_GET_DEVLINK_PORT
#endif
#define NO_DEVLINK_INFO_DRIVER_NAME_PUT
#endif

/*
* Load the implementations file which actually defines kcompat backports.
* Legacy backports still exist in this file, but all new backports must be
Expand Down

0 comments on commit c0af55a

Please sign in to comment.