From owner-freebsd-xen@FreeBSD.ORG Fri Dec 10 13:40:11 2010 Return-Path: Delivered-To: freebsd-xen@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECBEE1065675 for ; Fri, 10 Dec 2010 13:40:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C12398FC1C for ; Fri, 10 Dec 2010 13:40:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oBADeBbc022490 for ; Fri, 10 Dec 2010 13:40:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oBADeBnn022489; Fri, 10 Dec 2010 13:40:11 GMT (envelope-from gnats) Date: Fri, 10 Dec 2010 13:40:11 GMT Message-Id: <201012101340.oBADeBnn022489@freefall.freebsd.org> To: freebsd-xen@FreeBSD.org From: Andrew Kolchoogin Cc: Subject: Re: kern/143340: [xen] FreeBSD 8-RELEASE XEN pvm networking doesn't work on solaris dom0's X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Andrew Kolchoogin List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 13:40:12 -0000 The following reply was made to PR kern/143340; it has been noted by GNATS. From: Andrew Kolchoogin To: bug-followup@FreeBSD.org, wonslung@gmail.com Cc: Subject: Re: kern/143340: [xen] FreeBSD 8-RELEASE XEN pvm networking doesn't work on solaris dom0's Date: Fri, 10 Dec 2010 16:05:50 +0300 Dear colleagues, this is the correct patch resolving the problem: =3D=3D=3D --- sys/dev/xen/netfront/netfront.c.orig 2010-12-10 12:59:03.000000000 +000= 0 +++ sys/dev/xen/netfront/netfront.c 2010-12-10 12:31:01.000000000 +0000 @@ -258,6 +258,7 @@ u_int irq; u_int copying_receiver; u_int carrier; + u_int sg_allowed; =09 /* Receive-ring batched refills. */ #define RX_MIN_TARGET 32 @@ -1499,7 +1500,7 @@ * deal with nfrags > MAX_TX_REQ_FRAGS, which is a quirk of * the Linux network stack. */ - if (nfrags > MAX_TX_REQ_FRAGS) { + if (nfrags > (sc->sg_allowed? MAX_TX_REQ_FRAGS : 1)) { m =3D m_defrag(m_head, M_DONTWAIT); if (!m) { /* @@ -1878,6 +1879,37 @@ if_link_state_change(ifp, LINK_STATE_DOWN); } +static void +xennet_set_features(device_t dev, struct netfront_info *np) +{ + struct ifnet *ifp; + int val; + + device_printf(dev, "backend features:"); + + if (xs_scanf(XST_NIL, xenbus_get_otherend_path(np->xbdev), "feature-sg", NULL, "%d", &val) < 0) + val =3D 0; + + np->sg_allowed =3D val; + + if (val) + printf(" feature-sg"); + + if (xs_scanf(XST_NIL, xenbus_get_otherend_path(np->xbdev), "feature-gso-tcpv4", NULL, "%d", &val) < 0) + val =3D 0; + + if (val =3D=3D 0) { + ifp =3D np->xn_ifp; + ifp->if_capabilities &=3D ~(IFCAP_TSO4|IFCAP_LRO); + ifp->if_capenable &=3D ~(IFCAP_TSO4|IFCAP_LRO); + ifp->if_hwassist &=3D ~(CSUM_TSO); + xn_enable_lro =3D 0; + } else + printf(" feature-gso-tcp4"); + + printf("\n"); +} + /* START of Xenolinux helper functions adapted to FreeBSD */ int network_connect(struct netfront_info *np) @@ -1909,6 +1941,8 @@ if (error) return (error); =09 + xennet_set_features(np->xbdev, np); + /* Step 1: Reinitialise variables. */ netif_release_tx_bufs(np); =3D=3D=3D I've tested it on my system -- Solaris 11 Express 2010.11 + FreeBSD v8.2-BETA1 in paravirtualised mode. All is working as designed, I'm able at least to ssh into Guest and csup entire source tree. --=20 =C2=A0 =C2=A0 Yours =C2=A0 =C2=A0 =C2=A0 =C2=A0 Andrew Kolchoogin.