提交 c302e3a1 编写于 作者: M M Chetan Kumar 提交者: David S. Miller

net: wwan: iosm: fix netdev tx stats

Update tx stats on successful packet consume, drop.
Signed-off-by: NM Chetan Kumar <m.chetan.kumar@linux.intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 5bb4eea0
......@@ -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 @@ 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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册