Merge "sflow" into "master".
authorBen Pfaff <blp@nicira.com>
Mon, 25 Jan 2010 18:52:28 +0000 (10:52 -0800)
committerBen Pfaff <blp@nicira.com>
Mon, 25 Jan 2010 18:52:28 +0000 (10:52 -0800)
No conflicts, but lib/dpif.c needed a few changes since struct dpif's
member "class" was renamed to "dpif_class" in master since sflow was
branched off.

1  2 
configure.ac
datapath/datapath.c
datapath/datapath.h
lib/automake.mk
lib/dpif-provider.h
lib/dpif.c
lib/netdev.c
vswitchd/ovs-vswitchd.conf.5.in

diff --cc configure.ac
Simple merge
Simple merge
Simple merge
diff --cc lib/automake.mk
Simple merge
Simple merge
diff --cc lib/dpif.c
@@@ -845,6 -844,41 +845,41 @@@ dpif_recv_set_mask(struct dpif *dpif, i
      return error;
  }
  
 -    int error = (dpif->class->get_sflow_probability
 -                 ? dpif->class->get_sflow_probability(dpif, probability)
+ /* Retrieve the sFlow sampling probability.  '*probability' is expressed as the
+  * number of packets out of UINT_MAX to sample, e.g. probability/UINT_MAX is
+  * the probability of sampling a given packet.
+  *
+  * Returns 0 if successful, otherwise a positive errno value.  EOPNOTSUPP
+  * indicates that 'dpif' does not support sFlow sampling. */
+ int
+ dpif_get_sflow_probability(const struct dpif *dpif, uint32_t *probability)
+ {
 -    int error = (dpif->class->set_sflow_probability
 -                 ? dpif->class->set_sflow_probability(dpif, probability)
++    int error = (dpif->dpif_class->get_sflow_probability
++                 ? dpif->dpif_class->get_sflow_probability(dpif, probability)
+                  : EOPNOTSUPP);
+     if (error) {
+         *probability = 0;
+     }
+     log_operation(dpif, "get_sflow_probability", error);
+     return error;
+ }
+ /* Set the sFlow sampling probability.  'probability' is expressed as the
+  * number of packets out of UINT_MAX to sample, e.g. probability/UINT_MAX is
+  * the probability of sampling a given packet.
+  *
+  * Returns 0 if successful, otherwise a positive errno value.  EOPNOTSUPP
+  * indicates that 'dpif' does not support sFlow sampling. */
+ int
+ dpif_set_sflow_probability(struct dpif *dpif, uint32_t probability)
+ {
++    int error = (dpif->dpif_class->set_sflow_probability
++                 ? dpif->dpif_class->set_sflow_probability(dpif, probability)
+                  : EOPNOTSUPP);
+     log_operation(dpif, "set_sflow_probability", error);
+     return error;
+ }
  /* Attempts to receive a message from 'dpif'.  If successful, stores the
   * message into '*packetp'.  The message, if one is received, will begin with
   * 'struct odp_msg' as a header.  Only messages of the types selected with
diff --cc lib/netdev.c
Simple merge
Simple merge