Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Feb 2019 21:14:54 +0000 (UTC)
From:      Patrick Kelsey <pkelsey@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r343688 - head/sys/dev/vmware/vmxnet3
Message-ID:  <201902022114.x12LEsE8058821@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pkelsey
Date: Sat Feb  2 21:14:53 2019
New Revision: 343688
URL: https://svnweb.freebsd.org/changeset/base/343688

Log:
  Fix interrupt index configuratoin when using MSI interrupts.
  
  When in MSI mode, the device was only being configured with one
  interrupt index, but it needs two - one for the actual interrupt and
  one to park the tx queue at.
  
  Also clarified comments relating to interrupt index assignment.
  
  Reported by:	Yuri Pankov <yuripv@yuripv.net>
  MFC after:	1 day

Modified:
  head/sys/dev/vmware/vmxnet3/if_vmx.c

Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c
==============================================================================
--- head/sys/dev/vmware/vmxnet3/if_vmx.c	Sat Feb  2 17:42:17 2019	(r343687)
+++ head/sys/dev/vmware/vmxnet3/if_vmx.c	Sat Feb  2 21:14:53 2019	(r343688)
@@ -676,14 +676,16 @@ vmxnet3_set_interrupt_idx(struct vmxnet3_softc *sc)
 	scctx = sc->vmx_scctx;
 
 	/*
-	 * There is either one interrupt, or there is one interrupt per
-	 * receive queue.  If there is one interrupt, then all interrupt
-	 * indexes are zero.  If there is one interrupt per receive queue,
-	 * the transmit queue interrupt indexes are assigned the receive
-	 * queue interrupt indexesin round-robin fashion.
-	 *
-	 * The event interrupt is always the last interrupt index.
+	 * There is always one interrupt per receive queue, assigned
+	 * starting with the first interrupt.  When there is only one
+	 * interrupt available, the event interrupt shares the receive queue
+	 * interrupt, otherwise it uses the interrupt following the last
+	 * receive queue interrupt.  Transmit queues are not assigned
+	 * interrupts, so they are given indexes beyond the indexes that
+	 * correspond to the real interrupts.
 	 */
+
+	/* The event interrupt is always the last vector. */
 	sc->vmx_event_intr_idx = scctx->isc_vectors - 1;
 
 	intr_idx = 0;
@@ -1073,14 +1075,14 @@ vmxnet3_init_shared_data(struct vmxnet3_softc *sc)
 	ds->automask = sc->vmx_intr_mask_mode == VMXNET3_IMM_AUTO;
 	/*
 	 * Total number of interrupt indexes we are using in the shared
-	 * config data, even though we don't actually allocate MSI-X
+	 * config data, even though we don't actually allocate interrupt
 	 * resources for the tx queues.  Some versions of the device will
 	 * fail to initialize successfully if interrupt indexes are used in
 	 * the shared config that exceed the number of interrupts configured
 	 * here.
 	 */
 	ds->nintr = (scctx->isc_vectors == 1) ?
-	    1 : (scctx->isc_nrxqsets + scctx->isc_ntxqsets + 1);
+	    2 : (scctx->isc_nrxqsets + scctx->isc_ntxqsets + 1);
 	ds->evintr = sc->vmx_event_intr_idx;
 	ds->ictrl = VMXNET3_ICTRL_DISABLE_ALL;
 



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