summaryrefslogtreecommitdiff
path: root/lib/dpif-provider.h
diff options
context:
space:
mode:
authorAlex Wang <ee07b291@gmail.com>2015-08-25 16:36:46 -0700
committerAlex Wang <ee07b291@gmail.com>2015-09-02 05:57:59 +0000
commite4e74c3a2b9a83544cb976e5049fb65da9ecbed5 (patch)
treec0f27f679786c6c3ac119a832b74fc4296642bd5 /lib/dpif-provider.h
parentdba82d38b81894abfa574149105e27dafe9bd6b5 (diff)
downloadopenvswitch-e4e74c3a2b9a83544cb976e5049fb65da9ecbed5.tar.gz
dpif-netdev: Purge all ukeys when reconfigure pmd.
When dpdk configuration changes, all pmd threads are recreated and rx queues of each port are reloaded. After this process, rx queue could be mapped to a different pmd thread other than the one before reconfiguration. However, this is totally transparent to ofproto layer modules. So, if the ofproto-dpif-upcall module still holds ukeys generated before pmd thread recreation, this old ukey will collide with the ukey for the new upcalls from same traffic flow, causing flow installation failure. To fix the bug, this commit adds a new call-back function in dpif layer for notifying upper layer the purging of datapath (e.g. pmd thread deletion in dpif-netdev). So, the ofproto-dpif-upcall module can react properly with deleting the ukeys and with collecting flows' last stats. Reported-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Alex Wang <ee07b291@gmail.com> Acked-by: Daniele Di Proietto <diproiettod@vmware.com> Tested-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Joe Stringer <joestringer@nicira.com>
Diffstat (limited to 'lib/dpif-provider.h')
-rw-r--r--lib/dpif-provider.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/dpif-provider.h b/lib/dpif-provider.h
index 28ea86f48..54158977d 100644
--- a/lib/dpif-provider.h
+++ b/lib/dpif-provider.h
@@ -361,13 +361,22 @@ struct dpif_class {
* return. */
void (*recv_purge)(struct dpif *dpif);
+ /* When 'dpif' is about to purge the datapath, the higher layer may want
+ * to be notified so that it could try reacting accordingly (e.g. grabbing
+ * all flow stats before they are gone).
+ *
+ * Registers an upcall callback function with 'dpif'. This is only used
+ * if 'dpif' needs to notify the purging of datapath. 'aux' is passed to
+ * the callback on invocation. */
+ void (*register_dp_purge_cb)(struct dpif *, dp_purge_callback *, void *aux);
+
/* For datapaths that run in userspace (i.e. dpif-netdev), threads polling
* for incoming packets can directly call upcall functions instead of
* offloading packet processing to separate handler threads. Datapaths
* that directly call upcall functions should use the functions below to
* to register an upcall function and enable / disable upcalls.
*
- * Registers an upcall callback function with 'dpif'. This is only used if
+ * Registers an upcall callback function with 'dpif'. This is only used
* if 'dpif' directly executes upcall functions. 'aux' is passed to the
* callback on invocation. */
void (*register_upcall_cb)(struct dpif *, upcall_callback *, void *aux);