Skip to content

Commit

Permalink
netdev-tc-offloads: Fix vxlan tunnel offloading
Browse files Browse the repository at this point in the history
This commit fixes offloading when tunnel id is 0 by checking
for valid tunnel dst ipv4 or ipv6, like done in the normal flow.

Also need to reset the tunnel mask outside the condition
because in the special case, when adding a port with key=flow,
the match for tunnel_set gets a tunnel key id 0 with a mask.
If we don't reset the mask we'll fail later when we check
for unknown attributes that the mask was not reset.

Fixes: 8f283af ("netdev-tc-offloads: Implement netdev flow put using tc interface")
Signed-off-by: Paul Blakey <[email protected]>
Reviewed-by: Roi Dayan <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
  • Loading branch information
Paul Blakey authored and shorman-netronome committed Sep 20, 2017
1 parent 6922412 commit a90120f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/netdev-tc-offloads.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ netdev_tc_flow_put(struct netdev *netdev, struct match *match,

memset(&flower, 0, sizeof flower);

if (tnl->tun_id) {
if (flow_tnl_dst_is_set(&key->tunnel)) {
VLOG_DBG_RL(&rl,
"tunnel: id %#" PRIx64 " src " IP_FMT
" dst " IP_FMT " tp_src %d tp_dst %d",
Expand All @@ -698,9 +698,8 @@ netdev_tc_flow_put(struct netdev *netdev, struct match *match,
flower.tunnel.tp_src = tnl->tp_src;
flower.tunnel.tp_dst = tnl->tp_dst;
flower.tunnel.tunnel = true;

memset(&mask->tunnel, 0, sizeof mask->tunnel);
}
memset(&mask->tunnel, 0, sizeof mask->tunnel);

flower.key.eth_type = key->dl_type;
flower.mask.eth_type = mask->dl_type;
Expand Down

0 comments on commit a90120f

Please sign in to comment.