From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 16100A0567 for ; Fri, 13 Mar 2020 17:00:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CDF9A2BE3; Fri, 13 Mar 2020 17:00:32 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 8C3A22BE3 for ; Fri, 13 Mar 2020 17:00:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584115231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9kD9wjuJgYqlxtP+bU2xjyfXIfNn/BNNLqPRHOWzh/4=; b=Ka0DQWttwkoKwZoJ8/zdvZC2ij9ShcIDZcL6h82JXCKB/NhWtBk1DvEK/agZeFwk3c+iqU gBInvQj6nz/DkjRyBPDa6scKe73nd1a8VX9fohAZqyosuYoGaC+SSFKqgYYya4sUk5RVRI JguTrtQvgHx99MjOxwBfVKEOvuc7kTo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-187-hlkqQxr1OLmqtHrh2wJAVQ-1; Fri, 13 Mar 2020 12:00:29 -0400 X-MC-Unique: hlkqQxr1OLmqtHrh2wJAVQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2623F18B9FC6; Fri, 13 Mar 2020 16:00:28 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6FC545C122; Fri, 13 Mar 2020 16:00:23 +0000 (UTC) From: Kevin Traynor To: stable@dpdk.org Cc: ferruh.yigit@intel.com, Kevin Traynor Date: Fri, 13 Mar 2020 16:00:08 +0000 Message-Id: <20200313160008.30248-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] [PATCH 18.11] kni: fix ethtool build for kernel 5.5 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 --- 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 { }; =20 +#define RTE_SIZEOF_FIELD(type, field) (sizeof(((type *)0)->field)) + #define IGB_STAT(_name, _stat) { \ =09.stat_string =3D _name, \ -=09.sizeof_stat =3D FIELD_SIZEOF(struct igb_adapter, _stat), \ +=09.sizeof_stat =3D RTE_SIZEOF_FIELD(struct igb_adapter, _stat), \ =09.stat_offset =3D offsetof(struct igb_adapter, _stat) \ } @@ -97,5 +99,5 @@ static const struct igb_stats igb_gstrings_stats[] =3D { #define IGB_NETDEV_STAT(_net_stat) { \ =09.stat_string =3D #_net_stat, \ -=09.sizeof_stat =3D FIELD_SIZEOF(struct net_device_stats, _net_stat), \ +=09.sizeof_stat =3D RTE_SIZEOF_FIELD(struct net_device_stats, _net_stat), = \ =09.stat_offset =3D 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 { }; =20 +#define RTE_SIZEOF_FIELD(type, field) (sizeof(((type *)0)->field)) + #define IXGBE_NETDEV_STAT(_net_stat) { \ =09.stat_string =3D #_net_stat, \ -=09.sizeof_stat =3D FIELD_SIZEOF(struct net_device_stats, _net_stat), \ +=09.sizeof_stat =3D RTE_SIZEOF_FIELD(struct net_device_stats, _net_stat), = \ =09.stat_offset =3D offsetof(struct net_device_stats, _net_stat) \ } @@ -70,5 +72,5 @@ static const struct ixgbe_stats ixgbe_gstrings_net_stats[= ] =3D { #define IXGBE_STAT(_name, _stat) { \ =09.stat_string =3D _name, \ -=09.sizeof_stat =3D FIELD_SIZEOF(struct ixgbe_adapter, _stat), \ +=09.sizeof_stat =3D RTE_SIZEOF_FIELD(struct ixgbe_adapter, _stat), \ =09.stat_offset =3D offsetof(struct ixgbe_adapter, _stat) \ } --=20 2.21.1