[v2] kni:fix build failure as "ndo_change_mtu_rh74" not found in RHEL8

Message ID 20181219070759.7538-1-xiliang@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v2] kni:fix build failure as "ndo_change_mtu_rh74" not found in RHEL8 |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Xiao Liang Dec. 19, 2018, 7:07 a.m. UTC
  'ndo_change_mtu_rh74' was changed to 'ndo_change_mtu' in RHEL8.

Build error log:
/home/dpdk-18.11/kernel/linux/kni/compat.h:107:24: error: ‘const struct
net_device_ops’ has no member named ‘ndo_change_mtu_rh74’; did you mean
‘ndo_change_mtu’?
 #define ndo_change_mtu ndo_change_mtu_rh74

                        ^~~~~~~~~~~~~~~~~~~
Signed-off-by: Xiao Liang <xiliang@redhat.com>
---
 kernel/linux/kni/compat.h              | 3 ++-
 kernel/linux/kni/ethtool/igb/kcompat.h | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
  

Comments

Ferruh Yigit Dec. 19, 2018, 1:26 p.m. UTC | #1
On 12/19/2018 7:07 AM, Xiao Liang wrote:
> 'ndo_change_mtu_rh74' was changed to 'ndo_change_mtu' in RHEL8.
> 
> Build error log:
> /home/dpdk-18.11/kernel/linux/kni/compat.h:107:24: error: ‘const struct
> net_device_ops’ has no member named ‘ndo_change_mtu_rh74’; did you mean
> ‘ndo_change_mtu’?
>  #define ndo_change_mtu ndo_change_mtu_rh74

There is already a patch for it:
https://patches.dpdk.org/patch/48343/

But that one doesn't cover igb, so I suggest to go with this one.

> 
>                         ^~~~~~~~~~~~~~~~~~~
> Signed-off-by: Xiao Liang <xiliang@redhat.com>

<...>
  
Ferruh Yigit Dec. 19, 2018, 1:28 p.m. UTC | #2
On 12/19/2018 1:26 PM, Ferruh Yigit wrote:
> On 12/19/2018 7:07 AM, Xiao Liang wrote:
>> 'ndo_change_mtu_rh74' was changed to 'ndo_change_mtu' in RHEL8.
>>
>> Build error log:
>> /home/dpdk-18.11/kernel/linux/kni/compat.h:107:24: error: ‘const struct
>> net_device_ops’ has no member named ‘ndo_change_mtu_rh74’; did you mean
>> ‘ndo_change_mtu’?
>>  #define ndo_change_mtu ndo_change_mtu_rh74
> 
> There is already a patch for it:
> https://patches.dpdk.org/patch/48343/
> 
> But that one doesn't cover igb, so I suggest to go with this one.

cc'ed correct person (Mohammed) this time.
  
Ferruh Yigit Dec. 19, 2018, 1:47 p.m. UTC | #3
On 12/19/2018 7:07 AM, Xiao Liang wrote:
> 'ndo_change_mtu_rh74' was changed to 'ndo_change_mtu' in RHEL8.
> 
> Build error log:
> /home/dpdk-18.11/kernel/linux/kni/compat.h:107:24: error: ‘const struct
> net_device_ops’ has no member named ‘ndo_change_mtu_rh74’; did you mean
> ‘ndo_change_mtu’?
>  #define ndo_change_mtu ndo_change_mtu_rh74
> 
>                         ^~~~~~~~~~~~~~~~~~~
> Signed-off-by: Xiao Liang <xiliang@redhat.com>

Suggested title: 'kni: fix build on RHEL 8'

And a request to backport:
Cc: stable@dpdk.org

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Thomas Monjalon Jan. 14, 2019, 1:03 p.m. UTC | #4
19/12/2018 14:47, Ferruh Yigit:
> On 12/19/2018 7:07 AM, Xiao Liang wrote:
> > 'ndo_change_mtu_rh74' was changed to 'ndo_change_mtu' in RHEL8.
> > 
> > Build error log:
> > /home/dpdk-18.11/kernel/linux/kni/compat.h:107:24: error: ‘const struct
> > net_device_ops’ has no member named ‘ndo_change_mtu_rh74’; did you mean
> > ‘ndo_change_mtu’?
> >  #define ndo_change_mtu ndo_change_mtu_rh74
> > 
> >                         ^~~~~~~~~~~~~~~~~~~
> > Signed-off-by: Xiao Liang <xiliang@redhat.com>
> 
> Suggested title: 'kni: fix build on RHEL 8'
> 
> And a request to backport:
> Cc: stable@dpdk.org
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied, thanks
  

Patch

diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
index 5aadebbcd..bc81d0c8d 100644
--- a/kernel/linux/kni/compat.h
+++ b/kernel/linux/kni/compat.h
@@ -103,7 +103,8 @@ 
 #endif
 
 #if (defined(RHEL_RELEASE_CODE) && \
-	(RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7, 5)))
+	(RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7, 5)) && \
+	(RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(8, 0)))
 #define ndo_change_mtu ndo_change_mtu_rh74
 #endif
 
diff --git a/kernel/linux/kni/ethtool/igb/kcompat.h b/kernel/linux/kni/ethtool/igb/kcompat.h
index ae1b53093..2681be684 100644
--- a/kernel/linux/kni/ethtool/igb/kcompat.h
+++ b/kernel/linux/kni/ethtool/igb/kcompat.h
@@ -3930,7 +3930,8 @@  skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
 #endif
 
 #if (defined(RHEL_RELEASE_CODE) && \
-	(RHEL_RELEASE_VERSION(7, 5) <= RHEL_RELEASE_CODE))
+	(RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7, 5)) && \
+	(RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(8, 0)))
 #define ndo_change_mtu ndo_change_mtu_rh74
 #endif