From owner-freebsd-stable@freebsd.org Mon Nov 12 17:03:32 2018 Return-Path: Delivered-To: freebsd-stable@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 D9F23110B578; Mon, 12 Nov 2018 17:03:31 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB71C776E9; Mon, 12 Nov 2018 17:03:25 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (ezra.dcm1.omnilan.net [78.138.80.135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id wACH3Mot074266; Mon, 12 Nov 2018 18:03:22 +0100 (CET) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id A175A5A9; Mon, 12 Nov 2018 18:03:22 +0100 (CET) Subject: MSI allocation regression, still to be corrected in HEAD and please MFC before release/12.0 gets branched From: Harry Schmalzbauer To: scsi@freebsd.org, freebsd-stable References: <201707300653.v6U6rwLN099096@repo.freebsd.org> <597DA578.6030101@omnilan.de> <597F56A8.1060603@omnilan.de> <59804C8C.1020003@omnilan.de> <78611650-D7A4-4B1D-A254-DB058E1AC1C6@samsco.org> <6e1e5f9f-4ece-dc9d-b059-08d52c9e6965@omnilan.de> Organization: OmniLAN Message-ID: <042090da-f73f-ce80-517c-0b1729d3d6e1@omnilan.de> Date: Mon, 12 Nov 2018 18:03:22 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <6e1e5f9f-4ece-dc9d-b059-08d52c9e6965@omnilan.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Greylist: ACL 130 matched, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [78.138.80.130]); Mon, 12 Nov 2018 18:03:23 +0100 (CET) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: 78.138.80.135; Sender-helo: mh0.gentlemail.de; ) X-Rspamd-Queue-Id: DB71C776E9 X-Spamd-Result: default: False [-6.29 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[omnilan.de]; TO_DN_SOME(0.00)[]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[mx0.gentlemail.de]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; IP_SCORE(-3.03)[ip: (-7.97), ipnet: 2a00:e10:2800::/38(-3.98), asn: 25074(-3.19), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:25074, ipnet:2a00:e10:2800::/38, country:DE]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 17:03:32 -0000 Am 11.06.2018 um 20:28 schrieb Harry Schmalzbauer: > Am 05.06.2018 um 19:54 schrieb Scott Long: > … >>>>> Late in the 11.2 phase, I identified this commit as a regression >>>>> for MSI (non-x) alloctaion. >>>>> I have an idea what probably causes the problem here (INTx >>>>> allocation, although MSI (and MSI-x) capability): >>>>> disable_msix is not 0 (I need to disable MSI-x because of >>>>> ESXi-passthru…). >>>>> >>>>> Corresponding lines: >>>>> { >>>>>          device_t dev; >>>>>          int error, msgs; >>>>> >>>>>          dev = sc->mps_dev; >>>>>          error = 0; >>>>>          msgs = 0; >>>>> >>>>>          if ((sc->disable_msix == 0) && >>>>>              ((msgs = pci_msix_count(dev)) >= MPS_MSI_COUNT)) >>>>>                  error = mps_alloc_msix(sc, MPS_MSI_COUNT); >>>>>          if ((error != 0) && (sc->disable_msi == 0) && >>>>>              ((msgs = pci_msi_count(dev)) >= MPS_MSI_COUNT)) >>>>>                  error = mps_alloc_msi(sc, MPS_MSI_COUNT); >>>>>          if (error != 0) >>>>>                  msgs = 0; >>>>> >>>>>          sc->msi_msgs = msgs; >>>>>          return (error); >>>>> } >>>>> … >>>> Hi Harry, >>>> You are correct about the bug.  Please change the line at the top >>>> of the function that reads >>>> error = 0; >>>> to >>>> error = ENXIO; >>>> Let me know if that fixes the MSI problem for you. > > … > … > Index: src/sys/dev/mps/mps_pci.c > =================================================================== > --- sys/dev/mps/mps_pci.c   (Revision 334948) > +++ sys/dev/mps/mps_pci.c   (Arbeitskopie) > @@ -244,7 +244,7 @@ >         int error, msgs; > >         dev = sc->mps_dev; > -       error = 0; > +       error = ENXIO; >         msgs = 0; > >         if ((sc->disable_msix == 0) && > To my understanding, it's obvious that the way mps_pci_alloc_interrupts() currently works is unintended. This might not affect too many people, but is there a reason not to fix it? I already created a coresponding problem report: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229267 Anything else I should do? Thanks, -harry