The following reply was made to PR kern/143340; it has been noted by GNATS.

From: Andrew Kolchoogin <g...@avalon-island.ru>
To: bug-follo...@freebsd.org, wonsl...@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.
_______________________________________________
freebsd-xen@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-xen
To unsubscribe, send any mail to "freebsd-xen-unsubscr...@freebsd.org"

Reply via email to