| .. | .. |
|---|
| 327 | 327 | return features; |
|---|
| 328 | 328 | } |
|---|
| 329 | 329 | |
|---|
| 330 | | -/* IP header + UDP + VXLAN + Ethernet header */ |
|---|
| 331 | | -#define VXLAN_HEADROOM (20 + 8 + 8 + 14) |
|---|
| 332 | | -/* IPv6 header + UDP + VXLAN + Ethernet header */ |
|---|
| 333 | | -#define VXLAN6_HEADROOM (40 + 8 + 8 + 14) |
|---|
| 330 | +static inline int vxlan_headroom(u32 flags) |
|---|
| 331 | +{ |
|---|
| 332 | + /* VXLAN: IP4/6 header + UDP + VXLAN + Ethernet header */ |
|---|
| 333 | + /* VXLAN-GPE: IP4/6 header + UDP + VXLAN */ |
|---|
| 334 | + return (flags & VXLAN_F_IPV6 ? sizeof(struct ipv6hdr) : |
|---|
| 335 | + sizeof(struct iphdr)) + |
|---|
| 336 | + sizeof(struct udphdr) + sizeof(struct vxlanhdr) + |
|---|
| 337 | + (flags & VXLAN_F_GPE ? 0 : ETH_HLEN); |
|---|
| 338 | +} |
|---|
| 334 | 339 | |
|---|
| 335 | 340 | static inline struct vxlanhdr *vxlan_hdr(struct sk_buff *skb) |
|---|
| 336 | 341 | { |
|---|
| .. | .. |
|---|
| 492 | 497 | } |
|---|
| 493 | 498 | |
|---|
| 494 | 499 | static inline bool vxlan_fdb_nh_path_select(struct nexthop *nh, |
|---|
| 495 | | - int hash, |
|---|
| 500 | + u32 hash, |
|---|
| 496 | 501 | struct vxlan_rdst *rdst) |
|---|
| 497 | 502 | { |
|---|
| 498 | 503 | struct fib_nh_common *nhc; |
|---|
| 499 | 504 | |
|---|
| 500 | | - nhc = nexthop_path_fdb_result(nh, hash); |
|---|
| 505 | + nhc = nexthop_path_fdb_result(nh, hash >> 1); |
|---|
| 501 | 506 | if (unlikely(!nhc)) |
|---|
| 502 | 507 | return false; |
|---|
| 503 | 508 | |
|---|