[dpdk-dev] [PATCH 2/3] pcap: add support for jumbo frames

Mcnamara, John john.mcnamara at intel.com
Tue Apr 28 15:52:08 CEST 2015


> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Tero Aho
> Sent: Friday, February 27, 2015 1:43 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH 2/3] pcap: add support for jumbo frames
> 
> Extend eth_pcap_rx and eth_pcap_tx to support jumbo frames.
> On receive side read large packets into multiple mbufs and on the transmit
> side do the opposite.
> 


> +eth_pcap_tx_jumbo(pcap_t *pcap,
> +                 struct rte_mbuf *mbuf) {
> +       u_char data[ETHER_MAX_JUMBO_FRAME_LEN];
> +       uint16_t data_len = 0;
> +
> +       while (mbuf != NULL) {
> +               /* There is no writev style function in libpcap, */
> +               /* we unfortunately have to copy data to a buffer. */
> +               rte_memcpy(data + data_len, rte_pktmbuf_mtod(mbuf, void
> *),
> +                          mbuf->data_len);
> +               data_len += mbuf->data_len;
> +               mbuf = mbuf->next;
> +       }

Hi Tero,

Not sure if it is possible in practice to overflow data[ETHER_MAX_JUMBO_FRAME_LEN] but there should probably be a check.

John.
-- 




More information about the dev mailing list