Skip to content

Commit a43b25d

Browse files
author
Saeed Mahameed
committed
net/mlx5e: CQ and RQ don't need priv pointer
Remove mlx5e_priv pointer from CQ and RQ structs, it was needed only to access mdev pointer from priv pointer. Instead we now pass mdev where needed. Signed-off-by: Saeed Mahameed <[email protected]> Reviewed-by: Tariq Toukan <[email protected]>
1 parent 6a9764e commit a43b25d

File tree

4 files changed

+99
-125
lines changed

4 files changed

+99
-125
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en.h

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ struct mlx5e_cq {
280280
struct napi_struct *napi;
281281
struct mlx5_core_cq mcq;
282282
struct mlx5e_channel *channel;
283-
struct mlx5e_priv *priv;
284283

285284
/* cqe decompression */
286285
struct mlx5_cqe64 title;
@@ -290,6 +289,7 @@ struct mlx5e_cq {
290289
u16 decmprs_wqe_counter;
291290

292291
/* control */
292+
struct mlx5_core_dev *mdev;
293293
struct mlx5_frag_wq_ctrl wq_ctrl;
294294
} ____cacheline_aligned_in_smp;
295295

@@ -533,7 +533,7 @@ struct mlx5e_rq {
533533
u32 mpwqe_num_strides;
534534
u32 rqn;
535535
struct mlx5e_channel *channel;
536-
struct mlx5e_priv *priv;
536+
struct mlx5_core_dev *mdev;
537537
struct mlx5_core_mkey umr_mkey;
538538
} ____cacheline_aligned_in_smp;
539539

@@ -556,6 +556,8 @@ struct mlx5e_channel {
556556

557557
/* control */
558558
struct mlx5e_priv *priv;
559+
struct mlx5_core_dev *mdev;
560+
struct mlx5e_tstamp *tstamp;
559561
int ix;
560562
int cpu;
561563
};
@@ -715,22 +717,6 @@ enum {
715717
MLX5E_NIC_PRIO
716718
};
717719

718-
struct mlx5e_profile {
719-
void (*init)(struct mlx5_core_dev *mdev,
720-
struct net_device *netdev,
721-
const struct mlx5e_profile *profile, void *ppriv);
722-
void (*cleanup)(struct mlx5e_priv *priv);
723-
int (*init_rx)(struct mlx5e_priv *priv);
724-
void (*cleanup_rx)(struct mlx5e_priv *priv);
725-
int (*init_tx)(struct mlx5e_priv *priv);
726-
void (*cleanup_tx)(struct mlx5e_priv *priv);
727-
void (*enable)(struct mlx5e_priv *priv);
728-
void (*disable)(struct mlx5e_priv *priv);
729-
void (*update_stats)(struct mlx5e_priv *priv);
730-
int (*max_nch)(struct mlx5_core_dev *mdev);
731-
int max_tc;
732-
};
733-
734720
struct mlx5e_priv {
735721
/* priv data path fields - start */
736722
struct mlx5e_txqsq *txq2sq[MLX5E_MAX_NUM_CHANNELS * MLX5E_MAX_NUM_TC];
@@ -770,6 +756,22 @@ struct mlx5e_priv {
770756
void *ppriv;
771757
};
772758

759+
struct mlx5e_profile {
760+
void (*init)(struct mlx5_core_dev *mdev,
761+
struct net_device *netdev,
762+
const struct mlx5e_profile *profile, void *ppriv);
763+
void (*cleanup)(struct mlx5e_priv *priv);
764+
int (*init_rx)(struct mlx5e_priv *priv);
765+
void (*cleanup_rx)(struct mlx5e_priv *priv);
766+
int (*init_tx)(struct mlx5e_priv *priv);
767+
void (*cleanup_tx)(struct mlx5e_priv *priv);
768+
void (*enable)(struct mlx5e_priv *priv);
769+
void (*disable)(struct mlx5e_priv *priv);
770+
void (*update_stats)(struct mlx5e_priv *priv);
771+
int (*max_nch)(struct mlx5_core_dev *mdev);
772+
int max_tc;
773+
};
774+
773775
void mlx5e_build_ptys2ethtool_map(void);
774776

775777
u16 mlx5e_select_queue(struct net_device *dev, struct sk_buff *skb,

0 commit comments

Comments
 (0)