diff options
author | David S. Miller <davem@davemloft.net> | 2016-09-08 19:15:29 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-08 19:15:29 -0400 |
commit | 81d1a366ff814211f3169e6b3e2c9eea682a679e (patch) | |
tree | 78a463ca47e06f2b59dad504f05904f1ee0e5f85 | |
parent | 76061f631c2ea4ab9c4d66f3a96ecc5737f5aaf7 (diff) | |
parent | cd17d230dd060a12f7451c0caeedb3fd5158eaf9 (diff) |
Merge branch 'mlx5-fixes'
Saeed Mahameed says:
====================
Mellanox 100G mlx5 fixes 2016-09-07
The following series contains bug fixes for the mlx5e driver.
from Gal,
- Static code checker cleanup (casting overflow)
- Fix global PFC counter statistics reading
- Fix HW LRO when vlan stripping is off
From Bodong,
- Deprecate old autoneg capability bit and use new one.
From Tariq,
- Fix xmit more counter race condition
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 8 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 22 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 2 | ||||
-rw-r--r-- | include/linux/mlx5/mlx5_ifc.h | 5 |
4 files changed, 24 insertions, 13 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c index d0cf8fa22659..7a346bb2ed00 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | |||
@@ -331,7 +331,7 @@ static void mlx5e_get_ethtool_stats(struct net_device *dev, | |||
331 | if (mlx5e_query_global_pause_combined(priv)) { | 331 | if (mlx5e_query_global_pause_combined(priv)) { |
332 | for (i = 0; i < NUM_PPORT_PER_PRIO_PFC_COUNTERS; i++) { | 332 | for (i = 0; i < NUM_PPORT_PER_PRIO_PFC_COUNTERS; i++) { |
333 | data[idx++] = MLX5E_READ_CTR64_BE(&priv->stats.pport.per_prio_counters[0], | 333 | data[idx++] = MLX5E_READ_CTR64_BE(&priv->stats.pport.per_prio_counters[0], |
334 | pport_per_prio_pfc_stats_desc, 0); | 334 | pport_per_prio_pfc_stats_desc, i); |
335 | } | 335 | } |
336 | } | 336 | } |
337 | 337 | ||
@@ -659,9 +659,10 @@ out: | |||
659 | static void ptys2ethtool_supported_link(unsigned long *supported_modes, | 659 | static void ptys2ethtool_supported_link(unsigned long *supported_modes, |
660 | u32 eth_proto_cap) | 660 | u32 eth_proto_cap) |
661 | { | 661 | { |
662 | unsigned long proto_cap = eth_proto_cap; | ||
662 | int proto; | 663 | int proto; |
663 | 664 | ||
664 | for_each_set_bit(proto, (unsigned long *)ð_proto_cap, MLX5E_LINK_MODES_NUMBER) | 665 | for_each_set_bit(proto, &proto_cap, MLX5E_LINK_MODES_NUMBER) |
665 | bitmap_or(supported_modes, supported_modes, | 666 | bitmap_or(supported_modes, supported_modes, |
666 | ptys2ethtool_table[proto].supported, | 667 | ptys2ethtool_table[proto].supported, |
667 | __ETHTOOL_LINK_MODE_MASK_NBITS); | 668 | __ETHTOOL_LINK_MODE_MASK_NBITS); |
@@ -670,9 +671,10 @@ static void ptys2ethtool_supported_link(unsigned long *supported_modes, | |||
670 | static void ptys2ethtool_adver_link(unsigned long *advertising_modes, | 671 | static void ptys2ethtool_adver_link(unsigned long *advertising_modes, |
671 | u32 eth_proto_cap) | 672 | u32 eth_proto_cap) |
672 | { | 673 | { |
674 | unsigned long proto_cap = eth_proto_cap; | ||
673 | int proto; | 675 | int proto; |
674 | 676 | ||
675 | for_each_set_bit(proto, (unsigned long *)ð_proto_cap, MLX5E_LINK_MODES_NUMBER) | 677 | for_each_set_bit(proto, &proto_cap, MLX5E_LINK_MODES_NUMBER) |
676 | bitmap_or(advertising_modes, advertising_modes, | 678 | bitmap_or(advertising_modes, advertising_modes, |
677 | ptys2ethtool_table[proto].advertised, | 679 | ptys2ethtool_table[proto].advertised, |
678 | __ETHTOOL_LINK_MODE_MASK_NBITS); | 680 | __ETHTOOL_LINK_MODE_MASK_NBITS); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index b6f8ebbdb487..e7c969df3dad 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | |||
@@ -637,24 +637,32 @@ bool mlx5e_post_rx_wqes(struct mlx5e_rq *rq) | |||
637 | static void mlx5e_lro_update_hdr(struct sk_buff *skb, struct mlx5_cqe64 *cqe, | 637 | static void mlx5e_lro_update_hdr(struct sk_buff *skb, struct mlx5_cqe64 *cqe, |
638 | u32 cqe_bcnt) | 638 | u32 cqe_bcnt) |
639 | { | 639 | { |
640 | struct ethhdr *eth = (struct ethhdr *)(skb->data); | 640 | struct ethhdr *eth = (struct ethhdr *)(skb->data); |
641 | struct iphdr *ipv4 = (struct iphdr *)(skb->data + ETH_HLEN); | 641 | struct iphdr *ipv4; |
642 | struct ipv6hdr *ipv6 = (struct ipv6hdr *)(skb->data + ETH_HLEN); | 642 | struct ipv6hdr *ipv6; |
643 | struct tcphdr *tcp; | 643 | struct tcphdr *tcp; |
644 | int network_depth = 0; | ||
645 | __be16 proto; | ||
646 | u16 tot_len; | ||
644 | 647 | ||
645 | u8 l4_hdr_type = get_cqe_l4_hdr_type(cqe); | 648 | u8 l4_hdr_type = get_cqe_l4_hdr_type(cqe); |
646 | int tcp_ack = ((CQE_L4_HDR_TYPE_TCP_ACK_NO_DATA == l4_hdr_type) || | 649 | int tcp_ack = ((CQE_L4_HDR_TYPE_TCP_ACK_NO_DATA == l4_hdr_type) || |
647 | (CQE_L4_HDR_TYPE_TCP_ACK_AND_DATA == l4_hdr_type)); | 650 | (CQE_L4_HDR_TYPE_TCP_ACK_AND_DATA == l4_hdr_type)); |
648 | 651 | ||
649 | u16 tot_len = cqe_bcnt - ETH_HLEN; | 652 | skb->mac_len = ETH_HLEN; |
653 | proto = __vlan_get_protocol(skb, eth->h_proto, &network_depth); | ||
650 | 654 | ||
651 | if (eth->h_proto == htons(ETH_P_IP)) { | 655 | ipv4 = (struct iphdr *)(skb->data + network_depth); |
652 | tcp = (struct tcphdr *)(skb->data + ETH_HLEN + | 656 | ipv6 = (struct ipv6hdr *)(skb->data + network_depth); |
657 | tot_len = cqe_bcnt - network_depth; | ||
658 | |||
659 | if (proto == htons(ETH_P_IP)) { | ||
660 | tcp = (struct tcphdr *)(skb->data + network_depth + | ||
653 | sizeof(struct iphdr)); | 661 | sizeof(struct iphdr)); |
654 | ipv6 = NULL; | 662 | ipv6 = NULL; |
655 | skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4; | 663 | skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4; |
656 | } else { | 664 | } else { |
657 | tcp = (struct tcphdr *)(skb->data + ETH_HLEN + | 665 | tcp = (struct tcphdr *)(skb->data + network_depth + |
658 | sizeof(struct ipv6hdr)); | 666 | sizeof(struct ipv6hdr)); |
659 | ipv4 = NULL; | 667 | ipv4 = NULL; |
660 | skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6; | 668 | skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6; |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c index 988eca99ee0f..eb0e72537f10 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | |||
@@ -356,6 +356,7 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_sq *sq, struct sk_buff *skb) | |||
356 | sq->stats.stopped++; | 356 | sq->stats.stopped++; |
357 | } | 357 | } |
358 | 358 | ||
359 | sq->stats.xmit_more += skb->xmit_more; | ||
359 | if (!skb->xmit_more || netif_xmit_stopped(sq->txq)) { | 360 | if (!skb->xmit_more || netif_xmit_stopped(sq->txq)) { |
360 | int bf_sz = 0; | 361 | int bf_sz = 0; |
361 | 362 | ||
@@ -375,7 +376,6 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_sq *sq, struct sk_buff *skb) | |||
375 | 376 | ||
376 | sq->stats.packets++; | 377 | sq->stats.packets++; |
377 | sq->stats.bytes += num_bytes; | 378 | sq->stats.bytes += num_bytes; |
378 | sq->stats.xmit_more += skb->xmit_more; | ||
379 | return NETDEV_TX_OK; | 379 | return NETDEV_TX_OK; |
380 | 380 | ||
381 | dma_unmap_wqe_err: | 381 | dma_unmap_wqe_err: |
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 21bc4557b67a..d1f9a581aca8 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h | |||
@@ -6710,9 +6710,10 @@ struct mlx5_ifc_pude_reg_bits { | |||
6710 | }; | 6710 | }; |
6711 | 6711 | ||
6712 | struct mlx5_ifc_ptys_reg_bits { | 6712 | struct mlx5_ifc_ptys_reg_bits { |
6713 | u8 an_disable_cap[0x1]; | 6713 | u8 reserved_at_0[0x1]; |
6714 | u8 an_disable_admin[0x1]; | 6714 | u8 an_disable_admin[0x1]; |
6715 | u8 reserved_at_2[0x6]; | 6715 | u8 an_disable_cap[0x1]; |
6716 | u8 reserved_at_3[0x5]; | ||
6716 | u8 local_port[0x8]; | 6717 | u8 local_port[0x8]; |
6717 | u8 reserved_at_10[0xd]; | 6718 | u8 reserved_at_10[0xd]; |
6718 | u8 proto_mask[0x3]; | 6719 | u8 proto_mask[0x3]; |