/*
* Determine is multi-segment support required:
* - either frame buffer size is smaller then mtu
- * - or reassmeble support is requested
+ * - or reassemble support is requested
*/
static int
multi_seg_required(void)
ret = rte_hash_add_key_data(map, &key, (void *)i);
if (ret < 0) {
- printf("Faled to insert cdev mapping for (lcore %u, "
+ printf("Failed to insert cdev mapping for (lcore %u, "
"cdev %u, qp %u), errno %d\n",
key.lcore_id, ipsec_ctx->tbl[i].id,
ipsec_ctx->tbl[i].qp, ret);
str = "Inbound";
}
- /* Required cryptodevs with operation chainning */
+ /* Required cryptodevs with operation chaining */
if (!(dev_info->feature_flags &
RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING))
return ret;
"Error during getting device (port %u) info: %s\n",
portid, strerror(-ret));
- /* limit allowed HW offloafs, as user requested */
+ /* limit allowed HW offloads, as user requested */
dev_info.rx_offload_capa &= dev_rx_offload;
dev_info.tx_offload_capa &= dev_tx_offload;
local_port_conf.rxmode.offloads)
rte_exit(EXIT_FAILURE,
"Error: port %u required RX offloads: 0x%" PRIx64
- ", avaialbe RX offloads: 0x%" PRIx64 "\n",
+ ", available RX offloads: 0x%" PRIx64 "\n",
portid, local_port_conf.rxmode.offloads,
dev_info.rx_offload_capa);
local_port_conf.txmode.offloads)
rte_exit(EXIT_FAILURE,
"Error: port %u required TX offloads: 0x%" PRIx64
- ", avaialbe TX offloads: 0x%" PRIx64 "\n",
+ ", available TX offloads: 0x%" PRIx64 "\n",
portid, local_port_conf.txmode.offloads,
dev_info.tx_offload_capa);
if (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_IPV4_CKSUM)
local_port_conf.txmode.offloads |= RTE_ETH_TX_OFFLOAD_IPV4_CKSUM;
- printf("port %u configurng rx_offloads=0x%" PRIx64
+ printf("port %u configuring rx_offloads=0x%" PRIx64
", tx_offloads=0x%" PRIx64 "\n",
portid, local_port_conf.rxmode.offloads,
local_port_conf.txmode.offloads);
rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6)) {
struct rte_ipv6_hdr *iph;
- struct ipv6_extension_fragment *fh;
+ struct rte_ipv6_fragment_ext *fh;
iph = (struct rte_ipv6_hdr *)(eth + 1);
fh = rte_ipv6_frag_get_ipv6_fragment_header(iph);
struct rte_tel_data *spd4_data = rte_tel_data_alloc();
struct rte_tel_data *spd6_data = rte_tel_data_alloc();
struct rte_tel_data *sad_data = rte_tel_data_alloc();
-
unsigned int coreid = UINT32_MAX;
+ int rc = 0;
/* verify allocated telemetry data structures */
- if (!spd4_data || !spd6_data || !sad_data)
- return -ENOMEM;
+ if (!spd4_data || !spd6_data || !sad_data) {
+ rc = -ENOMEM;
+ goto exit;
+ }
/* initialize telemetry data structs as dicts */
rte_tel_data_start_dict(data);
if (params) {
coreid = (uint32_t)atoi(params);
- if (rte_lcore_is_enabled(coreid) == 0)
- return -EINVAL;
+ if (rte_lcore_is_enabled(coreid) == 0) {
+ rc = -EINVAL;
+ goto exit;
+ }
}
update_statistics(&total_stats, coreid);
rte_tel_data_add_dict_container(data, "sad", sad_data, 0);
- return 0;
+exit:
+ if (rc) {
+ rte_tel_data_free(spd4_data);
+ rte_tel_data_free(spd6_data);
+ rte_tel_data_free(sad_data);
+ }
+ return rc;
}
static int
struct rte_tel_data *spd4_data = rte_tel_data_alloc();
struct rte_tel_data *spd6_data = rte_tel_data_alloc();
struct rte_tel_data *sad_data = rte_tel_data_alloc();
-
unsigned int coreid = UINT32_MAX;
+ int rc = 0;
/* verify allocated telemetry data structures */
- if (!spd4_data || !spd6_data || !sad_data)
- return -ENOMEM;
+ if (!spd4_data || !spd6_data || !sad_data) {
+ rc = -ENOMEM;
+ goto exit;
+ }
/* initialize telemetry data structs as dicts */
rte_tel_data_start_dict(data);
if (params) {
coreid = (uint32_t)atoi(params);
- if (rte_lcore_is_enabled(coreid) == 0)
- return -EINVAL;
+ if (rte_lcore_is_enabled(coreid) == 0) {
+ rc = -EINVAL;
+ goto exit;
+ }
}
update_statistics(&total_stats, coreid);
rte_tel_data_add_dict_container(data, "spd6", spd6_data, 0);
- return 0;
+exit:
+ if (rc) {
+ rte_tel_data_free(spd4_data);
+ rte_tel_data_free(spd6_data);
+ rte_tel_data_free(sad_data);
+ }
+ return rc;
}
static int
struct rte_tel_data *lpm4_data = rte_tel_data_alloc();
struct rte_tel_data *lpm6_data = rte_tel_data_alloc();
-
unsigned int coreid = UINT32_MAX;
+ int rc = 0;
+
+ /* verify allocated telemetry data structures */
+ if (!lpm4_data || !lpm6_data) {
+ rc = -ENOMEM;
+ goto exit;
+ }
/* initialize telemetry data structs as dicts */
rte_tel_data_start_dict(data);
if (params) {
coreid = (uint32_t)atoi(params);
- if (rte_lcore_is_enabled(coreid) == 0)
- return -EINVAL;
+ if (rte_lcore_is_enabled(coreid) == 0) {
+ rc = -EINVAL;
+ goto exit;
+ }
}
update_statistics(&total_stats, coreid);
rte_tel_data_add_dict_container(data, "IPv6 LPM", lpm6_data, 0);
- return 0;
+exit:
+ if (rc) {
+ rte_tel_data_free(lpm4_data);
+ rte_tel_data_free(lpm6_data);
+ }
+ return rc;
}
static void
if ((enabled_port_mask & (1 << portid)) == 0)
continue;
- /* Create flow before starting the device */
- create_default_ipsec_flow(portid, req_rx_offloads[portid]);
-
ret = rte_eth_dev_start(portid);
if (ret < 0)
rte_exit(EXIT_FAILURE, "rte_eth_dev_start: "
"err=%d, port=%d\n", ret, portid);
+
+ /* Create flow after starting the device */
+ create_default_ipsec_flow(portid, req_rx_offloads[portid]);
+
/*
* If enabled, put device in promiscuous mode.
* This allows IO forwarding mode to forward packets