[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] Solarflare: Various build fixes, and make SFC drivers dependent on x86



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1203530747 0
# Node ID 8c8a097cae698dc0808bcbb66b3de423064b59a3
# Parent  a70eddc1004e9ec6a8ad5363b80ad71e798dfa6c
Solarflare: Various build fixes, and make SFC drivers dependent on x86
From: Kieran Mansley <kmansley@xxxxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 drivers/net/sfc/Kconfig                              |    2 
 drivers/net/sfc/sfc_resource/ci/efhw/common_sysdep.h |    6 ++
 drivers/net/sfc/tenxpress.c                          |    2 
 drivers/net/sfc/txc43128_phy.c                       |    2 
 drivers/xen/Kconfig                                  |    5 +-
 drivers/xen/sfc_netback/accel.c                      |    4 -
 drivers/xen/sfc_netback/accel.h                      |    2 
 drivers/xen/sfc_netback/accel_debugfs.c              |   22 ---------
 drivers/xen/sfc_netback/accel_xenbus.c               |    2 
 drivers/xen/sfc_netfront/accel.h                     |    4 -
 drivers/xen/sfc_netfront/accel_bufs.c                |    4 -
 drivers/xen/sfc_netfront/accel_debugfs.c             |   23 ---------
 drivers/xen/sfc_netfront/accel_msg.c                 |    4 -
 drivers/xen/sfc_netfront/accel_netfront.c            |   11 ++--
 fs/debugfs/file.c                                    |   45 +++++++++++++++++++
 include/linux/debugfs.h                              |    9 +++
 16 files changed, 82 insertions(+), 65 deletions(-)

diff -r a70eddc1004e -r 8c8a097cae69 drivers/net/sfc/Kconfig
--- a/drivers/net/sfc/Kconfig   Wed Feb 20 17:44:08 2008 +0000
+++ b/drivers/net/sfc/Kconfig   Wed Feb 20 18:05:47 2008 +0000
@@ -28,7 +28,7 @@ config SFC_MTD
          new boot ROM to the NIC.
 
 config SFC_RESOURCE
-       depends on SFC
+       depends on SFC && X86
        tristate "Solarflare Solarstorm SFC4000 resource driver"
        help
          This module provides the SFC resource manager driver.
diff -r a70eddc1004e -r 8c8a097cae69 
drivers/net/sfc/sfc_resource/ci/efhw/common_sysdep.h
--- a/drivers/net/sfc/sfc_resource/ci/efhw/common_sysdep.h      Wed Feb 20 
17:44:08 2008 +0000
+++ b/drivers/net/sfc/sfc_resource/ci/efhw/common_sysdep.h      Wed Feb 20 
18:05:47 2008 +0000
@@ -52,8 +52,12 @@
 
 /* Linux kernel also does not provide PRIx32... Sigh. */
 #define PRIx32 "x"
-#define PRIx64 "llx"
 
