diff options
author | Doug Berger <opendmb@gmail.com> | 2020-04-29 13:02:05 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-04-29 16:55:22 -0700 |
commit | 3e370952287c55e5fd240cb8bb41ef8acff8829d (patch) | |
tree | 2cf2495acb7caf14577502bb84f0422947f7c494 /drivers/net/ethernet/broadcom/genet/bcmgenet.h | |
parent | 854295d03ca04461f275d723289a5886e6827498 (diff) | |
download | lwn-3e370952287c55e5fd240cb8bb41ef8acff8829d.tar.gz lwn-3e370952287c55e5fd240cb8bb41ef8acff8829d.zip |
net: bcmgenet: add support for ethtool rxnfc flows
This commit enables driver support for ethtool commands of this form:
ethtool -N|-U|--config-nfc|--config-ntuple devname
flow-type ether|ip4
[src xx:yy:zz:aa:bb:cc [m xx:yy:zz:aa:bb:cc]]
[dst xx:yy:zz:aa:bb:cc [m xx:yy:zz:aa:bb:cc]] [proto N [m N]]
[src-ip x.x.x.x [m x.x.x.x]] [dst-ip x.x.x.x [m x.x.x.x]] [tos N [m N]]
[l4proto N [m N]] [src-port N [m N]] [dst-port N [m N]] [spi N [m N]]
[l4data N [m N]] [vlan-etype N [m N]] [vlan N [m N]]
[dst-mac xx:yy:zz:aa:bb:cc [m xx:yy:zz:aa:bb:cc]] [action 0] [loc N] |
delete N
Since there is only one Rx Ring in this implementation action 0 behaves no
differently from not specifying a rule.
The rules can be seen with ethtool commands of this form:
ethtool -n|-u|--show-nfc|--show-ntuple devname [rule N]
Signed-off-by: Doug Berger <opendmb@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/genet/bcmgenet.h')
-rw-r--r-- | drivers/net/ethernet/broadcom/genet/bcmgenet.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.h b/drivers/net/ethernet/broadcom/genet/bcmgenet.h index a858b7305832..031d91f45067 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h @@ -32,6 +32,7 @@ #define DMA_MAX_BURST_LENGTH 0x10 /* misc. configuration */ +#define MAX_NUM_OF_FS_RULES 16 #define CLEAR_ALL_HFB 0xFF #define DMA_FC_THRESH_HI (TOTAL_DESC >> 4) #define DMA_FC_THRESH_LO 5 @@ -609,6 +610,18 @@ struct bcmgenet_rx_ring { struct bcmgenet_priv *priv; }; +enum bcmgenet_rxnfc_state { + BCMGENET_RXNFC_STATE_UNUSED = 0, + BCMGENET_RXNFC_STATE_DISABLED, + BCMGENET_RXNFC_STATE_ENABLED +}; + +struct bcmgenet_rxnfc_rule { + struct list_head list; + struct ethtool_rx_flow_spec fs; + enum bcmgenet_rxnfc_state state; +}; + /* device context */ struct bcmgenet_priv { void __iomem *base; @@ -627,6 +640,8 @@ struct bcmgenet_priv { struct enet_cb *rx_cbs; unsigned int num_rx_bds; unsigned int rx_buf_len; + struct bcmgenet_rxnfc_rule rxnfc_rules[MAX_NUM_OF_FS_RULES]; + struct list_head rxnfc_list; struct bcmgenet_rx_ring rx_rings[DESC_INDEX + 1]; @@ -679,6 +694,7 @@ struct bcmgenet_priv { u32 wolopts; u8 sopass[SOPASS_MAX]; bool wol_active; + u32 hfb_en[3]; struct bcmgenet_mib_counters mib; |