/* check for vlan info */
if (ppd->tp_status & TP_STATUS_VLAN_VALID) {
mbuf->vlan_tci = ppd->tp_vlan_tci;
- mbuf->ol_flags |= (PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED);
+ mbuf->ol_flags |= (RTE_MBUF_F_RX_VLAN | RTE_MBUF_F_RX_VLAN_STRIPPED);
if (!pkt_q->vlan_strip && rte_vlan_insert(&mbuf))
PMD_LOG(ERR, "Failed to reinsert VLAN tag");
}
/* insert vlan info if necessary */
- if (mbuf->ol_flags & PKT_TX_VLAN) {
+ if (mbuf->ol_flags & RTE_MBUF_F_TX_VLAN) {
if (rte_vlan_insert(&mbuf)) {
rte_pktmbuf_free(mbuf);
continue;
}
/* point at the next incoming frame */
- if (!tx_ring_status_available(ppd->tp_status) &&
- poll(&pfd, 1, -1) < 0)
+ if (!tx_ring_status_available(ppd->tp_status)) {
+ if (poll(&pfd, 1, -1) < 0)
+ break;
+
+ /* poll() can return POLLERR if the interface is down */
+ if (pfd.revents & POLLERR)
+ break;
+ }
+
+ /*
+ * poll() will almost always return POLLOUT, even if there
+ * are no extra buffers available
+ *
+ * This happens, because packet_poll() calls datagram_poll()
+ * which checks the space left in the socket buffer and,
+ * in the case of packet_mmap, the default socket buffer length
+ * doesn't match the requested size for the tx_ring.
+ * As such, there is almost always space left in socket buffer,
+ * which doesn't seem to be correlated to the requested size
+ * for the tx_ring in packet_mmap.
+ *
+ * This results in poll() returning POLLOUT.
+ */
+ if (!tx_ring_status_available(ppd->tp_status))
break;
/* copy the tx frame data */
dev_info->if_index = internals->if_index;
dev_info->max_mac_addrs = 1;
- dev_info->max_rx_pktlen = (uint32_t)ETH_FRAME_LEN;
+ dev_info->max_rx_pktlen = RTE_ETHER_MAX_LEN;
dev_info->max_rx_queues = (uint16_t)internals->nb_queues;
dev_info->max_tx_queues = (uint16_t)internals->nb_queues;
dev_info->min_rx_bufsize = 0;