xen-netback: add support for multicast control
Xen's PV network protocol includes messages to add/remove ethernet multicast addresses to/from a filter list in the backend. This allows the frontend to request the backend only forward multicast packets which are of interest thus preventing unnecessary noise on the shared ring. The canonical netif header in git://xenbits.xen.org/xen.git specifies the message format (two more XEN_NETIF_EXTRA_TYPEs) so the minimal necessary changes have been pulled into include/xen/interface/io/netif.h. To prevent the frontend from extending the multicast filter list arbitrarily a limit (XEN_NETBK_MCAST_MAX) has been set to 64 entries. This limit is not specified by the protocol and so may change in future. If the limit is reached then the next XEN_NETIF_EXTRA_TYPE_MCAST_ADD sent by the frontend will be failed with NETIF_RSP_ERROR. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com> Cc: Wei Liu <wei.liu2@citrix.com> Acked-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
4db78d31de
commit
210c34dcd8
@@ -327,6 +327,14 @@ static int netback_probe(struct xenbus_device *dev,
|
||||
goto abort_transaction;
|
||||
}
|
||||
|
||||
/* We support multicast-control. */
|
||||
err = xenbus_printf(xbt, dev->nodename,
|
||||
"feature-multicast-control", "%d", 1);
|
||||
if (err) {
|
||||
message = "writing feature-multicast-control";
|
||||
goto abort_transaction;
|
||||
}
|
||||
|
||||
err = xenbus_transaction_end(xbt, 0);
|
||||
} while (err == -EAGAIN);
|
||||
|
||||
@@ -1016,6 +1024,11 @@ static int read_xenbus_vif_flags(struct backend_info *be)
|
||||
val = 0;
|
||||
vif->ipv6_csum = !!val;
|
||||
|
||||
if (xenbus_scanf(XBT_NIL, dev->otherend, "request-multicast-control",
|
||||
"%d", &val) < 0)
|
||||
val = 0;
|
||||
vif->multicast_control = !!val;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user