qede: reformat several structures in "qede.h"
Make the file more readable and easier for adding new fields. Misc: use IFNAMSIZ and netdev_name() instead of sizeof_field() and direct net_device::name dereferencing. Signed-off-by: Alexander Lobakin <alobakin@marvell.com> Signed-off-by: Igor Russkikh <irusskikh@marvell.com> Signed-off-by: Michal Kalderon <michal.kalderon@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
be0cec6ffd
commit
f35535f73c
@ -177,7 +177,8 @@ struct qede_dev {
|
|||||||
u8 dp_level;
|
u8 dp_level;
|
||||||
|
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
#define IS_VF(edev) (test_bit(QEDE_FLAGS_IS_VF, &(edev)->flags))
|
#define IS_VF(edev) test_bit(QEDE_FLAGS_IS_VF, \
|
||||||
|
&(edev)->flags)
|
||||||
|
|
||||||
const struct qed_eth_ops *ops;
|
const struct qed_eth_ops *ops;
|
||||||
struct qede_ptp *ptp;
|
struct qede_ptp *ptp;
|
||||||
@ -198,6 +199,7 @@ struct qede_dev {
|
|||||||
u8 fp_num_rx;
|
u8 fp_num_rx;
|
||||||
u16 req_queues;
|
u16 req_queues;
|
||||||
u16 num_queues;
|
u16 num_queues;
|
||||||
|
|
||||||
#define QEDE_QUEUE_CNT(edev) ((edev)->num_queues)
|
#define QEDE_QUEUE_CNT(edev) ((edev)->num_queues)
|
||||||
#define QEDE_RSS_COUNT(edev) ((edev)->num_queues - (edev)->fp_num_tx)
|
#define QEDE_RSS_COUNT(edev) ((edev)->num_queues - (edev)->fp_num_tx)
|
||||||
#define QEDE_RX_QUEUE_IDX(edev, i) (i)
|
#define QEDE_RX_QUEUE_IDX(edev, i) (i)
|
||||||
@ -205,7 +207,7 @@ struct qede_dev {
|
|||||||
|
|
||||||
struct qed_int_info int_info;
|
struct qed_int_info int_info;
|
||||||
|
|
||||||
/* Smaller private varaiant of the RTNL lock */
|
/* Smaller private variant of the RTNL lock */
|
||||||
struct mutex qede_lock;
|
struct mutex qede_lock;
|
||||||
u32 state; /* Protected by qede_lock */
|
u32 state; /* Protected by qede_lock */
|
||||||
u16 rx_buf_size;
|
u16 rx_buf_size;
|
||||||
@ -226,22 +228,28 @@ struct qede_dev {
|
|||||||
SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
|
SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
|
||||||
|
|
||||||
struct qede_stats stats;
|
struct qede_stats stats;
|
||||||
|
|
||||||
|
/* Bitfield to track initialized RSS params */
|
||||||
|
u32 rss_params_inited;
|
||||||
#define QEDE_RSS_INDIR_INITED BIT(0)
|
#define QEDE_RSS_INDIR_INITED BIT(0)
|
||||||
#define QEDE_RSS_KEY_INITED BIT(1)
|
#define QEDE_RSS_KEY_INITED BIT(1)
|
||||||
#define QEDE_RSS_CAPS_INITED BIT(2)
|
#define QEDE_RSS_CAPS_INITED BIT(2)
|
||||||
u32 rss_params_inited; /* bit-field to track initialized rss params */
|
|
||||||
u16 rss_ind_table[128];
|
u16 rss_ind_table[128];
|
||||||
u32 rss_key[10];
|
u32 rss_key[10];
|
||||||
u8 rss_caps;
|
u8 rss_caps;
|
||||||
|
|
||||||
u16 q_num_rx_buffers; /* Must be a power of two */
|
/* Both must be a power of two */
|
||||||
u16 q_num_tx_buffers; /* Must be a power of two */
|
u16 q_num_rx_buffers;
|
||||||
|
u16 q_num_tx_buffers;
|
||||||
|
|
||||||
bool gro_disable;
|
bool gro_disable;
|
||||||
|
|
||||||
struct list_head vlan_list;
|
struct list_head vlan_list;
|
||||||
u16 configured_vlans;
|
u16 configured_vlans;
|
||||||
u16 non_configured_vlans;
|
u16 non_configured_vlans;
|
||||||
bool accept_any_vlan;
|
bool accept_any_vlan;
|
||||||
|
|
||||||
struct delayed_work sp_task;
|
struct delayed_work sp_task;
|
||||||
unsigned long sp_flags;
|
unsigned long sp_flags;
|
||||||
u16 vxlan_dst_port;
|
u16 vxlan_dst_port;
|
||||||
@ -394,6 +402,7 @@ struct qede_tx_queue {
|
|||||||
|
|
||||||
void __iomem *doorbell_addr;
|
void __iomem *doorbell_addr;
|
||||||
union db_prod tx_db;
|
union db_prod tx_db;
|
||||||
|
|
||||||
int index; /* Slowpath only */
|
int index; /* Slowpath only */
|
||||||
#define QEDE_TXQ_XDP_TO_IDX(edev, txq) ((txq)->index - \
|
#define QEDE_TXQ_XDP_TO_IDX(edev, txq) ((txq)->index - \
|
||||||
QEDE_MAX_TSS_CNT(edev))
|
QEDE_MAX_TSS_CNT(edev))
|
||||||
@ -436,25 +445,28 @@ struct qede_tx_queue {
|
|||||||
|
|
||||||
struct qede_fastpath {
|
struct qede_fastpath {
|
||||||
struct qede_dev *edev;
|
struct qede_dev *edev;
|
||||||
|
|
||||||
|
u8 type;
|
||||||
#define QEDE_FASTPATH_TX BIT(0)
|
#define QEDE_FASTPATH_TX BIT(0)
|
||||||
#define QEDE_FASTPATH_RX BIT(1)
|
#define QEDE_FASTPATH_RX BIT(1)
|
||||||
#define QEDE_FASTPATH_XDP BIT(2)
|
#define QEDE_FASTPATH_XDP BIT(2)
|
||||||
#define QEDE_FASTPATH_COMBINED (QEDE_FASTPATH_TX | QEDE_FASTPATH_RX)
|
#define QEDE_FASTPATH_COMBINED (QEDE_FASTPATH_TX | QEDE_FASTPATH_RX)
|
||||||
u8 type;
|
|
||||||
u8 id;
|
u8 id;
|
||||||
|
|
||||||
u8 xdp_xmit;
|
u8 xdp_xmit;
|
||||||
|
|
||||||
struct napi_struct napi;
|
struct napi_struct napi;
|
||||||
struct qed_sb_info *sb_info;
|
struct qed_sb_info *sb_info;
|
||||||
struct qede_rx_queue *rxq;
|
struct qede_rx_queue *rxq;
|
||||||
struct qede_tx_queue *txq;
|
struct qede_tx_queue *txq;
|
||||||
struct qede_tx_queue *xdp_tx;
|
struct qede_tx_queue *xdp_tx;
|
||||||
|
|
||||||
#define VEC_NAME_SIZE (sizeof_field(struct net_device, name) + 8)
|
char name[IFNAMSIZ + 8];
|
||||||
char name[VEC_NAME_SIZE];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Debug print definitions */
|
/* Debug print definitions */
|
||||||
#define DP_NAME(edev) ((edev)->ndev->name)
|
#define DP_NAME(edev) netdev_name((edev)->ndev)
|
||||||
|
|
||||||
#define XMIT_PLAIN 0
|
#define XMIT_PLAIN 0
|
||||||
#define XMIT_L4_CSUM BIT(0)
|
#define XMIT_L4_CSUM BIT(0)
|
||||||
|
Loading…
Reference in New Issue
Block a user