Skip to content

Commit c302e3a

Browse files
mchetankumardavem330
authored andcommitted
net: wwan: iosm: fix netdev tx stats
Update tx stats on successful packet consume, drop. Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5bb4eea commit c302e3a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/net/wwan/iosm/iosm_ipc_wwan.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb,
107107
{
108108
struct iosm_netdev_priv *priv = wwan_netdev_drvpriv(netdev);
109109
struct iosm_wwan *ipc_wwan = priv->ipc_wwan;
110+
unsigned int len = skb->len;
110111
int if_id = priv->if_id;
111112
int ret;
112113

@@ -123,6 +124,8 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb,
123124

124125
/* Return code of zero is success */
125126
if (ret == 0) {
127+
netdev->stats.tx_packets++;
128+
netdev->stats.tx_bytes += len;
126129
ret = NETDEV_TX_OK;
127130
} else if (ret == -EBUSY) {
128131
ret = NETDEV_TX_BUSY;
@@ -140,7 +143,8 @@ static int ipc_wwan_link_transmit(struct sk_buff *skb,
140143
ret);
141144

142145
dev_kfree_skb_any(skb);
143-
return ret;
146+
netdev->stats.tx_dropped++;
147+
return NETDEV_TX_OK;
144148
}
145149

146150
/* Ops structure for wwan net link */

0 commit comments

Comments
 (0)