WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] Add version number to API between net

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] Add version number to API between netfront and accel plugin.
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 04 Oct 2007 17:42:18 -0700
Delivery-date: Thu, 04 Oct 2007 18:47:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1191420090 -3600
# Node ID e7a3f045cb60f2db1e38f65d9cca5934e4234f53
# Parent  df158d6b9e579730ac3868e291ccbb6570980442
Add version number to API between netfront and accel plugin.
Signed-off-by: Kieran Mansley <kmansley@xxxxxxxxxxxxxx>
---
 drivers/xen/netfront/accel.c    |   17 ++++++++++++++++-
 drivers/xen/netfront/netfront.h |   13 +++++++++++--
 2 files changed, 27 insertions(+), 3 deletions(-)

diff -r df158d6b9e57 -r e7a3f045cb60 drivers/xen/netfront/accel.c
--- a/drivers/xen/netfront/accel.c      Wed Oct 03 15:00:42 2007 +0100
+++ b/drivers/xen/netfront/accel.c      Wed Oct 03 15:01:30 2007 +0100
@@ -406,11 +406,26 @@ accelerator_probe_vifs_on_load(struct ne
 /* 
  * Called by the netfront accelerator plugin module when it has loaded 
  */
-int netfront_accelerator_loaded(const char *frontend, 
+int netfront_accelerator_loaded(int version, const char *frontend, 
                                struct netfront_accel_hooks *hooks)
 {
        struct netfront_accelerator *accelerator;
        unsigned flags;
+
+       if (version != NETFRONT_ACCEL_VERSION) {
+               if (version > NETFRONT_ACCEL_VERSION) {
+                       /* Caller has higher version number, leave it
+                          up to them to decide whether to continue.
+                          They can re-call with a lower number if
+                          they're happy to be compatible with us */
+                       return NETFRONT_ACCEL_VERSION;
+               } else {
+                       /* We have a more recent version than caller.
+                          Currently reject, but may in future be able
+                          to be backwardly compatible */
+                       return -EPROTO;
+               }
+       }
 
        spin_lock_irqsave(&accelerators_lock, flags);
 
diff -r df158d6b9e57 -r e7a3f045cb60 drivers/xen/netfront/netfront.h
--- a/drivers/xen/netfront/netfront.h   Wed Oct 03 15:00:42 2007 +0100
+++ b/drivers/xen/netfront/netfront.h   Wed Oct 03 15:01:30 2007 +0100
@@ -98,6 +98,11 @@ struct netfront_accel_hooks {
        int (*check_busy)(struct net_device *dev);
 };
 
+
+/* Version of API/protocol for communication between netfront and
+   acceleration plugin supported */
+#define NETFRONT_ACCEL_VERSION 0x00010000
+
 /* 
  * Per-netfront device state for the accelerator.  This is used to
  * allow efficient per-netfront device access to the accelerator
@@ -221,8 +226,12 @@ struct netfront_info {
  *
  * frontend: the string describing the accelerator, currently the module name 
  * hooks: the hooks for netfront to use to call into the accelerator
- */
-extern int netfront_accelerator_loaded(const char *frontend, 
+ * version: the version of API between frontend and plugin requested
+ * 
+ * return: 0 on success, <0 on error, >0 (with version supported) on
+ * version mismatch
+ */
+extern int netfront_accelerator_loaded(int version, const char *frontend, 
                                       struct netfront_accel_hooks *hooks);
 
 /* 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] Add version number to API between netfront and accel plugin., Xen patchbot-linux-2.6.18-xen <=