Skip to content

Commit

Permalink
linux/ena: Move eth_hw_addr_set to ECC
Browse files Browse the repository at this point in the history
Due to the increased amount of backports of this
function in different OS distributions, we keep on extending
the kcompat support with more complicated versioning logic,
trying to identify the range of kernel versions of each
distribution where this function is introduced.

Moving this definition to the hands of ECC in order to
avoid the added effort of maintaining the kcompat for
this entry.

Signed-off-by: David Arinzon <darinzon@amazon.com>
  • Loading branch information
davidarinzon committed Jun 27, 2024
1 parent 30782c8 commit 5d8ca7c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 6 additions & 0 deletions kernel/linux/ena/config/test_defs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ try_compile_async "#include <linux/ethtool.h>" \
"ENA_HAVE_ETHTOOL_RXFH_PARAM" \
"" \
"6.8.0 <= LINUX_VERSION_CODE"

try_compile_async "#include <linux/etherdevice.h>" \
"eth_hw_addr_set(NULL, NULL);" \
"ENA_HAVE_ETH_HW_ADDR_SET" \
"" \
"5.15.0 <= LINUX_VERSION_CODE"
10 changes: 1 addition & 9 deletions kernel/linux/ena/kcompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -888,15 +888,7 @@ xdp_prepare_buff(struct xdp_buff *xdp, unsigned char *hard_start,
#define ENA_XDP_XMIT_FREES_FAILED_DESCS_INTERNALLY
#endif

#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) && \
!(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 188) && \
LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)) && \
!(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 251) && \
LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0))) && \
!(defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8, 6)) && \
!(defined(SUSE_VERSION) && (SUSE_VERSION == 15 && SUSE_PATCHLEVEL >= 4)) && \
!(defined(SUSE_VERSION) && (SUSE_VERSION == 15 && SUSE_PATCHLEVEL == 3) && \
ENA_KERNEL_VERSION_GTE(5, 3, 18, 150300, 59, 43))
#ifndef ENA_HAVE_ETH_HW_ADDR_SET
static inline void eth_hw_addr_set(struct net_device *dev, const u8 *addr)
{
memcpy(dev->dev_addr, addr, ETH_ALEN);
Expand Down

0 comments on commit 5d8ca7c

Please sign in to comment.