Lines Matching refs:port
128 odp_port_t port_no; /* OF port no of this port */
129 odp_port_t pf_port_no; /* OF port no of the PF_PACKET socket */
162 struct dpif_solaris_port *port)
167 struct dpif_solaris_port *port, boolean_t notify)
170 struct dpif_solaris_port *port);
276 /* port related */
321 struct dpif_solaris_port *port, *next;
327 HMAP_FOR_EACH_SAFE(port, next, node, &dpif->ports) {
328 dpif_solaris_port_del__(dpif, port);
409 struct dpif_solaris_port *port;
440 LIST_FOR_EACH(port, uplink_node, &bridge->uplink_port_list) {
441 name = (char *)port->physname;
443 if (strchr(port->physname, '/') != NULL) {
445 port->physname, kstat_name, &zid);
510 struct dpif_solaris_port *port)
518 if (port->vtype != OVS_VPORT_TYPE_NETDEV &&
519 port->vtype != OVS_VPORT_TYPE_VXLAN &&
520 port->vtype != OVS_VPORT_TYPE_INTERNAL)
527 status = dladm_name2info(dpif->dh, port->linkname, &linkid,
544 port->xfd = fd;
546 port->name, port->port_no);
552 * Choose an unused, non-zero port number and return it on success.
554 * The current approach to choose unused port number is quite inefficient,
572 VLOG_DBG("dpif_solaris_choose_port: port no: %d", port_no);
606 * Choose an unused, non-zero port number and return it on success.
608 * The current approach to choose unused port number is quite inefficient,
658 const char *physname, struct dpif_solaris_port *port)
665 VLOG_DBG("dpif_solaris_bridge_add_port adding port %d to uplink %s",
666 port->port_no, physname);
669 brname = port->name;
671 brname = shash_find_data(&port_to_bridge_map, port->name);
691 port->bridge = bridge;
692 hmap_insert(&bridge->ports, &port->brnode,
693 hash_odp_port(port->port_no));
694 VLOG_DBG("dpif_solaris_bridge_add_port add port %s portno %d to "
695 "bridge %s", port->name, port->port_no, brname);
697 if ((port->is_uplink) && (port->vtype != OVS_VPORT_TYPE_VXLAN)) {
698 VLOG_DBG("Insert port %s into bridge %s uplink_port_list",
699 port->name, bridge->name);
700 list_push_back(&bridge->uplink_port_list, &port->uplink_node);
708 struct dpif_solaris_port *port)
711 struct dpif_solaris_bridge *bridge = port->bridge;
715 VLOG_DBG("dpif_solaris_bridge_del_port port %d not assigned "
716 "to a bridge", port->port_no);
719 VLOG_DBG("dpif_solaris_bridge_del_port deleting port %d from %s",
720 port->port_no, bridge->name);
724 if ((port->is_uplink) && (port->vtype != OVS_VPORT_TYPE_VXLAN)) {
727 * is to remove the uplink port from bridge's uplink_port_list.
730 if (strcmp(i_port->name, port->name) == 0) {
731 list_remove(&port->uplink_node);
741 hmap_remove(&bridge->ports, &port->brnode);
763 struct dpif_solaris_port *port = NULL;
771 VLOG_WARN_RL(&error_rl, "%s: cannot create port `%s' because "
792 VLOG_DBG("dpif_solaris_port_add primary port %s",
803 VLOG_DBG("dpif_solaris_port_add non-primary port "
835 port = xzalloc(sizeof (*port));
836 port->port_no = *port_nop;
837 port->pf_port_no = ODPP_NONE;
838 port->name = xstrdup(name);
839 port->linkname = xstrdup(linkname);
840 port->physname = xstrdup(physname);
841 port->type = xstrdup(type);
842 port->vtype = vtype;
843 port->netdev = netdev;
844 port->upcall_fd = -1;
845 port->xfd = -1;
846 port->is_uplink = is_uplink;
851 error = dpif_solaris_create_xsocket(dpif, port);
854 port->linkname, ovs_strerror(error));
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));
876 if (port != NULL) {
877 if (port->xfd != -1)
878 (void) close(port->xfd);
879 dpif_solaris_destroy_port_channel(dpif, port);
880 free(port->name);
881 free(port->linkname);
882 free(port->type);
883 free(port->physname);
884 free(port);
919 struct dpif_solaris_port *port;
926 HMAP_FOR_EACH_WITH_HASH(port, node,
928 if (port->port_no == port_no) {
929 *portp = port;
943 struct dpif_solaris_port *port, *uport;
946 HMAP_FOR_EACH(port, node, &dpif->ports)
947 if (port->port_no == port_no)
950 if (port == NULL)
954 *vtypep = port->vtype;
958 strcmp(port->physname, uport->linkname) == 0) {
975 struct dpif_solaris_port *port)
978 VLOG_DBG("dpif_solaris_port_del__ port %s # %d", port->name,
979 port->port_no);
981 hmap_remove(&dpif->ports, &port->node);
982 dpif_solaris_bridge_del_port(dpif, port);
984 if (port->xfd != -1)
985 (void) close(port->xfd);
986 dpif_solaris_destroy_port_channel(dpif, port);
987 if (port->vtype == OVS_VPORT_TYPE_NETDEV || port->vtype ==
988 OVS_VPORT_TYPE_VXLAN || port->vtype == OVS_VPORT_TYPE_INTERNAL) {
989 VLOG_DBG("1.reset portno on %s", port->linkname);
990 (void) solaris_set_dlprop_ulong(port->linkname,
992 if (port->is_uplink) {
993 VLOG_DBG("dpif_solaris_port_del__ primary port "
994 "%s", port->name);
997 VLOG_DBG("dpif_solaris_port_del %s close xfd %d", port->name,
998 port->xfd);
1000 reset_port(port->port_no);
1002 free(port->type);
1003 free(port->name);
1004 free(port->linkname);
1005 free(port->physname);
1006 free(port);
1013 struct dpif_solaris_port *port;
1016 VLOG_DBG("dpif_solaris_port_del port # %d", port_no);
1019 VLOG_ERR("dpif_solaris_port_del invalid port # %d", port_no);
1024 error = dpif_solaris_get_port_by_number(dpif, port_no, &port);
1027 VLOG_ERR("dpif_solaris_port_del port # %d failed %d", port_no,
1031 dpif_solaris_port_del__(dpif, port);
1041 struct dpif_solaris_port *port = NULL;
1045 error = dpif_solaris_get_port_by_number(dpif, port_no, &port);
1048 dpif_port->name = xstrdup(port->name);
1049 dpif_port->type = xstrdup(port->type);
1050 dpif_port->port_no = port->port_no;
1060 struct dpif_solaris_port *port = NULL;
1063 HMAP_FOR_EACH(port, node, &dpif->ports) {
1064 if (strcmp(port->name, devname) == 0) {
1067 dpif_port->type = xstrdup(port->type);
1068 dpif_port->port_no = port->port_no;
1090 struct dpif_solaris_port *port;
1092 port = xzalloc(sizeof (struct dpif_solaris_port));
1093 port->name = xstrdup(name);
1094 port->type = type;
1095 port->port_no = portno;
1097 hmap_insert(&state->ports, &port->node, hash_odp_port(port->port_no));
1125 struct dpif_solaris_port *port;
1127 port = CONTAINER_OF(node, struct dpif_solaris_port, node);
1130 state->name = xstrdup(port->name);
1132 dpif_port->type = port->type;
1133 dpif_port->port_no = port->port_no;
1147 struct dpif_solaris_port *port, *next;
1150 HMAP_FOR_EACH_SAFE(port, next, node, &state->ports) {
1151 free(port->name);
1152 hmap_remove(&state->ports, &port->node);
1215 * above because "everything" only includes the 16-bit OpenFlow port
1217 * datapath port number mask->in_port.odp_port.
1452 struct dpif_solaris_port *port = NULL;
1460 error = dpif_solaris_get_port_by_number(dpif, outport, &port);
1464 "failed to get port %d\n", outport);
1468 netdev = port->netdev;
1504 struct dpif_solaris_port *port = NULL;
1550 &port);
1560 (void) strlcpy(physname, port->physname, sizeof (physname));
1561 (void) strlcpy(portname, port->name, sizeof (portname));
1588 "(port:%s)%d", flowname, physname, portname, error);
1597 "(port:%s)", flowname, physname, portname);
2133 * Migrate the internal port to a different lower link, sets its physname, and
2134 * refresh its port channel.
2136 * Note that the internal port's name is the same as bridge name
2142 struct dpif_solaris_port *port;
2145 VLOG_DBG("dpif_solaris_migrate_internal_port port %s on %s", bridge,
2150 HMAP_FOR_EACH(port, node, &dpif->ports) {
2151 if (strcmp(port->name, bridge) != 0)
2153 dpif_solaris_destroy_port_channel(dpif, port);
2154 free(port->physname);
2155 port->physname = xstrdup(physname);
2156 err = dpif_solaris_refresh_port_channel(dpif, port,
2196 * if the in or outport is the internal port, and its uplink
2273 "port %d which is not associated with a "
2344 struct dpif_solaris_port *port)
2349 if (port->upcall_fd == -1)
2352 VLOG_DBG("dpif_solaris_destroy_port_channel port %s lower-link %s",
2353 port->linkname, port->physname);
2354 (void) setsockopt(port->upcall_fd, SOL_PACKET,
2355 PACKET_REM_OF_DEFFLOW, &port->port_no, sizeof (uint32_t));
2356 port->upcall_fd = -1;
2357 port->pf_port_no = ODPP_NONE;
2359 lowerlink = port->lowerlink;
2360 port->lowerlink = NULL;
2370 struct dpif_solaris_port *port;
2378 HMAP_FOR_EACH(port, node, &dpif->ports) {
2379 dpif_solaris_destroy_port_channel(dpif, port);
2392 struct dpif_solaris_port *port, boolean_t notify)
2401 if (!dpif->recv_set || (port->vtype != OVS_VPORT_TYPE_NETDEV &&
2402 port->vtype != OVS_VPORT_TYPE_VXLAN && port->vtype !=
2407 port->linkname, port->port_no, port->physname,
2411 if (strcmp(lowerlink->physname, port->physname) == 0) {
2419 error = dpif_solaris_create_lowerlink(dpif, port->physname,
2423 "%s creation failed %s", port->physname,
2429 idx = port->is_uplink ? 0 :
2435 "%d upcall_fd %d", port->linkname, port->port_no, pf_port_no, fd);
2438 mofport.mop_sport = port->port_no;
2443 "PACKET_ADD_OF_DEFFLOW: %s", port->name,
2449 if (!port->is_uplink)
2452 port->lowerlink = lowerlink;
2453 port->upcall_fd = fd;
2454 port->pf_port_no = pf_port_no;
2456 /* Inform the event_rfd that the port->upcall_fd has been changed */
2457 if (notify && write(dpif->event_wfd, (char *)(&port->port_no),
2460 "notify failed: %s", port->linkname, ovs_strerror(errno));
2528 "PACKET_ADD_OF_DEFFLOW port 0: %s", physname,
2629 struct dpif_solaris_port *port;
2638 * Setup the event pipe to monitor the port changes, so that
2667 HMAP_FOR_EACH(port, node, &dpif->ports) {
2668 error = dpif_solaris_refresh_port_channel(dpif, port, false);