Deleted Added
full compact
efx_ev.c (293814) efx_ev.c (299320)
1/*-
2 * Copyright (c) 2007-2015 Solarflare Communications Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,

--- 15 unchanged lines hidden (view full) ---

24 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * The views and conclusions contained in the software and documentation are
27 * those of the authors and should not be interpreted as representing official
28 * policies, either expressed or implied, of the FreeBSD Project.
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2007-2015 Solarflare Communications Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,

--- 15 unchanged lines hidden (view full) ---

24 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * The views and conclusions contained in the software and documentation are
27 * those of the authors and should not be interpreted as representing official
28 * policies, either expressed or implied, of the FreeBSD Project.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/dev/sfxge/common/efx_ev.c 293814 2016-01-13 07:25:51Z arybchik $");
32__FBSDID("$FreeBSD: head/sys/dev/sfxge/common/efx_ev.c 299320 2016-05-10 07:01:06Z arybchik $");
33
34#include "efx.h"
35#include "efx_impl.h"
36#if EFSYS_OPT_MON_MCDI
37#include "mcdi_mon.h"
38#endif
39
40#if EFSYS_OPT_QSTATS

--- 7 unchanged lines hidden (view full) ---

48#endif
49
50#define EFX_EV_PRESENT(_qword) \
51 (EFX_QWORD_FIELD((_qword), EFX_DWORD_0) != 0xffffffff && \
52 EFX_QWORD_FIELD((_qword), EFX_DWORD_1) != 0xffffffff)
53
54
55
33
34#include "efx.h"
35#include "efx_impl.h"
36#if EFSYS_OPT_MON_MCDI
37#include "mcdi_mon.h"
38#endif
39
40#if EFSYS_OPT_QSTATS

--- 7 unchanged lines hidden (view full) ---

48#endif
49
50#define EFX_EV_PRESENT(_qword) \
51 (EFX_QWORD_FIELD((_qword), EFX_DWORD_0) != 0xffffffff && \
52 EFX_QWORD_FIELD((_qword), EFX_DWORD_1) != 0xffffffff)
53
54
55
56#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
56#if EFSYS_OPT_SIENA
57
58static __checkReturn efx_rc_t
59falconsiena_ev_init(
60 __in efx_nic_t *enp);
61
62static void
63falconsiena_ev_fini(
64 __in efx_nic_t *enp);

--- 36 unchanged lines hidden (view full) ---

101#if EFSYS_OPT_QSTATS
102static void
103falconsiena_ev_qstats_update(
104 __in efx_evq_t *eep,
105 __inout_ecount(EV_NQSTATS) efsys_stat_t *stat);
106
107#endif
108
57
58static __checkReturn efx_rc_t
59falconsiena_ev_init(
60 __in efx_nic_t *enp);
61
62static void
63falconsiena_ev_fini(
64 __in efx_nic_t *enp);

--- 36 unchanged lines hidden (view full) ---

101#if EFSYS_OPT_QSTATS
102static void
103falconsiena_ev_qstats_update(
104 __in efx_evq_t *eep,
105 __inout_ecount(EV_NQSTATS) efsys_stat_t *stat);
106
107#endif
108
109#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
109#endif /* EFSYS_OPT_SIENA */
110
110
111#if EFSYS_OPT_FALCON
112static efx_ev_ops_t __efx_ev_falcon_ops = {
113 falconsiena_ev_init, /* eevo_init */
114 falconsiena_ev_fini, /* eevo_fini */
115 falconsiena_ev_qcreate, /* eevo_qcreate */
116 falconsiena_ev_qdestroy, /* eevo_qdestroy */
117 falconsiena_ev_qprime, /* eevo_qprime */
118 falconsiena_ev_qpost, /* eevo_qpost */
119 falconsiena_ev_qmoderate, /* eevo_qmoderate */
120#if EFSYS_OPT_QSTATS
121 falconsiena_ev_qstats_update, /* eevo_qstats_update */
122#endif
123};
124#endif /* EFSYS_OPT_FALCON */
125
126#if EFSYS_OPT_SIENA
127static efx_ev_ops_t __efx_ev_siena_ops = {
128 falconsiena_ev_init, /* eevo_init */
129 falconsiena_ev_fini, /* eevo_fini */
130 falconsiena_ev_qcreate, /* eevo_qcreate */
131 falconsiena_ev_qdestroy, /* eevo_qdestroy */
132 falconsiena_ev_qprime, /* eevo_qprime */
133 falconsiena_ev_qpost, /* eevo_qpost */

--- 31 unchanged lines hidden (view full) ---

165 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
166
167 if (enp->en_mod_flags & EFX_MOD_EV) {
168 rc = EINVAL;
169 goto fail1;
170 }
171
172 switch (enp->en_family) {
111#if EFSYS_OPT_SIENA
112static efx_ev_ops_t __efx_ev_siena_ops = {
113 falconsiena_ev_init, /* eevo_init */
114 falconsiena_ev_fini, /* eevo_fini */
115 falconsiena_ev_qcreate, /* eevo_qcreate */
116 falconsiena_ev_qdestroy, /* eevo_qdestroy */
117 falconsiena_ev_qprime, /* eevo_qprime */
118 falconsiena_ev_qpost, /* eevo_qpost */

--- 31 unchanged lines hidden (view full) ---

150 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
151
152 if (enp->en_mod_flags & EFX_MOD_EV) {
153 rc = EINVAL;
154 goto fail1;
155 }
156
157 switch (enp->en_family) {
173#if EFSYS_OPT_FALCON
174 case EFX_FAMILY_FALCON:
175 eevop = (efx_ev_ops_t *)&__efx_ev_falcon_ops;
176 break;
177#endif /* EFSYS_OPT_FALCON */
178
179#if EFSYS_OPT_SIENA
180 case EFX_FAMILY_SIENA:
181 eevop = (efx_ev_ops_t *)&__efx_ev_siena_ops;
182 break;
183#endif /* EFSYS_OPT_SIENA */
184
185#if EFSYS_OPT_HUNTINGTON
186 case EFX_FAMILY_HUNTINGTON:

--- 259 unchanged lines hidden (view full) ---

446
447 EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
448
449 eevop->eevo_qstats_update(eep, stat);
450}
451
452#endif /* EFSYS_OPT_QSTATS */
453
158#if EFSYS_OPT_SIENA
159 case EFX_FAMILY_SIENA:
160 eevop = (efx_ev_ops_t *)&__efx_ev_siena_ops;
161 break;
162#endif /* EFSYS_OPT_SIENA */
163
164#if EFSYS_OPT_HUNTINGTON
165 case EFX_FAMILY_HUNTINGTON:

--- 259 unchanged lines hidden (view full) ---

425
426 EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
427
428 eevop->eevo_qstats_update(eep, stat);
429}
430
431#endif /* EFSYS_OPT_QSTATS */
432
454#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
433#if EFSYS_OPT_SIENA
455
456static __checkReturn efx_rc_t
457falconsiena_ev_init(
458 __in efx_nic_t *enp)
459{
460 efx_oword_t oword;
461
462 /*

--- 894 unchanged lines hidden (view full) ---

1357fail2:
1358 EFSYS_PROBE(fail2);
1359fail1:
1360 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1361
1362 return (rc);
1363}
1364
434
435static __checkReturn efx_rc_t
436falconsiena_ev_init(
437 __in efx_nic_t *enp)
438{
439 efx_oword_t oword;
440
441 /*

--- 894 unchanged lines hidden (view full) ---

1336fail2:
1337 EFSYS_PROBE(fail2);
1338fail1:
1339 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1340
1341 return (rc);
1342}
1343
1365#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
1344#endif /* EFSYS_OPT_SIENA */
1366
1367#if EFSYS_OPT_QSTATS
1368#if EFSYS_OPT_NAMES
1369/* START MKCONFIG GENERATED EfxEventQueueStatNamesBlock b693ddf85aee1bfd */
1370static const char *__efx_ev_qstat_name[] = {
1371 "all",
1372 "rx",
1373 "rx_ok",

--- 42 unchanged lines hidden (view full) ---

1416 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
1417 EFSYS_ASSERT3U(id, <, EV_NQSTATS);
1418
1419 return (__efx_ev_qstat_name[id]);
1420}
1421#endif /* EFSYS_OPT_NAMES */
1422#endif /* EFSYS_OPT_QSTATS */
1423
1345
1346#if EFSYS_OPT_QSTATS
1347#if EFSYS_OPT_NAMES
1348/* START MKCONFIG GENERATED EfxEventQueueStatNamesBlock b693ddf85aee1bfd */
1349static const char *__efx_ev_qstat_name[] = {
1350 "all",
1351 "rx",
1352 "rx_ok",

--- 42 unchanged lines hidden (view full) ---

1395 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
1396 EFSYS_ASSERT3U(id, <, EV_NQSTATS);
1397
1398 return (__efx_ev_qstat_name[id]);
1399}
1400#endif /* EFSYS_OPT_NAMES */
1401#endif /* EFSYS_OPT_QSTATS */
1402
1424#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
1403#if EFSYS_OPT_SIENA
1425
1426#if EFSYS_OPT_QSTATS
1427static void
1428falconsiena_ev_qstats_update(
1429 __in efx_evq_t *eep,
1430 __inout_ecount(EV_NQSTATS) efsys_stat_t *stat)
1431{
1432 unsigned int id;

--- 29 unchanged lines hidden (view full) ---

1462
1463static void
1464falconsiena_ev_fini(
1465 __in efx_nic_t *enp)
1466{
1467 _NOTE(ARGUNUSED(enp))
1468}
1469
1404
1405#if EFSYS_OPT_QSTATS
1406static void
1407falconsiena_ev_qstats_update(
1408 __in efx_evq_t *eep,
1409 __inout_ecount(EV_NQSTATS) efsys_stat_t *stat)
1410{
1411 unsigned int id;

--- 29 unchanged lines hidden (view full) ---

1441
1442static void
1443falconsiena_ev_fini(
1444 __in efx_nic_t *enp)
1445{
1446 _NOTE(ARGUNUSED(enp))
1447}
1448
1470#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
1449#endif /* EFSYS_OPT_SIENA */