[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [Patch] Fix for BUG when MAC addresses conflict



When the Solarflare network acceleration plugins are used they currently
do a BUG check to make sure that they're not being used on multiple
guest interfaces with the same MAC address.  While this is a
configuration error it's not very nice to BUG dom0 as a result, so I've
attached a patch that instead returns an error.  Acceleration will
continue on the first interface with that MAC address but any subsequent
ones will be declined and continue to use the normal network path.

Signed-off-by: Kieran Mansley <kmansley@xxxxxxxxxxxxxx>

Avoid BUG_ON when vifs have conflicting MAC addresses

diff -r de57c3f218fb drivers/xen/sfc_netback/accel_fwd.c
--- a/drivers/xen/sfc_netback/accel_fwd.c
+++ b/drivers/xen/sfc_netback/accel_fwd.c
@@ -196,8 +196,13 @@ int netback_accel_fwd_add(const __u8 *ma
        index = rc;
 
        /* Shouldn't already be in the table */
-       BUG_ON(cuckoo_hash_lookup(&fwd_set->fwd_hash_table,
-                                 (cuckoo_hash_key *)(&key), &rc) != 0);
+       if (cuckoo_hash_lookup(&fwd_set->fwd_hash_table,
+                              (cuckoo_hash_key *)(&key), &rc) != 0) {
+               spin_unlock_irqrestore(&fwd_set->fwd_lock, flags);
+               EPRINTK("MAC address " MAC_FMT " already accelerated.\n",
+                       MAC_ARG(mac));
+               return -EEXIST;
+       }
 
        if ((rc = cuckoo_hash_add(&fwd_set->fwd_hash_table,
                                  (cuckoo_hash_key *)(&key), index, 1)) == 0) {


Kieran

Attachment: accel_mac_conflict
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.