From owner-svn-src-stable@freebsd.org Wed Jun 15 01:41:44 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E739EB72733; Wed, 15 Jun 2016 01:41:44 +0000 (UTC) (envelope-from mav@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 mx1.freebsd.org (Postfix) with ESMTPS id B83182DA4; Wed, 15 Jun 2016 01:41:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F1fhmM016268; Wed, 15 Jun 2016 01:41:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F1fhLr016267; Wed, 15 Jun 2016 01:41:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201606150141.u5F1fhLr016267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 15 Jun 2016 01:41:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301903 - stable/10/sys/dev/ntb/ntb_hw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 01:41:45 -0000 Author: mav Date: Wed Jun 15 01:41:43 2016 New Revision: 301903 URL: https://svnweb.freebsd.org/changeset/base/301903 Log: MFC r301292: When negotiating MSIX parameters, give other head time to see our NTB_MSIX_RECEIVED status, before making upper layers overwrite it. This is not completely perfect, but now it works better then before. Sponsored by: iXsystems, Inc. Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Jun 15 01:39:43 2016 (r301902) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Jun 15 01:41:43 2016 (r301903) @@ -2820,6 +2820,8 @@ ntb_exchange_msix(void *ctx) ntb = ctx; + if (ntb->peer_msix_good) + goto msix_good; if (ntb->peer_msix_done) goto msix_done; @@ -2851,16 +2853,21 @@ msix_done: goto reschedule; ntb->peer_msix_good = true; + /* Give peer time to see our NTB_MSIX_RECEIVED. */ + goto reschedule; +msix_good: ntb_poll_link(ntb); ntb_link_event(ntb); return; reschedule: ntb->lnk_sta = pci_read_config(ntb->device, ntb->reg->lnk_sta, 2); - if (_xeon_link_is_up(ntb)) - callout_reset(&ntb->peer_msix_work, hz / 100, ntb_exchange_msix, ntb); - else + if (_xeon_link_is_up(ntb)) { + callout_reset(&ntb->peer_msix_work, + hz * (ntb->peer_msix_good ? 2 : 1) / 100, + ntb_exchange_msix, ntb); + } else ntb_spad_clear(ntb); }