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);
 }
 
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to