diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-03 01:35:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-05 05:29:40 -0400 |
commit | 534cb283efef9fdbd9f70f4615054d26aa444dd6 (patch) | |
tree | e044ce1397f698d107282ae035fb0d30944b86c3 /drivers | |
parent | 1d248b1cf4e09dbec8cef5f7fbeda5874248bd09 (diff) |
cxgb3: Convert t3_l2t_get() over to dst_neigh_lookup().
This means passing in a suitable destination address.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/infiniband/hw/cxgb3/iwch_cm.c | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c | 11 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb3/l2t.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb3/l2t.h | 2 | ||||
-rw-r--r-- | drivers/scsi/cxgbi/cxgb3i/cxgb3i.c | 3 |
5 files changed, 17 insertions, 10 deletions
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c index 740dcc065cf2..77b6b182778a 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_cm.c +++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c | |||
@@ -1374,7 +1374,7 @@ static int pass_accept_req(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) | |||
1374 | goto reject; | 1374 | goto reject; |
1375 | } | 1375 | } |
1376 | dst = &rt->dst; | 1376 | dst = &rt->dst; |
1377 | l2t = t3_l2t_get(tdev, dst, NULL); | 1377 | l2t = t3_l2t_get(tdev, dst, NULL, &req->peer_ip); |
1378 | if (!l2t) { | 1378 | if (!l2t) { |
1379 | printk(KERN_ERR MOD "%s - failed to allocate l2t entry!\n", | 1379 | printk(KERN_ERR MOD "%s - failed to allocate l2t entry!\n", |
1380 | __func__); | 1380 | __func__); |
@@ -1942,7 +1942,8 @@ int iwch_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) | |||
1942 | goto fail3; | 1942 | goto fail3; |
1943 | } | 1943 | } |
1944 | ep->dst = &rt->dst; | 1944 | ep->dst = &rt->dst; |
1945 | ep->l2t = t3_l2t_get(ep->com.tdev, ep->dst, NULL); | 1945 | ep->l2t = t3_l2t_get(ep->com.tdev, ep->dst, NULL, |
1946 | &cm_id->remote_addr.sin_addr.s_addr); | ||
1946 | if (!ep->l2t) { | 1947 | if (!ep->l2t) { |
1947 | printk(KERN_ERR MOD "%s - cannot alloc l2e.\n", __func__); | 1948 | printk(KERN_ERR MOD "%s - cannot alloc l2e.\n", __func__); |
1948 | err = -ENOMEM; | 1949 | err = -ENOMEM; |
diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c index 633c6029e53c..2dbbcbb450d3 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c +++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c | |||
@@ -63,7 +63,8 @@ static const unsigned int ATID_BASE = 0x10000; | |||
63 | 63 | ||
64 | static void cxgb_neigh_update(struct neighbour *neigh); | 64 | static void cxgb_neigh_update(struct neighbour *neigh); |
65 | static void cxgb_redirect(struct dst_entry *old, struct neighbour *old_neigh, | 65 | static void cxgb_redirect(struct dst_entry *old, struct neighbour *old_neigh, |
66 | struct dst_entry *new, struct neighbour *new_neigh); | 66 | struct dst_entry *new, struct neighbour *new_neigh, |
67 | const void *daddr); | ||
67 | 68 | ||
68 | static inline int offload_activated(struct t3cdev *tdev) | 69 | static inline int offload_activated(struct t3cdev *tdev) |
69 | { | 70 | { |
@@ -970,7 +971,8 @@ static int nb_callback(struct notifier_block *self, unsigned long event, | |||
970 | case (NETEVENT_REDIRECT):{ | 971 | case (NETEVENT_REDIRECT):{ |
971 | struct netevent_redirect *nr = ctx; | 972 | struct netevent_redirect *nr = ctx; |
972 | cxgb_redirect(nr->old, nr->old_neigh, | 973 | cxgb_redirect(nr->old, nr->old_neigh, |
973 | nr->new, nr->new_neigh); | 974 | nr->new, nr->new_neigh, |
975 | nr->daddr); | ||
974 | cxgb_neigh_update(nr->new_neigh); | 976 | cxgb_neigh_update(nr->new_neigh); |
975 | break; | 977 | break; |
976 | } | 978 | } |
@@ -1110,7 +1112,8 @@ static void set_l2t_ix(struct t3cdev *tdev, u32 tid, struct l2t_entry *e) | |||
1110 | } | 1112 | } |
1111 | 1113 | ||
1112 | static void cxgb_redirect(struct dst_entry *old, struct neighbour *old_neigh, | 1114 | static void cxgb_redirect(struct dst_entry *old, struct neighbour *old_neigh, |
1113 | struct dst_entry *new, struct neighbour *new_neigh) | 1115 | struct dst_entry *new, struct neighbour *new_neigh, |
1116 | const void *daddr) | ||
1114 | { | 1117 | { |
1115 | struct net_device *olddev, *newdev; | 1118 | struct net_device *olddev, *newdev; |
1116 | struct tid_info *ti; | 1119 | struct tid_info *ti; |
@@ -1139,7 +1142,7 @@ static void cxgb_redirect(struct dst_entry *old, struct neighbour *old_neigh, | |||
1139 | } | 1142 | } |
1140 | 1143 | ||
1141 | /* Add new L2T entry */ | 1144 | /* Add new L2T entry */ |
1142 | e = t3_l2t_get(tdev, new, newdev); | 1145 | e = t3_l2t_get(tdev, new, newdev, daddr); |
1143 | if (!e) { | 1146 | if (!e) { |
1144 | printk(KERN_ERR "%s: couldn't allocate new l2t entry!\n", | 1147 | printk(KERN_ERR "%s: couldn't allocate new l2t entry!\n", |
1145 | __func__); | 1148 | __func__); |
diff --git a/drivers/net/ethernet/chelsio/cxgb3/l2t.c b/drivers/net/ethernet/chelsio/cxgb3/l2t.c index 3fa3c8833ed7..8d53438638b2 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/l2t.c +++ b/drivers/net/ethernet/chelsio/cxgb3/l2t.c | |||
@@ -299,7 +299,7 @@ static inline void reuse_entry(struct l2t_entry *e, struct neighbour *neigh) | |||
299 | } | 299 | } |
300 | 300 | ||
301 | struct l2t_entry *t3_l2t_get(struct t3cdev *cdev, struct dst_entry *dst, | 301 | struct l2t_entry *t3_l2t_get(struct t3cdev *cdev, struct dst_entry *dst, |
302 | struct net_device *dev) | 302 | struct net_device *dev, const void *daddr) |
303 | { | 303 | { |
304 | struct l2t_entry *e = NULL; | 304 | struct l2t_entry *e = NULL; |
305 | struct neighbour *neigh; | 305 | struct neighbour *neigh; |
@@ -311,7 +311,7 @@ struct l2t_entry *t3_l2t_get(struct t3cdev *cdev, struct dst_entry *dst, | |||
311 | int smt_idx; | 311 | int smt_idx; |
312 | 312 | ||
313 | rcu_read_lock(); | 313 | rcu_read_lock(); |
314 | neigh = dst_get_neighbour_noref(dst); | 314 | neigh = dst_neigh_lookup(dst, daddr); |
315 | if (!neigh) | 315 | if (!neigh) |
316 | goto done_rcu; | 316 | goto done_rcu; |
317 | 317 | ||
@@ -360,6 +360,8 @@ struct l2t_entry *t3_l2t_get(struct t3cdev *cdev, struct dst_entry *dst, | |||
360 | done_unlock: | 360 | done_unlock: |
361 | write_unlock_bh(&d->lock); | 361 | write_unlock_bh(&d->lock); |
362 | done_rcu: | 362 | done_rcu: |
363 | if (neigh) | ||
364 | neigh_release(neigh); | ||
363 | rcu_read_unlock(); | 365 | rcu_read_unlock(); |
364 | return e; | 366 | return e; |
365 | } | 367 | } |
diff --git a/drivers/net/ethernet/chelsio/cxgb3/l2t.h b/drivers/net/ethernet/chelsio/cxgb3/l2t.h index c4e864369751..8cffcdfd5678 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/l2t.h +++ b/drivers/net/ethernet/chelsio/cxgb3/l2t.h | |||
@@ -110,7 +110,7 @@ static inline void set_arp_failure_handler(struct sk_buff *skb, | |||
110 | void t3_l2e_free(struct l2t_data *d, struct l2t_entry *e); | 110 | void t3_l2e_free(struct l2t_data *d, struct l2t_entry *e); |
111 | void t3_l2t_update(struct t3cdev *dev, struct neighbour *neigh); | 111 | void t3_l2t_update(struct t3cdev *dev, struct neighbour *neigh); |
112 | struct l2t_entry *t3_l2t_get(struct t3cdev *cdev, struct dst_entry *dst, | 112 | struct l2t_entry *t3_l2t_get(struct t3cdev *cdev, struct dst_entry *dst, |
113 | struct net_device *dev); | 113 | struct net_device *dev, const void *daddr); |
114 | int t3_l2t_send_slow(struct t3cdev *dev, struct sk_buff *skb, | 114 | int t3_l2t_send_slow(struct t3cdev *dev, struct sk_buff *skb, |
115 | struct l2t_entry *e); | 115 | struct l2t_entry *e); |
116 | void t3_l2t_send_event(struct t3cdev *dev, struct l2t_entry *e); | 116 | void t3_l2t_send_event(struct t3cdev *dev, struct l2t_entry *e); |
diff --git a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c index 36739da8bc15..49692a1ac44a 100644 --- a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c +++ b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c | |||
@@ -966,7 +966,8 @@ static int init_act_open(struct cxgbi_sock *csk) | |||
966 | csk->saddr.sin_addr.s_addr = chba->ipv4addr; | 966 | csk->saddr.sin_addr.s_addr = chba->ipv4addr; |
967 | 967 | ||
968 | csk->rss_qid = 0; | 968 | csk->rss_qid = 0; |
969 | csk->l2t = t3_l2t_get(t3dev, dst, ndev); | 969 | csk->l2t = t3_l2t_get(t3dev, dst, ndev, |
970 | &csk->daddr.sin_addr.s_addr); | ||
970 | if (!csk->l2t) { | 971 | if (!csk->l2t) { |
971 | pr_err("NO l2t available.\n"); | 972 | pr_err("NO l2t available.\n"); |
972 | return -EINVAL; | 973 | return -EINVAL; |