LX2162 DPDK RX checksum offload

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LX2162 DPDK RX checksum offload

1,747 Views
embedded_eng_
Contributor III

Hi,

hardware: LX2162 SoC.

SW: LSDK-21.08

When DPNI_OFF_RX_L3_CSUM and DPNI_OFF_RX_L4_CSUM offloads are on, how received packets with invalid checksum are marked?

Are these packets  dropped/ignored?

Thanks!

0 Kudos
7 Replies

1,728 Views
yipingwang
NXP TechSupport
NXP TechSupport

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;
}

0 Kudos

1,674 Views
embedded_eng_
Contributor III

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?

0 Kudos

1,657 Views
yipingwang
NXP TechSupport
NXP TechSupport

Yes, sure, if the invalid packets are received, then it will be forwarded according to it's mac address for l2fwd.

0 Kudos

1,651 Views
embedded_eng_
Contributor III

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:

  • If DPNI_OFF_TX_L4_CSUM/DPNI_OFF_TX_L3_CSUM offloads are on, dpaa2 will checksum packets forwarded from port X before transmitting them.
  • If DPNI_OFF_RX_L4_CSUM/DPNI_OFF_RX_L3_CSUM offloads are on, dpaa2 will verify the checksum on packets received on this port, before forwarding them to port X.

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

 

0 Kudos

1,644 Views
yipingwang
NXP TechSupport
NXP TechSupport

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.

0 Kudos

1,640 Views
embedded_eng_
Contributor III

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.

 

0 Kudos

1,636 Views
yipingwang
NXP TechSupport
NXP TechSupport

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.

 

0 Kudos