}
switch (conf->rxmode.mq_mode) {
- case ETH_MQ_RX_RSS:
+ case RTE_ETH_MQ_RX_RSS:
if (nb_rx_queues != 1) {
sfcr_err(sr, "Rx RSS is not supported with %u queues",
nb_rx_queues);
ret = -EINVAL;
}
break;
- case ETH_MQ_RX_NONE:
+ case RTE_ETH_MQ_RX_NONE:
break;
default:
sfcr_err(sr, "Rx mode MQ modes other than RSS not supported");
break;
}
- if (conf->txmode.mq_mode != ETH_MQ_TX_NONE) {
+ if (conf->txmode.mq_mode != RTE_ETH_MQ_TX_NONE) {
sfcr_err(sr, "Tx mode MQ modes not supported");
ret = -EINVAL;
}
sfc_port_link_mode_to_info(EFX_LINK_UNKNOWN, &link);
} else {
memset(&link, 0, sizeof(link));
- link.link_status = ETH_LINK_UP;
- link.link_speed = ETH_SPEED_NUM_UNKNOWN;
+ link.link_status = RTE_ETH_LINK_UP;
+ link.link_speed = RTE_ETH_SPEED_NUM_UNKNOWN;
}
return rte_eth_linkstatus_set(dev, &link);
struct sfc_repr_init_data {
uint16_t pf_port_id;
- uint16_t repr_id;
uint16_t switch_domain_id;
efx_mport_sel_t mport_sel;
+ efx_pcie_interface_t intf;
+ uint16_t pf;
+ uint16_t vf;
};
static int
switch_port_request.ethdev_mportp = ðdev_mport_sel;
switch_port_request.entity_mportp = &repr_data->mport_sel;
switch_port_request.ethdev_port_id = dev->data->port_id;
+ switch_port_request.port_data.repr.intf = repr_data->intf;
+ switch_port_request.port_data.repr.pf = repr_data->pf;
+ switch_port_request.port_data.repr.vf = repr_data->vf;
ret = sfc_repr_assign_mae_switch_port(repr_data->switch_domain_id,
&switch_port_request,
}
ret = sfc_repr_proxy_add_port(repr_data->pf_port_id,
- repr_data->repr_id,
+ srs->switch_port_id,
dev->data->port_id,
&repr_data->mport_sel);
if (ret != 0) {
dev->process_private = sr;
srs->pf_port_id = repr_data->pf_port_id;
- srs->repr_id = repr_data->repr_id;
+ srs->repr_id = srs->switch_port_id;
srs->switch_domain_id = repr_data->switch_domain_id;
dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
fail_alloc_sr:
(void)sfc_repr_proxy_del_port(repr_data->pf_port_id,
- repr_data->repr_id);
+ srs->switch_port_id);
fail_create_port:
fail_mae_assign_switch_port:
}
int
-sfc_repr_create(struct rte_eth_dev *parent, uint16_t representor_id,
- uint16_t switch_domain_id, const efx_mport_sel_t *mport_sel)
+sfc_repr_create(struct rte_eth_dev *parent,
+ struct sfc_repr_entity_info *entity,
+ uint16_t switch_domain_id,
+ const efx_mport_sel_t *mport_sel)
{
struct sfc_repr_init_data repr_data;
char name[RTE_ETH_NAME_MAX_LEN];
+ int controller;
int ret;
+ int rc;
struct rte_eth_dev *dev;
- if (snprintf(name, sizeof(name), "net_%s_representor_%u",
- parent->device->name, representor_id) >=
- (int)sizeof(name)) {
+ controller = -1;
+ rc = sfc_mae_switch_domain_get_controller(switch_domain_id,
+ entity->intf, &controller);
+ if (rc != 0) {
+ SFC_GENERIC_LOG(ERR, "%s() failed to get DPDK controller for %d",
+ __func__, entity->intf);
+ return -rc;
+ }
+
+ switch (entity->type) {
+ case RTE_ETH_REPRESENTOR_VF:
+ ret = snprintf(name, sizeof(name), "net_%s_representor_c%upf%uvf%u",
+ parent->device->name, controller, entity->pf,
+ entity->vf);
+ break;
+ case RTE_ETH_REPRESENTOR_PF:
+ ret = snprintf(name, sizeof(name), "net_%s_representor_c%upf%u",
+ parent->device->name, controller, entity->pf);
+ break;
+ default:
+ return -ENOTSUP;
+ }
+
+ if (ret >= (int)sizeof(name)) {
SFC_GENERIC_LOG(ERR, "%s() failed name too long", __func__);
return -ENAMETOOLONG;
}
if (dev == NULL) {
memset(&repr_data, 0, sizeof(repr_data));
repr_data.pf_port_id = parent->data->port_id;
- repr_data.repr_id = representor_id;
repr_data.switch_domain_id = switch_domain_id;
repr_data.mport_sel = *mport_sel;
+ repr_data.intf = entity->intf;
+ repr_data.pf = entity->pf;
+ repr_data.vf = entity->vf;
ret = rte_eth_dev_create(parent->device, name,
sizeof(struct sfc_repr_shared),