| 1064 | } |
| 1065 | |
| 1066 | int |
| 1067 | sfc_repr_proxy_start(struct sfc_adapter *sa) |
| 1068 | { |
| 1069 | struct sfc_adapter_shared * const sas = sfc_sa2shared(sa); |
| 1070 | struct sfc_repr_proxy *rp = &sa->repr_proxy; |
| 1071 | struct sfc_repr_proxy_port *last_port = NULL; |
| 1072 | struct sfc_repr_proxy_port *port; |
| 1073 | int rc; |
| 1074 | |
| 1075 | sfc_log_init(sa, "entry"); |
| 1076 | |
| 1077 | /* Representor proxy is not started when no representors are started */ |
| 1078 | if (!sfc_repr_available(sas)) { |
| 1079 | sfc_log_init(sa, "representors not supported - skip"); |
| 1080 | return 0; |
| 1081 | } |
| 1082 | |
| 1083 | if (sfc_repr_proxy_ports_disabled(rp)) { |
| 1084 | sfc_log_init(sa, "no started representor ports - skip"); |
| 1085 | return 0; |
| 1086 | } |
| 1087 | |
| 1088 | rc = sfc_repr_proxy_rxq_start(sa); |
| 1089 | if (rc != 0) |
| 1090 | goto fail_rxq_start; |
| 1091 | |
| 1092 | rc = sfc_repr_proxy_txq_start(sa); |
| 1093 | if (rc != 0) |
| 1094 | goto fail_txq_start; |
| 1095 | |
| 1096 | rp->nb_txq = sfc_repr_nb_txq(sas); |
| 1097 | rp->nb_rxq = sfc_repr_nb_rxq(sas); |
| 1098 | |
| 1099 | /* Service core may be in "stopped" state, start it */ |
| 1100 | rc = rte_service_lcore_start(rp->service_core_id); |
| 1101 | if (rc != 0 && rc != -EALREADY) { |
| 1102 | rc = -rc; |
| 1103 | sfc_err(sa, "failed to start service core for %s: %s", |
| 1104 | rte_service_get_name(rp->service_id), |
| 1105 | rte_strerror(rc)); |
| 1106 | goto fail_start_core; |
| 1107 | } |
| 1108 | |
| 1109 | /* Run the service */ |
| 1110 | rc = rte_service_component_runstate_set(rp->service_id, 1); |
| 1111 | if (rc < 0) { |
| 1112 | rc = -rc; |
| 1113 | sfc_err(sa, "failed to run %s component: %s", |
| 1114 | rte_service_get_name(rp->service_id), |
| 1115 | rte_strerror(rc)); |
| 1116 | goto fail_component_runstate_set; |
| 1117 | } |
| 1118 | rc = rte_service_runstate_set(rp->service_id, 1); |
| 1119 | if (rc < 0) { |
| 1120 | rc = -rc; |
| 1121 | sfc_err(sa, "failed to run %s: %s", |
| 1122 | rte_service_get_name(rp->service_id), |
| 1123 | rte_strerror(rc)); |
no test coverage detected