From: Paul Blakey <pa...@mellanox.com> Signed-off-by: Paul Blakey <pa...@mellanox.com> Reviewed-by: Roi Dayan <r...@mellanox.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- lib/netdev-tc-offloads.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/lib/netdev-tc-offloads.c b/lib/netdev-tc-offloads.c index 1fd5120..808b761 100644 --- a/lib/netdev-tc-offloads.c +++ b/lib/netdev-tc-offloads.c @@ -72,6 +72,7 @@ #include "openvswitch/match.h" #include "openvswitch/vlog.h" #include "tc.h" +#include "netdev-linux.h" VLOG_DEFINE_THIS_MODULE(netdev_tc_offloads); @@ -945,8 +946,28 @@ netdev_tc_flow_del(struct netdev *netdev OVS_UNUSED, } int -netdev_tc_init_flow_api(struct netdev *netdev OVS_UNUSED) +netdev_tc_init_flow_api(struct netdev *netdev) { + int ifindex; + int error; + + ifindex = netdev_get_ifindex(netdev); + if (ifindex < 0) { + VLOG_ERR_RL(&rl_err, "failed to get ifindex for %s: %s", + netdev_get_name(netdev), ovs_strerror(-ifindex)); + return -ifindex; + } + + error = tc_add_del_ingress_qdisc(ifindex, true); + + if (error && error != EEXIST) { + VLOG_ERR("failed adding ingress qdisc required for offloading: %s", + ovs_strerror(error)); + return error; + } + + VLOG_INFO("added ingress qdisc to %s", netdev_get_name(netdev)); + return 0; } -- 2.7.4 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev