Runtime Config Options
----------------------
-- ``HW offload ptype parsing disable`` (default ``0``)
-
- Packet type parsing is HW offloaded by default and this feature may be toggled
- using ``ptype_disable`` ``devargs`` parameter.
-
- ``Rx&Tx scalar mode enable`` (default ``0``)
Ethdev supports both scalar and vector mode, it may be selected at runtime
.dev_set_link_up = otx2_nix_dev_set_link_up,
.dev_set_link_down = otx2_nix_dev_set_link_down,
.dev_supported_ptypes_get = otx2_nix_supported_ptypes_get,
+ .dev_ptypes_set = otx2_nix_ptypes_set,
.dev_reset = otx2_nix_dev_reset,
.stats_get = otx2_nix_dev_stats_get,
.stats_reset = otx2_nix_dev_stats_reset,
return 0;
}
-static int
-parse_ptype_flag(const char *key, const char *value, void *extra_args)
-{
- RTE_SET_USED(key);
- uint32_t val;
-
- val = atoi(value);
- if (val)
- val = 0; /* Disable NIX_RX_OFFLOAD_PTYPE_F */
-
- *(uint16_t *)extra_args = val;
-
- return 0;
-}
-
static int
parse_flag(const char *key, const char *value, void *extra_args)
{
}
#define OTX2_RSS_RETA_SIZE "reta_size"
-#define OTX2_PTYPE_DISABLE "ptype_disable"
#define OTX2_SCL_ENABLE "scalar_enable"
#define OTX2_MAX_SQB_COUNT "max_sqb_count"
#define OTX2_FLOW_PREALLOC_SIZE "flow_prealloc_size"
int
otx2_ethdev_parse_devargs(struct rte_devargs *devargs, struct otx2_eth_dev *dev)
{
- uint16_t offload_flag = NIX_RX_OFFLOAD_PTYPE_F;
uint16_t rss_size = NIX_RSS_RETA_SIZE;
uint16_t sqb_count = NIX_MAX_SQB;
uint16_t flow_prealloc_size = 8;
if (kvlist == NULL)
goto exit;
- rte_kvargs_process(kvlist, OTX2_PTYPE_DISABLE,
- &parse_ptype_flag, &offload_flag);
rte_kvargs_process(kvlist, OTX2_RSS_RETA_SIZE,
&parse_reta_size, &rss_size);
rte_kvargs_process(kvlist, OTX2_SCL_ENABLE,
rte_kvargs_free(kvlist);
null_devargs:
- dev->rx_offload_flags = offload_flag;
dev->scalar_ena = scalar_enable;
dev->max_sqb_count = sqb_count;
dev->rss_info.rss_size = rss_size;
RTE_PMD_REGISTER_PARAM_STRING(net_octeontx2,
OTX2_RSS_RETA_SIZE "=<64|128|256>"
- OTX2_PTYPE_DISABLE "=1"
OTX2_SCL_ENABLE "=1"
OTX2_MAX_SQB_COUNT "=<8-512>"
OTX2_FLOW_PREALLOC_SIZE "=<1-32>"
return NULL;
}
+int
+otx2_nix_ptypes_set(struct rte_eth_dev *eth_dev, uint32_t ptype_mask)
+{
+ struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev);
+
+ if (ptype_mask)
+ dev->rx_offload_flags |= NIX_RX_OFFLOAD_PTYPE_F;
+ else
+ dev->rx_offload_flags &= ~NIX_RX_OFFLOAD_PTYPE_F;
+
+ otx2_eth_set_rx_function(eth_dev);
+
+ return 0;
+}
+
/*
* +------------------ +------------------ +
* | | IL4 | IL3| IL2 | TU | L4 | L3 | L2 |