summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/netronome/nfp/nfp_port.c
diff options
context:
space:
mode:
authorPieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>2017-06-29 23:08:13 +0300
committerDavid S. Miller <davem@davemloft.net>2017-07-01 18:51:32 +0300
commit8a2768732a4dfdaabdbea18603330922fb0ee773 (patch)
treea19076000b0ce36a5a84032d32adb22463db7c92 /drivers/net/ethernet/netronome/nfp/nfp_port.c
parent8f15df600dff00c8f28c8588bdd4dca55dff690b (diff)
downloadlinux-8a2768732a4dfdaabdbea18603330922fb0ee773.tar.xz
nfp: provide infrastructure for offloading flower based TC filters
Adds a flower based TC offload handler for representor devices, this is in addition to the bpf based offload handler. The changes in this patch will be used in a follow-up patch to add tc flower offload to the NFP. The flower app enables tc offloads on representors by default. Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/nfp_port.c')
-rw-r--r--drivers/net/ethernet/netronome/nfp/nfp_port.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_port.c b/drivers/net/ethernet/netronome/nfp/nfp_port.c
index 3aa834fb2250..776e54dd5dd0 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_port.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_port.c
@@ -88,6 +88,21 @@ const struct switchdev_ops nfp_port_switchdev_ops = {
.switchdev_port_attr_get = nfp_port_attr_get,
};
+int nfp_port_setup_tc(struct net_device *netdev, u32 handle, u32 chain_index,
+ __be16 proto, struct tc_to_netdev *tc)
+{
+ struct nfp_port *port;
+
+ if (chain_index)
+ return -EOPNOTSUPP;
+
+ port = nfp_port_from_netdev(netdev);
+ if (!port)
+ return -EOPNOTSUPP;
+
+ return nfp_app_setup_tc(port->app, netdev, handle, proto, tc);
+}
+
struct nfp_port *
nfp_port_from_id(struct nfp_pf *pf, enum nfp_port_type type, unsigned int id)
{