aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx4/en_tx.c
diff options
context:
space:
mode:
authorEugenia Emantayev <eugenia@mellanox.co.il>2011-12-12 23:16:38 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-13 13:56:07 -0500
commit5b4c4d36860ef1c411d0669ffc15090417a33389 (patch)
treeabd1a09a1f97cf41bc2e08c6bd505f3a632b393c /drivers/net/ethernet/mellanox/mlx4/en_tx.c
parentffe455ad04681f3fc48eef595fe526a795f809a3 (diff)
mlx4_en: Allow communication between functions on same host
To enable internal loopback, always fill DMAC in control segment when transmitting the packet, once this is done, the packet is subject for loopback for if the DMAC mathces one of the multicast/unicast addresses registered on the physical port. In receive path if source MAC is our own MAC and we are not in selftest, or not in force LB mode - drop this packet. Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il> Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/en_tx.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_tx.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
index 7e76862de35..9ef9038d062 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
@@ -688,17 +688,15 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
688 ring->tx_csum++; 688 ring->tx_csum++;
689 } 689 }
690 690
691 if (unlikely(priv->validate_loopback)) { 691 /* Copy dst mac address to wqe */
692 /* Copy dst mac address to wqe */ 692 skb_reset_mac_header(skb);
693 skb_reset_mac_header(skb); 693 ethh = eth_hdr(skb);
694 ethh = eth_hdr(skb); 694 if (ethh && ethh->h_dest) {
695 if (ethh && ethh->h_dest) { 695 mac = mlx4_en_mac_to_u64(ethh->h_dest);
696 mac = mlx4_en_mac_to_u64(ethh->h_dest); 696 mac_h = (u32) ((mac & 0xffff00000000ULL) >> 16);
697 mac_h = (u32) ((mac & 0xffff00000000ULL) >> 16); 697 mac_l = (u32) (mac & 0xffffffff);
698 mac_l = (u32) (mac & 0xffffffff); 698 tx_desc->ctrl.srcrb_flags |= cpu_to_be32(mac_h);
699 tx_desc->ctrl.srcrb_flags |= cpu_to_be32(mac_h); 699 tx_desc->ctrl.imm = cpu_to_be32(mac_l);
700 tx_desc->ctrl.imm = cpu_to_be32(mac_l);
701 }
702 } 700 }
703 701
704 /* Handle LSO (TSO) packets */ 702 /* Handle LSO (TSO) packets */