Commit c302e3a1 authored by M Chetan Kumar's avatar M Chetan Kumar Committed by David S. Miller

net: wwan: iosm: fix netdev tx stats

Update tx stats on successful packet consume, drop.
Signed-off-by: default avatarM Chetan Kumar <m.chetan.kumar@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5bb4eea0
...@@ -107,6 +107,7 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb, ...@@ -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_netdev_priv *priv = wwan_netdev_drvpriv(netdev);
struct iosm_wwan *ipc_wwan = priv->ipc_wwan; struct iosm_wwan *ipc_wwan = priv->ipc_wwan;
unsigned int len = skb->len;
int if_id = priv->if_id; int if_id = priv->if_id;
int ret; int ret;
...@@ -123,6 +124,8 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb, ...@@ -123,6 +124,8 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb,
/* Return code of zero is success */ /* Return code of zero is success */
if (ret == 0) { if (ret == 0) {
netdev->stats.tx_packets++;
netdev->stats.tx_bytes += len;
ret = NETDEV_TX_OK; ret = NETDEV_TX_OK;
} else if (ret == -EBUSY) { } else if (ret == -EBUSY) {
ret = NETDEV_TX_BUSY; ret = NETDEV_TX_BUSY;
...@@ -140,7 +143,8 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb, ...@@ -140,7 +143,8 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb,
ret); ret);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return ret; netdev->stats.tx_dropped++;
return NETDEV_TX_OK;
} }
/* Ops structure for wwan net link */ /* Ops structure for wwan net link */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment