]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - sys/dev/sfxge/common/hunt_tx.c
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / sys / dev / sfxge / common / hunt_tx.c
1 /*-
2  * Copyright (c) 2012-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,
9  *    this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright notice,
11  *    this list of conditions and the following disclaimer in the documentation
12  *    and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
18  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
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$");
33
34 #include "efsys.h"
35 #include "efx.h"
36 #include "efx_impl.h"
37
38
39 #if EFSYS_OPT_HUNTINGTON
40
41 #if EFSYS_OPT_QSTATS
42 #define EFX_TX_QSTAT_INCR(_etp, _stat)                                  \
43         do {                                                            \
44                 (_etp)->et_stat[_stat]++;                               \
45         _NOTE(CONSTANTCONDITION)                                        \
46         } while (B_FALSE)
47 #else
48 #define EFX_TX_QSTAT_INCR(_etp, _stat)
49 #endif
50
51 static  __checkReturn   int
52 efx_mcdi_init_txq(
53         __in            efx_nic_t *enp,
54         __in            uint32_t size,
55         __in            uint32_t target_evq,
56         __in            uint32_t label,
57         __in            uint32_t instance,
58         __in            uint16_t flags,
59         __in            efsys_mem_t *esmp)
60 {
61         efx_mcdi_req_t req;
62         uint8_t payload[MAX(MC_CMD_INIT_TXQ_IN_LEN(EFX_TXQ_MAX_BUFS),
63                             MC_CMD_INIT_TXQ_OUT_LEN)];
64         efx_qword_t *dma_addr;
65         uint64_t addr;
66         int npages;
67         int i;
68         int rc;
69
70         EFSYS_ASSERT(EFX_TXQ_MAX_BUFS >=
71             EFX_TXQ_NBUFS(EFX_TXQ_MAXNDESCS(&enp->en_nic_cfg)));
72
73         npages = EFX_TXQ_NBUFS(size);
74         if (npages > MC_CMD_INIT_TXQ_IN_DMA_ADDR_MAXNUM) {
75                 rc = EINVAL;
76                 goto fail1;
77         }
78
79         (void) memset(payload, 0, sizeof (payload));
80         req.emr_cmd = MC_CMD_INIT_TXQ;
81         req.emr_in_buf = payload;
82         req.emr_in_length = MC_CMD_INIT_TXQ_IN_LEN(npages);
83         req.emr_out_buf = payload;
84         req.emr_out_length = MC_CMD_INIT_TXQ_OUT_LEN;
85
86         MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_SIZE, size);
87         MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_TARGET_EVQ, target_evq);
88         MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_LABEL, label);
89         MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_INSTANCE, instance);
90
91         MCDI_IN_POPULATE_DWORD_6(req, INIT_TXQ_IN_FLAGS,
92             INIT_TXQ_IN_FLAG_BUFF_MODE, 0,
93             INIT_TXQ_IN_FLAG_IP_CSUM_DIS, (flags & EFX_CKSUM_IPV4) ? 0 : 1,
94             INIT_TXQ_IN_FLAG_TCP_CSUM_DIS, (flags & EFX_CKSUM_TCPUDP) ? 0 : 1,
95             INIT_TXQ_IN_FLAG_TCP_UDP_ONLY, 0,
96             INIT_TXQ_IN_CRC_MODE, 0,
97             INIT_TXQ_IN_FLAG_TIMESTAMP, 0);
98
99         MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_OWNER_ID, 0);
100         MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_PORT_ID, EVB_PORT_ID_ASSIGNED);
101
102         dma_addr = MCDI_IN2(req, efx_qword_t, INIT_TXQ_IN_DMA_ADDR);
103         addr = EFSYS_MEM_ADDR(esmp);
104
105         for (i = 0; i < npages; i++) {
106                 EFX_POPULATE_QWORD_2(*dma_addr,
107                     EFX_DWORD_1, (uint32_t)(addr >> 32),
108                     EFX_DWORD_0, (uint32_t)(addr & 0xffffffff));
109
110                 dma_addr++;
111                 addr += EFX_BUF_SIZE;
112         }
113
114         efx_mcdi_execute(enp, &req);
115
116         if (req.emr_rc != 0) {
117                 rc = req.emr_rc;
118                 goto fail2;
119         }
120
121         return (0);
122
123 fail2:
124         EFSYS_PROBE(fail2);
125 fail1:
126         EFSYS_PROBE1(fail1, int, rc);
127
128         return (rc);
129 }
130
131 static  __checkReturn   int
132 efx_mcdi_fini_txq(
133         __in            efx_nic_t *enp,
134         __in            uint32_t instance)
135 {
136         efx_mcdi_req_t req;
137         uint8_t payload[MAX(MC_CMD_FINI_TXQ_IN_LEN,
138                             MC_CMD_FINI_TXQ_OUT_LEN)];
139         int rc;
140
141         (void) memset(payload, 0, sizeof (payload));
142         req.emr_cmd = MC_CMD_FINI_TXQ;
143         req.emr_in_buf = payload;
144         req.emr_in_length = MC_CMD_FINI_TXQ_IN_LEN;
145         req.emr_out_buf = payload;
146         req.emr_out_length = MC_CMD_FINI_TXQ_OUT_LEN;
147
148         MCDI_IN_SET_DWORD(req, FINI_TXQ_IN_INSTANCE, instance);
149
150         efx_mcdi_execute(enp, &req);
151
152         if ((req.emr_rc != 0) && (req.emr_rc != MC_CMD_ERR_EALREADY)) {
153                 rc = req.emr_rc;
154                 goto fail1;
155         }
156
157         return (0);
158
159 fail1:
160         EFSYS_PROBE1(fail1, int, rc);
161
162         return (rc);
163 }
164
165         __checkReturn   int
166 hunt_tx_init(
167         __in            efx_nic_t *enp)
168 {
169         _NOTE(ARGUNUSED(enp))
170         return (0);
171 }
172
173                         void
174 hunt_tx_fini(
175         __in            efx_nic_t *enp)
176 {
177         _NOTE(ARGUNUSED(enp))
178 }
179
180         __checkReturn   int
181 hunt_tx_qcreate(
182         __in            efx_nic_t *enp,
183         __in            unsigned int index,
184         __in            unsigned int label,
185         __in            efsys_mem_t *esmp,
186         __in            size_t n,
187         __in            uint32_t id,
188         __in            uint16_t flags,
189         __in            efx_evq_t *eep,
190         __in            efx_txq_t *etp,
191         __out           unsigned int *addedp)
192 {
193         efx_qword_t desc;
194         int rc;
195
196
197         if ((rc = efx_mcdi_init_txq(enp, n, eep->ee_index, label, index, flags,
198             esmp)) != 0)
199                 goto fail1;
200
201         /*
202          * A previous user of this TX queue may have written a descriptor to the
203          * TX push collector, but not pushed the doorbell (e.g. after a crash).
204          * The next doorbell write would then push the stale descriptor.
205          *
206          * Ensure the (per network port) TX push collector is cleared by writing
207          * a no-op TX option descriptor. See bug29981 for details.
208          */
209         *addedp = 1;
210         EFX_POPULATE_QWORD_4(desc,
211             ESF_DZ_TX_DESC_IS_OPT, 1,
212             ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_CRC_CSUM,
213             ESF_DZ_TX_OPTION_UDP_TCP_CSUM, (flags & EFX_CKSUM_TCPUDP) ? 1 : 0,
214             ESF_DZ_TX_OPTION_IP_CSUM, (flags & EFX_CKSUM_IPV4) ? 1 : 0);
215
216         EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc);
217         hunt_tx_qpush(etp, *addedp, 0);
218
219         return (0);
220
221 fail1:
222         EFSYS_PROBE1(fail1, int, rc);
223
224         return (rc);
225 }
226
227                 void
228 hunt_tx_qdestroy(
229         __in    efx_txq_t *etp)
230 {
231         /* FIXME */
232         _NOTE(ARGUNUSED(etp))
233         /* FIXME */
234 }
235
236         __checkReturn   int
237 hunt_tx_qpio_enable(
238         __in            efx_txq_t *etp)
239 {
240         efx_nic_t *enp = etp->et_enp;
241         efx_piobuf_handle_t handle;
242         int rc;
243
244         if (etp->et_pio_size != 0) {
245                 rc = EALREADY;
246                 goto fail1;
247         }
248
249         /* Sub-allocate a PIO block from a piobuf */
250         if ((rc = hunt_nic_pio_alloc(enp,
251                     &etp->et_pio_bufnum,
252                     &handle,
253                     &etp->et_pio_blknum,
254                     &etp->et_pio_offset,
255                     &etp->et_pio_size)) != 0) {
256                 goto fail2;
257         }
258         EFSYS_ASSERT3U(etp->et_pio_size, !=, 0);
259
260         /* Link the piobuf to this TXQ */
261         if ((rc = hunt_nic_pio_link(enp, etp->et_index, handle)) != 0) {
262                 goto fail3;
263         }
264
265         /*
266          * et_pio_offset is the offset of the sub-allocated block within the
267          * hardware PIO buffer. It is used as the buffer address in the PIO
268          * option descriptor.
269          *
270          * et_pio_write_offset is the offset of the sub-allocated block from the
271          * start of the write-combined memory mapping, and is used for writing
272          * data into the PIO buffer.
273          */
274         etp->et_pio_write_offset =
275             (etp->et_pio_bufnum * ER_DZ_TX_PIOBUF_STEP) +
276             ER_DZ_TX_PIOBUF_OFST + etp->et_pio_offset;
277
278         return (0);
279
280 fail3:
281         EFSYS_PROBE(fail3);
282         hunt_nic_pio_free(enp, etp->et_pio_bufnum, etp->et_pio_blknum);
283         etp->et_pio_size = 0;
284 fail2:
285         EFSYS_PROBE(fail2);
286 fail1:
287         EFSYS_PROBE1(fail1, int, rc);
288
289         return (rc);
290 }
291
292                         void
293 hunt_tx_qpio_disable(
294         __in            efx_txq_t *etp)
295 {
296         efx_nic_t *enp = etp->et_enp;
297
298         if (etp->et_pio_size != 0) {
299                 /* Unlink the piobuf from this TXQ */
300                 hunt_nic_pio_unlink(enp, etp->et_index);
301
302                 /* Free the sub-allocated PIO block */
303                 hunt_nic_pio_free(enp, etp->et_pio_bufnum, etp->et_pio_blknum);
304                 etp->et_pio_size = 0;
305                 etp->et_pio_write_offset = 0;
306         }
307 }
308
309         __checkReturn   int
310 hunt_tx_qpio_write(
311         __in                    efx_txq_t *etp,
312         __in_ecount(length)     uint8_t *buffer,
313         __in                    size_t length,
314         __in                    size_t offset)
315 {
316         efx_nic_t *enp = etp->et_enp;
317         efsys_bar_t *esbp = enp->en_esbp;
318         uint32_t write_offset;
319         uint32_t write_offset_limit;
320         efx_qword_t *eqp;
321         int rc;
322
323         EFSYS_ASSERT(length % sizeof (efx_qword_t) == 0);
324
325         if (etp->et_pio_size == 0) {
326                 rc = ENOENT;
327                 goto fail1;
328         }
329         if (offset + length > etp->et_pio_size) {
330                 rc = ENOSPC;
331                 goto fail2;
332         }
333
334         /*
335          * Writes to PIO buffers must be 64 bit aligned, and multiples of
336          * 64 bits.
337          */
338         write_offset = etp->et_pio_write_offset + offset;
339         write_offset_limit = write_offset + length;
340         eqp = (efx_qword_t *)buffer;
341         while (write_offset < write_offset_limit) {
342                 EFSYS_BAR_WC_WRITEQ(esbp, write_offset, eqp);
343                 eqp++;
344                 write_offset += sizeof (efx_qword_t);
345         }
346
347         return (0);
348
349 fail2:
350         EFSYS_PROBE(fail2);
351 fail1:
352         EFSYS_PROBE1(fail1, int, rc);
353
354         return (rc);
355 }
356
357         __checkReturn   int
358 hunt_tx_qpio_post(
359         __in                    efx_txq_t *etp,
360         __in                    size_t pkt_length,
361         __in                    unsigned int completed,
362         __inout                 unsigned int *addedp)
363 {
364         efx_qword_t pio_desc;
365         unsigned int id;
366         size_t offset;
367         unsigned int added = *addedp;
368         int rc;
369
370
371         if (added - completed + 1 > EFX_TXQ_LIMIT(etp->et_mask + 1)) {
372                 rc = ENOSPC;
373                 goto fail1;
374         }
375
376         if (etp->et_pio_size == 0) {
377                 rc = ENOENT;
378                 goto fail2;
379         }
380
381         id = added++ & etp->et_mask;
382         offset = id * sizeof (efx_qword_t);
383
384         EFSYS_PROBE4(tx_pio_post, unsigned int, etp->et_index,
385                     unsigned int, id, uint32_t, etp->et_pio_offset,
386                     size_t, pkt_length);
387
388         EFX_POPULATE_QWORD_5(pio_desc,
389                         ESF_DZ_TX_DESC_IS_OPT, 1,
390                         ESF_DZ_TX_OPTION_TYPE, 1,
391                         ESF_DZ_TX_PIO_CONT, 0,
392                         ESF_DZ_TX_PIO_BYTE_CNT, pkt_length,
393                         ESF_DZ_TX_PIO_BUF_ADDR, etp->et_pio_offset);
394
395         EFSYS_MEM_WRITEQ(etp->et_esmp, offset, &pio_desc);
396
397         EFX_TX_QSTAT_INCR(etp, TX_POST_PIO);
398
399         *addedp = added;
400         return (0);
401
402 fail2:
403         EFSYS_PROBE(fail2);
404 fail1:
405         EFSYS_PROBE1(fail1, int, rc);
406
407         return (rc);
408 }
409
410         __checkReturn   int
411 hunt_tx_qpost(
412         __in            efx_txq_t *etp,
413         __in_ecount(n)  efx_buffer_t *eb,
414         __in            unsigned int n,
415         __in            unsigned int completed,
416         __inout         unsigned int *addedp)
417 {
418         unsigned int added = *addedp;
419         unsigned int i;
420         int rc;
421
422         if (added - completed + n > EFX_TXQ_LIMIT(etp->et_mask + 1)) {
423                 rc = ENOSPC;
424                 goto fail1;
425         }
426
427         for (i = 0; i < n; i++) {
428                 efx_buffer_t *ebp = &eb[i];
429                 efsys_dma_addr_t addr = ebp->eb_addr;
430                 size_t size = ebp->eb_size;
431                 boolean_t eop = ebp->eb_eop;
432                 unsigned int id;
433                 size_t offset;
434                 efx_qword_t qword;
435
436                 /* Fragments must not span 4k boundaries. */
437                 EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= (addr + size));
438
439                 id = added++ & etp->et_mask;
440                 offset = id * sizeof (efx_qword_t);
441
442                 EFSYS_PROBE5(tx_post, unsigned int, etp->et_index,
443                     unsigned int, id, efsys_dma_addr_t, addr,
444                     size_t, size, boolean_t, eop);
445
446                 EFX_POPULATE_QWORD_5(qword,
447                     ESF_DZ_TX_KER_TYPE, 0,
448                     ESF_DZ_TX_KER_CONT, (eop) ? 0 : 1,
449                     ESF_DZ_TX_KER_BYTE_CNT, (uint32_t)(size),
450                     ESF_DZ_TX_KER_BUF_ADDR_DW0, (uint32_t)(addr & 0xffffffff),
451                     ESF_DZ_TX_KER_BUF_ADDR_DW1, (uint32_t)(addr >> 32));
452
453                 EFSYS_MEM_WRITEQ(etp->et_esmp, offset, &qword);
454         }
455
456         EFX_TX_QSTAT_INCR(etp, TX_POST);
457
458         *addedp = added;
459         return (0);
460
461 fail1:
462         EFSYS_PROBE1(fail1, int, rc);
463
464         return (rc);
465 }
466
467 /*
468  * This improves performance by pushing a TX descriptor at the same time as the
469  * doorbell. The descriptor must be added to the TXQ, so that can be used if the
470  * hardware decides not to use the pushed descriptor.
471  */
472                         void
473 hunt_tx_qpush(
474         __in            efx_txq_t *etp,
475         __in            unsigned int added,
476         __in            unsigned int pushed)
477 {
478         efx_nic_t *enp = etp->et_enp;
479         unsigned int wptr;
480         unsigned int id;
481         size_t offset;
482         efx_qword_t desc;
483         efx_oword_t oword;
484
485         wptr = added & etp->et_mask;
486         id = pushed & etp->et_mask;
487         offset = id * sizeof (efx_qword_t);
488
489         EFSYS_MEM_READQ(etp->et_esmp, offset, &desc);
490         EFX_POPULATE_OWORD_3(oword,
491             ERF_DZ_TX_DESC_WPTR, wptr,
492             ERF_DZ_TX_DESC_HWORD, EFX_QWORD_FIELD(desc, EFX_DWORD_1),
493             ERF_DZ_TX_DESC_LWORD, EFX_QWORD_FIELD(desc, EFX_DWORD_0));
494
495         /* Guarantee ordering of memory (descriptors) and PIO (doorbell) */
496         EFX_DMA_SYNC_QUEUE_FOR_DEVICE(etp->et_esmp, etp->et_mask + 1, wptr, id);
497         EFSYS_PIO_WRITE_BARRIER();
498         EFX_BAR_TBL_DOORBELL_WRITEO(enp, ER_DZ_TX_DESC_UPD_REG, etp->et_index,
499                                     &oword);
500 }
501
502         __checkReturn   int
503 hunt_tx_qdesc_post(
504         __in            efx_txq_t *etp,
505         __in_ecount(n)  efx_desc_t *ed,
506         __in            unsigned int n,
507         __in            unsigned int completed,
508         __inout         unsigned int *addedp)
509 {
510         unsigned int added = *addedp;
511         unsigned int i;
512         int rc;
513
514         if (added - completed + n > EFX_TXQ_LIMIT(etp->et_mask + 1)) {
515                 rc = ENOSPC;
516                 goto fail1;
517         }
518
519         for (i = 0; i < n; i++) {
520                 efx_desc_t *edp = &ed[i];
521                 unsigned int id;
522                 size_t offset;
523
524                 id = added++ & etp->et_mask;
525                 offset = id * sizeof (efx_desc_t);
526
527                 EFSYS_MEM_WRITEQ(etp->et_esmp, offset, &edp->ed_eq);
528         }
529
530         EFSYS_PROBE3(tx_desc_post, unsigned int, etp->et_index,
531                     unsigned int, added, unsigned int, n);
532
533         EFX_TX_QSTAT_INCR(etp, TX_POST);
534
535         *addedp = added;
536         return (0);
537
538 fail1:
539         EFSYS_PROBE1(fail1, int, rc);
540
541         return (rc);
542 }
543
544         void
545 hunt_tx_qdesc_dma_create(
546         __in    efx_txq_t *etp,
547         __in    efsys_dma_addr_t addr,
548         __in    size_t size,
549         __in    boolean_t eop,
550         __out   efx_desc_t *edp)
551 {
552         /* Fragments must not span 4k boundaries. */
553         EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= addr + size);
554
555         EFSYS_PROBE4(tx_desc_dma_create, unsigned int, etp->et_index,
556                     efsys_dma_addr_t, addr,
557                     size_t, size, boolean_t, eop);
558
559         EFX_POPULATE_QWORD_5(edp->ed_eq,
560                     ESF_DZ_TX_KER_TYPE, 0,
561                     ESF_DZ_TX_KER_CONT, (eop) ? 0 : 1,
562                     ESF_DZ_TX_KER_BYTE_CNT, (uint32_t)(size),
563                     ESF_DZ_TX_KER_BUF_ADDR_DW0, (uint32_t)(addr & 0xffffffff),
564                     ESF_DZ_TX_KER_BUF_ADDR_DW1, (uint32_t)(addr >> 32));
565 }
566
567         void
568 hunt_tx_qdesc_tso_create(
569         __in    efx_txq_t *etp,
570         __in    uint16_t ipv4_id,
571         __in    uint32_t tcp_seq,
572         __in    uint8_t  tcp_flags,
573         __out   efx_desc_t *edp)
574 {
575         EFSYS_PROBE4(tx_desc_tso_create, unsigned int, etp->et_index,
576                     uint16_t, ipv4_id, uint32_t, tcp_seq,
577                     uint8_t, tcp_flags);
578
579         EFX_POPULATE_QWORD_5(edp->ed_eq,
580                             ESF_DZ_TX_DESC_IS_OPT, 1,
581                             ESF_DZ_TX_OPTION_TYPE,
582                             ESE_DZ_TX_OPTION_DESC_TSO,
583                             ESF_DZ_TX_TSO_TCP_FLAGS, tcp_flags,
584                             ESF_DZ_TX_TSO_IP_ID, ipv4_id,
585                             ESF_DZ_TX_TSO_TCP_SEQNO, tcp_seq);
586 }
587
588         void
589 hunt_tx_qdesc_vlantci_create(
590         __in    efx_txq_t *etp,
591         __in    uint16_t  tci,
592         __out   efx_desc_t *edp)
593 {
594         EFSYS_PROBE2(tx_desc_vlantci_create, unsigned int, etp->et_index,
595                     uint16_t, tci);
596
597         EFX_POPULATE_QWORD_4(edp->ed_eq,
598                             ESF_DZ_TX_DESC_IS_OPT, 1,
599                             ESF_DZ_TX_OPTION_TYPE,
600                             ESE_DZ_TX_OPTION_DESC_VLAN,
601                             ESF_DZ_TX_VLAN_OP, tci ? 1 : 0,
602                             ESF_DZ_TX_VLAN_TAG1, tci);
603 }
604
605
606         __checkReturn   int
607 hunt_tx_qpace(
608         __in            efx_txq_t *etp,
609         __in            unsigned int ns)
610 {
611         int rc;
612
613         /* FIXME */
614         _NOTE(ARGUNUSED(etp, ns))
615         if (B_FALSE) {
616                 rc = ENOTSUP;
617                 goto fail1;
618         }
619         /* FIXME */
620
621         return (0);
622
623 fail1:
624         EFSYS_PROBE1(fail1, int, rc);
625
626         return (rc);
627 }
628
629         __checkReturn   int
630 hunt_tx_qflush(
631         __in            efx_txq_t *etp)
632 {
633         efx_nic_t *enp = etp->et_enp;
634         int rc;
635
636         if ((rc = efx_mcdi_fini_txq(enp, etp->et_index)) != 0)
637                 goto fail1;
638
639         return (0);
640
641 fail1:
642         EFSYS_PROBE1(fail1, int, rc);
643
644         return (rc);
645 }
646
647                         void
648 hunt_tx_qenable(
649         __in            efx_txq_t *etp)
650 {
651         /* FIXME */
652         _NOTE(ARGUNUSED(etp))
653         /* FIXME */
654 }
655
656 #if EFSYS_OPT_QSTATS
657                         void
658 hunt_tx_qstats_update(
659         __in                            efx_txq_t *etp,
660         __inout_ecount(TX_NQSTATS)      efsys_stat_t *stat)
661 {
662         /*
663          * TBD: Consider a common Siena/Huntington function.  The code is
664          * essentially identical.
665          */
666
667         unsigned int id;
668
669         for (id = 0; id < TX_NQSTATS; id++) {
670                 efsys_stat_t *essp = &stat[id];
671
672                 EFSYS_STAT_INCR(essp, etp->et_stat[id]);
673                 etp->et_stat[id] = 0;
674         }
675 }
676
677 #endif /* EFSYS_OPT_QSTATS */
678
679 #endif /* EFSYS_OPT_HUNTINGTON */