[dpdk-users] Clone logic doesn't seem to work (using DPDK 17-11.1)

Prashanth Fernando prashanth.fernando at tatacommunications.com
Mon Jun 3 06:04:41 CEST 2019


Hi,
I am trying UDP replication in DPDK-17.11.1.

For replication I a trying to have a linked buffer, the header buffer will contain Ethernet/Ip header and the rest will be in second segment.
When I tx the packet, I see only the Ethernet/IP header(first segment) the rest of the contents (in the second segment) is missing.
I am tx the packet using rte_port_ring_writer_tx().

Not sure what I am missing, can you please let me know on how to debug this issue.

Tx_Logic in f_run function

  if (likely ((mc = clone_out_pkt(m)) != NULL))
  {
      update_headers_in_clone (mc, &eth_head, &in_hdr);

      if (port_out_id == 4)
         port_out_id = 0;

      struct rte_port_out *port_out =
             &p->ports_out[port_out_id];

      /* Output port user actions */
      if (port_out->f_action == NULL) /* Output port TX */
           port_out->ops.f_tx(port_out->h_port, mc);

      port_out_id++;
  }

Clone Logic

static inline struct rte_mbuf *
clone_out_pkt(struct rte_mbuf *pkt)
{
        struct rte_mbuf *hdr;

        /* Create new mbuf for the header. */
        if (unlikely ((hdr = rte_pktmbuf_alloc(header_pool)) == NULL))
                return NULL;

        /* If requested, then make a new clone packet. */
        if (unlikely ((pkt = rte_pktmbuf_clone(pkt, clone_pool)) == NULL)) {
                rte_pktmbuf_free(hdr);
                return NULL;
        }

        /* prepend new header */
        hdr->next = pkt;

        /* update header's fields */
        hdr->pkt_len = (uint16_t)(pkt->pkt_len);
        hdr->nb_segs = pkt->nb_segs + 1;
}

Tks,
Prashanth



More information about the users mailing list