octeon: fix compilation for octeon 21/41821/2
authorMonendra Singh Kushwaha <[email protected]>
Mon, 11 Nov 2024 19:02:50 +0000 (00:32 +0530)
committerDamjan Marion <[email protected]>
Wed, 13 Nov 2024 08:22:21 +0000 (08:22 +0000)
This patch adapts new changes introduced in vnet/dev framework
as part of 61e287b9.

Type: fix
fixes: 61e287b9

Change-Id: I816ee9b80fca188ee799e704d08aaf3515bd57c0
Signed-off-by: Monendra Singh Kushwaha <[email protected]>
src/plugins/dev_octeon/flow.c
src/plugins/dev_octeon/port.c
src/plugins/dev_octeon/rx_node.c

index 5bef25f..e86425e 100644 (file)
@@ -131,6 +131,7 @@ oct_flow_validate_params (vlib_main_t *vm, vnet_dev_port_t *port,
                          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;
@@ -151,11 +152,11 @@ oct_flow_validate_params (vlib_main_t *vm, vnet_dev_port_t *port,
   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;
        }
     }
@@ -163,12 +164,12 @@ oct_flow_validate_params (vlib_main_t *vm, vnet_dev_port_t *port,
   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;
        }
     }
@@ -538,6 +539,7 @@ oct_flow_add (vlib_main_t *vm, vnet_dev_port_t *port, vnet_flow_t *flow,
   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 = {};
@@ -775,7 +777,7 @@ parse_flow_actions:
          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++;
index 528683f..4c6d841 100644 (file)
@@ -129,6 +129,7 @@ oct_port_init (vlib_main_t *vm, vnet_dev_port_t *port)
   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;
@@ -136,14 +137,14 @@ oct_port_init (vlib_main_t *vm, vnet_dev_port_t *port)
 
   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;
 
index b057c4d..833227e 100644 (file)
@@ -103,7 +103,7 @@ oct_rx_batch (vlib_main_t *vm, oct_rx_node_ctx_t *ctx,
              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;
@@ -347,9 +347,9 @@ oct_rx_node_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
   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 */