Skip to content

Commit

Permalink
vr_host_interface.c: skb->rxhash renamed in EL7.2
Browse files Browse the repository at this point in the history
EL7.2 has integrated the upstream (torvalds/linux.git) commit 61b905da33
that renames skbuff's "rxhash" member into "hash".

There are two functions in vr_host_interface.c that relies on the
skb->rxhash member: vr_skb_set_rxhash and vr_skb_get_rxhash.

These two functions already carry tests:
 - tests that Linux version is between 2.6.32 and 3.15.0
   (skb->rxhash is the correct name in this region)
 - tests that, when the above is true, RHEL (major,minor) is at least (6,4)

We're adding another test to declare that when Linux version is greater
than 3.15.0, and:
 - a) RHEL (major,minor) is greater than (7,2), use skb->hash,
 - b) else, use skb->rxhash.

Compilation of vrouter then succeeds on EL 7.2 again, and sends
packets.

Change-Id: Id70126356293bc08058db10f3ef5005bbd1a1899
Closes-Bug: #1531237
Signed-off-by: Martin Millnert <martin@millnert.se>
  • Loading branch information
Millnert authored and ravi-bk committed Oct 25, 2016
1 parent c7bd58a commit b7abbd8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions linux/vr_host_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,12 @@ vr_skb_set_rxhash(struct sk_buff *skb, __u32 val)
skb->rxhash = val;
#endif
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0))
#if defined(RHEL_MAJOR) && defined(RHEL_MINOR) && \
(RHEL_MAJOR == 7) && (RHEL_MINOR >= 2)
skb->hash = val;
#else
skb->rxhash = val;
#endif
#else
skb->hash = val;
#endif
Expand All @@ -131,11 +136,18 @@ vr_skb_get_rxhash(struct sk_buff *skb)
#if defined(RHEL_MAJOR) && defined(RHEL_MINOR) && \
(RHEL_MAJOR == 6) && (RHEL_MINOR >= 4)
return skb->rxhash;
#elif
return skb->hash;
#else
return 0;
#endif
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0))
#if defined(RHEL_MAJOR) && defined(RHEL_MINOR) && \
(RHEL_MAJOR == 7) && (RHEL_MINOR >= 2)
return skb->hash;
#else
return skb->rxhash;
#endif
#else
return skb->hash;
#endif
Expand Down

0 comments on commit b7abbd8

Please sign in to comment.