Commit 3817b2ac authored by Robert-Ionut Alexa's avatar Robert-Ionut Alexa Committed by David S. Miller

net: dpaa2-eth: add trace points on XSK events

Define the dpaa2_tx_xsk_fd and dpaa2_rx_xsk_fd trace events for the XSK
zero-copy Rx and Tx path.  Also, define the dpaa2_eth_buf as an event
class so that both dpaa2_eth_buf_seed and dpaa2_xsk_buf_seed traces can
derive from the same class.
Signed-off-by: default avatarRobert-Ionut Alexa <robert-ionut.alexa@nxp.com>
Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4a7f6c5a
...@@ -73,6 +73,14 @@ DEFINE_EVENT(dpaa2_eth_fd, dpaa2_tx_fd, ...@@ -73,6 +73,14 @@ DEFINE_EVENT(dpaa2_eth_fd, dpaa2_tx_fd,
TP_ARGS(netdev, fd) TP_ARGS(netdev, fd)
); );
/* Tx (egress) XSK fd */
DEFINE_EVENT(dpaa2_eth_fd, dpaa2_tx_xsk_fd,
TP_PROTO(struct net_device *netdev,
const struct dpaa2_fd *fd),
TP_ARGS(netdev, fd)
);
/* Rx fd */ /* Rx fd */
DEFINE_EVENT(dpaa2_eth_fd, dpaa2_rx_fd, DEFINE_EVENT(dpaa2_eth_fd, dpaa2_rx_fd,
TP_PROTO(struct net_device *netdev, TP_PROTO(struct net_device *netdev,
...@@ -81,6 +89,14 @@ DEFINE_EVENT(dpaa2_eth_fd, dpaa2_rx_fd, ...@@ -81,6 +89,14 @@ DEFINE_EVENT(dpaa2_eth_fd, dpaa2_rx_fd,
TP_ARGS(netdev, fd) TP_ARGS(netdev, fd)
); );
/* Rx XSK fd */
DEFINE_EVENT(dpaa2_eth_fd, dpaa2_rx_xsk_fd,
TP_PROTO(struct net_device *netdev,
const struct dpaa2_fd *fd),
TP_ARGS(netdev, fd)
);
/* Tx confirmation fd */ /* Tx confirmation fd */
DEFINE_EVENT(dpaa2_eth_fd, dpaa2_tx_conf_fd, DEFINE_EVENT(dpaa2_eth_fd, dpaa2_tx_conf_fd,
TP_PROTO(struct net_device *netdev, TP_PROTO(struct net_device *netdev,
...@@ -90,7 +106,7 @@ DEFINE_EVENT(dpaa2_eth_fd, dpaa2_tx_conf_fd, ...@@ -90,7 +106,7 @@ DEFINE_EVENT(dpaa2_eth_fd, dpaa2_tx_conf_fd,
); );
/* Log data about raw buffers. Useful for tracing DPBP content. */ /* Log data about raw buffers. Useful for tracing DPBP content. */
TRACE_EVENT(dpaa2_eth_buf_seed, DECLARE_EVENT_CLASS(dpaa2_eth_buf,
/* Trace function prototype */ /* Trace function prototype */
TP_PROTO(struct net_device *netdev, TP_PROTO(struct net_device *netdev,
/* virtual address and size */ /* virtual address and size */
...@@ -143,6 +159,30 @@ TRACE_EVENT(dpaa2_eth_buf_seed, ...@@ -143,6 +159,30 @@ TRACE_EVENT(dpaa2_eth_buf_seed,
__entry->bpid) __entry->bpid)
); );
/* Main memory buff seeding */
DEFINE_EVENT(dpaa2_eth_buf, dpaa2_eth_buf_seed,
TP_PROTO(struct net_device *netdev,
void *vaddr,
size_t size,
dma_addr_t dma_addr,
size_t map_size,
u16 bpid),
TP_ARGS(netdev, vaddr, size, dma_addr, map_size, bpid)
);
/* UMEM buff seeding on AF_XDP fast path */
DEFINE_EVENT(dpaa2_eth_buf, dpaa2_xsk_buf_seed,
TP_PROTO(struct net_device *netdev,
void *vaddr,
size_t size,
dma_addr_t dma_addr,
size_t map_size,
u16 bpid),
TP_ARGS(netdev, vaddr, size, dma_addr, map_size, bpid)
);
/* If only one event of a certain type needs to be declared, use TRACE_EVENT(). /* If only one event of a certain type needs to be declared, use TRACE_EVENT().
* The syntax is the same as for DECLARE_EVENT_CLASS(). * The syntax is the same as for DECLARE_EVENT_CLASS().
*/ */
......
...@@ -1731,6 +1731,12 @@ static int dpaa2_eth_add_bufs(struct dpaa2_eth_priv *priv, ...@@ -1731,6 +1731,12 @@ static int dpaa2_eth_add_bufs(struct dpaa2_eth_priv *priv,
goto err_map; goto err_map;
buf_array[i] = addr; buf_array[i] = addr;
trace_dpaa2_xsk_buf_seed(priv->net_dev,
xdp_buffs[i]->data_hard_start,
DPAA2_ETH_RX_BUF_RAW_SIZE,
addr, priv->rx_buf_size,
ch->bp->bpid);
} }
} }
......
...@@ -113,6 +113,8 @@ static void dpaa2_xsk_rx(struct dpaa2_eth_priv *priv, ...@@ -113,6 +113,8 @@ static void dpaa2_xsk_rx(struct dpaa2_eth_priv *priv,
void *vaddr; void *vaddr;
u32 xdp_act; u32 xdp_act;
trace_dpaa2_rx_xsk_fd(priv->net_dev, fd);
vaddr = dpaa2_iova_to_virt(priv->iommu_domain, addr); vaddr = dpaa2_iova_to_virt(priv->iommu_domain, addr);
percpu_stats = this_cpu_ptr(priv->percpu_stats); percpu_stats = this_cpu_ptr(priv->percpu_stats);
...@@ -416,6 +418,8 @@ bool dpaa2_xsk_tx(struct dpaa2_eth_priv *priv, ...@@ -416,6 +418,8 @@ bool dpaa2_xsk_tx(struct dpaa2_eth_priv *priv,
batch = i; batch = i;
break; break;
} }
trace_dpaa2_tx_xsk_fd(priv->net_dev, &fds[i]);
} }
/* Enqueue all the created FDs */ /* Enqueue all the created FDs */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment