summaryrefslogtreecommitdiffstats
path: root/src/plugins/dev_octeon/port.c
diff options
context:
space:
mode:
authorMonendra Singh Kushwaha <kmonendra@marvell.com>2024-02-14 16:18:24 +0530
committerDamjan Marion <damarion@cisco.com>2024-02-28 15:35:52 +0100
commit3d1459b142d16a74a79576ed4c18f8c1ac14ed47 (patch)
treea93ceb00a114141b9ab317625a2c473405485199 /src/plugins/dev_octeon/port.c
parent7f050d9749bbf16c0d16625d52d94e0811f284c7 (diff)
octeon: add flow offload infra
Type: feature Change-Id: I3485e1627eafc5125255985003573247e7562db2 Signed-off-by: Kommula Shiva Shankar <kshankar@marvell.com> Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
Diffstat (limited to 'src/plugins/dev_octeon/port.c')
-rw-r--r--src/plugins/dev_octeon/port.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/plugins/dev_octeon/port.c b/src/plugins/dev_octeon/port.c
index 5857bc15f77..f1ae15aadb1 100644
--- a/src/plugins/dev_octeon/port.c
+++ b/src/plugins/dev_octeon/port.c
@@ -10,6 +10,9 @@
#include <dev_octeon/common.h>
#include <vnet/ethernet/ethernet.h>
+#define OCT_FLOW_PREALLOC_SIZE 1
+#define OCT_FLOW_MAX_PRIORITY 7
+
VLIB_REGISTER_LOG_CLASS (oct_log, static) = {
.class_name = "octeon",
.subclass_name = "port",
@@ -95,6 +98,8 @@ oct_port_init (vlib_main_t *vm, vnet_dev_port_t *port)
roc_nix_rss_key_set (nix, default_rss_key);
cp->npc.roc_nix = nix;
+ cp->npc.flow_prealloc_size = OCT_FLOW_PREALLOC_SIZE;
+ cp->npc.flow_max_priority = OCT_FLOW_MAX_PRIORITY;
if ((rrv = roc_npc_init (&cp->npc)))
{
oct_port_deinit (vm, port);
@@ -360,7 +365,7 @@ oct_port_stop (vlib_main_t *vm, vnet_dev_port_t *port)
}
vnet_dev_rv_t
-oct_port_cfg_change_precheck (vlib_main_t *vm, vnet_dev_port_t *port,
+oct_port_cfg_change_validate (vlib_main_t *vm, vnet_dev_port_t *port,
vnet_dev_port_cfg_change_req_t *req)
{
vnet_dev_rv_t rv = VNET_DEV_OK;
@@ -378,6 +383,14 @@ oct_port_cfg_change_precheck (vlib_main_t *vm, vnet_dev_port_t *port,
case VNET_DEV_PORT_CFG_REMOVE_SECONDARY_HW_ADDR:
break;
+ case VNET_DEV_PORT_CFG_ADD_RX_FLOW:
+ case VNET_DEV_PORT_CFG_DEL_RX_FLOW:
+ case VNET_DEV_PORT_CFG_GET_RX_FLOW_COUNTER:
+ case VNET_DEV_PORT_CFG_RESET_RX_FLOW_COUNTER:
+ rv = oct_flow_validate_params (vm, port, req->type, req->flow_index,
+ req->private_data);
+ break;
+
default:
rv = VNET_DEV_ERR_NOT_SUPPORTED;
};
@@ -394,8 +407,6 @@ oct_port_cfg_change (vlib_main_t *vm, vnet_dev_port_t *port,
switch (req->type)
{
case VNET_DEV_PORT_CFG_PROMISC_MODE:
- {
- }
break;
case VNET_DEV_PORT_CFG_CHANGE_PRIMARY_HW_ADDR:
@@ -410,6 +421,15 @@ oct_port_cfg_change (vlib_main_t *vm, vnet_dev_port_t *port,
case VNET_DEV_PORT_CFG_MAX_RX_FRAME_SIZE:
break;
+ case VNET_DEV_PORT_CFG_ADD_RX_FLOW:
+ case VNET_DEV_PORT_CFG_DEL_RX_FLOW:
+ case VNET_DEV_PORT_CFG_GET_RX_FLOW_COUNTER:
+ case VNET_DEV_PORT_CFG_RESET_RX_FLOW_COUNTER:
+ rv = oct_flow_ops_fn (vm, port, req->type, req->flow_index,
+ req->private_data);
+
+ break;
+
default:
return VNET_DEV_ERR_NOT_SUPPORTED;
};