net/mlx5e: IPoIB, Get more TX statistics
authorErez Shitrit <erezsh@mellanox.com>
Sun, 21 May 2017 13:28:07 +0000 (16:28 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Mon, 19 Jun 2017 15:40:20 +0000 (18:40 +0300)
Add misses counters (bytes, packet, gso, xmit_more) in TX flow for ipoib
traffic.

Fixes: 58545449b7b ("net/mlx5e: IPoIB, Xmit flow")
Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c

index 354f474..0433d69 100644 (file)
@@ -557,11 +557,16 @@ netdev_tx_t mlx5i_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,
        if (skb_is_gso(skb)) {
                opcode = MLX5_OPCODE_LSO;
                ihs = mlx5e_txwqe_build_eseg_gso(sq, skb, eseg, &num_bytes);
+               sq->stats.packets += skb_shinfo(skb)->gso_segs;
        } else {
                ihs = mlx5e_calc_min_inline(sq->min_inline_mode, skb);
                num_bytes = max_t(unsigned int, skb->len, ETH_ZLEN);
+               sq->stats.packets++;
        }
 
+       sq->stats.bytes += num_bytes;
+       sq->stats.xmit_more += skb->xmit_more;
+
        ds_cnt = sizeof(*wqe) / MLX5_SEND_WQE_DS;
        if (ihs) {
                memcpy(eseg->inline_hdr.start, skb_data, ihs);