diff options
author | Sathya Perla <sathya.perla@broadcom.com> | 2017-08-28 20:40:33 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-29 02:57:10 +0300 |
commit | 2ae7408fedfee979e01ed3801223c632bb124c46 (patch) | |
tree | 539e6f6d123b9f4ca9277d3d911962023509197e /drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | |
parent | 70855603e0a129d1c810947a4e4dd7ecd6f4560d (diff) | |
download | linux-2ae7408fedfee979e01ed3801223c632bb124c46.tar.xz |
bnxt_en: bnxt: add TC flower filter offload support
This patch adds support for offloading TC based flow
rules and actions for the 'flower' classifier in the bnxt_en driver.
It includes logic to parse flow rules and actions received from the
TC subsystem, store them and issue the corresponding
hwrm_cfa_flow_alloc/free FW cmds. L2/IPv4/IPv6 flows and drop,
redir, vlan push/pop actions are supported in this patch.
In this patch the hwrm_cfa_flow_xxx routines are just stubs.
The code for these routines is introduced in the next patch for easier
review. Also, the code to query the TC/flower action stats will
be introduced in a subsequent patch.
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c index c365d3cf8e51..e75db04c6cdc 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c @@ -11,10 +11,12 @@ #include <linux/etherdevice.h> #include <linux/rtnetlink.h> #include <linux/jhash.h> +#include <net/pkt_cls.h> #include "bnxt_hsi.h" #include "bnxt.h" #include "bnxt_vfr.h" +#include "bnxt_tc.h" #ifdef CONFIG_BNXT_SRIOV @@ -113,6 +115,21 @@ bnxt_vf_rep_get_stats64(struct net_device *dev, stats->tx_bytes = vf_rep->tx_stats.bytes; } +static int bnxt_vf_rep_setup_tc(struct net_device *dev, enum tc_setup_type type, + void *type_data) +{ + struct bnxt_vf_rep *vf_rep = netdev_priv(dev); + struct bnxt *bp = vf_rep->bp; + int vf_fid = bp->pf.vf[vf_rep->vf_idx].fw_fid; + + switch (type) { + case TC_SETUP_CLSFLOWER: + return bnxt_tc_setup_flower(bp, vf_fid, type_data); + default: + return -EOPNOTSUPP; + } +} + struct net_device *bnxt_get_vf_rep(struct bnxt *bp, u16 cfa_code) { u16 vf_idx; @@ -182,6 +199,7 @@ static const struct net_device_ops bnxt_vf_rep_netdev_ops = { .ndo_stop = bnxt_vf_rep_close, .ndo_start_xmit = bnxt_vf_rep_xmit, .ndo_get_stats64 = bnxt_vf_rep_get_stats64, + .ndo_setup_tc = bnxt_vf_rep_setup_tc, .ndo_get_phys_port_name = bnxt_vf_rep_get_phys_port_name }; |