As soon as skb is given to hardware, TX completion can free skb under us. Therefore, we should update dev stats before kicking the device.
Unified · Split
| @@ -1965,11 +1965,11 @@ netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) · 1964 unmodified lines | ||
| 1965 | 1965 | |
| 1966 | 1966 | netxen_tso_check(netdev, tx_ring, first_desc, skb); |
| 1967 | 1967 | |
| 1968 | − netxen_nic_update_cmd_producer(adapter, tx_ring); | |
| 1969 | − | |
| 1970 | 1968 | adapter->stats.txbytes += skb->len; |
| 1971 | 1969 | adapter->stats.xmitcalled++; |
| 1972 | 1970 | |
| 1971 | + netxen_nic_update_cmd_producer(adapter, tx_ring); | |
| 1972 | + | |
| 1973 | 1973 | return NETDEV_TX_OK; |
| 1974 | 1974 | |
| 1975 | 1975 | drop_packet: |