diff options
author | Alexander Motin <mav@FreeBSD.org> | 2016-06-04 00:08:37 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2016-06-04 00:08:37 +0000 |
commit | c096696f31f6978856bfc57d6478ea1ca88ab93d (patch) | |
tree | 6d04ba5feada2061669294aecec8d3cce2c4e11a /sys/dev/ntb/ntb_hw | |
parent | e8c66cf0875c577ded1f661686d336ffe3b10adc (diff) | |
download | src-c096696f31f6978856bfc57d6478ea1ca88ab93d.tar.gz src-c096696f31f6978856bfc57d6478ea1ca88ab93d.zip |
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.
Notes
Notes:
svn path=/head/; revision=301292
Diffstat (limited to 'sys/dev/ntb/ntb_hw')
-rw-r--r-- | sys/dev/ntb/ntb_hw/ntb_hw.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/ntb/ntb_hw/ntb_hw.c b/sys/dev/ntb/ntb_hw/ntb_hw.c index 4359d2a9e5c0..13cfad124e2d 100644 --- a/sys/dev/ntb/ntb_hw/ntb_hw.c +++ b/sys/dev/ntb/ntb_hw/ntb_hw.c @@ -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); } |