diff mbox

[ovs-dev] netdev-provider: fix comments for netdev_rxq_recv

Message ID 1469539157-187340-1-git-send-email-mark.b.kavanagh@intel.com
State Accepted
Headers show

Commit Message

Mark Kavanagh July 26, 2016, 1:19 p.m. UTC
Commit 64839cf43 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 <mark.b.kavanagh@intel.com>
---
 lib/netdev-provider.h |  4 ++--
 lib/netdev.c          | 15 ++++++++-------
 2 files changed, 10 insertions(+), 9 deletions(-)

Comments

William Tu July 26, 2016, 3:32 p.m. UTC | #1
Hi Mark,

Thanks for fixing them! looks good to me.

Signed-off-by: William Tu <u9012063@gmail.com>



On Tue, Jul 26, 2016 at 6:19 AM, Mark Kavanagh
<mark.b.kavanagh@intel.com> wrote:
> Commit 64839cf43 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 <mark.b.kavanagh@intel.com>
> ---
>  lib/netdev-provider.h |  4 ++--
>  lib/netdev.c          | 15 ++++++++-------
>  2 files changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h
> index 915a5a5..3ded6c1 100644
> --- a/lib/netdev-provider.h
> +++ b/lib/netdev-provider.h
> @@ -729,8 +729,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.
>       *
> diff --git a/lib/netdev.c b/lib/netdev.c
> index 31a6a46..be86519 100644
> --- a/lib/netdev.c
> +++ b/lib/netdev.c
> @@ -608,14 +608,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
> @@ -625,7 +626,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 {
> --
> 1.9.3
>
William Tu July 27, 2016, 12:36 a.m. UTC | #2
Sorry, this should be

Acked-by: William Tu <u9012063@gmail.com>

On Tue, Jul 26, 2016 at 8:32 AM, William Tu <u9012063@gmail.com> wrote:
> Hi Mark,
>
> Thanks for fixing them! looks good to me.
>
> Signed-off-by: William Tu <u9012063@gmail.com>
>
>
>
> On Tue, Jul 26, 2016 at 6:19 AM, Mark Kavanagh
> <mark.b.kavanagh@intel.com> wrote:
>> Commit 64839cf43 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 <mark.b.kavanagh@intel.com>
>> ---
>>  lib/netdev-provider.h |  4 ++--
>>  lib/netdev.c          | 15 ++++++++-------
>>  2 files changed, 10 insertions(+), 9 deletions(-)
>>
>> diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h
>> index 915a5a5..3ded6c1 100644
>> --- a/lib/netdev-provider.h
>> +++ b/lib/netdev-provider.h
>> @@ -729,8 +729,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.
>>       *
>> diff --git a/lib/netdev.c b/lib/netdev.c
>> index 31a6a46..be86519 100644
>> --- a/lib/netdev.c
>> +++ b/lib/netdev.c
>> @@ -608,14 +608,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
>> @@ -625,7 +626,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 {
>> --
>> 1.9.3
>>
Flavio Leitner July 28, 2016, 8:01 p.m. UTC | #3
On Tue, Jul 26, 2016 at 02:19:17PM +0100, Mark Kavanagh wrote:
> Commit 64839cf43 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 <mark.b.kavanagh@intel.com>
> ---

Acked-by: Flavio Leitner <fbl@sysclose.org>
diff mbox

Patch

diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h
index 915a5a5..3ded6c1 100644
--- a/lib/netdev-provider.h
+++ b/lib/netdev-provider.h
@@ -729,8 +729,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.
      *
diff --git a/lib/netdev.c b/lib/netdev.c
index 31a6a46..be86519 100644
--- a/lib/netdev.c
+++ b/lib/netdev.c
@@ -608,14 +608,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
@@ -625,7 +626,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 {