diff options
author | Ioana Ciornei <ioana.ciornei@nxp.com> | 2021-03-10 14:14:45 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-03-10 13:30:36 -0800 |
commit | 7fd94d86b7f4a7f71223bdc1348b897411f2224b (patch) | |
tree | a6de5900bb24c5fb53d22b58ee927f37ac29d630 /drivers/staging/fsl-dpaa2/ethsw/ethsw.h | |
parent | 0b1b71370458860579831e77485883fcf2e8fbbe (diff) | |
download | linux-7fd94d86b7f4a7f71223bdc1348b897411f2224b.tar.gz linux-7fd94d86b7f4a7f71223bdc1348b897411f2224b.tar.bz2 linux-7fd94d86b7f4a7f71223bdc1348b897411f2224b.zip |
staging: dpaa2-switch: add .ndo_start_xmit() callback
Implement the .ndo_start_xmit() callback for the switch port interfaces.
For each of the switch ports, gather the corresponding queue
destination ID (QDID) necessary for Tx enqueueing.
We'll reserve 64 bytes for software annotations, where we keep a skb
backpointer used on the Tx confirmation side for releasing the allocated
memory. At the moment, we only support linear skbs.
Also, add support for the Tx confirmation path which for the most part
shares the code path with the normal Rx queue.
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/staging/fsl-dpaa2/ethsw/ethsw.h')
-rw-r--r-- | drivers/staging/fsl-dpaa2/ethsw/ethsw.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.h b/drivers/staging/fsl-dpaa2/ethsw/ethsw.h index 238f16561979..ab3b75a62f01 100644 --- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.h +++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.h @@ -66,6 +66,19 @@ */ #define DPAA2_SWITCH_SWP_BUSY_RETRIES 1000 +/* Hardware annotation buffer size */ +#define DPAA2_SWITCH_HWA_SIZE 64 +/* Software annotation buffer size */ +#define DPAA2_SWITCH_SWA_SIZE 64 + +#define DPAA2_SWITCH_TX_BUF_ALIGN 64 + +#define DPAA2_SWITCH_TX_DATA_OFFSET \ + (DPAA2_SWITCH_HWA_SIZE + DPAA2_SWITCH_SWA_SIZE) + +#define DPAA2_SWITCH_NEEDED_HEADROOM \ + (DPAA2_SWITCH_TX_DATA_OFFSET + DPAA2_SWITCH_TX_BUF_ALIGN) + extern const struct ethtool_ops dpaa2_switch_port_ethtool_ops; struct ethsw_core; @@ -91,6 +104,7 @@ struct ethsw_port_priv { u8 vlans[VLAN_VID_MASK + 1]; u16 pvid; struct net_device *bridge_dev; + u16 tx_qdid; }; /* Switch data */ |