Skip to content

Commit 11d8cd5

Browse files
chelsiocudbgdavem330
authored andcommitted
cxgb4: move handling L2T ARP failures to caller
Move code handling L2T ARP failures to the only caller. Fixes following sparse warning: skbuff.h:2091:29: warning: context imbalance in 'handle_failed_resolution' - unexpected unlock Fixes: 749cb5f ("cxgb4: Replace arpq_head/arpq_tail with SKB double link-list code") Signed-off-by: Rahul Lakkireddy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6199496 commit 11d8cd5

File tree

1 file changed

+24
-28
lines changed
  • drivers/net/ethernet/chelsio/cxgb4

1 file changed

+24
-28
lines changed

drivers/net/ethernet/chelsio/cxgb4/l2t.c

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -502,41 +502,20 @@ u64 cxgb4_select_ntuple(struct net_device *dev,
502502
}
503503
EXPORT_SYMBOL(cxgb4_select_ntuple);
504504

505-
/*
506-
* Called when address resolution fails for an L2T entry to handle packets
507-
* on the arpq head. If a packet specifies a failure handler it is invoked,
508-
* otherwise the packet is sent to the device.
509-
*/
510-
static void handle_failed_resolution(struct adapter *adap, struct l2t_entry *e)
511-
{
512-
struct sk_buff *skb;
513-
514-
while ((skb = __skb_dequeue(&e->arpq)) != NULL) {
515-
const struct l2t_skb_cb *cb = L2T_SKB_CB(skb);
516-
517-
spin_unlock(&e->lock);
518-
if (cb->arp_err_handler)
519-
cb->arp_err_handler(cb->handle, skb);
520-
else
521-
t4_ofld_send(adap, skb);
522-
spin_lock(&e->lock);
523-
}
524-
}
525-
526505
/*
527506
* Called when the host's neighbor layer makes a change to some entry that is
528507
* loaded into the HW L2 table.
529508
*/
530509
void t4_l2t_update(struct adapter *adap, struct neighbour *neigh)
531510
{
532-
struct l2t_entry *e;
533-
struct sk_buff_head *arpq = NULL;
534-
struct l2t_data *d = adap->l2t;
535511
unsigned int addr_len = neigh->tbl->key_len;
536512
u32 *addr = (u32 *) neigh->primary_key;
537-
int ifidx = neigh->dev->ifindex;
538-
int hash = addr_hash(d, addr, addr_len, ifidx);
513+
int hash, ifidx = neigh->dev->ifindex;
514+
struct sk_buff_head *arpq = NULL;
515+
struct l2t_data *d = adap->l2t;
516+
struct l2t_entry *e;
539517

518+
hash = addr_hash(d, addr, addr_len, ifidx);
540519
read_lock_bh(&d->lock);
541520
for (e = d->l2tab[hash].first; e; e = e->next)
542521
if (!addreq(e, addr) && e->ifindex == ifidx) {
@@ -569,8 +548,25 @@ void t4_l2t_update(struct adapter *adap, struct neighbour *neigh)
569548
write_l2e(adap, e, 0);
570549
}
571550

572-
if (arpq)
573-
handle_failed_resolution(adap, e);
551+
if (arpq) {
552+
struct sk_buff *skb;
553+
554+
/* Called when address resolution fails for an L2T
555+
* entry to handle packets on the arpq head. If a
556+
* packet specifies a failure handler it is invoked,
557+
* otherwise the packet is sent to the device.
558+
*/
559+
while ((skb = __skb_dequeue(&e->arpq)) != NULL) {
560+
const struct l2t_skb_cb *cb = L2T_SKB_CB(skb);
561+
562+
spin_unlock(&e->lock);
563+
if (cb->arp_err_handler)
564+
cb->arp_err_handler(cb->handle, skb);
565+
else
566+
t4_ofld_send(adap, skb);
567+
spin_lock(&e->lock);
568+
}
569+
}
574570
spin_unlock_bh(&e->lock);
575571
}
576572

0 commit comments

Comments
 (0)