| 1072 | } |
| 1073 | |
| 1074 | int |
| 1075 | rte_event_port_profile_unlink(uint8_t dev_id, uint8_t port_id, uint8_t queues[], |
| 1076 | uint16_t nb_unlinks, uint8_t profile_id) |
| 1077 | { |
| 1078 | uint8_t all_queues[RTE_EVENT_MAX_QUEUES_PER_DEV]; |
| 1079 | struct rte_event_dev_info info; |
| 1080 | struct rte_eventdev *dev; |
| 1081 | uint16_t *links_map; |
| 1082 | int i, diag, j; |
| 1083 | |
| 1084 | RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, EINVAL, 0); |
| 1085 | dev = &rte_eventdevs[dev_id]; |
| 1086 | |
| 1087 | if (*dev->dev_ops->dev_infos_get == NULL) |
| 1088 | return -ENOTSUP; |
| 1089 | |
| 1090 | (*dev->dev_ops->dev_infos_get)(dev, &info); |
| 1091 | if (profile_id >= RTE_EVENT_MAX_PROFILES_PER_PORT || |
| 1092 | profile_id >= info.max_profiles_per_port) { |
| 1093 | RTE_EDEV_LOG_ERR("Invalid profile_id=%" PRIu8, profile_id); |
| 1094 | return -EINVAL; |
| 1095 | } |
| 1096 | |
| 1097 | if (*dev->dev_ops->port_unlink == NULL) { |
| 1098 | RTE_EDEV_LOG_ERR("Function not supported"); |
| 1099 | rte_errno = ENOTSUP; |
| 1100 | return 0; |
| 1101 | } |
| 1102 | |
| 1103 | if (profile_id && *dev->dev_ops->port_unlink_profile == NULL) { |
| 1104 | RTE_EDEV_LOG_ERR("Function not supported"); |
| 1105 | rte_errno = ENOTSUP; |
| 1106 | return 0; |
| 1107 | } |
| 1108 | |
| 1109 | if (!is_valid_port(dev, port_id)) { |
| 1110 | RTE_EDEV_LOG_ERR("Invalid port_id=%" PRIu8, port_id); |
| 1111 | rte_errno = EINVAL; |
| 1112 | return 0; |
| 1113 | } |
| 1114 | |
| 1115 | links_map = dev->data->links_map[profile_id]; |
| 1116 | /* Point links_map to this port specific area */ |
| 1117 | links_map += (port_id * RTE_EVENT_MAX_QUEUES_PER_DEV); |
| 1118 | |
| 1119 | if (queues == NULL) { |
| 1120 | j = 0; |
| 1121 | for (i = 0; i < dev->data->nb_queues; i++) { |
| 1122 | if (links_map[i] != |
| 1123 | EVENT_QUEUE_SERVICE_PRIORITY_INVALID) { |
| 1124 | all_queues[j] = i; |
| 1125 | j++; |
| 1126 | } |
| 1127 | } |
| 1128 | queues = all_queues; |
| 1129 | } else { |
| 1130 | for (j = 0; j < nb_unlinks; j++) { |
| 1131 | if (links_map[queues[j]] == |