Mon Sep 28 01:31:46 2009 UTC ()
Pull up following revision(s) (requested by bouyer in ticket #1027):
	sys/arch/xen/xen/if_xennet_xenbus.c: revision 1.36
Patch from Brian Marcotte on port-xen@:
write a "feature-rx-notify" to the xenstore, which is used by recent
linux dom0 kernels. This reduce packet loss when using a NetBSD domU
on such linux dom0.
This entry is ignored by NetBSD and older linux domUs.


(snj)
diff -r1.29.2.2 -r1.29.2.3 src/sys/arch/xen/xen/if_xennet_xenbus.c

cvs diff -r1.29.2.2 -r1.29.2.3 src/sys/arch/xen/xen/if_xennet_xenbus.c (expand / switch to unified diff)

--- src/sys/arch/xen/xen/if_xennet_xenbus.c 2009/05/13 01:05:20 1.29.2.2
+++ src/sys/arch/xen/xen/if_xennet_xenbus.c 2009/09/28 01:31:46 1.29.2.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_xennet_xenbus.c,v 1.29.2.2 2009/05/13 01:05:20 snj Exp $ */ 1/* $NetBSD: if_xennet_xenbus.c,v 1.29.2.3 2009/09/28 01:31:46 snj Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2006 Manuel Bouyer. 4 * Copyright (c) 2006 Manuel Bouyer.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -51,27 +51,27 @@ @@ -51,27 +51,27 @@
51 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 51 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
52 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 52 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
53 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 53 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
54 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 54 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
55 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 55 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
56 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 56 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
57 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 57 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
58 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 58 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
59 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 59 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
60 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 60 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 */ 61 */
62 62
63#include <sys/cdefs.h> 63#include <sys/cdefs.h>
64__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.29.2.2 2009/05/13 01:05:20 snj Exp $"); 64__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.29.2.3 2009/09/28 01:31:46 snj Exp $");
65 65
66#include "opt_xen.h" 66#include "opt_xen.h"
67#include "opt_nfs_boot.h" 67#include "opt_nfs_boot.h"
68#include "rnd.h" 68#include "rnd.h"
69#include "bpfilter.h" 69#include "bpfilter.h"
70 70
71#include <sys/param.h> 71#include <sys/param.h>
72#include <sys/device.h> 72#include <sys/device.h>
73#include <sys/conf.h> 73#include <sys/conf.h>
74#include <sys/kernel.h> 74#include <sys/kernel.h>
75#include <sys/proc.h> 75#include <sys/proc.h>
76#include <sys/systm.h> 76#include <sys/systm.h>
77#include <sys/intr.h> 77#include <sys/intr.h>
@@ -457,26 +457,32 @@ again: @@ -457,26 +457,32 @@ again:
457 error = xenbus_printf(xbt, sc->sc_xbusd->xbusd_path, 457 error = xenbus_printf(xbt, sc->sc_xbusd->xbusd_path,
458 "tx-ring-ref","%u", sc->sc_tx_ring_gntref); 458 "tx-ring-ref","%u", sc->sc_tx_ring_gntref);
459 if (error) { 459 if (error) {
460 errmsg = "writing tx ring-ref"; 460 errmsg = "writing tx ring-ref";
461 goto abort_transaction; 461 goto abort_transaction;
462 } 462 }
463 error = xenbus_printf(xbt, sc->sc_xbusd->xbusd_path, 463 error = xenbus_printf(xbt, sc->sc_xbusd->xbusd_path,
464 "rx-ring-ref","%u", sc->sc_rx_ring_gntref); 464 "rx-ring-ref","%u", sc->sc_rx_ring_gntref);
465 if (error) { 465 if (error) {
466 errmsg = "writing rx ring-ref"; 466 errmsg = "writing rx ring-ref";
467 goto abort_transaction; 467 goto abort_transaction;
468 } 468 }
469 error = xenbus_printf(xbt, sc->sc_xbusd->xbusd_path, 469 error = xenbus_printf(xbt, sc->sc_xbusd->xbusd_path,
 470 "feature-rx-notify", "%u", 1);
 471 if (error) {
 472 errmsg = "writing feature-rx-notify";
 473 goto abort_transaction;
 474 }
 475 error = xenbus_printf(xbt, sc->sc_xbusd->xbusd_path,
470 "event-channel", "%u", sc->sc_evtchn); 476 "event-channel", "%u", sc->sc_evtchn);
471 if (error) { 477 if (error) {
472 errmsg = "writing event channel"; 478 errmsg = "writing event channel";
473 goto abort_transaction; 479 goto abort_transaction;
474 } 480 }
475 error = xenbus_printf(xbt, sc->sc_xbusd->xbusd_path, 481 error = xenbus_printf(xbt, sc->sc_xbusd->xbusd_path,
476 "state", "%d", XenbusStateConnected); 482 "state", "%d", XenbusStateConnected);
477 if (error) { 483 if (error) {
478 errmsg = "writing frontend XenbusStateConnected"; 484 errmsg = "writing frontend XenbusStateConnected";
479 goto abort_transaction; 485 goto abort_transaction;
480 } 486 }
481 error = xenbus_transaction_end(xbt, 0); 487 error = xenbus_transaction_end(xbt, 0);
482 if (error == EAGAIN) 488 if (error == EAGAIN)