Skip to content

Commit 133fac0

Browse files
Sudarsana Kallurudavem330
authored andcommitted
qede: Add basic ethtool support
This adds basic ethtool operations to the qed driver, allowing support in: - Statistics gathering [ethtool -S] - Setting of debug level [ethtool -s <interface> msglvl] - Getting basic information [ethtool, ethtool -i] In addition it adds the ability to change the MTU. Signed-off-by: Sudarsana Kalluru <Sudarsana.Kalluru@qlogic.com> Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9df2ed0 commit 133fac0

File tree

4 files changed

+596
-2
lines changed

4 files changed

+596
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
obj-$(CONFIG_QEDE) := qede.o
22

3-
qede-y := qede_main.o
3+
qede-y := qede_main.o qede_ethtool.o

drivers/net/ethernet/qlogic/qede/qede.h

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,70 @@
3636

3737
#define DRV_MODULE_SYM qede
3838

39+
struct qede_stats {
40+
u64 no_buff_discards;
41+
u64 rx_ucast_bytes;
42+
u64 rx_mcast_bytes;
43+
u64 rx_bcast_bytes;
44+
u64 rx_ucast_pkts;
45+
u64 rx_mcast_pkts;
46+
u64 rx_bcast_pkts;
47+
u64 mftag_filter_discards;
48+
u64 mac_filter_discards;
49+
u64 tx_ucast_bytes;
50+
u64 tx_mcast_bytes;
51+
u64 tx_bcast_bytes;
52+
u64 tx_ucast_pkts;
53+
u64 tx_mcast_pkts;
54+
u64 tx_bcast_pkts;
55+
u64 tx_err_drop_pkts;
56+
u64 coalesced_pkts;
57+
u64 coalesced_events;
58+
u64 coalesced_aborts_num;
59+
u64 non_coalesced_pkts;
60+
u64 coalesced_bytes;
61+
62+
/* port */
63+
u64 rx_64_byte_packets;
64+
u64 rx_127_byte_packets;
65+
u64 rx_255_byte_packets;
66+
u64 rx_511_byte_packets;
67+
u64 rx_1023_byte_packets;
68+
u64 rx_1518_byte_packets;
69+
u64 rx_1522_byte_packets;
70+
u64 rx_2047_byte_packets;
71+
u64 rx_4095_byte_packets;
72+
u64 rx_9216_byte_packets;
73+
u64 rx_16383_byte_packets;
74+
u64 rx_crc_errors;
75+
u64 rx_mac_crtl_frames;
76+
u64 rx_pause_frames;
77+
u64 rx_pfc_frames;
78+
u64 rx_align_errors;
79+
u64 rx_carrier_errors;
80+
u64 rx_oversize_packets;
81+
u64 rx_jabbers;
82+
u64 rx_undersize_packets;
83+
u64 rx_fragments;
84+
u64 tx_64_byte_packets;
85+
u64 tx_65_to_127_byte_packets;
86+
u64 tx_128_to_255_byte_packets;
87+
u64 tx_256_to_511_byte_packets;
88+
u64 tx_512_to_1023_byte_packets;
89+
u64 tx_1024_to_1518_byte_packets;
90+
u64 tx_1519_to_2047_byte_packets;
91+
u64 tx_2048_to_4095_byte_packets;
92+
u64 tx_4096_to_9216_byte_packets;
93+
u64 tx_9217_to_16383_byte_packets;
94+
u64 tx_pause_frames;
95+
u64 tx_pfc_frames;
96+
u64 tx_lpi_entry_count;
97+
u64 tx_total_collisions;
98+
u64 brb_truncates;
99+
u64 brb_discards;
100+
u64 tx_mac_ctrl_frames;
101+
};
102+
39103
struct qede_dev {
40104
struct qed_dev *cdev;
41105
struct net_device *ndev;
@@ -84,6 +148,7 @@ struct qede_dev {
84148
max_t(u64, 1UL << QEDE_RX_ALIGN_SHIFT, \
85149
SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
86150

151+
struct qede_stats stats;
87152
struct qed_update_vport_rss_params rss_params;
88153
u16 q_num_rx_buffers; /* Must be a power of two */
89154
u16 q_num_tx_buffers; /* Must be a power of two */
@@ -194,6 +259,15 @@ union qede_reload_args {
194259
u16 mtu;
195260
};
196261

262+
void qede_config_debug(uint debug, u32 *p_dp_module, u8 *p_dp_level);
263+
void qede_set_ethtool_ops(struct net_device *netdev);
264+
void qede_reload(struct qede_dev *edev,
265+
void (*func)(struct qede_dev *edev,
266+
union qede_reload_args *args),
267+
union qede_reload_args *args);
268+
int qede_change_mtu(struct net_device *dev, int new_mtu);
269+
void qede_fill_by_demand_stats(struct qede_dev *edev);
270+
197271
#define RX_RING_SIZE_POW 13
198272
#define RX_RING_SIZE BIT(RX_RING_SIZE_POW)
199273
#define NUM_RX_BDS_MAX (RX_RING_SIZE - 1)

0 commit comments

Comments
 (0)