sfxge_ev.c (300607) | sfxge_ev.c (301075) |
---|---|
1/*- 2 * Copyright (c) 2010-2016 Solarflare Communications Inc. 3 * All rights reserved. 4 * 5 * This software was developed in part by Philip Paeps under contract for 6 * Solarflare Communications, Inc. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 18 unchanged lines hidden (view full) --- 27 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * 29 * The views and conclusions contained in the software and documentation are 30 * those of the authors and should not be interpreted as representing official 31 * policies, either expressed or implied, of the FreeBSD Project. 32 */ 33 34#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2010-2016 Solarflare Communications Inc. 3 * All rights reserved. 4 * 5 * This software was developed in part by Philip Paeps under contract for 6 * Solarflare Communications, Inc. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 18 unchanged lines hidden (view full) --- 27 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * 29 * The views and conclusions contained in the software and documentation are 30 * those of the authors and should not be interpreted as representing official 31 * policies, either expressed or implied, of the FreeBSD Project. 32 */ 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: head/sys/dev/sfxge/sfxge_ev.c 300607 2016-05-24 12:16:57Z arybchik $"); | 35__FBSDID("$FreeBSD: head/sys/dev/sfxge/sfxge_ev.c 301075 2016-05-31 20:54:42Z arybchik $"); |
36 37#include <sys/param.h> 38#include <sys/kernel.h> 39#include <sys/malloc.h> 40#include <sys/param.h> 41#include <sys/queue.h> 42#include <sys/systm.h> 43#include <sys/taskqueue.h> --- 181 unchanged lines hidden (view full) --- 225 return (B_FALSE); 226 } 227 228 evq = sc->evq[index]; 229 230 label = 0; 231 KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, 232 ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != level")); | 36 37#include <sys/param.h> 38#include <sys/kernel.h> 39#include <sys/malloc.h> 40#include <sys/param.h> 41#include <sys/queue.h> 42#include <sys/systm.h> 43#include <sys/taskqueue.h> --- 181 unchanged lines hidden (view full) --- 225 return (B_FALSE); 226 } 227 228 evq = sc->evq[index]; 229 230 label = 0; 231 KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, 232 ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != level")); |
233 magic = SFXGE_MAGIC_RX_QFLUSH_DONE | label; | 233 magic = SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QFLUSH_DONE) | label; |
234 235 KASSERT(evq->init_state == SFXGE_EVQ_STARTED, 236 ("evq not started")); 237 efx_ev_qpost(evq->common, magic); 238 239 return (B_FALSE); 240} 241 --- 17 unchanged lines hidden (view full) --- 259 260 /* Resend a software event on the correct queue */ 261 index = rxq->index; 262 evq = sc->evq[index]; 263 264 label = 0; 265 KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, 266 ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != label")); | 234 235 KASSERT(evq->init_state == SFXGE_EVQ_STARTED, 236 ("evq not started")); 237 efx_ev_qpost(evq->common, magic); 238 239 return (B_FALSE); 240} 241 --- 17 unchanged lines hidden (view full) --- 259 260 /* Resend a software event on the correct queue */ 261 index = rxq->index; 262 evq = sc->evq[index]; 263 264 label = 0; 265 KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, 266 ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != label")); |
267 magic = SFXGE_MAGIC_RX_QFLUSH_FAILED | label; | 267 magic = SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QFLUSH_FAILED) | label; |
268 269 KASSERT(evq->init_state == SFXGE_EVQ_STARTED, 270 ("evq not started")); 271 efx_ev_qpost(evq->common, magic); 272 273 return (B_FALSE); 274} 275 --- 74 unchanged lines hidden (view full) --- 350 } 351 352 /* Resend a software event on the correct queue */ 353 evq = sc->evq[txq->evq_index]; 354 355 label = txq->type; 356 KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, 357 ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != label")); | 268 269 KASSERT(evq->init_state == SFXGE_EVQ_STARTED, 270 ("evq not started")); 271 efx_ev_qpost(evq->common, magic); 272 273 return (B_FALSE); 274} 275 --- 74 unchanged lines hidden (view full) --- 350 } 351 352 /* Resend a software event on the correct queue */ 353 evq = sc->evq[txq->evq_index]; 354 355 label = txq->type; 356 KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, 357 ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != label")); |
358 magic = SFXGE_MAGIC_TX_QFLUSH_DONE | label; | 358 magic = SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_TX_QFLUSH_DONE) | label; |
359 360 KASSERT(evq->init_state == SFXGE_EVQ_STARTED, 361 ("evq not started")); 362 efx_ev_qpost(evq->common, magic); 363 364 return (B_FALSE); 365} 366 --- 8 unchanged lines hidden (view full) --- 375 SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); 376 377 sc = evq->sc; 378 379 label = magic & SFXGE_MAGIC_DMAQ_LABEL_MASK; 380 magic &= ~SFXGE_MAGIC_DMAQ_LABEL_MASK; 381 382 switch (magic) { | 359 360 KASSERT(evq->init_state == SFXGE_EVQ_STARTED, 361 ("evq not started")); 362 efx_ev_qpost(evq->common, magic); 363 364 return (B_FALSE); 365} 366 --- 8 unchanged lines hidden (view full) --- 375 SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); 376 377 sc = evq->sc; 378 379 label = magic & SFXGE_MAGIC_DMAQ_LABEL_MASK; 380 magic &= ~SFXGE_MAGIC_DMAQ_LABEL_MASK; 381 382 switch (magic) { |
383 case SFXGE_MAGIC_RX_QFLUSH_DONE: | 383 case SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QFLUSH_DONE): |
384 sfxge_rx_qflush_done(sfxge_get_rxq_by_label(evq, label)); 385 break; 386 | 384 sfxge_rx_qflush_done(sfxge_get_rxq_by_label(evq, label)); 385 break; 386 |
387 case SFXGE_MAGIC_RX_QFLUSH_FAILED: | 387 case SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QFLUSH_FAILED): |
388 sfxge_rx_qflush_failed(sfxge_get_rxq_by_label(evq, label)); 389 break; 390 | 388 sfxge_rx_qflush_failed(sfxge_get_rxq_by_label(evq, label)); 389 break; 390 |
391 case SFXGE_MAGIC_RX_QREFILL: | 391 case SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QREFILL): |
392 sfxge_rx_qrefill(sfxge_get_rxq_by_label(evq, label)); 393 break; 394 | 392 sfxge_rx_qrefill(sfxge_get_rxq_by_label(evq, label)); 393 break; 394 |
395 case SFXGE_MAGIC_TX_QFLUSH_DONE: { | 395 case SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_TX_QFLUSH_DONE): { |
396 struct sfxge_txq *txq = sfxge_get_txq_by_label(evq, label); 397 398 KASSERT(txq != NULL, ("txq == NULL")); 399 KASSERT(evq->index == txq->evq_index, 400 ("evq->index != txq->evq_index")); 401 402 sfxge_tx_qflush_done(txq); 403 break; --- 558 unchanged lines hidden --- | 396 struct sfxge_txq *txq = sfxge_get_txq_by_label(evq, label); 397 398 KASSERT(txq != NULL, ("txq == NULL")); 399 KASSERT(evq->index == txq->evq_index, 400 ("evq->index != txq->evq_index")); 401 402 sfxge_tx_qflush_done(txq); 403 break; --- 558 unchanged lines hidden --- |