Date: Sat, 4 Jun 2016 00:08:38 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301292 - head/sys/dev/ntb/ntb_hw Message-ID: <201606040008.u5408c4P068109@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Sat Jun 4 00:08:37 2016 New Revision: 301292 URL: https://svnweb.freebsd.org/changeset/base/301292 Log: 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. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Fri Jun 3 21:37:24 2016 (r301291) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Sat Jun 4 00:08:37 2016 (r301292) @@ -2801,6 +2801,8 @@ ntb_exchange_msix(void *ctx) ntb = ctx; + if (ntb->peer_msix_good) + goto msix_good; if (ntb->peer_msix_done) goto msix_done; @@ -2832,16 +2834,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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606040008.u5408c4P068109>