[port <portnum> default]
start_hdr = <start_hdr>
+ forward_bad_frames = <forward_bad_frames>
default_tc = <default_tc>
mapping_priority = <mapping_priority>
- ``<start_hdr>``: Indicate what is the start header mode (`none` (eth), `dsa`, `ext_dsa` or `custom`).
+- ``<forward_bad_frames>``: Indicate whether to forward or drop l2 bad packets (0 or 1).
+
- ``<default_tc>``: Default traffic class (e.g. 0)
- ``<mapping_priority>``: QoS priority for mapping (`ip`, `vlan`, `ip/vlan` or `vlan/ip`).
priv->pp_id, priv->ppio_id);
priv->ppio_params.match = match;
priv->ppio_params.eth_start_hdr = PP2_PPIO_HDR_ETH;
- if (mrvl_cfg)
+ priv->forward_bad_frames = 0;
+
+ if (mrvl_cfg) {
priv->ppio_params.eth_start_hdr =
mrvl_cfg->port[dev->data->port_id].eth_start_hdr;
+ priv->forward_bad_frames =
+ mrvl_cfg->port[dev->data->port_id].forward_bad_frames;
+ }
/*
* Calculate the minimum bpool size for refill feature as follows:
/* drop packet in case of mac, overrun or resource error */
status = pp2_ppio_inq_desc_get_l2_pkt_error(&descs[i]);
- if (unlikely(status != PP2_DESC_ERR_OK)) {
+ if ((unlikely(status != PP2_DESC_ERR_OK)) &&
+ !(q->priv->forward_bad_frames)) {
struct pp2_buff_inf binf = {
.addr = rte_mbuf_data_iova_default(mbuf),
.cookie = (uint64_t)mbuf,
LIST_HEAD(shaper_profiles, mrvl_tm_shaper_profile) shaper_profiles;
LIST_HEAD(nodes, mrvl_tm_node) nodes;
uint64_t rate_max;
+
+ uint8_t forward_bad_frames;
};
/** Flow operations forward declaration. */
#define MRVL_TOK_PARSER_UDF_PROTO_UDP "udp"
#define MRVL_TOK_PARSER_UDF_FIELD_UDP_DPORT "dport"
+/* parser forward bad frames tokens */
+#define MRVL_TOK_FWD_BAD_FRAMES "forward_bad_frames"
/** Number of tokens in range a-b = 2. */
#define MAX_RNG_TOKENS 2
return -1;
}
}
+
+ /* Parse forward bad frames option */
+ entry = rte_cfgfile_get_entry(file, sec_name,
+ MRVL_TOK_FWD_BAD_FRAMES);
+ if (entry) {
+ if (get_val_securely(entry, &val) < 0) {
+ MRVL_LOG(ERR,
+ "Error in parsing %s value (%s)!\n",
+ MRVL_TOK_FWD_BAD_FRAMES, entry);
+ return -1;
+ }
+ (*cfg)->port[n].forward_bad_frames = (uint8_t)val;
+ } else {
+ (*cfg)->port[n].forward_bad_frames = 0;
+ }
}
return 0;
uint8_t use_global_defaults;
struct pp2_cls_plcr_params policer_params;
uint8_t setup_policer;
+ uint8_t forward_bad_frames;
} port[RTE_MAX_ETHPORTS];
};