summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hurley <john.hurley@netronome.com>2019-12-19 14:58:43 +0000
committerSimon Horman <simon.horman@netronome.com>2020-01-28 15:09:45 +0100
commit2ce2f85580dff1d921fdb5fc6da9a941386a2870 (patch)
treee2e1de8ee008bb4307e7dee8bf5d6007552900a5
parent50092caf1114a7a150e9ff6b1a6279922e264cdd (diff)
downloadopenvswitch-2ce2f85580dff1d921fdb5fc6da9a941386a2870.tar.gz
tc: handle packet mark of zero
Openstack may set an skb mark of 0 in tunnel rules. This is considered to be an unused/unset value. However, it prevents the rule from being offloaded. Check if the key value of the skb mark is 0 when it is in use (mask is set to all ones). If it is then ignore the field and continue with TC offload. Only the exact-match case is covered by this patch as it addresses the Openstack use-case and seems most robust against feature evolution: f.e. in future there may exist hardware offload scenarios where an operation, such as a BPF offload, sets the SKB mark before proceeding tho the in-HW OVS. datapath. Signed-off-by: John Hurley <john.hurley@netronome.com> Co-Authored-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Acked-by: Aaron Conole <aconole@redhat.com>
-rw-r--r--lib/netdev-tc-offloads.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/netdev-tc-offloads.c b/lib/netdev-tc-offloads.c
index 3f575bd2b..ed8fc2435 100644
--- a/lib/netdev-tc-offloads.c
+++ b/lib/netdev-tc-offloads.c
@@ -817,6 +817,11 @@ netdev_tc_flow_put(struct netdev *netdev, struct match *match,
}
}
+ /* ignore exact match on skb_mark of 0. */
+ if (mask->pkt_mark == UINT32_MAX && !key->pkt_mark) {
+ mask->pkt_mark = 0;
+ }
+
err = test_key_and_mask(match);
if (err) {
return err;