vnet_dev_port_cfg_type_t type, u32 flow_index,
uword *priv_data)
{
+ vnet_dev_port_interfaces_t *ifs = port->interfaces;
vnet_flow_t *flow = vnet_get_flow (flow_index);
u32 last_queue;
u32 qid;
if (flow->actions & VNET_FLOW_ACTION_REDIRECT_TO_QUEUE)
{
qid = flow->redirect_queue;
- if (qid > port->intf.num_rx_queues - 1 || qid < 0)
+ if (qid > ifs->num_rx_queues - 1 || qid < 0)
{
log_err (port->dev,
"Given Q(%d) is invalid, supported range is %d-%d", qid, 0,
- port->intf.num_rx_queues - 1);
+ ifs->num_rx_queues - 1);
return VNET_DEV_ERR_NOT_SUPPORTED;
}
}
if (flow->actions & VNET_FLOW_ACTION_RSS)
{
last_queue = flow->queue_index + flow->queue_num;
- if (last_queue > port->intf.num_rx_queues - 1)
+ if (last_queue > ifs->num_rx_queues - 1)
{
log_err (port->dev,
"Given Q range(%d-%d) is invalid, supported range is %d-%d",
flow->queue_index, flow->queue_index + flow->queue_num, 0,
- port->intf.num_rx_queues - 1);
+ ifs->num_rx_queues - 1);
return VNET_DEV_ERR_NOT_SUPPORTED;
}
}
struct roc_npc_item_info item_info[ROC_NPC_ITEM_TYPE_END] = {};
struct roc_npc_action actions[ROC_NPC_ITEM_TYPE_END] = {};
oct_port_t *oct_port = vnet_dev_get_port_data (port);
+ vnet_dev_port_interfaces_t *ifs = port->interfaces;
ethernet_header_t eth_spec = {}, eth_mask = {};
sctp_header_t sctp_spec = {}, sctp_mask = {};
gtpu_header_t gtpu_spec = {}, gtpu_mask = {};
log_err (port->dev, "RSS action has no queues");
return VNET_DEV_ERR_NOT_SUPPORTED;
}
- queues = clib_mem_alloc (sizeof (u16) * port->intf.num_rx_queues);
+ queues = clib_mem_alloc (sizeof (u16) * ifs->num_rx_queues);
for (index = 0; index < flow->queue_num; index++)
queues[index] = flow->queue_index++;
vnet_dev_t *dev = port->dev;
oct_device_t *cd = vnet_dev_get_data (dev);
oct_port_t *cp = vnet_dev_get_port_data (port);
+ vnet_dev_port_interfaces_t *ifs = port->interfaces;
u8 mac_addr[PLT_ETHER_ADDR_LEN];
struct roc_nix *nix = cd->nix;
vnet_dev_rv_t rv;
log_debug (dev, "port init: port %u", port->port_id);
- if ((rrv = roc_nix_lf_alloc (nix, port->intf.num_rx_queues,
- port->intf.num_tx_queues, rxq_cfg)))
+ if ((rrv = roc_nix_lf_alloc (nix, ifs->num_rx_queues, ifs->num_tx_queues,
+ rxq_cfg)))
{
oct_port_deinit (vm, port);
return oct_roc_err (
dev, rrv,
"roc_nix_lf_alloc(nb_rxq = %u, nb_txq = %d, rxq_cfg=0x%lx) failed",
- port->intf.num_rx_queues, port->intf.num_tx_queues, rxq_cfg);
+ ifs->num_rx_queues, ifs->num_tx_queues, rxq_cfg);
}
cp->lf_allocated = 1;
vnet_dev_rx_queue_t *rxq, u32 n)
{
oct_rxq_t *crq = vnet_dev_get_rx_queue_data (rxq);
- vlib_buffer_template_t bt = rxq->buffer_template;
+ vlib_buffer_template_t bt = vnet_dev_get_rx_queue_if_buffer_template (rxq);
u32 b0_err_flags = 0, b1_err_flags = 0;
u32 b2_err_flags = 0, b3_err_flags = 0;
u32 n_left, err_flags = 0;
oct_nix_rx_cqe_desc_t *descs = crq->cq.desc_base;
oct_nix_lf_cq_op_status_t status;
oct_rx_node_ctx_t _ctx = {
- .next_index = rxq->next_index,
- .sw_if_index = port->intf.sw_if_index,
- .hw_if_index = port->intf.hw_if_index,
+ .next_index = vnet_dev_get_rx_queue_if_next_index(rxq),
+ .sw_if_index = vnet_dev_get_rx_queue_if_sw_if_index (rxq),
+ .hw_if_index = vnet_dev_get_rx_queue_if_hw_if_index (rxq),
}, *ctx = &_ctx;
/* get head and tail from NIX_LF_CQ_OP_STATUS */