On Tue, 2019-04-23 at 15:53 +0300, Gal Pressman wrote: > On 23-Apr-19 01:32, Saeed Mahameed wrote: > > static inline void > > -mlx5e_xdp_mpwqe_add_dseg(struct mlx5e_xdpsq *sq, dma_addr_t > > dma_addr, u16 dma_len) > > +mlx5e_xdp_mpwqe_add_dseg(struct mlx5e_xdpsq *sq, struct > > mlx5e_xdp_info *xdpi, > > + struct mlx5e_xdpsq_stats *stats) > > Passing stats as a function parameter is weird, why not remove and > use sq->stats? >
This is the core function to put the packet pointer into the hw ring buffer, it is very performance critical, and since the sq->stats now is a pointer we want to avoid two ptr de-references (sq->stats- >tx_pacets); we read the sq->stats once and provide it all the way down to lower level functions.