Skip to content

Commit

Permalink
netdev-provider: fix comments for netdev_rxq_recv
Browse files Browse the repository at this point in the history
Commit 64839cf applies batch objects to netdev-providers, but
some comments were not updated accordingly. Fix these:
   - replace 'pkts' with 'batch'
   - replace '*cnt' with 'batch->count'
   - replace MAX_RX_BATCH with NETDEV_MAX_BURST
   - remove superfluous whitespace

Signed-off-by: Mark Kavanagh <[email protected]>
Acked-by: William Tu <[email protected]>
Acked-by: Daniele Di Proietto <[email protected]>
  • Loading branch information
mark-kavanagh authored and ddiproietto committed Jul 27, 2016
1 parent 9b2cc0c commit c90e4d9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/netdev-provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -730,8 +730,8 @@ struct netdev_class {

/* Attempts to receive a batch of packets from 'rx'. In 'batch', the
* caller supplies 'packets' as the pointer to the beginning of an array
* of MAX_RX_BATCH pointers to dp_packet. If successful, the
* implementation stores pointers to up to MAX_RX_BATCH dp_packets into
* of NETDEV_MAX_BURST pointers to dp_packet. If successful, the
* implementation stores pointers to up to NETDEV_MAX_BURST dp_packets into
* the array, transferring ownership of the packets to the caller, stores
* the number of received packets into 'count', and returns 0.
*
Expand Down
15 changes: 8 additions & 7 deletions lib/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,14 +614,15 @@ netdev_rxq_close(struct netdev_rxq *rx)
}
}

/* Attempts to receive a batch of packets from 'rx'. 'pkts' should point to
* the beginning of an array of MAX_RX_BATCH pointers to dp_packet. If
* successful, this function stores pointers to up to MAX_RX_BATCH dp_packets
* into the array, transferring ownership of the packets to the caller, stores
* the number of received packets into '*cnt', and returns 0.
/* Attempts to receive a batch of packets from 'rx'. 'batch' should point to
* the beginning of an array of NETDEV_MAX_BURST pointers to dp_packet. If
* successful, this function stores pointers to up to NETDEV_MAX_BURST
* dp_packets into the array, transferring ownership of the packets to the
* caller, stores the number of received packets in 'batch->count', and returns
* 0.
*
* The implementation does not necessarily initialize any non-data members of
* 'pkts'. That is, the caller must initialize layer pointers and metadata
* 'batch'. That is, the caller must initialize layer pointers and metadata
* itself, if desired, e.g. with pkt_metadata_init() and miniflow_extract().
*
* Returns EAGAIN immediately if no packet is ready to be received or another
Expand All @@ -631,7 +632,7 @@ netdev_rxq_recv(struct netdev_rxq *rx, struct dp_packet_batch *batch)
{
int retval;

retval = rx->netdev->netdev_class->rxq_recv(rx, batch);
retval = rx->netdev->netdev_class->rxq_recv(rx, batch);
if (!retval) {
COVERAGE_INC(netdev_received);
} else {
Expand Down

0 comments on commit c90e4d9

Please sign in to comment.