Skip to content

Commit 1ac6762

Browse files
Manish Chopradavem330
authored andcommitted
qlcnic: Fix bug in TX statistics
o Driver was not updating TX stats so it was not populating statistics in `ifconfig` command output. Signed-off-by: Manish Chopra <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f663dd9 commit 1ac6762

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

drivers/net/ethernet/qlogic/qlcnic/qlcnic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,6 +1711,7 @@ int qlcnic_83xx_init_mailbox_work(struct qlcnic_adapter *);
17111711
void qlcnic_83xx_detach_mailbox_work(struct qlcnic_adapter *);
17121712
void qlcnic_83xx_reinit_mbx_work(struct qlcnic_mailbox *mbx);
17131713
void qlcnic_83xx_free_mailbox(struct qlcnic_mailbox *mbx);
1714+
void qlcnic_update_stats(struct qlcnic_adapter *);
17141715

17151716
/* Adapter hardware abstraction */
17161717
struct qlcnic_hardware_ops {

drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,7 @@ static u64 *qlcnic_fill_stats(u64 *data, void *stats, int type)
12671267
return data;
12681268
}
12691269

1270-
static void qlcnic_update_stats(struct qlcnic_adapter *adapter)
1270+
void qlcnic_update_stats(struct qlcnic_adapter *adapter)
12711271
{
12721272
struct qlcnic_host_tx_ring *tx_ring;
12731273
int ring;

drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2780,6 +2780,9 @@ static struct net_device_stats *qlcnic_get_stats(struct net_device *netdev)
27802780
struct qlcnic_adapter *adapter = netdev_priv(netdev);
27812781
struct net_device_stats *stats = &netdev->stats;
27822782

2783+
if (test_bit(__QLCNIC_DEV_UP, &adapter->state))
2784+
qlcnic_update_stats(adapter);
2785+
27832786
stats->rx_packets = adapter->stats.rx_pkts + adapter->stats.lro_pkts;
27842787
stats->tx_packets = adapter->stats.xmitfinished;
27852788
stats->rx_bytes = adapter->stats.rxbytes + adapter->stats.lrobytes;

0 commit comments

Comments
 (0)