patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: stable@dpdk.org
Cc: ferruh.yigit@intel.com, Kevin Traynor <ktraynor@redhat.com>
Subject: [dpdk-stable] [PATCH 18.11] kni: fix ethtool build for kernel 5.5
Date: Fri, 13 Mar 2020 16:00:08 +0000	[thread overview]
Message-ID: <20200313160008.30248-1-ktraynor@redhat.com> (raw)

FIELD_SIZEOF() was removed in kernel 5.5 in commit
1f07dcc459d5 ("kernel.h: Remove unused FIELD_SIZEOF()")

It's replacement, sizeof_field() is not a good replacement
for us as it was only introduced in 4.16.

Create RTE_SIZEOF_FIELD to enable build.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
 kernel/linux/kni/ethtool/igb/igb_ethtool.c     | 6 ++++--
 kernel/linux/kni/ethtool/ixgbe/ixgbe_ethtool.c | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/kernel/linux/kni/ethtool/igb/igb_ethtool.c b/kernel/linux/kni/ethtool/igb/igb_ethtool.c
index a35f3da7d..7b406f1da 100644
--- a/kernel/linux/kni/ethtool/igb/igb_ethtool.c
+++ b/kernel/linux/kni/ethtool/igb/igb_ethtool.c
@@ -40,7 +40,9 @@ struct igb_stats {
 };
 
+#define RTE_SIZEOF_FIELD(type, field) (sizeof(((type *)0)->field))
+
 #define IGB_STAT(_name, _stat) { \
 	.stat_string = _name, \
-	.sizeof_stat = FIELD_SIZEOF(struct igb_adapter, _stat), \
+	.sizeof_stat = RTE_SIZEOF_FIELD(struct igb_adapter, _stat), \
 	.stat_offset = offsetof(struct igb_adapter, _stat) \
 }
@@ -97,5 +99,5 @@ static const struct igb_stats igb_gstrings_stats[] = {
 #define IGB_NETDEV_STAT(_net_stat) { \
 	.stat_string = #_net_stat, \
-	.sizeof_stat = FIELD_SIZEOF(struct net_device_stats, _net_stat), \
+	.sizeof_stat = RTE_SIZEOF_FIELD(struct net_device_stats, _net_stat), \
 	.stat_offset = offsetof(struct net_device_stats, _net_stat) \
 }
diff --git a/kernel/linux/kni/ethtool/ixgbe/ixgbe_ethtool.c b/kernel/linux/kni/ethtool/ixgbe/ixgbe_ethtool.c
index a03a77ff2..34a423a63 100644
--- a/kernel/linux/kni/ethtool/ixgbe/ixgbe_ethtool.c
+++ b/kernel/linux/kni/ethtool/ixgbe/ixgbe_ethtool.c
@@ -41,7 +41,9 @@ struct ixgbe_stats {
 };
 
+#define RTE_SIZEOF_FIELD(type, field) (sizeof(((type *)0)->field))
+
 #define IXGBE_NETDEV_STAT(_net_stat) { \
 	.stat_string = #_net_stat, \
-	.sizeof_stat = FIELD_SIZEOF(struct net_device_stats, _net_stat), \
+	.sizeof_stat = RTE_SIZEOF_FIELD(struct net_device_stats, _net_stat), \
 	.stat_offset = offsetof(struct net_device_stats, _net_stat) \
 }
@@ -70,5 +72,5 @@ static const struct ixgbe_stats ixgbe_gstrings_net_stats[] = {
 #define IXGBE_STAT(_name, _stat) { \
 	.stat_string = _name, \
-	.sizeof_stat = FIELD_SIZEOF(struct ixgbe_adapter, _stat), \
+	.sizeof_stat = RTE_SIZEOF_FIELD(struct ixgbe_adapter, _stat), \
 	.stat_offset = offsetof(struct ixgbe_adapter, _stat) \
 }
-- 
2.21.1


             reply	other threads:[~2020-03-13 16:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-13 16:00 Kevin Traynor [this message]
2020-03-18 23:04 ` Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200313160008.30248-1-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=ferruh.yigit@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).