netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cxgb4: Save the correct mac addr for hw-loopback connections in the L2T
@ 2014-04-14 19:22 Steve Wise
  2014-04-14 20:48 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Wise @ 2014-04-14 19:22 UTC (permalink / raw)
  To: davem; +Cc: netdev, hariprasad

Hardware needs the local device mac address to support hw loopback for
rdma loopback connections.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---

 drivers/net/ethernet/chelsio/cxgb4/l2t.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/l2t.c b/drivers/net/ethernet/chelsio/cxgb4/l2t.c
index 81e8402..8a96572 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/l2t.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/l2t.c
@@ -154,7 +154,7 @@ static int write_l2e(struct adapter *adap, struct l2t_entry *e, int sync)
 	req->params = htons(L2T_W_PORT(e->lport) | L2T_W_NOREPLY(!sync));
 	req->l2t_idx = htons(e->idx);
 	req->vlan = htons(e->vlan);
-	if (e->neigh)
+	if (e->neigh && !(e->neigh->dev->flags & IFF_LOOPBACK))
 		memcpy(e->dmac, e->neigh->ha, sizeof(e->dmac));
 	memcpy(req->dst_mac, e->dmac, sizeof(req->dst_mac));
 
@@ -394,6 +394,8 @@ struct l2t_entry *cxgb4_l2t_get(struct l2t_data *d, struct neighbour *neigh,
 	if (e) {
 		spin_lock(&e->lock);          /* avoid race with t4_l2t_free */
 		e->state = L2T_STATE_RESOLVING;
+		if (neigh->dev->flags & IFF_LOOPBACK)
+			memcpy(e->dmac, physdev->dev_addr, sizeof(e->dmac));
 		memcpy(e->addr, addr, addr_len);
 		e->ifindex = ifidx;
 		e->hash = hash;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cxgb4: Save the correct mac addr for hw-loopback connections in the L2T
  2014-04-14 19:22 [PATCH] cxgb4: Save the correct mac addr for hw-loopback connections in the L2T Steve Wise
@ 2014-04-14 20:48 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-04-14 20:48 UTC (permalink / raw)
  To: swise; +Cc: netdev, hariprasad

From: Steve Wise <swise@opengridcomputing.com>
Date: Mon, 14 Apr 2014 14:22:43 -0500

> Hardware needs the local device mac address to support hw loopback for
> rdma loopback connections.
> 
> Signed-off-by: Steve Wise <swise@opengridcomputing.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-14 20:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-14 19:22 [PATCH] cxgb4: Save the correct mac addr for hw-loopback connections in the L2T Steve Wise
2014-04-14 20:48 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).