The packets with invalid checksum are supposed to be received from error RXQ or can be also received to normal queue.
Please refer:
if (dpaa2_enable_err_queue) {
ret = dpni_get_queue(dpni, CMD_PRI_LOW, priv->token,
DPNI_QUEUE_RX_ERR, 0, 0, &cfg, &qid);
if (ret) {
DPAA2_PMD_ERR(
"Error getting rx err flow information: err=%d",
ret);
return ret;
}
dpaa2_q = (struct dpaa2_queue *)priv->rx_err_vq;
dpaa2_q->fqid = qid.fqid;
dpaa2_q->eth_data = dev->data;
err_cfg.errors = DPNI_ERROR_DISC;
err_cfg.error_action = DPNI_ERROR_ACTION_SEND_TO_ERROR_QUEUE;
} else {
/* checksum errors, send them to normal path
* and set it in annotation
*/
err_cfg.errors = DPNI_ERROR_L3CE | DPNI_ERROR_L4CE;
/* if packet with parse error are not to be dropped */
if (!(priv->flags & DPAA2_PARSE_ERR_DROP))
err_cfg.errors |= DPNI_ERROR_PHE;
err_cfg.error_action = DPNI_ERROR_ACTION_CONTINUE;
}
err_cfg.set_frame_annotation = true;
ret = dpni_set_errors_behavior(dpni, CMD_PRI_LOW,
priv->token, &err_cfg);
if (ret) {
DPAA2_PMD_ERR("Error to dpni_set_errors_behavior: code = %d",
ret);
return ret;
}
Thanks for the reply.
So what happens if I run l2fwd application when one of the 2 ports is a dpaa2 port?
The invalid packets will be forwarded from the dpaa2 port to the other port?
Yes, sure, if the invalid packets are received, then it will be forwarded according to it's mac address for l2fwd.
Hi,
I'm not sure I'm clear enough.
I'm running DPDK l2fwd application between a dpaa2 port and another port X.
If I understand correctly:
So my question is, if a packet with an invalid checksum is received in the dpaa2 port, what happens to this packet?
If this packet is forwarded to port X anyway, how can port X know that this packet has an invalid checksum?
Thanks
For ingress packets with invalid checksum from DPAA2 port, it's up to you to drop or receive, please refer the code pasted before.
If the packets with invalid checksum are received from DPAA2 port, they will be forward to port X. In general, port X (SW driver or HW) is responsible to check sum before transmitting.
Thanks for the reply.
"For ingress packets with invalid checksum from DPAA2 port, it's up to you to drop or receive, please refer the code pasted before."
Is there a way to know if the packet that was forwarded from DPAA2 port to port X has invalid checksum without having to verify it again?
Port X in the prev. example is attached to a software PMD which I'm developing, and I tried to rely on the dpaa2 RX_OFFLOAD, so I won't need to verify the checksum before transmitting the packets.
It there a way to do so?
I'm not sure what is the point of DPNI_OFF_RX_L4_CSUM/DPNI_OFF_RX_L3_CSUM offloads if the checksum needs to be verified again.
Yes, you can receive frames with invalid checksum to specific error RX queue. Hence mark the frames from this queue as "invalid checksum" in some field of mbuf. Before you send these frames to port X, you only need to check the field of mbuf to identify if they are invalid or not.