Lines Matching refs:dpif
22 #include "dpif-solaris.h"
27 #include "dpif-provider.h"
62 struct dpif dpif;
161 static void dpif_solaris_port_del__(struct dpif_solaris *dpif,
163 OVS_REQ_WRLOCK(dpif->port_rwlock);
164 static void dpif_solaris_destroy_channels(struct dpif_solaris *dpif)
165 OVS_REQ_WRLOCK(dpif->upcall_lock);
166 static int dpif_solaris_refresh_port_channel(struct dpif_solaris *dpif,
168 OVS_REQ_WRLOCK(dpif->port_rwlock);
169 static void dpif_solaris_destroy_port_channel(struct dpif_solaris *dpif,
171 static int dpif_solaris_get_port_by_number(struct dpif_solaris *dpif,
173 OVS_REQ_RDLOCK(dpif->port_rwlock);
174 static int dpif_solaris_get_uplink_port_info(struct dpif_solaris *dpif,
177 static void dpif_solaris_flow_remove(struct dpif_solaris *dpif,
179 OVS_REQ_WRLOCK(dpif->flow_rwlock);
180 static int dpif_solaris_flow_flush__(struct dpif_solaris *dpif);
181 static void dpif_solaris_destroy_lowerlink(struct dpif_solaris *dpif,
183 static int dpif_solaris_create_lowerlink(struct dpif_solaris *dpif,
187 dpif_solaris_cast(const struct dpif *dpif)
189 dpif_assert_class(dpif, &dpif_solaris_class);
190 return (CONTAINER_OF(dpif, struct dpif_solaris, dpif));
213 bool create, struct dpif **dpifp)
215 struct dpif_solaris *dpif;
233 dpif = shash_find_data(&dp_all_solaris, name);
238 * dpif does not exists at first, create it here if dp_exists indicate
242 if ((dp_exists && dpif == NULL) || (!dp_exists && create)) {
261 dpif = xzalloc(sizeof (*dpif));
262 dpif->dh = dh;
263 dpif->dp_ifindex = getzoneid();
264 dpif->class = class;
265 dpif->name = xstrdup(name);
266 atomic_flag_clear(&dpif->destroyed);
269 ovs_rwlock_init(&dpif->upcall_lock);
270 dpif->recv_set = false;
273 ovs_rwlock_init(&dpif->bridge_rwlock);
274 hmap_init(&dpif->bridges);
277 ovs_rwlock_init(&dpif->port_rwlock);
278 hmap_init(&dpif->ports);
279 hmap_init(&dpif->lowerlinks);
280 dpif->event_rfd = dpif->event_wfd = -1;
281 dpif->n_handlers = 0;
284 ovs_rwlock_init(&dpif->flow_rwlock);
285 classifier_init(&dpif->cls, NULL);
286 hmap_init(&dpif->flows);
288 ovs_refcount_init(&dpif->ref_cnt);
289 shash_add(&dp_all_solaris, name, dpif);
291 ovs_refcount_ref(&dpif->ref_cnt);
297 error = (dpif->class != class ? EOPNOTSUPP :
302 ovs_refcount_ref(&dpif->ref_cnt);
305 dpif_init(&dpif->dpif, class, name, dpif->dp_ifindex,
306 dpif->dp_ifindex);
307 *dpifp = &dpif->dpif;
318 dp_solaris_free(struct dpif_solaris *dpif)
323 VLOG_DBG("dp_solaris_free %s", dpif->name);
325 shash_find_and_delete(&dp_all_solaris, dpif->name);
326 ovs_rwlock_wrlock(&dpif->port_rwlock);
327 HMAP_FOR_EACH_SAFE(port, next, node, &dpif->ports) {
328 dpif_solaris_port_del__(dpif, port);
330 ovs_assert(hmap_count(&dpif->lowerlinks) == 0);
331 ovs_rwlock_unlock(&dpif->port_rwlock);
333 dpif_solaris_flow_flush__(dpif);
334 classifier_destroy(&dpif->cls);
336 hmap_destroy(&dpif->bridges);
337 ovs_rwlock_destroy(&dpif->bridge_rwlock);
339 hmap_destroy(&dpif->ports);
340 hmap_destroy(&dpif->lowerlinks);
341 ovs_rwlock_destroy(&dpif->port_rwlock);
343 hmap_destroy(&dpif->flows);
344 ovs_rwlock_destroy(&dpif->flow_rwlock);
346 (void) close(dpif->event_rfd);
347 (void) close(dpif->event_wfd);
349 free(dpif->name);
350 dladm_close(dpif->dh);
352 ovs_rwlock_destroy(&dpif->upcall_lock);
353 free(dpif);
357 dp_solaris_unref(struct dpif_solaris *dpif)
359 if (dpif != NULL) {
361 * Take dp_solaris_mutex so that, if dpif->ref_cnt falls to
362 * zero, we can't get a hold of 'dpif'.
366 if (ovs_refcount_unref(&dpif->ref_cnt) == 2) {
367 dp_solaris_free(dpif);
374 dpif_solaris_close(struct dpif *dpif_)
376 struct dpif_solaris *dpif = dpif_solaris_cast(dpif_);
378 VLOG_DBG("dpif_solaris_close %s", dpif->name);
380 ovs_rwlock_wrlock(&dpif->upcall_lock);
381 dpif_solaris_destroy_channels(dpif);
382 ovs_rwlock_unlock(&dpif->upcall_lock);
384 dp_solaris_unref(dpif);
388 dpif_solaris_destroy(struct dpif *dpif_)
390 struct dpif_solaris *dpif = dpif_solaris_cast(dpif_);
393 VLOG_DBG("dpif_solaris_destroy %s", dpif->name);
394 if (!atomic_flag_test_and_set(&dpif->destroyed)) {
395 cnt = ovs_refcount_unref(&dpif->ref_cnt);
405 dpif_solaris_get_stats(const struct dpif *dpif_, struct dpif_dp_stats *stats)
407 struct dpif_solaris *dpif = dpif_solaris_cast(dpif_);
437 ovs_rwlock_rdlock(&dpif->bridge_rwlock);
438 HMAP_FOR_EACH(bridge, node, &dpif->bridges) {
454 ovs_rwlock_unlock(&dpif->bridge_rwlock);
467 ovs_rwlock_unlock(&dpif->bridge_rwlock);
468 ovs_rwlock_rdlock(&dpif->port_rwlock);
469 HMAP_FOR_EACH(lowerlink, node, &dpif->lowerlinks) {
474 ovs_rwlock_unlock(&dpif->port_rwlock);
484 ovs_rwlock_unlock(&dpif->port_rwlock);
509 dpif_solaris_create_xsocket(struct dpif_solaris *dpif OVS_UNUSED,
527 status = dladm_name2info(dpif->dh, port->linkname, &linkid,
589 pf_port_no_used(struct dpif_solaris *dpif, uint32_t pf_port_no)
594 HMAP_FOR_EACH(lowerlink, node, &dpif->lowerlinks) {
612 choose_pf_port(struct dpif_solaris *dpif,
621 if (pf_port_no_used(dpif, pf_port_no))
641 dpif_solaris_lookup_bridge(const struct dpif_solaris *dpif,
643 OVS_REQ_RDLOCK(dpif->bridge_rwlock)
647 HMAP_FOR_EACH(bridge, node, &dpif->bridges) {
657 dpif_solaris_bridge_add_port(struct dpif_solaris *dpif,
659 OVS_REQ_WRLOCK(dpif->port_rwlock)
664 ovs_rwlock_wrlock(&dpif->bridge_rwlock);
680 bridge = dpif_solaris_lookup_bridge(dpif, brname);
686 hmap_insert(&dpif->bridges, &bridge->node,
702 ovs_rwlock_unlock(&dpif->bridge_rwlock);
707 dpif_solaris_bridge_del_port(struct dpif_solaris *dpif,
709 OVS_REQ_WRLOCK(dpif->port_rwlock)
722 ovs_rwlock_wrlock(&dpif->bridge_rwlock);
746 hmap_remove(&dpif->bridges, &bridge->node);
750 ovs_rwlock_unlock(&dpif->bridge_rwlock);
754 dpif_solaris_port_add__(struct dpif_solaris *dpif, struct netdev *netdev,
772 "it has unsupported type `%s'", dpif_name(&dpif->dpif),
810 ovs_rwlock_wrlock(&dpif->upcall_lock);
848 ovs_rwlock_wrlock(&dpif->port_rwlock);
851 error = dpif_solaris_create_xsocket(dpif, port);
859 error = dpif_solaris_refresh_port_channel(dpif, port, true);
868 (void) dpif_solaris_bridge_add_port(dpif, physname, port);
870 hmap_insert(&dpif->ports, &port->node, hash_odp_port(port->port_no));
871 ovs_rwlock_unlock(&dpif->port_rwlock);
872 ovs_rwlock_unlock(&dpif->upcall_lock);
879 dpif_solaris_destroy_port_channel(dpif, port);
887 ovs_rwlock_unlock(&dpif->port_rwlock);
899 ovs_rwlock_unlock(&dpif->upcall_lock);
904 dpif_solaris_port_add(struct dpif *dpif_, struct netdev *netdev,
907 struct dpif_solaris *dpif = dpif_solaris_cast(dpif_);
910 error = dpif_solaris_port_add__(dpif, netdev, port_nop);
915 dpif_solaris_get_port_by_number(struct dpif_solaris *dpif, odp_port_t port_no,
917 OVS_REQ_RDLOCK(dpif->port_rwlock)
927 hash_odp_port(port_no), &dpif->ports) {
939 dpif_solaris_get_uplink_port_info(struct dpif_solaris *dpif,
945 ovs_rwlock_rdlock(&dpif->port_rwlock);
946 HMAP_FOR_EACH(port, node, &dpif->ports)
956 HMAP_FOR_EACH(uport, node, &dpif->ports) {
963 ovs_rwlock_unlock(&dpif->port_rwlock);
969 ovs_rwlock_unlock(&dpif->port_rwlock);
974 dpif_solaris_port_del__(struct dpif_solaris *dpif,
976 OVS_REQ_WRLOCK(dpif->port_rwlock)
981 hmap_remove(&dpif->ports, &port->node);
982 dpif_solaris_bridge_del_port(dpif, port);
986 dpif_solaris_destroy_port_channel(dpif, port);
1010 dpif_solaris_port_del(struct dpif *dpif_, odp_port_t port_no)
1012 struct dpif_solaris *dpif = dpif_solaris_cast(dpif_);
1023 ovs_rwlock_wrlock(&dpif->port_rwlock);
1024 error = dpif_solaris_get_port_by_number(dpif, port_no, &port);
1026 ovs_rwlock_unlock(&dpif->port_rwlock);
1031 dpif_solaris_port_del__(dpif, port);
1032 ovs_rwlock_unlock(&dpif->port_rwlock);
1037 dpif_solaris_port_query_by_number(const struct dpif *dpif_, odp_port_t port_no,
1040 struct dpif_solaris *dpif = dpif_solaris_cast(dpif_);
1044 ovs_rwlock_rdlock(&dpif->port_rwlock);
1045 error = dpif_solaris_get_port_by_number(dpif, port_no, &port);
1046 ovs_rwlock_unlock(&dpif->port_rwlock);
1056 dpif_solaris_port_query_by_name(const struct dpif *dpif_, const char *devname,
1059 struct dpif_solaris *dpif = dpif_solaris_cast(dpif_);
1062 ovs_rwlock_wrlock(&dpif->port_rwlock);
1063 HMAP_FOR_EACH(port, node, &dpif->ports) {
1070 ovs_rwlock_unlock(&dpif->port_rwlock);
1074 ovs_rwlock_unlock(&dpif->port_rwlock);
1102 dpif_solaris_port_dump_start(const struct dpif *dpif_ OVS_UNUSED,
1115 dpif_solaris_port_dump_next(const struct dpif *dpif_ OVS_UNUSED, void *state_,
1144 dpif_solaris_port_dump_done(const struct dpif *dpif_ OVS_UNUSED, void *state_)
1163 dpif_solaris_port_poll(const struct dpif *dpif_ OVS_UNUSED,
1170 dpif_solaris_port_poll_wait(const struct dpif *dpif_ OVS_UNUSED)
1276 dpif_solaris_lookup_flow(const struct dpif_solaris *dpif,
1278 OVS_EXCLUDED(dpif->cls.rwlock)
1283 fat_rwlock_rdlock(&dpif->cls.rwlock);
1284 rule = classifier_lookup_miniflow_first(&dpif->cls, key);
1286 fat_rwlock_unlock(&dpif->cls.rwlock);
1292 dpif_solaris_find_flow(const struct dpif_solaris *dpif, const struct flow *flow)
1297 &dpif->flows) {
1307 dpif_solaris_find_flow_by_name(const struct dpif_solaris *dpif,
1312 HMAP_FOR_EACH(solaris_flow, node, &dpif->flows) {
1322 dpif_solaris_flow_add(struct dpif_solaris *dpif, const char *physname,
1324 OVS_REQ_WRLOCK(dpif->flow_rwlock)
1337 fat_rwlock_wrlock(&dpif->cls.rwlock);
1339 hmap_insert(&dpif->flows, &solaris_flow->node, flow_hash(flow, 0));
1340 classifier_insert(&dpif->cls, &solaris_flow->cr);
1341 fat_rwlock_unlock(&dpif->cls.rwlock);
1346 dpif_solaris_flow_remove(struct dpif_solaris *dpif,
1347 struct dpif_solaris_flow *solaris_flow) OVS_REQ_WRLOCK(dpif->flow_rwlock)
1352 fat_rwlock_wrlock(&dpif->cls.rwlock);
1355 classifier_remove(&dpif->cls, cr);
1356 hmap_remove(&dpif->flows, node);
1358 fat_rwlock_unlock(&dpif->cls.rwlock);
1380 dpif_solaris_flow_get(const struct dpif *dpif_,
1387 const struct dpif_solaris *dpif = dpif_solaris_cast(dpif_);
1402 ovs_rwlock_rdlock(&dpif->flow_rwlock);
1403 solaris_flow = dpif_solaris_find_flow(dpif, &f);
1405 ovs_rwlock_unlock(&dpif->flow_rwlock);
1411 ovs_rwlock_unlock(&dpif->flow_rwlock);
1451 struct dpif_solaris *dpif = (struct dpif_solaris *)cookie;
1459 ovs_rwlock_wrlock(&dpif->port_rwlock);
1460 error = dpif_solaris_get_port_by_number(dpif, outport, &port);
1461 ovs_rwlock_unlock(&dpif->port_rwlock);
1493 dpif_solaris_flow_put(struct dpif *dpif_, const struct dpif_flow_put *put)
1495 struct dpif_solaris *dpif = dpif_solaris_cast(dpif_);
1532 ovs_rwlock_wrlock(&dpif->flow_rwlock);
1533 solaris_flow = dpif_solaris_lookup_flow(dpif, &miniflow);
1538 ovs_rwlock_unlock(&dpif->flow_rwlock);
1548 ovs_rwlock_rdlock(&dpif->port_rwlock);
1549 error = dpif_solaris_get_port_by_number(dpif, inport,
1553 ovs_rwlock_unlock(&dpif->port_rwlock);
1554 ovs_rwlock_unlock(&dpif->flow_rwlock);
1562 ovs_rwlock_unlock(&dpif->port_rwlock);
1566 solaris_flow = dpif_solaris_flow_add(dpif, physname, &f,
1571 ovs_rwlock_unlock(&dpif->flow_rwlock);
1576 * workaround to passing a struct dpif to
1582 error = solaris_add_flow((void *)dpif,
1589 ovs_rwlock_wrlock(&dpif->flow_rwlock);
1590 dpif_solaris_flow_remove(dpif, solaris_flow);
1591 ovs_rwlock_unlock(&dpif->flow_rwlock);
1602 ovs_rwlock_unlock(&dpif->flow_rwlock);
1606 error = solaris_modify_flow((void *)dpif,
1664 dpif_solaris_flow_del(struct dpif *dpif_, const struct dpif_flow_del *del)
1666 struct dpif_solaris *dpif = dpif_solaris_cast(dpif_);
1685 ovs_rwlock_wrlock(&dpif->flow_rwlock);
1686 solaris_flow = dpif_solaris_find_flow(dpif, &f);
1688 ovs_rwlock_unlock(&dpif->flow_rwlock);
1695 dpif_solaris_flow_remove(dpif, solaris_flow);
1706 ovs_rwlock_unlock(&dpif->flow_rwlock);
1721 dpif_solaris_flow_flush__(struct dpif_solaris *dpif)
1726 ovs_rwlock_wrlock(&dpif->flow_rwlock);
1727 flow_count = hmap_count(&dpif->flows);
1732 HMAP_FOR_EACH_SAFE(solaris_flow, next, node, &dpif->flows) {
1735 dpif_solaris_flow_remove(dpif, solaris_flow);
1737 ovs_rwlock_unlock(&dpif->flow_rwlock);
1750 dpif_solaris_flow_flush(struct dpif *dpif_)
1752 struct dpif_solaris *dpif = dpif_solaris_cast(dpif_);
1753 return (dpif_solaris_flow_flush__(dpif));
1771 struct dpif_solaris *dpif;
1801 struct dpif_solaris *dpif = iter->dpif;
1810 fat_rwlock_rdlock(&dpif->cls.rwlock);
1811 if ((dsflow = dpif_solaris_find_flow_by_name(dpif, name)) != NULL) {
1822 fat_rwlock_unlock(&dpif->cls.rwlock);
1838 dpif_solaris_flow_dump_start(const struct dpif *dpif_, void **iterp)
1840 struct dpif_solaris *dpif = dpif_solaris_cast(dpif_);
1845 iter->dpif = dpif;
1860 dpif_solaris_flow_dump_next(const struct dpif *dpif_ OVS_UNUSED, void *iter_,
1949 dpif_solaris_flow_dump_done(const struct dpif *dpif OVS_UNUSED, void *iter_)
1968 dpif_solaris_port_output(struct dpif_solaris *dpif, odp_port_t port_no,
1985 error = dpif_solaris_get_uplink_port_info(dpif, port_no, NULL,
2045 struct dpif_solaris *dpif = NULL;
2048 dpif = shash_find_data(&dp_all_solaris, dp_name);
2049 if (!dpif) {
2050 VLOG_ERR("get_dp_by_name: couldn't get a hold on dpif for %s",
2054 return (dpif);
2060 struct dpif_solaris *dpif;
2066 dpif = get_dp_by_name("ovs-system");
2067 if (dpif == NULL) {
2071 ovs_rwlock_wrlock(&dpif->bridge_rwlock);
2072 bridge = dpif_solaris_lookup_bridge(dpif, brname);
2076 ovs_rwlock_unlock(&dpif->bridge_rwlock);
2087 ovs_rwlock_unlock(&dpif->bridge_rwlock);
2097 ovs_rwlock_unlock(&dpif->bridge_rwlock);
2121 ovs_rwlock_unlock(&dpif->bridge_rwlock);
2128 ovs_rwlock_unlock(&dpif->bridge_rwlock);
2141 struct dpif_solaris *dpif;
2148 if ((dpif = get_dp_by_name("ovs-system")) != NULL) {
2149 ovs_rwlock_wrlock(&dpif->port_rwlock);
2150 HMAP_FOR_EACH(port, node, &dpif->ports) {
2153 dpif_solaris_destroy_port_channel(dpif, port);
2156 err = dpif_solaris_refresh_port_channel(dpif, port,
2166 ovs_rwlock_unlock(&dpif->port_rwlock);
2174 struct dpif_solaris *dpif = aux_;
2201 err = dpif_solaris_get_uplink_port_info(dpif,
2214 err = dpif_solaris_get_uplink_port_info(dpif, port_no,
2244 (void) dpif_solaris_port_output(dpif, port_no, packet, tnl,
2262 err = dpif_solaris_get_uplink_port_info(dpif,
2285 (void) dpif_solaris_port_output(dpif, pin, packet, tnl,
2305 dpif_solaris_execute(struct dpif *dpif_, struct dpif_execute *execute)
2307 struct dpif_solaris *dpif = dpif_solaris_cast(dpif_);
2317 odp_execute_actions(dpif, execute->packet, false, md, execute->actions,
2323 dpif_solaris_destroy_lowerlink(struct dpif_solaris *dpif,
2325 OVS_REQ_WRLOCK(dpif->port_rwlock)
2331 hmap_remove(&dpif->lowerlinks, &lowerlink->node);
2343 dpif_solaris_destroy_port_channel(struct dpif_solaris *dpif,
2347 ovs_assert(dpif->recv_set);
2363 dpif_solaris_destroy_lowerlink(dpif, lowerlink);
2367 dpif_solaris_destroy_channels(struct dpif_solaris *dpif)
2368 OVS_REQ_WRLOCK(dpif->upcall_lock)
2372 if (!dpif->recv_set)
2377 ovs_rwlock_wrlock(&dpif->port_rwlock);
2378 HMAP_FOR_EACH(port, node, &dpif->ports) {
2379 dpif_solaris_destroy_port_channel(dpif, port);
2381 ovs_rwlock_unlock(&dpif->port_rwlock);
2383 (void) close(dpif->event_rfd);
2384 (void) close(dpif->event_wfd);
2385 dpif->event_rfd = dpif->event_wfd = -1;
2386 dpif->recv_set = false;
2387 dpif->n_handlers = 0;
2391 dpif_solaris_refresh_port_channel(struct dpif_solaris *dpif,
2393 OVS_REQ_WRLOCK(dpif->port_rwlock)
2401 if (!dpif->recv_set || (port->vtype != OVS_VPORT_TYPE_NETDEV &&
2410 HMAP_FOR_EACH(lowerlink, node, &dpif->lowerlinks) {
2419 error = dpif_solaris_create_lowerlink(dpif, port->physname,
2446 dpif_solaris_destroy_lowerlink(dpif, lowerlink);
2457 if (notify && write(dpif->event_wfd, (char *)(&port->port_no),
2467 dpif_solaris_create_upfd(struct dpif_solaris *dpif, const char *physname,
2468 int *upcall_fdp) OVS_REQ_WRLOCK(dpif->port_rwlock)
2477 if (!dpif->recv_set)
2489 status = dladm_name2info(dpif->dh, physname, &linkid,
2550 dpif_solaris_create_lowerlink(struct dpif_solaris *dpif, char *physname,
2552 OVS_REQ_WRLOCK(dpif->port_rwlock)
2558 if (!dpif->recv_set)
2562 "link %s", dpif->n_handlers, physname);
2571 lowerlink->n_handlers = dpif->n_handlers;
2581 err = dpif_solaris_create_upfd(dpif,
2594 choose_pf_port(dpif, lowerlink, i);
2608 hmap_insert(&dpif->lowerlinks, &lowerlink->node,
2615 dpif_solaris_destroy_lowerlink(dpif, lowerlink);
2620 * Synchronizes 'channels' in 'dpif->handlers' with the set of vports
2621 * currently in 'dpif' in the kernel, by adding a new set of channels for
2626 dpif_solaris_refresh_channels(struct dpif_solaris *dpif, uint32_t n_handlers)
2627 OVS_REQ_WRLOCK(dpif->upcall_lock)
2635 dpif_solaris_destroy_channels(dpif);
2661 dpif->n_handlers = n_handlers;
2662 dpif->recv_set = true;
2663 dpif->event_rfd = fds[0];
2664 dpif->event_wfd = fds[1];
2666 ovs_rwlock_wrlock(&dpif->port_rwlock);
2667 HMAP_FOR_EACH(port, node, &dpif->ports) {
2668 error = dpif_solaris_refresh_port_channel(dpif, port, false);
2670 ovs_rwlock_unlock(&dpif->port_rwlock);
2671 dpif_solaris_destroy_channels(dpif);
2675 ovs_rwlock_unlock(&dpif->port_rwlock);
2678 if (write(dpif->event_wfd, (char *)&port_no, sizeof (odp_port_t)) < 0) {
2686 dpif_solaris_recv_set_(struct dpif_solaris *dpif, bool enable)
2688 if (dpif->recv_set == enable)
2692 dpif_solaris_destroy_channels(dpif);
2695 return (dpif_solaris_refresh_channels(dpif, 1));
2700 dpif_solaris_recv_set(struct dpif *dpif_, bool enable)
2702 struct dpif_solaris *dpif = dpif_solaris_cast(dpif_);
2707 ovs_rwlock_wrlock(&dpif->upcall_lock);
2708 dpif_solaris_recv_set_(dpif, enable);
2709 ovs_rwlock_unlock(&dpif->upcall_lock);
2719 dpif_solaris_queue_to_priority(const struct dpif *dpif OVS_UNUSED,
2727 dpif_solaris_parse_pkt(struct dpif_solaris *dpif OVS_UNUSED,
2787 dpif_solaris_recv__(struct dpif_solaris *dpif, uint32_t handler_id OVS_UNUSED,
2789 OVS_REQ_WRLOCK(dpif->upcall_lock)
2803 if (!dpif->recv_set) {
2807 (void) read(dpif->event_rfd, (char *)&port_no,
2810 ovs_rwlock_rdlock(&dpif->port_rwlock);
2811 HMAP_FOR_EACH(lowerlink, node, &dpif->lowerlinks) {
2893 error = dpif_solaris_parse_pkt(dpif, &pkt, &md,
2904 ovs_rwlock_unlock(&dpif->port_rwlock);
2911 ovs_rwlock_unlock(&dpif->port_rwlock);
2916 dpif_solaris_recv(struct dpif *dpif_, uint32_t handler_id,
2919 struct dpif_solaris *dpif = dpif_solaris_cast(dpif_);
2922 ovs_rwlock_rdlock(&dpif->upcall_lock);
2923 error = dpif_solaris_recv__(dpif, handler_id, upcall, buf);
2924 ovs_rwlock_unlock(&dpif->upcall_lock);
2930 dpif_solaris_recv_wait(struct dpif *dpif_, uint32_t handler_id OVS_UNUSED)
2932 struct dpif_solaris *dpif = dpif_solaris_cast(dpif_);
2936 ovs_rwlock_rdlock(&dpif->upcall_lock);
2937 if (!dpif->recv_set)
2940 poll_fd_wait(dpif->event_rfd, POLLIN);
2941 ovs_rwlock_rdlock(&dpif->port_rwlock);
2942 HMAP_FOR_EACH(lowerlink, node, &dpif->lowerlinks) {
2949 ovs_rwlock_unlock(&dpif->port_rwlock);
2951 ovs_rwlock_unlock(&dpif->upcall_lock);
2955 dpif_solaris_recv_purge__(struct dpif_solaris *dpif)
2956 OVS_REQ_WRLOCK(dpif->upcall_lock)
2961 if (!dpif->recv_set)
2964 drain_rcvbuf(dpif->event_rfd);
2965 ovs_rwlock_rdlock(&dpif->port_rwlock);
2966 HMAP_FOR_EACH(lowerlink, node, &dpif->lowerlinks) {
2973 ovs_rwlock_unlock(&dpif->port_rwlock);
2977 dpif_solaris_recv_purge(struct dpif *dpif_)
2979 struct dpif_solaris *dpif = dpif_solaris_cast(dpif_);
2982 ovs_rwlock_wrlock(&dpif->upcall_lock);
2983 dpif_solaris_recv_purge__(dpif);
2984 ovs_rwlock_unlock(&dpif->upcall_lock);
2988 dpif_solaris_handlers_set(struct dpif *dpif_, uint32_t n_handlers)
2990 struct dpif_solaris *dpif = dpif_solaris_cast(dpif_);
2994 ovs_rwlock_wrlock(&dpif->upcall_lock);
2995 if (dpif->recv_set)
2996 err = dpif_solaris_refresh_channels(dpif, n_handlers);
2997 ovs_rwlock_unlock(&dpif->upcall_lock);