net/bnxt: fix Thor SVIF size for generic tables
[dpdk.git] / drivers / net / sfc / sfc_switch.c
index 3f7518f..5c10e8f 100644 (file)
@@ -567,6 +567,35 @@ unlock:
        return rc;
 }
 
+int
+sfc_mae_switch_get_entity_mport(uint16_t switch_domain_id,
+                               uint16_t ethdev_port_id,
+                               efx_mport_sel_t *mport_sel)
+{
+       static struct sfc_mae_switch_port *port;
+       int rc;
+
+       rte_spinlock_lock(&sfc_mae_switch.lock);
+       rc = sfc_mae_find_switch_port_by_ethdev(switch_domain_id,
+                                               ethdev_port_id, &port);
+       if (rc != 0)
+               goto unlock;
+
+       if (port->type == SFC_MAE_SWITCH_PORT_INDEPENDENT &&
+           !port->data.indep.mae_admin) {
+               /* See sfc_mae_assign_entity_mport() */
+               rc = ENOTSUP;
+               goto unlock;
+       }
+
+       *mport_sel = port->entity_mport;
+
+unlock:
+       rte_spinlock_unlock(&sfc_mae_switch.lock);
+
+       return rc;
+}
+
 int
 sfc_mae_switch_port_id_by_entity(uint16_t switch_domain_id,
                                 const efx_mport_sel_t *entity_mportp,