+#ifdef __ia64__
+# define PRIx64 "lx"
+#else
+# define PRIx64 "llx"
+#endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
 enum {
diff -r a70eddc1004e -r 8c8a097cae69 drivers/net/sfc/tenxpress.c
--- a/drivers/net/sfc/tenxpress.c       Wed Feb 20 17:44:08 2008 +0000
+++ b/drivers/net/sfc/tenxpress.c       Wed Feb 20 18:05:47 2008 +0000
@@ -391,9 +391,11 @@ static int tenxpress_phy_init(struct efx
        if (rc < 0)
                goto fail;
 
+#ifdef CONFIG_SFC_DEBUGFS
        rc = tenxpress_debugfs_init(efx);
        if (rc < 0)
                goto fail;
+#endif
 
        schedule_timeout_uninterruptible(HZ / 5); /* 200ms */
 
diff -r a70eddc1004e -r 8c8a097cae69 drivers/net/sfc/txc43128_phy.c
--- a/drivers/net/sfc/txc43128_phy.c    Wed Feb 20 17:44:08 2008 +0000
+++ b/drivers/net/sfc/txc43128_phy.c    Wed Feb 20 18:05:47 2008 +0000
@@ -644,8 +644,8 @@ static void txc43128_phy_fini(struct efx
  * don't use LASI interrupts. Also update the BER counters and poll the lm87 */
 static int txc43128_phy_check_hw(struct efx_nic *efx)
 {
+       struct txc43128_data *data = efx->phy_data;
 #ifdef CONFIG_SFC_DEBUGFS
-       struct txc43128_data *data = efx->phy_data;
        int phy = efx->mii.phy_id;
        int timer, count, i, mmd;
 #endif
diff -r a70eddc1004e -r 8c8a097cae69 drivers/xen/Kconfig
--- a/drivers/xen/Kconfig       Wed Feb 20 17:44:08 2008 +0000
+++ b/drivers/xen/Kconfig       Wed Feb 20 18:05:47 2008 +0000
@@ -81,11 +81,12 @@ config XEN_NETDEV_PIPELINED_TRANSMITTER
 
 config XEN_NETDEV_ACCEL_SFC_UTIL
         tristate
+        depends on X86
         default n
 
 config XEN_NETDEV_ACCEL_SFC_BACKEND
        tristate "Network-device backend driver acceleration for Solarflare 
NICs"
-        depends on XEN_NETDEV_BACKEND
+        depends on XEN_NETDEV_BACKEND && SFC && SFC_RESOURCE && X86
         select XEN_NETDEV_ACCEL_SFC_UTIL
         default m
 
@@ -194,7 +195,7 @@ config XEN_GRANT_DEV
 
 config XEN_NETDEV_ACCEL_SFC_FRONTEND
        tristate "Network-device frontend driver acceleration for Solarflare 
NICs"
-       depends on XEN_NETDEV_FRONTEND
+       depends on XEN_NETDEV_FRONTEND && X86
         select XEN_NETDEV_ACCEL_SFC_UTIL
        default m
 
diff -r a70eddc1004e -r 8c8a097cae69 drivers/xen/sfc_netback/accel.c
--- a/drivers/xen/sfc_netback/accel.c   Wed Feb 20 17:44:08 2008 +0000
+++ b/drivers/xen/sfc_netback/accel.c   Wed Feb 20 18:05:47 2008 +0000
@@ -71,8 +71,8 @@ static struct notifier_block netback_acc
 };
 
 
-unsigned max_pages = NETBACK_ACCEL_DEFAULT_MAX_BUF_PAGES;
-module_param(max_pages, int, 0666);
+unsigned sfc_netback_max_pages = NETBACK_ACCEL_DEFAULT_MAX_BUF_PAGES;
+module_param_named(max_pages, sfc_netback_max_pages, uint, 0666);
 MODULE_PARM_DESC(max_pages, 
                 "The number of buffer pages to enforce on each guest");
 
diff -r a70eddc1004e -r 8c8a097cae69 drivers/xen/sfc_netback/accel.h
--- a/drivers/xen/sfc_netback/accel.h   Wed Feb 20 17:44:08 2008 +0000
+++ b/drivers/xen/sfc_netback/accel.h   Wed Feb 20 18:05:47 2008 +0000
@@ -49,7 +49,7 @@
 #define NETBACK_ACCEL_DEFAULT_MAX_MCASTS (8)
 #define NETBACK_ACCEL_DEFAULT_MAX_BUF_PAGES (384)
 /* Variable to store module parameter for max_buf_pages */
-extern unsigned max_pages;
+extern unsigned sfc_netback_max_pages;
 
 #define NETBACK_ACCEL_STATS 1
 
diff -r a70eddc1004e -r 8c8a097cae69 drivers/xen/sfc_netback/accel_debugfs.c
--- a/drivers/xen/sfc_netback/accel_debugfs.c   Wed Feb 20 17:44:08 2008 +0000
+++ b/drivers/xen/sfc_netback/accel_debugfs.c   Wed Feb 20 18:05:47 2008 +0000
@@ -37,28 +37,6 @@ static struct netback_accel_global_dbfs 
 static struct netback_accel_global_dbfs  global_dbfs;
 #endif
 #endif
-
-/*
- * Extend debugfs helper functions to have a u64 version
- */ 
-static void debugfs_u64_set(void *data, u64 val)
-{
-  *(u64 *)data = val;
-}
-
-static u64 debugfs_u64_get(void *data)
-{
-  return *(u64 *)data;
-}
-
-DEFINE_SIMPLE_ATTRIBUTE(fops_u64, debugfs_u64_get, debugfs_u64_set, "%llu\n");
-
-struct dentry *debugfs_create_u64(const char *name, mode_t mode,
-                                  struct dentry *parent, u64 *value)
-{
-  return debugfs_create_file(name, mode, parent, value, &fops_u64);
-}
-
 
 void netback_accel_debugfs_init(void) 
 {
diff -r a70eddc1004e -r 8c8a097cae69 drivers/xen/sfc_netback/accel_xenbus.c
--- a/drivers/xen/sfc_netback/accel_xenbus.c    Wed Feb 20 17:44:08 2008 +0000
+++ b/drivers/xen/sfc_netback/accel_xenbus.c    Wed Feb 20 18:05:47 2008 +0000
@@ -113,7 +113,7 @@ void cfg_hw_quotas(struct xenbus_device 
                 */
                DPRINTK("Failed to read quotas from xenbus, using defaults\n");
                bend->quotas.max_filters = NETBACK_ACCEL_DEFAULT_MAX_FILTERS;
-               bend->quotas.max_buf_pages = max_pages;
+               bend->quotas.max_buf_pages = sfc_netback_max_pages;
                bend->quotas.max_mcasts = NETBACK_ACCEL_DEFAULT_MAX_MCASTS;
        }
 
diff -r a70eddc1004e -r 8c8a097cae69 drivers/xen/sfc_netfront/accel.h
--- a/drivers/xen/sfc_netfront/accel.h  Wed Feb 20 17:44:08 2008 +0000
+++ b/drivers/xen/sfc_netfront/accel.h  Wed Feb 20 18:05:47 2008 +0000
@@ -336,8 +336,8 @@ typedef struct netfront_accel_vnic {
 
 
 /* Module parameters */
-extern unsigned max_pages;
-extern unsigned buffer_split;
+extern unsigned sfc_netfront_max_pages;
+extern unsigned sfc_netfront_buffer_split;
 
 extern const char *frontend_name;
 extern struct netfront_accel_hooks accel_hooks;
diff -r a70eddc1004e -r 8c8a097cae69 drivers/xen/sfc_netfront/accel_bufs.c
--- a/drivers/xen/sfc_netfront/accel_bufs.c     Wed Feb 20 17:44:08 2008 +0000
+++ b/drivers/xen/sfc_netfront/accel_bufs.c     Wed Feb 20 18:05:47 2008 +0000
@@ -72,12 +72,12 @@ int netfront_accel_alloc_buffer_mem(stru
        int n, rc;
 
        if ((rc = netfront_accel_alloc_buf_desc_blocks
-            (rx_manager, pages - (pages / buffer_split))) < 0) {
+            (rx_manager, pages - (pages / sfc_netfront_buffer_split))) < 0) {
                goto rx_fail;
        }
 
        if ((rc = netfront_accel_alloc_buf_desc_blocks
-            (tx_manager, pages / buffer_split)) < 0) {
+            (tx_manager, pages / sfc_netfront_buffer_split)) < 0) {
                goto tx_fail;
        }
 
diff -r a70eddc1004e -r 8c8a097cae69 drivers/xen/sfc_netfront/accel_debugfs.c
--- a/drivers/xen/sfc_netfront/accel_debugfs.c  Wed Feb 20 17:44:08 2008 +0000
+++ b/drivers/xen/sfc_netfront/accel_debugfs.c  Wed Feb 20 18:05:47 2008 +0000
@@ -30,29 +30,6 @@
 #if defined(CONFIG_DEBUG_FS)
 static struct dentry *sfc_debugfs_root = NULL;
 #endif
-
-
-/*
- * Extend debugfs helper functions to have a u64 version
- */
-static void debugfs_u64_set(void *data, u64 val)
-{
-  *(u64 *)data = val;
-}
-
-static u64 debugfs_u64_get(void *data)
-{
-  return *(u64 *)data;
-}
-
-DEFINE_SIMPLE_ATTRIBUTE(fops_u64, debugfs_u64_get, debugfs_u64_set, "%llu\n");
-
-struct dentry *debugfs_create_u64(const char *name, mode_t mode,
-                                 struct dentry *parent, u64 *value)
-{
-  return debugfs_create_file(name, mode, parent, value, &fops_u64);
-}
-
 
 void netfront_accel_debugfs_init(void) 
 {
diff -r a70eddc1004e -r 8c8a097cae69 drivers/xen/sfc_netfront/accel_msg.c
--- a/drivers/xen/sfc_netfront/accel_msg.c      Wed Feb 20 17:44:08 2008 +0000
+++ b/drivers/xen/sfc_netfront/accel_msg.c      Wed Feb 20 18:05:47 2008 +0000
@@ -157,7 +157,7 @@ static int vnic_add_bufs(netfront_accel_
        offset = msg->u.mapbufs.reqid;
 
        if (offset < vnic->bufpages.max_pages - 
-           (vnic->bufpages.max_pages / buffer_split)) {
+           (vnic->bufpages.max_pages / sfc_netfront_buffer_split)) {
                bufinfo = vnic->rx_bufs;
        } else
                bufinfo = vnic->tx_bufs;
@@ -286,7 +286,7 @@ static int vnic_process_hello_msg(netfro
                                  struct net_accel_msg *msg)
 {
        int err = 0;
-       unsigned pages = max_pages;
+       unsigned pages = sfc_netfront_max_pages;
 
        if (vnic_check_hello_version(msg->u.hello.version) < 0) {
                msg->id = NET_ACCEL_MSG_HELLO | NET_ACCEL_MSG_REPLY 
diff -r a70eddc1004e -r 8c8a097cae69 drivers/xen/sfc_netfront/accel_netfront.c
--- a/drivers/xen/sfc_netfront/accel_netfront.c Wed Feb 20 17:44:08 2008 +0000
+++ b/drivers/xen/sfc_netfront/accel_netfront.c Wed Feb 20 18:05:47 2008 +0000
@@ -234,13 +234,14 @@ struct netfront_accel_hooks accel_hooks 
 };
 
 
-unsigned max_pages = NETFRONT_ACCEL_DEFAULT_BUF_PAGES;
-module_param (max_pages, int, 0666);
+unsigned sfc_netfront_max_pages = NETFRONT_ACCEL_DEFAULT_BUF_PAGES;
+module_param_named (max_pages, sfc_netfront_max_pages, uint, 0666);
 MODULE_PARM_DESC(max_pages, "Number of buffer pages to request");
 
-unsigned buffer_split = 2;
-module_param (buffer_split, int, 0666);
-MODULE_PARM_DESC(buffer_split, "Fraction of buffers to use for TX, rest for 
RX");
+unsigned sfc_netfront_buffer_split = 2;
+module_param_named (buffer_split, sfc_netfront_buffer_split, uint, 0666);
+MODULE_PARM_DESC(buffer_split, 
+                "Fraction of buffers to use for TX, rest for RX");
 
 
 const char *frontend_name = "sfc_netfront";
diff -r a70eddc1004e -r 8c8a097cae69 fs/debugfs/file.c
--- a/fs/debugfs/file.c Wed Feb 20 17:44:08 2008 +0000
+++ b/fs/debugfs/file.c Wed Feb 20 18:05:47 2008 +0000
@@ -169,6 +169,51 @@ struct dentry *debugfs_create_u32(const 
        return debugfs_create_file(name, mode, parent, value, &fops_u32);
 }
 EXPORT_SYMBOL_GPL(debugfs_create_u32);
+
+
+static void debugfs_u64_set(void *data, u64 val)
+{
+       *(u64 *)data = val;
+}
+
+static u64 debugfs_u64_get(void *data)
+{
+       return *(u64 *)data;
+}
+DEFINE_SIMPLE_ATTRIBUTE(fops_u64, debugfs_u64_get, debugfs_u64_set, "%llu\n");
+
+/**
+ * debugfs_create_u64 - create a file in the debugfs filesystem that is used 
to read and write an unsigned 64 bit value.
+ *
+ * @name: a pointer to a string containing the name of the file to create.
+ * @mode: the permission that the file should have
+ * @parent: a pointer to the parent dentry for this file.  This should be a
+ *          directory dentry if set.  If this paramater is NULL, then the
+ *          file will be created in the root of the debugfs filesystem.
+ * @value: a pointer to the variable that the file should read to and write
+ *         from.
+ *
+ * This function creates a file in debugfs with the given name that
+ * contains the value of the variable @value.  If the @mode variable is so
+ * set, it can be read from, and written to.
+ *
+ * This function will return a pointer to a dentry if it succeeds.  This
+ * pointer must be passed to the debugfs_remove() function when the file is
+ * to be removed (no automatic cleanup happens if your module is unloaded,
+ * you are responsible here.)  If an error occurs, NULL will be returned.
+ *
+ * If debugfs is not enabled in the kernel, the value -ENODEV will be
+ * returned.  It is not wise to check for this value, but rather, check for
+ * NULL or !NULL instead as to eliminate the need for #ifdef in the calling
+ * code.
+ */
+struct dentry *debugfs_create_u64(const char *name, mode_t mode,
+                                 struct dentry *parent, u64 *value)
+{
+       return debugfs_create_file(name, mode, parent, value, &fops_u64);
+}
+EXPORT_SYMBOL_GPL(debugfs_create_u64);
+
 
 static ssize_t read_file_bool(struct file *file, char __user *user_buf,
                              size_t count, loff_t *ppos)
diff -r a70eddc1004e -r 8c8a097cae69 include/linux/debugfs.h
--- a/include/linux/debugfs.h   Wed Feb 20 17:44:08 2008 +0000
+++ b/include/linux/debugfs.h   Wed Feb 20 18:05:47 2008 +0000
@@ -41,6 +41,8 @@ struct dentry *debugfs_create_u16(const 
                                  struct dentry *parent, u16 *value);
 struct dentry *debugfs_create_u32(const char *name, mode_t mode,
                                  struct dentry *parent, u32 *value);
+struct dentry *debugfs_create_u64(const char *name, mode_t mode,
+                                 struct dentry *parent, u64 *value);
 struct dentry *debugfs_create_bool(const char *name, mode_t mode,
                                  struct dentry *parent, u32 *value);
 
@@ -94,6 +96,13 @@ static inline struct dentry *debugfs_cre
        return ERR_PTR(-ENODEV);
 }
 
+static inline struct dentry *debugfs_create_u64(const char *name, mode_t mode,
+                                               struct dentry *parent,
+                                               u64 *value)
+{
+       return ERR_PTR(-ENODEV);
+}
+
 static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode,
                                                 struct dentry *parent,
                                                 u32 *value)

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.