lib/netdev-bsd.c
/*
 * This function attempts to receive a packet from the specified network
 * device. It is assumed that the network device is a tap device and
 * 'rxq->fd' is initialized with the tap file descriptor.
 */
This function attempts to receive a packet from the specified network
device. It is assumed that the network device is a tap device and
'rxq->fd' is initialized with the tap file descriptor.
This function attempts to receive a packet from the specified network device . It is assumed that the network device is a tap device and ' rxq - > fd ' is initialized with the tap file descriptor .
static int
netdev_rxq_bsd_recv_tap(struct netdev_rxq_bsd *rxq, struct dp_packet *buffer)
{
    size_t size = dp_packet_tailroom(buffer);
    for (;;) {
        ssize_t retval = read(rxq->fd, dp_packet_data(buffer), size);
        if (retval >= 0) {
            dp_packet_set_size(buffer, dp_packet_size(buffer) + retval);
            return 0;
        } else if (errno != EINTR) {
            if (errno != EAGAIN) {
                VLOG_WARN_RL(&rl, "error receiving Ethernet packet on %s: %s",
                             ovs_strerror(errno), netdev_rxq_get_name(&rxq->up));
            }
            return errno;
        }
    }
}
static int netdev_rxq_bsd_recv_tap ( struct netdev_rxq_bsd * rxq , struct dp_packet * buffer ) { size_t size = dp_packet_tailroom ( buffer ) ; for ( ; ; ) { ssize_t retval = read ( rxq -> fd , dp_packet_data ( buffer ) , size ) ; if ( retval >= 0 ) { dp_packet_set_size ( buffer , dp_packet_size ( buffer ) + retval ) ; return 0 ; } else if ( errno != EINTR ) { if ( errno != EAGAIN ) { VLOG_WARN_RL ( & rl , " " , ovs_strerror ( errno ) , netdev_rxq_get_name ( & rxq -> up ) ) ; } return errno ; } } }
This function attempts to receive a packet from the specified network
 device.
This function attempts to receive a packet from the specified network device .