#include <rte_eal.h>
#include <rte_pci.h>
#include <rte_ethdev.h>
+#include <rte_ether.h>
#include <rte_cycles.h>
#include <rte_memzone.h>
if (oi.needs_ip_csum) {
head->ol_flags |= PKT_TX_IP_CKSUM;
// TODO: Take a VLAN header into an account here
- head->l2_len = sizeof(struct ether_hdr);
+ head->l2_len = sizeof(struct rte_ether_hdr);
head->l3_len = oi.ip_hdr_len;
}
if (qp.port().get_hw_features().tx_csum_l4_offload) {
if (oi.protocol == ip_protocol_num::tcp) {
head->ol_flags |= PKT_TX_TCP_CKSUM;
// TODO: Take a VLAN header into an account here
- head->l2_len = sizeof(struct ether_hdr);
+ head->l2_len = sizeof(struct rte_ether_hdr);
head->l3_len = oi.ip_hdr_len;
if (oi.tso_seg_size) {
public:
tx_buf(tx_buf_factory& fc) : _fc(fc) {
- _buf_physaddr = _mbuf.buf_physaddr;
+ _buf_physaddr = _mbuf.buf_iova;
_data_off = _mbuf.data_off;
}
// Set the mbuf to point to our data
_mbuf.buf_addr = va;
- _mbuf.buf_physaddr = pa;
+ _mbuf.buf_iova = pa;
_mbuf.data_off = 0;
_is_zc = true;
}
// to call the "packet"'s destructor and reset the
// "optional" state to "nonengaged".
//
- _p.destroy();
+ _p.reset();
} else if (!_is_zc) {
return;
}
// Restore the rte_mbuf fields we trashed in set_zc_info()
- _mbuf.buf_physaddr = _buf_physaddr;
+ _mbuf.buf_iova = _buf_physaddr;
_mbuf.buf_addr = rte_mbuf_to_baddr(&_mbuf);
_mbuf.data_off = _data_off;
// actual data buffer.
//
m->buf_addr = (char*)data - RTE_PKTMBUF_HEADROOM;
- m->buf_physaddr = rte_mem_virt2phy(data) - RTE_PKTMBUF_HEADROOM;
+ m->buf_iova = rte_mem_virt2iova(data) - RTE_PKTMBUF_HEADROOM;
return true;
}
return sub;
}
ethernet_address hw_address() {
- struct ether_addr mac;
+ struct rte_ether_addr mac;
rte_eth_macaddr_get(_port_idx, &mac);
return mac.addr_bytes;