efx_tx.c (293891) | efx_tx.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_tx.c 293891 2016-01-14 09:05:51Z arybchik $"); | 32__FBSDID("$FreeBSD: head/sys/dev/sfxge/common/efx_tx.c 299320 2016-05-10 07:01:06Z arybchik $"); |
33 34#include "efx.h" 35#include "efx_impl.h" 36 37#if EFSYS_OPT_QSTATS 38#define EFX_TX_QSTAT_INCR(_etp, _stat) \ 39 do { \ 40 (_etp)->et_stat[_stat]++; \ 41 _NOTE(CONSTANTCONDITION) \ 42 } while (B_FALSE) 43#else 44#define EFX_TX_QSTAT_INCR(_etp, _stat) 45#endif 46 | 33 34#include "efx.h" 35#include "efx_impl.h" 36 37#if EFSYS_OPT_QSTATS 38#define EFX_TX_QSTAT_INCR(_etp, _stat) \ 39 do { \ 40 (_etp)->et_stat[_stat]++; \ 41 _NOTE(CONSTANTCONDITION) \ 42 } while (B_FALSE) 43#else 44#define EFX_TX_QSTAT_INCR(_etp, _stat) 45#endif 46 |
47#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA | 47#if EFSYS_OPT_SIENA |
48 49static __checkReturn efx_rc_t 50falconsiena_tx_init( 51 __in efx_nic_t *enp); 52 53static void 54falconsiena_tx_fini( 55 __in efx_nic_t *enp); --- 60 unchanged lines hidden (view full) --- 116 117#if EFSYS_OPT_QSTATS 118static void 119falconsiena_tx_qstats_update( 120 __in efx_txq_t *etp, 121 __inout_ecount(TX_NQSTATS) efsys_stat_t *stat); 122#endif 123 | 48 49static __checkReturn efx_rc_t 50falconsiena_tx_init( 51 __in efx_nic_t *enp); 52 53static void 54falconsiena_tx_fini( 55 __in efx_nic_t *enp); --- 60 unchanged lines hidden (view full) --- 116 117#if EFSYS_OPT_QSTATS 118static void 119falconsiena_tx_qstats_update( 120 __in efx_txq_t *etp, 121 __inout_ecount(TX_NQSTATS) efsys_stat_t *stat); 122#endif 123 |
124#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ | 124#endif /* EFSYS_OPT_SIENA */ |
125 126 | 125 126 |
127#if EFSYS_OPT_FALCON 128static efx_tx_ops_t __efx_tx_falcon_ops = { 129 falconsiena_tx_init, /* etxo_init */ 130 falconsiena_tx_fini, /* etxo_fini */ 131 falconsiena_tx_qcreate, /* etxo_qcreate */ 132 falconsiena_tx_qdestroy, /* etxo_qdestroy */ 133 falconsiena_tx_qpost, /* etxo_qpost */ 134 falconsiena_tx_qpush, /* etxo_qpush */ 135 falconsiena_tx_qpace, /* etxo_qpace */ 136 falconsiena_tx_qflush, /* etxo_qflush */ 137 falconsiena_tx_qenable, /* etxo_qenable */ 138 NULL, /* etxo_qpio_enable */ 139 NULL, /* etxo_qpio_disable */ 140 NULL, /* etxo_qpio_write */ 141 NULL, /* etxo_qpio_post */ 142 falconsiena_tx_qdesc_post, /* etxo_qdesc_post */ 143 falconsiena_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */ 144 NULL, /* etxo_qdesc_tso_create */ 145 NULL, /* etxo_qdesc_tso2_create */ 146 NULL, /* etxo_qdesc_vlantci_create */ 147#if EFSYS_OPT_QSTATS 148 falconsiena_tx_qstats_update, /* etxo_qstats_update */ 149#endif 150}; 151#endif /* EFSYS_OPT_FALCON */ 152 | |
153#if EFSYS_OPT_SIENA 154static efx_tx_ops_t __efx_tx_siena_ops = { 155 falconsiena_tx_init, /* etxo_init */ 156 falconsiena_tx_fini, /* etxo_fini */ 157 falconsiena_tx_qcreate, /* etxo_qcreate */ 158 falconsiena_tx_qdestroy, /* etxo_qdestroy */ 159 falconsiena_tx_qpost, /* etxo_qpost */ 160 falconsiena_tx_qpush, /* etxo_qpush */ --- 83 unchanged lines hidden (view full) --- 244 } 245 246 if (enp->en_mod_flags & EFX_MOD_TX) { 247 rc = EINVAL; 248 goto fail2; 249 } 250 251 switch (enp->en_family) { | 127#if EFSYS_OPT_SIENA 128static efx_tx_ops_t __efx_tx_siena_ops = { 129 falconsiena_tx_init, /* etxo_init */ 130 falconsiena_tx_fini, /* etxo_fini */ 131 falconsiena_tx_qcreate, /* etxo_qcreate */ 132 falconsiena_tx_qdestroy, /* etxo_qdestroy */ 133 falconsiena_tx_qpost, /* etxo_qpost */ 134 falconsiena_tx_qpush, /* etxo_qpush */ --- 83 unchanged lines hidden (view full) --- 218 } 219 220 if (enp->en_mod_flags & EFX_MOD_TX) { 221 rc = EINVAL; 222 goto fail2; 223 } 224 225 switch (enp->en_family) { |
252#if EFSYS_OPT_FALCON 253 case EFX_FAMILY_FALCON: 254 etxop = (efx_tx_ops_t *)&__efx_tx_falcon_ops; 255 break; 256#endif /* EFSYS_OPT_FALCON */ 257 | |
258#if EFSYS_OPT_SIENA 259 case EFX_FAMILY_SIENA: 260 etxop = (efx_tx_ops_t *)&__efx_tx_siena_ops; 261 break; 262#endif /* EFSYS_OPT_SIENA */ 263 264#if EFSYS_OPT_HUNTINGTON 265 case EFX_FAMILY_HUNTINGTON: --- 423 unchanged lines hidden (view full) --- 689 690 EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); 691 692 etxop->etxo_qstats_update(etp, stat); 693} 694#endif 695 696 | 226#if EFSYS_OPT_SIENA 227 case EFX_FAMILY_SIENA: 228 etxop = (efx_tx_ops_t *)&__efx_tx_siena_ops; 229 break; 230#endif /* EFSYS_OPT_SIENA */ 231 232#if EFSYS_OPT_HUNTINGTON 233 case EFX_FAMILY_HUNTINGTON: --- 423 unchanged lines hidden (view full) --- 657 658 EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); 659 660 etxop->etxo_qstats_update(etp, stat); 661} 662#endif 663 664 |
697#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA | 665#if EFSYS_OPT_SIENA |
698 699static __checkReturn efx_rc_t 700falconsiena_tx_init( 701 __in efx_nic_t *enp) 702{ 703 efx_oword_t oword; 704 705 /* --- 344 unchanged lines hidden (view full) --- 1050 FSF_AZ_TX_KER_CONT, eop ? 0 : 1, 1051 FSF_AZ_TX_KER_BYTE_COUNT, (uint32_t)size, 1052 FSF_AZ_TX_KER_BUF_ADDR_DW0, 1053 (uint32_t)(addr & 0xffffffff), 1054 FSF_AZ_TX_KER_BUF_ADDR_DW1, 1055 (uint32_t)(addr >> 32)); 1056} 1057 | 666 667static __checkReturn efx_rc_t 668falconsiena_tx_init( 669 __in efx_nic_t *enp) 670{ 671 efx_oword_t oword; 672 673 /* --- 344 unchanged lines hidden (view full) --- 1018 FSF_AZ_TX_KER_CONT, eop ? 0 : 1, 1019 FSF_AZ_TX_KER_BYTE_COUNT, (uint32_t)size, 1020 FSF_AZ_TX_KER_BUF_ADDR_DW0, 1021 (uint32_t)(addr & 0xffffffff), 1022 FSF_AZ_TX_KER_BUF_ADDR_DW1, 1023 (uint32_t)(addr >> 32)); 1024} 1025 |
1058#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ | 1026#endif /* EFSYS_OPT_SIENA */ |
1059 1060#if EFSYS_OPT_QSTATS 1061#if EFSYS_OPT_NAMES 1062/* START MKCONFIG GENERATED EfxTransmitQueueStatNamesBlock 9d8d26a0a5e2c453 */ 1063static const char *__efx_tx_qstat_name[] = { 1064 "post", 1065 "post_pio", 1066}; --- 8 unchanged lines hidden (view full) --- 1075 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); 1076 EFSYS_ASSERT3U(id, <, TX_NQSTATS); 1077 1078 return (__efx_tx_qstat_name[id]); 1079} 1080#endif /* EFSYS_OPT_NAMES */ 1081#endif /* EFSYS_OPT_QSTATS */ 1082 | 1027 1028#if EFSYS_OPT_QSTATS 1029#if EFSYS_OPT_NAMES 1030/* START MKCONFIG GENERATED EfxTransmitQueueStatNamesBlock 9d8d26a0a5e2c453 */ 1031static const char *__efx_tx_qstat_name[] = { 1032 "post", 1033 "post_pio", 1034}; --- 8 unchanged lines hidden (view full) --- 1043 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); 1044 EFSYS_ASSERT3U(id, <, TX_NQSTATS); 1045 1046 return (__efx_tx_qstat_name[id]); 1047} 1048#endif /* EFSYS_OPT_NAMES */ 1049#endif /* EFSYS_OPT_QSTATS */ 1050 |
1083#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA | 1051#if EFSYS_OPT_SIENA |
1084 1085#if EFSYS_OPT_QSTATS 1086static void 1087falconsiena_tx_qstats_update( 1088 __in efx_txq_t *etp, 1089 __inout_ecount(TX_NQSTATS) efsys_stat_t *stat) 1090{ 1091 unsigned int id; --- 23 unchanged lines hidden (view full) --- 1115 1116static void 1117falconsiena_tx_fini( 1118 __in efx_nic_t *enp) 1119{ 1120 _NOTE(ARGUNUSED(enp)) 1121} 1122 | 1052 1053#if EFSYS_OPT_QSTATS 1054static void 1055falconsiena_tx_qstats_update( 1056 __in efx_txq_t *etp, 1057 __inout_ecount(TX_NQSTATS) efsys_stat_t *stat) 1058{ 1059 unsigned int id; --- 23 unchanged lines hidden (view full) --- 1083 1084static void 1085falconsiena_tx_fini( 1086 __in efx_nic_t *enp) 1087{ 1088 _NOTE(ARGUNUSED(enp)) 1089} 1090 |
1123#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ | 1091#endif /* EFSYS_OPT_SIENA */ |