[ovs-dev,V7,15/18] netdev-offload-dpdk: Support offload of drop action
diff mbox series

Message ID 20200109074655.1104-16-elibr@mellanox.com
State Accepted
Delegated to: Ilya Maximets
Headers show
Series
  • netdev datapath actions offload
Related show

Commit Message

Eli Britstein Jan. 9, 2020, 7:46 a.m. UTC
Signed-off-by: Eli Britstein <elibr@mellanox.com>
Reviewed-by: Oz Shlomo <ozsh@mellanox.com>
---
 Documentation/howto/dpdk.rst | 1 +
 NEWS                         | 2 +-
 lib/netdev-offload-dpdk.c    | 4 ++++
 3 files changed, 6 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/Documentation/howto/dpdk.rst b/Documentation/howto/dpdk.rst
index f0fe2bef7..d9de7bedd 100644
--- a/Documentation/howto/dpdk.rst
+++ b/Documentation/howto/dpdk.rst
@@ -391,6 +391,7 @@  Supported protocols for hardware offload matches are:
 Supported actions for hardware offload are:
 
 - Output.
+- Drop.
 
 Further Reading
 ---------------
diff --git a/NEWS b/NEWS
index 7f31ad80b..ffa6a91be 100644
--- a/NEWS
+++ b/NEWS
@@ -34,7 +34,7 @@  Post-v2.12.0
        interval is increased to 60 seconds for the connection to the
        replication server. This value is configurable with the unixctl
        command - ovsdb-server/set-active-ovsdb-server-probe-interval.
-     * Add hardware offload support for output actions (experimental).
+     * Add hardware offload support for output and drop actions (experimental).
    - 'ovs-appctl dpctl/dump-flows' can now show offloaded=partial for
      partially offloaded flows, dp:dpdk for fully offloaded by dpdk, and
      type filter supports new filters: "dpdk" and "partially-offloaded".
diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c
index 4fc13b149..026e77756 100644
--- a/lib/netdev-offload-dpdk.c
+++ b/lib/netdev-offload-dpdk.c
@@ -367,6 +367,8 @@  dump_flow_action(struct ds *s, const struct rte_flow_action *actions)
         } else {
             ds_put_cstr(s, "  Port-id = null\n");
         }
+    } else if (actions->type == RTE_FLOW_ACTION_TYPE_DROP) {
+        ds_put_cstr(s, "rte flow drop action\n");
     } else {
         ds_put_format(s, "unknown rte flow action (%d)\n", actions->type);
     }
@@ -811,6 +813,8 @@  parse_flow_actions(struct netdev *netdev,
             if (add_output_action(netdev, actions, nla, info)) {
                 return -1;
             }
+        } else if (nl_attr_type(nla) == OVS_ACTION_ATTR_DROP) {
+            add_flow_action(actions, RTE_FLOW_ACTION_TYPE_DROP, NULL);
         } else {
             VLOG_DBG_RL(&rl, "Unsupported action type %d", nl_attr_type(nla));
             return -1;