Author: arybchik Date: Sat Jun 4 17:03:06 2016 New Revision: 301386 URL: https://svnweb.freebsd.org/changeset/base/301386
Log: MFC r300605 sfxge(4): be ready to receive events immediately after event queues are created Submitted by: Mark Spender <mspender at solarflare.com> Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/ef10_ev.c stable/10/sys/dev/sfxge/common/efx_ev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/ef10_ev.c Sat Jun 4 17:00:50 2016 (r301385) +++ stable/10/sys/dev/sfxge/common/ef10_ev.c Sat Jun 4 17:03:06 2016 (r301386) @@ -275,6 +275,11 @@ ef10_ev_qcreate( /* Set up the event queue */ irq = index; /* INIT_EVQ expects function-relative vector number */ + + /* + * Interrupts may be raised for events immediately after the queue is + * created. See bug58606. + */ if ((rc = efx_mcdi_init_evq(enp, index, esmp, n, irq)) != 0) goto fail3; Modified: stable/10/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_ev.c Sat Jun 4 17:00:50 2016 (r301385) +++ stable/10/sys/dev/sfxge/common/efx_ev.c Sat Jun 4 17:03:06 2016 (r301386) @@ -251,16 +251,27 @@ efx_ev_qcreate( eep->ee_mask = n - 1; eep->ee_esmp = esmp; - if ((rc = eevop->eevo_qcreate(enp, index, esmp, n, id, eep)) != 0) - goto fail2; - + /* + * Set outputs before the queue is created because interrupts may be + * raised for events immediately after the queue is created, before the + * function call below returns. See bug58606. + * + * The eepp pointer passed in by the client must therefore point to data + * shared with the client's event processing context. + */ enp->en_ev_qcount++; *eepp = eep; + if ((rc = eevop->eevo_qcreate(enp, index, esmp, n, id, eep)) != 0) + goto fail2; + return (0); fail2: EFSYS_PROBE(fail2); + + *eepp = NULL; + enp->en_ev_qcount--; EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_evq_t), eep); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); _______________________________________________ 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"