ia64/linux-2.6.18-xen.hg

changeset 490:14b987774233

netback accel: Avoid BUG_ON when vifs have conflicting MAC addresses

Signed-off-by: Kieran Mansley <kmansley@solarflare.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 25 17:54:59 2008 +0000 (2008-03-25)
parents de57c3f218fb
children bb2f8ba47833 ba11d3cf69f0
files drivers/xen/sfc_netback/accel_fwd.c
line diff
     1.1 --- a/drivers/xen/sfc_netback/accel_fwd.c	Thu Mar 20 11:35:25 2008 +0000
     1.2 +++ b/drivers/xen/sfc_netback/accel_fwd.c	Tue Mar 25 17:54:59 2008 +0000
     1.3 @@ -196,8 +196,13 @@ int netback_accel_fwd_add(const __u8 *ma
     1.4  	index = rc;
     1.5  
     1.6  	/* Shouldn't already be in the table */
     1.7 -	BUG_ON(cuckoo_hash_lookup(&fwd_set->fwd_hash_table,
     1.8 -				  (cuckoo_hash_key *)(&key), &rc) != 0);
     1.9 +	if (cuckoo_hash_lookup(&fwd_set->fwd_hash_table,
    1.10 +			       (cuckoo_hash_key *)(&key), &rc) != 0) {
    1.11 +		spin_unlock_irqrestore(&fwd_set->fwd_lock, flags);
    1.12 +		EPRINTK("MAC address " MAC_FMT " already accelerated.\n",
    1.13 +			MAC_ARG(mac));
    1.14 +		return -EEXIST;
    1.15 +	}
    1.16  
    1.17  	if ((rc = cuckoo_hash_add(&fwd_set->fwd_hash_table,
    1.18  				  (cuckoo_hash_key *)(&key), index, 1)) == 0) {