summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h
diff options
context:
space:
mode:
authorTariq Toukan <tariqt@mellanox.com>2018-10-14 14:37:48 +0300
committerSaeed Mahameed <saeedm@mellanox.com>2018-12-21 09:54:19 +0300
commitfea28dd6a281045e18c1412ab5bba54436c11088 (patch)
tree8efa18422c498c212296b5e28a9e95ad36df530b /drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h
parentb8180392edd97cd5bfdf12270315a72fe601cf7e (diff)
downloadlinux-fea28dd6a281045e18c1412ab5bba54436c11088.tar.xz
net/mlx5e: XDP, Maintain a FIFO structure for xdp_info instances
This provides infrastructure to have multiple xdp_info instances for the same consumer index. Signed-off-by: Tariq Toukan <tariqt@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h
index e2faf869e77c..fd689ed506af 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h
@@ -57,4 +57,19 @@ static inline void mlx5e_xmit_xdp_doorbell(struct mlx5e_xdpsq *sq)
}
}
+static inline void
+mlx5e_xdpi_fifo_push(struct mlx5e_xdp_info_fifo *fifo,
+ struct mlx5e_xdp_info *xi)
+{
+ u32 i = (*fifo->pc)++ & fifo->mask;
+
+ fifo->xi[i] = *xi;
+}
+
+static inline struct mlx5e_xdp_info
+mlx5e_xdpi_fifo_pop(struct mlx5e_xdp_info_fifo *fifo)
+{
+ return fifo->xi[(*fifo->cc)++ & fifo->mask];
+}
+
#endif