help
Support for Xen version 2 network devices
+config XEN_NETDEV2_BYPASSABLE
+ bool "Allow netchannel2 interfaces in this domain to be bypassed"
+ depends on XEN_NETCHANNEL2
+ default y
+ help
+ Netchannel2 allows interdomain traffic to be sent directly from
+ one domain to another, without going through domain 0, which can
+ significantly increase performance. This option controls whether
+ interfaces created into this domain can be bypassed in this way.
+ You should also say yes to XEN_NETDEV2_BYPASS_ENDPOINT in the
+ frontend domains for this to be useful.
+
+config XEN_NETDEV2_BYPASS_ENDPOINT
+ bool "Allow netchannel2 interfaces in this domain to establish bypasses"
+ depends on XEN_NETCHANNEL2
+ default y
+ help
+ Netchannel2 allows interdomain traffic to be sent directly from
+ one domain to another, without going through domain 0, which can
+ significantly increase performance. This option controls whether
+ interfaces in this domain can be the endpoints of these bypasses.
+
config ISERIES_VETH
tristate "iSeries Virtual Ethernet driver support"
depends on PPC_ISERIES
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <xen/evtchn.h>
-#include <xen/driver_util.h>
+#include <xen/events.h>
+#include <asm/xen/page.h>
#include "netchannel2_core.h"
/* Can we send this packet on this bypass? True if the destination
spin_unlock(&nar->rings.lock);
}
-static void start_detach_worker(void *data)
+static void start_detach_worker(struct work_struct *ws)
{
- struct nc2_alternate_ring *ncr = data;
+ struct nc2_alternate_ring *ncr =
+ container_of(ws, struct nc2_alternate_ring, detach_work_item);
ENTER();
/* We can't do unbind_from_irqhandler() from a tasklet, so
punt it to a workitem. */
INIT_WORK(&nar->detach_work_item,
- start_detach_worker,
- nar);
+ start_detach_worker);
schedule_work(&nar->detach_work_item);
}
spin_unlock(&nar->rings.lock);
return;
}
- frontend_ready_msg.port =
- irq_to_evtchn_port(nar->rings.irq);
+ frontend_ready_msg.port = nar->rings.evtchn;
nc2_send_message(&nc->rings.prod_ring,
NETCHANNEL2_MSG_BYPASS_FRONTEND_READY,
0,
nc2_kick(&ncr->rings.interface->rings);
}
-static void initialise_bypass_frontend_work_item(void *data)
+static void initialise_bypass_frontend_work_item(struct work_struct *ws)
{
- struct nc2_alternate_ring *ncr = data;
+ struct nc2_alternate_ring *ncr =
+ container_of(ws, struct nc2_alternate_ring, work_item);
struct netchannel2 *interface = ncr->rings.interface;
int err;
BUG_ON(ncr->rings.cons_ring.sring == NULL);
- err = bind_listening_port_to_irqhandler(ncr->rings.otherend_id,
- nc2_int,
- 0,
- "netchannel2_bypass",
- &ncr->rings);
- if (err < 0)
- goto err;
+ err = xen_alloc_evtchn(ncr->rings.otherend_id);
+ if (err < 0)
+ goto err;
+ ncr->rings.evtchn = err;
+ err = bind_evtchn_to_irqhandler(ncr->rings.evtchn,
+ nc2_int, 0,
+ "netchannel2", &ncr->rings);
+ BUG_ON(err < 0);
ncr->rings.irq = err;
/* Get it going. */
return;
}
-static void initialise_bypass_backend_work_item(void *data)
+static void initialise_bypass_backend_work_item(struct work_struct *ws)
{
- struct nc2_alternate_ring *ncr = data;
+ struct nc2_alternate_ring *ncr =
+ container_of(ws, struct nc2_alternate_ring, work_item);
struct netchannel2 *interface = ncr->rings.interface;
int err;
#endif
init_waitqueue_head(&work->eventq);
work->handle = work->frontend_setup_msg.common.handle;
- INIT_WORK(&work->work_item, initialise_bypass_frontend_work_item,
- work);
+ INIT_WORK(&work->work_item, initialise_bypass_frontend_work_item);
init_ring_pair(&work->rings);
work->rings.filter_mac = 1;
work->rings.interface = nc;
work->state = nc2_alt_ring_backend_preparing;
init_waitqueue_head(&work->eventq);
work->handle = work->backend_setup_msg.common.handle;
- INIT_WORK(&work->work_item, initialise_bypass_backend_work_item,
- work);
+ INIT_WORK(&work->work_item, initialise_bypass_backend_work_item);
init_ring_pair(&work->rings);
work->rings.filter_mac = 1;
work->rings.interface = nc;
nar->state = nc2_alt_ring_detaching;
spin_unlock(&nar->rings.lock);
INIT_WORK(&nar->detach_work_item,
- start_detach_worker,
- nar);
+ start_detach_worker);
schedule_work(&nar->detach_work_item);
}
spin_unlock_bh(&nc->rings.lock);
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/spinlock.h>
+#include <asm/xen/page.h>
#include "netchannel2_core.h"
/* Bypass disable is a bit tricky. Enable is relatively easy:
static void grant_end(grant_ref_t *gref)
{
- if (*gref && gnttab_end_foreign_access_ref(*gref)) {
+ if (*gref && gnttab_end_foreign_access_ref(*gref, 0)) {
gnttab_free_grant_reference(*gref);
*gref = 0;
}
msg.handle);
}
-static void process_suggestion_queue_workitem(void *ctxt)
+static void process_suggestion_queue_workitem(struct work_struct *ws)
{
- struct netchannel2 *nc = ctxt;
+ struct netchannel2 *nc =
+ container_of(ws, struct netchannel2,
+ incoming_bypass_suggestions.workitem);
struct nc2_incoming_bypass_suggestions *sugg =
&nc->incoming_bypass_suggestions;
unsigned ind;
struct nc2_incoming_bypass_suggestions *nibs)
{
spin_lock_init(&nibs->lock);
- INIT_WORK(&nibs->workitem, process_suggestion_queue_workitem, nc2);
+ INIT_WORK(&nibs->workitem, process_suggestion_queue_workitem);
}