Hi Antonio,

> -----Original Message-----
> From: [email protected] [mailto:ovs-dev-
> [email protected]] On Behalf Of [email protected]
> Sent: 11 August 2017 11:57
> To: [email protected]
> Subject: [ovs-dev] [PATCH] dpif-netdev: Fix comments in function headers
> 
> Fix comments for emc_processing and dp_netdev_input__ regarding
> md_is_valid.
> 
> Signed-off-by: Antonio Fischetti <[email protected]>
> ---
>  lib/dpif-netdev.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index e2cd931..5c5c20e
> 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -4660,8 +4660,11 @@ dp_netdev_queue_batches(struct dp_packet
> *pkt,
>   * The function returns the number of packets that needs to be processed in
> the
>   * 'packets' array (they have been moved to the beginning of the vector).
>   *
> - * If 'md_is_valid' is false, the metadata in 'packets' is not valid and must
> - * be initialized by this function using 'port_no'.
> + * For performance reasons a caller may choose not to initialize the
> + metadata
> + * in 'packets_'.  If 'md_is_valid' is false, the metadata in 'packets'
> + * is not valid and must be initialized by this function using 'port_no'.
> + * If 'md_is_valid' is true, the metadata is already valid and 'port_no'
> + * will be ignored.
>   */

I like your explanation more, stating why the metadata might not be initialized.
One nit for the above: if I wrap lines at 79 characters according to the 
CodingStyle.rst, the above can be changed to:

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 8b33bd3..73e6067 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -4859,10 +4859,10 @@ dp_netdev_queue_batches(struct dp_packet *pkt,
  * 'packets' array (they have been moved to the beginning of the vector).
  *
  * For performance reasons a caller may choose not to initialize the metadata
- * in 'packets_'.  If 'md_is_valid' is false, the metadata in 'packets'
- * is not valid and must be initialized by this function using 'port_no'.
- * If 'md_is_valid' is true, the metadata is already valid and 'port_no'
- * will be ignored.
+ * in 'packets_'.  If 'md_is_valid' is false, the metadata in 'packets' is not
+ * valid and must be initialized by this function using 'port_no'.  If
+ * 'md_is_valid' is true, the metadata is already valid and 'port_no' will be
+ * ignored.
  */
 static inline size_t
 emc_processing(struct dp_netdev_pmd_thread *pmd,

>  static inline size_t
>  emc_processing(struct dp_netdev_pmd_thread *pmd, @@ -4894,10
> +4897,8 @@ fast_path_processing(struct dp_netdev_pmd_thread *pmd,
> 
>  /* Packets enter the datapath from a port (or from recirculation) here.
>   *
> - * For performance reasons a caller may choose not to initialize the
> metadata
> - * in 'packets': in this case 'mdinit' is false and this function needs to
> - * initialize it using 'port_no'.  If the metadata in 'packets' is already
> - * valid, 'md_is_valid' must be true and 'port_no' will be ignored. */
> + * When 'md_is_valid' is true the metadata in 'packets' are already valid.
> + * When false the metadata in 'packets' need to be initialized. */

This makes more sense and is more succinct. I'm not sure what the 'mdinit' was 
in reference to before.

>  static void
>  dp_netdev_input__(struct dp_netdev_pmd_thread *pmd,
>                    struct dp_packet_batch *packets,
> --

Overall, it looks good to me.
Acked-by: Cian Ferriter <[email protected]>
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to