/freebsd/sys/dev/netmap/ |
H A D | netmap_monitor.c | 141 netmap_monitor_txsync(struct netmap_kring *kring, int flags) in netmap_monitor_txsync() argument 143 nm_prlim(1, "%s %x", kring->name, flags); in netmap_monitor_txsync() 154 netmap_monitor_rxsync(struct netmap_kring *kring, int flags) in netmap_monitor_rxsync() argument 157 (struct netmap_monitor_adapter *)kring->na; in netmap_monitor_rxsync() 162 nm_prdis("%s %x", kring->name, flags); in netmap_monitor_rxsync() 163 kring->nr_hwcur = kring->rhead; in netmap_monitor_rxsync() 183 struct netmap_kring *kring = NMR(na, t)[first + i]; in netmap_monitor_krings_create() local 184 kring->nm_sync = t == NR_TX ? netmap_monitor_txsync : in netmap_monitor_krings_create() 207 nm_monitor_alloc(struct netmap_kring *kring, u_int n) in nm_monitor_alloc() argument 212 if (n <= kring->max_monitors) in nm_monitor_alloc() [all …]
|
H A D | netmap_generic.c | 225 struct netmap_kring *kring = NULL; in generic_netmap_unregister() local 240 for_each_rx_kring(r, kring, na) { in generic_netmap_unregister() 244 mbq_safe_purge(&kring->rx_queue); in generic_netmap_unregister() 252 for_each_tx_kring(r, kring, na) { in generic_netmap_unregister() 257 mtx_lock_spin(&kring->tx_event_lock); in generic_netmap_unregister() 258 if (kring->tx_event) { in generic_netmap_unregister() 259 SET_MBUF_DESTRUCTOR(kring->tx_event, NULL, NULL); in generic_netmap_unregister() 261 kring->tx_event = NULL; in generic_netmap_unregister() 262 mtx_unlock_spin(&kring->tx_event_lock); in generic_netmap_unregister() 268 for_each_rx_kring(r, kring, na) { in generic_netmap_unregister() [all …]
|
H A D | netmap.c | 808 static int netmap_txsync_to_host(struct netmap_kring *kring, int flags); 809 static int netmap_rxsync_from_host(struct netmap_kring *kring, int flags); 812 netmap_default_bufcfg(struct netmap_kring *kring, uint64_t target) in netmap_default_bufcfg() argument 814 kring->hwbuf_len = target; in netmap_default_bufcfg() 815 kring->buf_align = 0; /* no alignment */ in netmap_default_bufcfg() 848 struct netmap_kring *kring; in netmap_krings_create() local 876 kring = (struct netmap_kring *)((char *)na->tailroom + tailroom); in netmap_krings_create() 878 na->tx_rings[i] = kring; in netmap_krings_create() 879 kring++; in netmap_krings_create() 889 kring = NMR(na, t)[i]; in netmap_krings_create() [all …]
|
H A D | netmap_kloop.c | 134 sync_kloop_kring_dump(const char *title, const struct netmap_kring *kring) in sync_kloop_kring_dump() argument 138 title, kring->name, kring->nr_hwcur, kring->rhead, in sync_kloop_kring_dump() 139 kring->rcur, kring->rtail, kring->nr_hwtail); in sync_kloop_kring_dump() 146 struct netmap_kring *kring; member 161 struct netmap_kring *kring = a->kring; in netmap_sync_kloop_tx_ring() local 171 if (unlikely(nm_kr_tryget(kring, 1, NULL))) { in netmap_sync_kloop_tx_ring() 175 num_slots = kring->nkr_num_slots; in netmap_sync_kloop_tx_ring() 185 batch = shadow_ring.head - kring->nr_hwcur; in netmap_sync_kloop_tx_ring() 193 uint32_t head_lim = kring->nr_hwcur + PTN_TX_BATCH_LIM(num_slots); in netmap_sync_kloop_tx_ring() 204 if (nm_kr_txspace(kring) <= (num_slots >> 1)) { in netmap_sync_kloop_tx_ring() [all …]
|
H A D | if_vtnet_netmap.h | 58 vtnet_netmap_txsync(struct netmap_kring *kring, int flags) in vtnet_netmap_txsync() argument 60 struct netmap_adapter *na = kring->na; in vtnet_netmap_txsync() 62 struct netmap_ring *ring = kring->ring; in vtnet_netmap_txsync() 63 u_int ring_nr = kring->ring_id; in vtnet_netmap_txsync() 65 u_int const lim = kring->nkr_num_slots - 1; in vtnet_netmap_txsync() 66 u_int const head = kring->rhead; in vtnet_netmap_txsync() 72 int interrupts = !(kring->nr_kflags & NKR_NOINTR); in vtnet_netmap_txsync() 79 nm_i = kring->nr_hwcur; in vtnet_netmap_txsync() 86 uint64_t offset = nm_get_offset(kring, slot); in vtnet_netmap_txsync() 109 kring->name, err); in vtnet_netmap_txsync() [all …]
|
H A D | if_re_netmap.h | 69 re_netmap_txsync(struct netmap_kring *kring, int flags) in re_netmap_txsync() argument 71 struct netmap_adapter *na = kring->na; in re_netmap_txsync() 73 struct netmap_ring *ring = kring->ring; in re_netmap_txsync() 77 u_int const lim = kring->nkr_num_slots - 1; in re_netmap_txsync() 78 u_int const head = kring->rhead; in re_netmap_txsync() 91 nm_i = kring->nr_hwcur; in re_netmap_txsync() 133 kring->nr_hwcur = head; in re_netmap_txsync() 147 if (flags & NAF_FORCE_RECLAIM || nm_kr_txempty(kring)) { in re_netmap_txsync() 159 kring->nr_hwtail = nm_prev(netmap_idx_n2k(kring, nic_i), lim); in re_netmap_txsync() 171 re_netmap_rxsync(struct netmap_kring *kring, int flags) in re_netmap_rxsync() argument [all …]
|
H A D | netmap_bdg.c | 723 struct netmap_kring **kring0, *kring; in netmap_bwrap_polling() local 733 kring = kring0[i]; in netmap_bwrap_polling() 734 kring->nm_notify(kring, 0); in netmap_bwrap_polling() 1096 netmap_vp_rxsync_locked(struct netmap_kring *kring, int flags) in netmap_vp_rxsync_locked() argument 1098 struct netmap_adapter *na = kring->na; in netmap_vp_rxsync_locked() 1099 struct netmap_ring *ring = kring->ring; in netmap_vp_rxsync_locked() 1100 u_int nm_i, lim = kring->nkr_num_slots - 1; in netmap_vp_rxsync_locked() 1101 u_int head = kring->rhead; in netmap_vp_rxsync_locked() 1106 n = netmap_ring_reinit(kring); in netmap_vp_rxsync_locked() 1114 nm_i = kring->nr_hwcur; in netmap_vp_rxsync_locked() [all …]
|
H A D | netmap_vale.c | 193 struct netmap_kring **kring; in nm_free_bdgfwd() local 197 kring = na->tx_rings; in nm_free_bdgfwd() 199 if (kring[i]->nkr_ft) { in nm_free_bdgfwd() 200 nm_os_free(kring[i]->nkr_ft); in nm_free_bdgfwd() 201 kring[i]->nkr_ft = NULL; /* protect from freeing twice */ in nm_free_bdgfwd() 214 struct netmap_kring **kring; in nm_alloc_bdgfwd() local 224 kring = na->tx_rings; in nm_alloc_bdgfwd() 240 kring[i]->nkr_ft = ft; in nm_alloc_bdgfwd() 482 nm_vale_preflush(struct netmap_kring *kring, u_int end) in nm_vale_preflush() argument 485 (struct netmap_vp_adapter*)kring->na; in nm_vale_preflush() [all …]
|
H A D | netmap_pipe.c | 398 struct netmap_kring *kring = NMR(na, t)[i]; in netmap_pipe_reg_both() local 400 if (nm_kring_pending_on(kring)) { in netmap_pipe_reg_both() 402 kring->pipe->nr_kflags |= NKR_NEEDRING; in netmap_pipe_reg_both() 418 struct netmap_kring *kring = NMR(na, t)[i]; in netmap_pipe_reg_both() local 419 if (nm_kring_pending_on(kring)) { in netmap_pipe_reg_both() 421 kring->nr_mode = NKR_NETMAP_ON; in netmap_pipe_reg_both() 422 if ((kring->nr_kflags & NKR_FAKERING) && in netmap_pipe_reg_both() 423 (kring->pipe->nr_kflags & NKR_FAKERING)) { in netmap_pipe_reg_both() 434 memcpy(kring->pipe->ring->slot, in netmap_pipe_reg_both() 435 kring->ring->slot, in netmap_pipe_reg_both() [all …]
|
H A D | if_ptnet.c | 211 static int ptnet_nm_txsync(struct netmap_kring *kring, int flags); 212 static int ptnet_nm_rxsync(struct netmap_kring *kring, int flags); 218 static unsigned ptnet_rx_discard(struct netmap_kring *kring, 1124 struct netmap_kring *kring; in ptnet_sync_from_csb() local 1127 kring = na->tx_rings[i]; in ptnet_sync_from_csb() 1129 kring = na->rx_rings[i - na->num_tx_rings]; in ptnet_sync_from_csb() 1131 kring->rhead = kring->ring->head = atok->head; in ptnet_sync_from_csb() 1132 kring->rcur = kring in ptnet_sync_from_csb() 1238 ptnet_nm_txsync(struct netmap_kring * kring,int flags) ptnet_nm_txsync() argument 1253 ptnet_nm_rxsync(struct netmap_kring * kring,int flags) ptnet_nm_rxsync() argument 1339 ptnet_ring_update(struct ptnet_queue * pq,struct netmap_kring * kring,unsigned int head,unsigned int sync_flags) ptnet_ring_update() argument 1380 struct netmap_kring *kring; ptnet_drain_transmit_queue() local 1616 ptnet_rx_discard(struct netmap_kring * kring,unsigned int head) ptnet_rx_discard() argument 1678 struct netmap_kring *kring = na->rx_rings[pq->kring_id]; ptnet_rx_eof() local [all...] |
H A D | netmap_kern.h | 527 int (*nm_sync)(struct netmap_kring *kring, int flags); 528 int (*nm_notify)(struct netmap_kring *kring, int flags); 565 int (*nm_bufcfg)(struct netmap_kring *kring, uint64_t target); 567 int (*save_notify)(struct netmap_kring *kring, int flags); 585 int (*mon_sync)(struct netmap_kring *kring, int flags); 586 int (*mon_notify)(struct netmap_kring *kring, int flags); 598 nm_kring_pending_on(struct netmap_kring *kring) in nm_kring_pending_on() argument 600 return kring->nr_pending_mode == NKR_NETMAP_ON && in nm_kring_pending_on() 601 kring->nr_mode == NKR_NETMAP_OFF; in nm_kring_pending_on() 606 nm_kring_pending_off(struct netmap_kring *kring) in nm_kring_pending_off() argument [all …]
|
H A D | netmap_mem2.c | 1964 netmap_mem_ring_needed(struct netmap_kring *kring) in netmap_mem_ring_needed() argument 1966 return kring->ring == NULL && in netmap_mem_ring_needed() 1967 (kring->users > 0 || in netmap_mem_ring_needed() 1968 (kring->nr_kflags & NKR_NEEDRING)); in netmap_mem_ring_needed() 1972 netmap_mem_ring_todelete(struct netmap_kring *kring) in netmap_mem_ring_todelete() argument 1974 return kring->ring != NULL && in netmap_mem_ring_todelete() 1975 kring->users == 0 && in netmap_mem_ring_todelete() 1976 !(kring->nr_kflags & NKR_NEEDRING); in netmap_mem_ring_todelete() 1996 struct netmap_kring *kring = NMR(na, t)[i]; in netmap_mem2_rings_create() local 1997 struct netmap_ring *ring = kring->ring; in netmap_mem2_rings_create() [all …]
|
H A D | netmap_bdg.h | 181 int netmap_vp_rxsync(struct netmap_kring *kring, int flags); 182 int netmap_bwrap_intr_notify(struct netmap_kring *kring, int flags); 183 int netmap_bwrap_notify(struct netmap_kring *kring, int flags);
|
H A D | netmap_null.c | 76 netmap_null_sync(struct netmap_kring *kring, int flags) in netmap_null_sync() argument 78 (void)kring; in netmap_null_sync()
|
/freebsd/sys/dev/ena/ |
H A D | ena_netmap.c | 41 struct netmap_kring *kring; member 108 struct netmap_kring *kring; in ena_netmap_alloc_rx_slot() local 120 kring = na->rx_rings[qid]; in ena_netmap_alloc_rx_slot() 121 nm_i = kring->nr_hwcur; in ena_netmap_alloc_rx_slot() 122 head = kring->rhead; in ena_netmap_alloc_rx_slot() 126 kring->nr_hwcur, kring->nr_hwtail, kring->rhead, kring->rcur, in ena_netmap_alloc_rx_slot() 127 kring->rtail); in ena_netmap_alloc_rx_slot() 135 ring = kring->ring; in ena_netmap_alloc_rx_slot() 162 lim = kring->nkr_num_slots - 1; in ena_netmap_alloc_rx_slot() 163 kring->nr_hwcur = nm_next(nm_i, lim); in ena_netmap_alloc_rx_slot() [all …]
|
/freebsd/sys/dev/cxgbe/ |
H A D | t4_netmap.c | 516 struct netmap_kring *kring; in cxgbe_netmap_simple_rss() local 528 kring = na->rx_rings[nm_rxq->nid]; in cxgbe_netmap_simple_rss() 529 if ((nm_state != NM_OFF && !nm_kring_pending_off(kring)) || in cxgbe_netmap_simple_rss() 530 (nm_state == NM_OFF && nm_kring_pending_on(kring))) { in cxgbe_netmap_simple_rss() 547 kring = na->rx_rings[nm_rxq->nid]; in cxgbe_netmap_simple_rss() 549 !nm_kring_pending_off(kring)) || in cxgbe_netmap_simple_rss() 551 nm_kring_pending_on(kring))) { in cxgbe_netmap_simple_rss() 584 struct netmap_kring *kring; in cxgbe_netmap_split_rss() local 597 kring = na->rx_rings[nm_rxq->nid]; in cxgbe_netmap_split_rss() 598 if ((nm_state != NM_OFF && !nm_kring_pending_off(kring)) || in cxgbe_netmap_split_rss() [all …]
|
/freebsd/sys/net/ |
H A D | iflib.c | 768 static int netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring *kring, bool init); 858 netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring *kring, bool init) in netmap_fl_refill() argument 860 struct netmap_adapter *na = kring->na; in netmap_fl_refill() 861 u_int const lim = kring->nkr_num_slots - 1; in netmap_fl_refill() 862 struct netmap_ring *ring = kring->ring; in netmap_fl_refill() 891 n = kring->nkr_num_slots - nm_kr_rxspace(kring); in netmap_fl_refill() 893 n = kring->rhead - kring->nr_hwcur; in netmap_fl_refill() 897 n += kring->nkr_num_slots; in netmap_fl_refill() 903 nm_i = netmap_idx_n2k(kring, nic_i); in netmap_fl_refill() 910 MPASS(nm_i == kring->nr_hwtail); in netmap_fl_refill() [all …]
|
/freebsd/sys/dev/virtio/network/ |
H A D | if_vtnet.c | 1501 struct netmap_kring *kring = netmap_kring_on(NA(rxq->vtnrx_sc->vtnet_ifp), in vtnet_rxq_free_mbufs() local 1504 void *kring = NULL; in vtnet_rxq_free_mbufs() local 1511 if (kring == NULL) in vtnet_rxq_free_mbufs() 2337 struct netmap_kring *kring = netmap_kring_on(NA(txq->vtntx_sc->vtnet_ifp), in vtnet_txq_free_mbufs() local 2340 void *kring = NULL; in vtnet_txq_free_mbufs() local 2347 if (kring == NULL) { in vtnet_txq_free_mbufs()
|
/freebsd/sys/dev/ixgbe/ |
H A D | if_ixv.c | 1476 struct netmap_kring *kring = na->rx_rings[j]; in ixv_initialize_receive_units() local 1477 int t = na->num_rx_desc - 1 - nm_kr_rxspace(kring); in ixv_initialize_receive_units()
|
/freebsd/sys/dev/re/ |
H A D | if_re.c | 2946 struct netmap_kring *kring = NA(ifp)->tx_rings[0]; in re_start_locked() local 2947 if (sc->rl_ldata.rl_tx_prodidx != kring->nr_hwcur) { in re_start_locked()
|