bogdanPricope replied on github web page:

platform/linux-generic/pktio/dpdk.c
@@ -301,6 +301,40 @@ static struct rte_mempool_ops ops_stack = {
 
 MEMPOOL_REGISTER_OPS(ops_stack);
 
+#define HAS_L4_PROTO(m, proto) ((m->packet_type & RTE_PTYPE_L4_MASK) == proto)
+
+static inline int pkt_set_ol_rx(odp_pktin_config_opt_t *pktin_cfg,
+                               odp_packet_hdr_t *pkt_hdr,
+                               struct rte_mbuf *mbuf)
+{
+       if (pktin_cfg->bit.ipv4_chksum &&
+           (mbuf->packet_type & RTE_PTYPE_L3_IPV4) &&
+           mbuf->ol_flags & PKT_RX_IP_CKSUM_BAD) {
+               if (pktin_cfg->bit.drop_ipv4_err)
+                       return -1;
+
+               pkt_hdr->p.error_flags.ip_err = 1;
+       }
+
+       if (pktin_cfg->bit.udp_chksum &&
+           HAS_L4_PROTO(mbuf, RTE_PTYPE_L4_UDP) &&
+           mbuf->ol_flags & PKT_RX_L4_CKSUM_BAD) {


Comment:
OK

html_url=https://github.com/Linaro/odp/pull/124#discussion_r134221252
updated_at=2017-08-22 07:50:46

Reply via email to