diff mbox series

[ovs-dev] Fix datapath compilation on RHEL >= 7.5

Message ID 20180510141107.17771-1-dalvarez@redhat.com
State Superseded
Headers show
Series [ovs-dev] Fix datapath compilation on RHEL >= 7.5 | expand

Commit Message

Daniel Alvarez Sanchez May 10, 2018, 2:11 p.m. UTC
On RHEL 7.5 we get compilation errors due to field ndo_change_mtu
missing. This patch checks the RHEL version and redefines it to
ndo_change_mtu_rh74.

Reported-by: Lucas Alvares <lucasagomes@gmail.com>
Signed-off-by: Daniel Alvarez <dalvarez@redhat.com>
---
 datapath/datapath.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Gregory Rose May 10, 2018, 9:15 p.m. UTC | #1
On 5/10/2018 7:11 AM, Daniel Alvarez wrote:
> On RHEL 7.5 we get compilation errors due to field ndo_change_mtu
> missing. This patch checks the RHEL version and redefines it to
> ndo_change_mtu_rh74.
>
> Reported-by: Lucas Alvares <lucasagomes@gmail.com>
> Signed-off-by: Daniel Alvarez <dalvarez@redhat.com>
> ---
>   datapath/datapath.h | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/datapath/datapath.h b/datapath/datapath.h
> index 93c9ed505..d418bf381 100644
> --- a/datapath/datapath.h
> +++ b/datapath/datapath.h
> @@ -25,6 +25,7 @@
>   #include <linux/netdevice.h>
>   #include <linux/skbuff.h>
>   #include <linux/u64_stats_sync.h>
> +#include <linux/version.h>
>   #include <net/net_namespace.h>
>   #include <net/ip_tunnels.h>
>   
> @@ -36,6 +37,10 @@
>   #define DP_MAX_PORTS           USHRT_MAX
>   #define DP_VPORT_HASH_BUCKETS  1024
>   
> +#if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,5)
> +#define ndo_change_mtu ndo_change_mtu_rh74
> +#endif
> +
>   /**
>    * struct dp_stats_percpu - per-cpu packet processing statistics for a given
>    * datapath.

There are dueling patches for this.  I think the one posted by Yi-hung 
is a bit more complete because it doesn't just check version numbers.

Thanks,

- Greg
Daniel Alvarez Sanchez May 10, 2018, 9:24 p.m. UTC | #2
Yes, let’s go with that one then.
Thanks a lot!
Daniel 

> On 10 May 2018, at 23:15, Gregory Rose <gvrose8192@gmail.com> wrote:
> 
>> On 5/10/2018 7:11 AM, Daniel Alvarez wrote:
>> On RHEL 7.5 we get compilation errors due to field ndo_change_mtu
>> missing. This patch checks the RHEL version and redefines it to
>> ndo_change_mtu_rh74.
>> 
>> Reported-by: Lucas Alvares <lucasagomes@gmail.com>
>> Signed-off-by: Daniel Alvarez <dalvarez@redhat.com>
>> ---
>>  datapath/datapath.h | 5 +++++
>>  1 file changed, 5 insertions(+)
>> 
>> diff --git a/datapath/datapath.h b/datapath/datapath.h
>> index 93c9ed505..d418bf381 100644
>> --- a/datapath/datapath.h
>> +++ b/datapath/datapath.h
>> @@ -25,6 +25,7 @@
>>  #include <linux/netdevice.h>
>>  #include <linux/skbuff.h>
>>  #include <linux/u64_stats_sync.h>
>> +#include <linux/version.h>
>>  #include <net/net_namespace.h>
>>  #include <net/ip_tunnels.h>
>>  @@ -36,6 +37,10 @@
>>  #define DP_MAX_PORTS           USHRT_MAX
>>  #define DP_VPORT_HASH_BUCKETS  1024
>>  +#if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,5)
>> +#define ndo_change_mtu ndo_change_mtu_rh74
>> +#endif
>> +
>>  /**
>>   * struct dp_stats_percpu - per-cpu packet processing statistics for a given
>>   * datapath.
> 
> There are dueling patches for this.  I think the one posted by Yi-hung is a bit more complete because it doesn't just check version numbers.
> 
> Thanks,
> 
> - Greg
diff mbox series

Patch

diff --git a/datapath/datapath.h b/datapath/datapath.h
index 93c9ed505..d418bf381 100644
--- a/datapath/datapath.h
+++ b/datapath/datapath.h
@@ -25,6 +25,7 @@ 
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <linux/u64_stats_sync.h>
+#include <linux/version.h>
 #include <net/net_namespace.h>
 #include <net/ip_tunnels.h>
 
@@ -36,6 +37,10 @@ 
 #define DP_MAX_PORTS           USHRT_MAX
 #define DP_VPORT_HASH_BUCKETS  1024
 
+#if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,5)
+#define ndo_change_mtu ndo_change_mtu_rh74
+#endif
+
 /**
  * struct dp_stats_percpu - per-cpu packet processing statistics for a given
  * datapath.