Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Jan 2015 02:06:01 +0000 (UTC)
From:      Bryan Venteicher <bryanv@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r276491 - head/sys/dev/virtio/network
Message-ID:  <201501010206.t01261X2011429@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bryanv
Date: Thu Jan  1 02:06:00 2015
New Revision: 276491
URL: https://svnweb.freebsd.org/changeset/base/276491

Log:
  Add softc flag for when the indirect descriptor feature was negotiated
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/virtio/network/if_vtnet.c
  head/sys/dev/virtio/network/if_vtnetvar.h

Modified: head/sys/dev/virtio/network/if_vtnet.c
==============================================================================
--- head/sys/dev/virtio/network/if_vtnet.c	Thu Jan  1 02:04:44 2015	(r276490)
+++ head/sys/dev/virtio/network/if_vtnet.c	Thu Jan  1 02:06:00 2015	(r276491)
@@ -599,6 +599,8 @@ vtnet_setup_features(struct vtnet_softc 
 
 	vtnet_negotiate_features(sc);
 
+	if (virtio_with_feature(dev, VIRTIO_RING_F_INDIRECT_DESC))
+		sc->vtnet_flags |= VTNET_FLAG_INDIRECT;
 	if (virtio_with_feature(dev, VIRTIO_RING_F_EVENT_IDX))
 		sc->vtnet_flags |= VTNET_FLAG_EVENT_IDX;
 
@@ -3653,7 +3655,7 @@ vtnet_set_tx_intr_threshold(struct vtnet
 	 * Without indirect descriptors, leave enough room for the most
 	 * segments we handle.
 	 */
-	if (virtio_with_feature(dev, VIRTIO_RING_F_INDIRECT_DESC) == 0 &&
+	if ((sc->vtnet_flags & VTNET_FLAG_INDIRECT) == 0 &&
 	    thresh < sc->vtnet_tx_nsegs)
 		thresh = sc->vtnet_tx_nsegs;
 

Modified: head/sys/dev/virtio/network/if_vtnetvar.h
==============================================================================
--- head/sys/dev/virtio/network/if_vtnetvar.h	Thu Jan  1 02:04:44 2015	(r276490)
+++ head/sys/dev/virtio/network/if_vtnetvar.h	Thu Jan  1 02:06:00 2015	(r276491)
@@ -140,7 +140,8 @@ struct vtnet_softc {
 #define VTNET_FLAG_MRG_RXBUFS	 0x0080
 #define VTNET_FLAG_LRO_NOMRG	 0x0100
 #define VTNET_FLAG_MULTIQ	 0x0200
-#define VTNET_FLAG_EVENT_IDX	 0x0400
+#define VTNET_FLAG_INDIRECT	 0x0400
+#define VTNET_FLAG_EVENT_IDX	 0x0800
 
 	int			 vtnet_link_active;
 	int			 vtnet_hdr_size;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501010206.t01261X2011429>