diff options
author | M Chetan Kumar <m.chetan.kumar@linux.intel.com> | 2021-07-01 20:39:17 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-07-01 13:04:41 -0700 |
commit | c302e3a1c86f78421d58ef564ba22519b0b039c0 (patch) | |
tree | ad1fed5f5d0281ed7d48523e5569e19de58c4b00 /drivers/net/wwan | |
parent | 5bb4eea0c5f5b9383a543293966bdf20e54988aa (diff) | |
download | linux-c302e3a1c86f78421d58ef564ba22519b0b039c0.tar.bz2 |
net: wwan: iosm: fix netdev tx stats
Update tx stats on successful packet consume, drop.
Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wwan')
-rw-r--r-- | drivers/net/wwan/iosm/iosm_ipc_wwan.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/wwan/iosm/iosm_ipc_wwan.c b/drivers/net/wwan/iosm/iosm_ipc_wwan.c index 84e37c4b0f74..e0c19c59c5f6 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_wwan.c +++ b/drivers/net/wwan/iosm/iosm_ipc_wwan.c @@ -107,6 +107,7 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb, { struct iosm_netdev_priv *priv = wwan_netdev_drvpriv(netdev); struct iosm_wwan *ipc_wwan = priv->ipc_wwan; + unsigned int len = skb->len; int if_id = priv->if_id; int ret; @@ -123,6 +124,8 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb, /* Return code of zero is success */ if (ret == 0) { + netdev->stats.tx_packets++; + netdev->stats.tx_bytes += len; ret = NETDEV_TX_OK; } else if (ret == -EBUSY) { ret = NETDEV_TX_BUSY; @@ -140,7 +143,8 @@ exit: ret); dev_kfree_skb_any(skb); - return ret; + netdev->stats.tx_dropped++; + return NETDEV_TX_OK; } /* Ops structure for wwan net link */ |