• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/sys/dev/netmap/

Lines Matching defs:hwna

585 	kring0 = NMR(bna->hwna, NR_RX);
779 nma_intr_enable(bna->hwna, 0);
787 nma_intr_enable(bna->hwna, 1);
808 nma_intr_enable(bna->hwna, 1);
1010 netmap_bwrap_attach(const char *nr_name, struct netmap_adapter *hwna,
1013 return ops->bwrap_attach(nr_name, hwna);
1018 * This is used to connect a non-VALE-port netmap_adapter (hwna) to a
1024 * rest of the system and the hwna. The netmap_bwrap_adapter looks like
1026 * translates all callbacks to what the hwna expects.
1031 * passing around the netmap_bwrap_adapter instead of the hwna
1034 * about the hwna. This, however, only happens in interrupt
1035 * handlers, where only the hwna->nm_notify callback is called.
1036 * What the bwrap does is to overwrite the hwna->nm_notify callback
1038 * XXX This assumes that the hwna->nm_notify callback was the
1040 * Any additional action performed by hwna->nm_notify will not be
1052 struct netmap_adapter *hwna = bna->hwna;
1067 hwna->na_vp = bna->saved_na_vp;
1068 hwna->na_hostvp = NULL;
1069 hwna->na_private = NULL;
1070 hwna->na_flags &= ~NAF_BUSY;
1071 netmap_adapter_put(hwna);
1090 * callback that overwrites the hwna notify callback.
1092 * hwna rx ring.
1164 struct netmap_adapter *hwna = bna->hwna;
1174 * memory allocator down to the hwna before
1177 hwna->na_lut = na->na_lut;
1192 NMR(hwna, nm_txrx_swap(t))[i]->nr_pending_mode =
1197 /* forward the request to the hwna */
1198 error = hwna->nm_register(hwna, onoff);
1205 struct netmap_kring *kring = NMR(hwna, nm_txrx_swap(t))[i];
1217 /* intercept the hwna nm_nofify callback on the hw rings */
1218 for (i = 0; i < hwna->num_rx_rings; i++) {
1219 hwna->rx_rings[i]->save_notify = hwna->rx_rings[i]->nm_notify;
1220 hwna->rx_rings[i]->nm_notify = netmap_bwrap_intr_notify;
1222 i = hwna->num_rx_rings; /* for safety */
1224 for (; i < netmap_real_rings(hwna, NR_RX); i++) {
1225 hwna->rx_rings[i]->save_notify =
1226 hwna->rx_rings[i]->nm_notify;
1229 hwna->rx_rings[i]->nm_notify =
1243 for (i = 0; i < netmap_all_rings(hwna, NR_RX); i++) {
1244 hwna->rx_rings[i]->nm_notify =
1245 hwna->rx_rings[i]->save_notify;
1246 hwna->rx_rings[i]->save_notify = NULL;
1248 hwna->na_lut.lut = NULL;
1249 hwna->na_lut.plut = NULL;
1250 hwna->na_lut.objtotal = 0;
1251 hwna->na_lut.objsize = 0;
1253 /* pass ownership of the netmap rings to the hwna */
1261 nma_set_host_nrings(hwna, t, 1);
1275 struct netmap_adapter *hwna = bna->hwna;
1278 /* Forward the request to the hwna. It may happen that nobody
1279 * registered hwna yet, so netmap_mem_get_lut() may have not
1281 error = netmap_mem_get_lut(hwna->nm_mem, &hwna->na_lut);
1284 netmap_update_config(hwna);
1286 info->num_tx_rings = hwna->num_rx_rings;
1287 info->num_tx_descs = hwna->num_rx_desc;
1288 info->num_rx_rings = hwna->num_tx_rings;
1289 info->num_rx_descs = hwna->num_tx_desc;
1290 info->rx_buf_maxsize = hwna->rx_buf_maxsize;
1302 struct netmap_adapter *hwna = bna->hwna;
1307 /* also create the hwna krings */
1308 error = hwna->nm_krings_create(hwna);
1313 /* increment the usage counter for all the hwna krings */
1315 for (i = 0; i < netmap_all_rings(hwna, t); i++) {
1316 NMR(hwna, t)[i]->users++;
1321 error = netmap_mem_rings_create(hwna);
1327 * The original number of rings comes from hwna,
1332 for (i = 0; i < netmap_all_rings(hwna, r); i++) {
1333 NMR(na, t)[i]->nkr_num_slots = NMR(hwna, r)[i]->nkr_num_slots;
1334 NMR(na, t)[i]->ring = NMR(hwna, r)[i]->ring;
1356 for (i = 0; i < netmap_all_rings(hwna, t); i++) {
1357 NMR(hwna, t)[i]->users--;
1360 hwna->nm_krings_delete(hwna);
1370 struct netmap_adapter *hwna = bna->hwna;
1376 /* decrement the usage counter for all the hwna krings */
1378 for (i = 0; i < netmap_all_rings(hwna, t); i++) {
1379 NMR(hwna, t)[i]->users--;
1384 netmap_mem_rings_delete(hwna);
1385 hwna->nm_krings_delete(hwna);
1389 /* notify method for the bridge-->hwna direction */
1395 struct netmap_adapter *hwna = bna->hwna;
1401 nm_prdis("%s: na %s hwna %s",
1404 (hwna ? hwna->name : "NULL!"));
1405 hw_kring = hwna->tx_rings[ring_n];
1448 * bwrap and the hwna in netmap mode, with the netmap rings shared
1450 * directed to hwna.
1501 struct netmap_adapter *hwna)
1509 if (NETMAP_OWNED_BY_ANY(hwna)) {
1510 nm_prerr("NIC %s busy, cannot attach to bridge", hwna->name);
1516 na->ifp = hwna->ifp;
1525 nma_set_nrings(na, t, nma_get_nrings(hwna, r));
1526 nma_set_ndesc(na, t, nma_get_ndesc(hwna, r));
1531 na->pdev = hwna->pdev;
1532 na->nm_mem = netmap_mem_get(hwna->nm_mem);
1533 na->virt_hdr_len = hwna->virt_hdr_len;
1534 na->rx_buf_maxsize = hwna->rx_buf_maxsize;
1536 bna->hwna = hwna;
1537 netmap_adapter_get(hwna);
1538 hwna->na_private = bna; /* weak reference */
1539 bna->saved_na_vp = hwna->na_vp;
1540 hwna->na_vp = &bna->up;
1543 if (hwna->na_flags & NAF_HOST_RINGS) {
1544 if (hwna->na_flags & NAF_SW_ONLY)
1551 nma_get_nrings(hwna, NR_TX), NULL);
1553 nma_get_nrings(hwna, NR_RX), NULL);
1556 hostna->ifp = hwna->ifp;
1563 if (nma_get_host_nrings(hwna, t) < nr) {
1564 nma_set_host_nrings(hwna, t, nr);
1566 nma_set_ndesc(hostna, t, nma_get_ndesc(hwna, r));
1573 na->na_hostvp = hwna->na_hostvp =
1576 hostna->rx_buf_maxsize = hwna->rx_buf_maxsize;
1578 if (hwna->na_flags & NAF_MOREFRAG)
1590 hwna->na_flags |= NAF_BUSY;
1594 hwna->na_vp = hwna->na_hostvp = NULL;
1595 netmap_adapter_put(hwna);