From owner-svn-src-all@freebsd.org Sat Feb 2 21:14:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC80114CFD72; Sat, 2 Feb 2019 21:14:54 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61A4669C38; Sat, 2 Feb 2019 21:14:54 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50CA4C85C; Sat, 2 Feb 2019 21:14:54 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x12LEsQ2058822; Sat, 2 Feb 2019 21:14:54 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x12LEsE8058821; Sat, 2 Feb 2019 21:14:54 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201902022114.x12LEsE8058821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Sat, 2 Feb 2019 21:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343688 - head/sys/dev/vmware/vmxnet3 X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/sys/dev/vmware/vmxnet3 X-SVN-Commit-Revision: 343688 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 61A4669C38 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 21:14:55 -0000 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 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;