Skip to content

Commit

Permalink
net: wwan: iosm: fix netdev tx stats
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
M Chetan Kumar authored and David S. Miller committed Jul 1, 2021
1 parent 5bb4eea commit c302e3a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/wwan/iosm/iosm_ipc_wwan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand All @@ -140,7 +143,8 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb,
ret);

dev_kfree_skb_any(skb);
return ret;
netdev->stats.tx_dropped++;
return NETDEV_TX_OK;
}

/* Ops structure for wwan net link */
Expand Down

0 comments on commit c302e3a

Please sign in to comment.