Changeset 10c47a0 for lib/format_dpdk.c


Ignore:
Timestamp:
02/23/15 15:01:00 (6 years ago)
Author:
Richard Sanger <rsangerarj@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
526d9d0
Parents:
5df059b
Message:

Fixes DAG DUCK reporting for parallel libtrace.
In parallel libtrace DUCK is only ever sent to the first thread.

It is now up each formats pread_packet to tag the trace along with
the error (AKA bytes read) to each packet.

Change logic in parallel libtrace to alwaus prefer pread over read if
it exists.

Fix some unresolved conflict in DPDK that I missed, that was ifdef'd out.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_dpdk.c

    r694823f r10c47a0  
    18241824 * @param packets Optional - If not null nb_pkts of libtrace packets which will be prepared
    18251825 */
    1826 static inline void dpdk_ready_pkts(struct dpdk_format_data_t *format_data, struct dpdk_per_lcore_t *plc,
     1826static inline void dpdk_ready_pkts(libtrace_t *libtrace, struct dpdk_per_lcore_t *plc,
    18271827                                   struct rte_mbuf **pkts, size_t nb_pkts, libtrace_packet_t **packets) {
     1828        struct dpdk_format_data_t *format_data = FORMAT(libtrace);
    18281829        struct dpdk_addt_hdr *hdr;
    18291830        size_t i;
     
    18651866#endif
    18661867
    1867         assert(RTE_PKTMBUF_HEADROOM >= sizeof(struct dpdk_addt_hdr)); // TODO static compile time assert sometime??
     1868        ct_assert(RTE_PKTMBUF_HEADROOM >= sizeof(struct dpdk_addt_hdr));
    18681869        for (i = 0 ; i < nb_pkts ; ++i) {
    18691870
     
    18731874
    18741875#if GET_MAC_CRC_CHECKSUM
    1875 <<<<<<< HEAD
    18761876                /* Add back in the CRC sum */
    1877                 pkts[i]->pkt.pkt_len += ETHER_CRC_LEN;
    1878                 pkts[i]->pkt.data_len += ETHER_CRC_LEN;
     1877                rte_pktmbuf_pkt_len(pkt) += ETHER_CRC_LEN;
     1878                rte_pktmbuf_data_len(pkt) += ETHER_CRC_LEN;
    18791879                hdr->flags |= INCLUDES_CHECKSUM;
    1880 =======
    1881     /* Add back in the CRC sum */
    1882     rte_pktmbuf_pkt_len(pkt) += ETHER_CRC_LEN;
    1883     rte_pktmbuf_data_len(pkt) += ETHER_CRC_LEN;
    1884     hdr->flags |= INCLUDES_CHECKSUM;
    1885 >>>>>>> master
    18861880#endif
    18871881
     
    19821976                        packets[i]->buffer = pkts[i];
    19831977                        packets[i]->header = pkts[i];
     1978                        packets[i]->trace = libtrace;
    19841979#if HAS_HW_TIMESTAMPS_82580
    19851980                        packets[i]->payload = (char *) pkts[i] + sizeof(struct rte_mbuf) +
     
    20422037                FORMAT(libtrace)->burst_size = nb_rx;
    20432038                FORMAT(libtrace)->burst_offset = 1;
    2044                 dpdk_ready_pkts(FORMAT(libtrace), &FORMAT(libtrace)->per_lcore[0], FORMAT(libtrace)->burst_pkts, nb_rx, NULL);
     2039                dpdk_ready_pkts(libtrace, &FORMAT(libtrace)->per_lcore[0], FORMAT(libtrace)->burst_pkts, nb_rx, NULL);
    20452040                packet->buffer = FORMAT(libtrace)->burst_pkts[0];
    20462041                dpdk_prepare_packet(libtrace, packet, packet->buffer, packet->type, 0);
     
    20902085                /* Got some packets - otherwise we keep spining */
    20912086                //fprintf(stderr, "Doing P READ PACKET port=%d q=%d\n", (int) FORMAT(libtrace)->port, (int) get_thread_table_num(libtrace));
    2092                 dpdk_ready_pkts(FORMAT(libtrace), PERPKT_FORMAT(t), pkts_burst, nb_rx, packets);
     2087                dpdk_ready_pkts(libtrace, PERPKT_FORMAT(t), pkts_burst, nb_rx, packets);
    20932088                return nb_rx;
    20942089        }
     
    22122207            packet->type = TRACE_RT_DATA_DPDK;
    22132208            event.type = TRACE_EVENT_PACKET;
    2214             dpdk_ready_pkts(FORMAT(trace), &FORMAT(trace)->per_lcore[0], pkts_burst, 1, &packet);
     2209            dpdk_ready_pkts(trace, &FORMAT(trace)->per_lcore[0], pkts_burst, 1, &packet);
    22152210            event.size = 1; // TODO should be bytes read, which essentially useless anyway
    22162211
Note: See TracChangeset for help on using the changeset viewer.