Lines Matching refs:tx

776 	myri10ge_tx_ring_t *tx = &ss->tx;
789 cmn_err(CE_WARN, "%s: Falled to alloc tx dma handle\n",
795 mutex_enter(&tx->handle_lock);
797 handle->next = tx->free_tx_handles;
798 tx->free_tx_handles = handle;
799 mutex_exit(&tx->handle_lock);
806 myri10ge_tx_ring_t *tx = &ss->tx;
808 mutex_enter(&tx->handle_lock);
810 handle = tx->free_tx_handles;
812 tx->free_tx_handles = handle->next;
815 handle = tx->free_tx_handles;
818 mutex_exit(&tx->handle_lock);
820 cmn_err(CE_WARN, "%s: %d tx dma handles allocated at close\n",
827 myri10ge_free_tx_handles(myri10ge_tx_ring_t *tx,
830 mutex_enter(&tx->handle_lock);
831 list->tail->next = tx->free_tx_handles;
832 tx->free_tx_handles = list->head;
833 mutex_exit(&tx->handle_lock);
837 myri10ge_free_tx_handle_slist(myri10ge_tx_ring_t *tx,
850 myri10ge_free_tx_handles(tx, &list);
857 myri10ge_tx_ring_t *tx = &ss->tx;
861 mutex_enter(&tx->handle_lock);
863 handle = tx->free_tx_handles;
865 mutex_exit(&tx->handle_lock);
870 mutex_enter(&tx->handle_lock);
871 handle = tx->free_tx_handles;
873 tx->free_tx_handles = handle->next;
877 mutex_exit(&tx->handle_lock);
881 myri10ge_free_tx_handle_slist(tx, *ret);
892 myri10ge_tx_ring_t *tx;
897 tx = &ss->tx;
900 for (idx = 0; idx < ss->tx.mask + 1; idx++) {
901 if (tx->info[idx].m) {
902 (void) ddi_dma_unbind_handle(tx->info[idx].handle->h);
903 handles.head = tx->info[idx].handle;
905 handles.tail = tx->info[idx].handle;
906 freeb(tx->info[idx].m);
907 tx->info[idx].m = 0;
908 tx->info[idx].handle = 0;
910 tx->cp[idx].va = NULL;
911 myri10ge_dma_free(&tx->cp[idx].dma);
913 bytes = sizeof (*tx->cp) * (tx->mask + 1);
914 kmem_free(tx->cp, bytes);
915 tx->cp = NULL;
917 myri10ge_free_tx_handles(tx, &handles);
931 bytes = sizeof (*ss->tx.cp) * (ss->tx.mask + 1);
932 ss->tx.cp = kmem_zalloc(bytes, KM_SLEEP);
933 if (ss->tx.cp == NULL) {
935 "%s: Failed to allocate tx copyblock storage\n",
942 for (h = 0; h < ss->tx.mask + 1; h++) {
943 ss->tx.cp[h].va = myri10ge_dma_alloc(ss->mgp->dip,
946 DDI_DMA_WRITE|DDI_DMA_STREAMING, &ss->tx.cp[h].dma, 1,
948 if (ss->tx.cp[h].va == NULL) {
949 cmn_err(CE_WARN, "%s: Failed to allocate tx "
959 myri10ge_free_tx_handle_slist(&ss->tx, handles);
966 myri10ge_dma_free(&ss->tx.cp[h].dma);
969 bytes = sizeof (*ss->tx.cp) * (ss->tx.mask + 1);
970 kmem_free(ss->tx.cp, bytes);
971 ss->tx.cp = NULL;
1628 ss->tx.req = 0;
1629 ss->tx.done = 0;
1630 ss->tx.pkt_done = 0;
1636 ss->tx.watchdog_done = 0;
1637 ss->tx.watchdog_req = 0;
1638 ss->tx.active = 0;
1639 ss->tx.activate = 0;
1851 ss->tx.mask = tx_ring_entries - 1;
1858 ss->tx.lanai = (mcp_kreq_ether_send_t *)(void *)(mgp->sram + cmd.data0);
1860 ss->tx.go = (char *)mgp->sram + MXGEFW_ETH_SEND_GO + 64 * slice;
1861 ss->tx.stop = (char *)mgp->sram + MXGEFW_ETH_SEND_STOP +
1864 ss->tx.go = NULL;
1865 ss->tx.stop = NULL;
1899 bytes = tx_ring_entries * sizeof (*ss->tx.info);
1900 ss->tx.info = kmem_zalloc(bytes, KM_SLEEP);
1901 if (ss->tx.info == NULL)
1903 (void) memset(ss->tx.info, 0, bytes);
1917 ss->tx.stall = ss->tx.sched = 0;
1918 ss->tx.stall_early = ss->tx.stall_late = 0;
2014 bytes = tx_ring_entries * sizeof (*ss->tx.info);
2015 kmem_free(ss->tx.info, bytes);
2036 if (ss->tx.cp == NULL)
2053 tx_ring_entries = ss->tx.mask + 1;
2061 bytes = tx_ring_entries * sizeof (*ss->tx.info);
2062 kmem_free(ss->tx.info, bytes);
2119 "toeplitz tx hash table", mgp->name);
2512 myri10ge_tx_ring_t *tx;
2517 tx = &ss->tx;
2520 while (tx->pkt_done != (int)mcp_index) {
2521 idx = tx->done & tx->mask;
2528 if (tx->info[idx].m) {
2529 (void) ddi_dma_unbind_handle(tx->info[idx].handle->h);
2530 tx->info[idx].handle->next = handles.head;
2531 handles.head = tx->info[idx].handle;
2533 handles.tail = tx->info[idx].handle;
2534 freeb(tx->info[idx].m);
2535 tx->info[idx].m = 0;
2536 tx->info[idx].handle = 0;
2538 if (tx->info[idx].ostat.opackets != 0) {
2539 tx->stats.multixmt += tx->info[idx].ostat.multixmt;
2540 tx->stats.brdcstxmt += tx->info[idx].ostat.brdcstxmt;
2541 tx->stats.obytes += tx->info[idx].ostat.obytes;
2542 tx->stats.opackets += tx->info[idx].ostat.opackets;
2543 tx->info[idx].stat.un.all = 0;
2544 tx->pkt_done++;
2547 tx->done++;
2552 if ((tx->req - tx->done) < (tx->mask >> 1) &&
2553 tx->stall != tx->sched) {
2554 mutex_enter(&ss->tx.lock);
2555 tx->sched = tx->stall;
2556 mutex_exit(&ss->tx.lock);
2557 mac_tx_ring_update(ss->mgp->mh, tx->rh);
2561 if (unlikely(++limit > 2 * tx->mask))
2564 if (tx->req == tx->done && tx->stop != NULL) {
2569 mutex_enter(&tx->lock);
2570 if (tx->req == tx->done && tx->active) {
2571 *(int *)(void *)tx->stop = 1;
2572 tx->active = 0;
2575 mutex_exit(&tx->lock);
2578 myri10ge_free_tx_handles(tx, &handles);
2693 myri10ge_tx_ring_t *tx = &ss->tx;
2723 if (send_done_count != tx->pkt_done)
2816 myri10ge_submit_req_backwards(myri10ge_tx_ring_t *tx,
2820 starting_slot = tx->req;
2823 idx = (starting_slot + cnt) & tx->mask;
2824 myri10ge_pio_copy(&tx->lanai[idx],
2838 myri10ge_submit_req(myri10ge_tx_ring_t *tx, mcp_kreq_ether_send_t *src,
2846 idx = tx->req & tx->mask;
2851 dst = dstp = &tx->lanai[idx];
2854 if ((idx + cnt) < tx->mask) {
2866 myri10ge_submit_req_backwards(tx, src, cnt);
2882 tx->req += cnt;
2884 /* notify NIC to poll this tx ring */
2885 if (!tx->active && tx->go != NULL) {
2886 *(int *)(void *)tx->go = 1;
2887 tx->active = 1;
2888 tx->activate++;
2947 myri10ge_tx_ring_t *tx = &ss->tx;
2954 mutex_enter(&tx->lock);
2955 avail = tx->mask - (tx->req - tx->done);
2957 mutex_exit(&tx->lock);
2960 idx = tx->req & tx->mask;
2961 cp = &tx->cp[idx];
2979 myri10ge_tx_stat(&tx->info[idx].stat,
2982 myri10ge_submit_req(&ss->tx, req, 1);
2983 mutex_exit(&tx->lock);
2990 myri10ge_send_locked(myri10ge_tx_ring_t *tx, mcp_kreq_ether_send_t *req_list,
2997 /* store unmapping and bp info for tx irq handler */
2999 idx = (tx->req + i) & tx->mask;
3000 tx->info[idx].m = tx_info[i].m;
3001 tx->info[idx].handle = tx_info[i].handle;
3003 tx->info[idx].stat.un.all = tx_info[0].stat.un.all;
3006 myri10ge_submit_req(tx, req_list, count);
3121 myri10ge_tx_ring_t *tx = &ss->tx;
3138 mutex_enter(&tx->lock);
3141 avail = tx->mask - (tx->req - tx->done);
3143 atomic_inc_32(&tx->stall);
3144 mutex_exit(&tx->lock);
3152 idx = tx->mask & tx->req;
3153 cp = &tx->cp[idx];
3160 tx->info[idx].ostat.opackets = opackets;
3161 tx->info[idx].ostat.obytes = (opackets - 1) * hdr_size
3167 tx_req = tx->req;
3184 idx = tx->mask & tx_req;
3185 cp = &tx->cp[idx];
3204 idx = tx->mask & tx_req;
3205 cp = &tx->cp[idx];
3219 tx_req = tx->req;
3221 idx = tx->mask & tx_req;
3222 cp = &tx->cp[idx];
3234 tx_req = tx->req;
3236 idx = tx->mask & tx_req;
3237 cp = &tx->cp[idx];
3318 myri10ge_submit_req(tx, req_list, count);
3320 mutex_exit(&tx->lock);
3327 * encapsulate more than eth->tx.req - eth->tx.done, or
3336 myri10ge_tx_ring_t *tx = &ss->tx;
3372 avail = tx->mask - (tx->req - tx->done);
3384 atomic_inc_32(&tx->stall_early);
3618 /* calculate tx stats */
3633 mutex_enter(&tx->lock);
3636 avail = tx->mask - (tx->req - tx->done);
3638 mutex_exit(&tx->lock);
3643 myri10ge_send_locked(tx, req_list, tx_info, count);
3644 mutex_exit(&tx->lock);
3649 atomic_inc_32(&tx->stall_late);
3665 myri10ge_free_tx_handle_slist(tx, handles);
3682 atomic_inc_32(&tx->stall);
3829 * Retrieve a value for one of the statistics for a particular tx ring
3839 *val = ss->tx.stats.obytes;
3843 *val = ss->tx.stats.opackets;
3907 ss->tx.rh = rh;
4018 ethstat->tx_done.value.ul = ss->tx.done;
4019 ethstat->tx_req.value.ul = ss->tx.req;
4020 ethstat->tx_activate.value.ul = ss->tx.activate;
4021 ethstat->xmit_sched.value.ul = ss->tx.sched;
4022 ethstat->xmit_stall.value.ul = ss->tx.stall;
4023 ethstat->xmit_stall_early.value.ul = ss->tx.stall_early;
4024 ethstat->xmit_stall_late.value.ul = ss->tx.stall_late;
4358 * larger than 2KB by setting the tx.boundary to 2KB. If ECRC is
4360 * firmware image, and set tx.boundary to 4KB.
4911 myri10ge_ring_stalled(myri10ge_tx_ring_t *tx)
4913 if (tx->sched != tx->stall &&
4914 tx->done == tx->watchdog_done &&
4915 tx->watchdog_req != tx->watchdog_done)
4925 myri10ge_tx_ring_t *tx;
4949 tx = &mgp->ss[i].tx;
4950 slices_stalled = myri10ge_ring_stalled(tx);
4959 mgp->name, i, tx->sched, tx->stall,
4960 tx->done, tx->watchdog_done, tx->req, tx->pkt_done,
4978 tx = &ss->tx;
4979 tx->watchdog_done = tx->done;
4980 tx->watchdog_req = tx->req;
5275 tstat = &mgp->ss[i].tx.stats;
5283 tstat = &mgp->ss[i].tx.stats;
5336 tstat = &mgp->ss[i].tx.stats;
5344 tstat = &mgp->ss[i].tx.stats;
5588 mutex_destroy(&ss->tx.lock);
5589 mutex_destroy(&ss->tx.handle_lock);
5641 mutex_init(&ss->tx.lock, NULL, MUTEX_DEFAULT, NULL);
5642 mutex_init(&ss->tx.handle_lock, NULL, MUTEX_DEFAULT, NULL);
5986 printf("%s: %s, tx bndry %d, fw %s\n", mgp->name,