ia64/linux-2.6.18-xen.hg

changeset 433:8c8a097cae69

Solarflare: Various build fixes, and make SFC drivers dependent on x86
From: Kieran Mansley <kmansley@solarflare.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Feb 20 18:05:47 2008 +0000 (2008-02-20)
parents a70eddc1004e
children 3445e940a0e7
files drivers/net/sfc/Kconfig drivers/net/sfc/sfc_resource/ci/efhw/common_sysdep.h drivers/net/sfc/tenxpress.c drivers/net/sfc/txc43128_phy.c drivers/xen/Kconfig drivers/xen/sfc_netback/accel.c drivers/xen/sfc_netback/accel.h drivers/xen/sfc_netback/accel_debugfs.c drivers/xen/sfc_netback/accel_xenbus.c drivers/xen/sfc_netfront/accel.h drivers/xen/sfc_netfront/accel_bufs.c drivers/xen/sfc_netfront/accel_debugfs.c drivers/xen/sfc_netfront/accel_msg.c drivers/xen/sfc_netfront/accel_netfront.c fs/debugfs/file.c include/linux/debugfs.h
line diff
     1.1 --- a/drivers/net/sfc/Kconfig	Wed Feb 20 17:44:08 2008 +0000
     1.2 +++ b/drivers/net/sfc/Kconfig	Wed Feb 20 18:05:47 2008 +0000
     1.3 @@ -28,7 +28,7 @@ config SFC_MTD
     1.4  	  new boot ROM to the NIC.
     1.5  
     1.6  config SFC_RESOURCE
     1.7 -	depends on SFC
     1.8 +	depends on SFC && X86
     1.9  	tristate "Solarflare Solarstorm SFC4000 resource driver"
    1.10  	help
    1.11  	  This module provides the SFC resource manager driver.
     2.1 --- a/drivers/net/sfc/sfc_resource/ci/efhw/common_sysdep.h	Wed Feb 20 17:44:08 2008 +0000
     2.2 +++ b/drivers/net/sfc/sfc_resource/ci/efhw/common_sysdep.h	Wed Feb 20 18:05:47 2008 +0000
     2.3 @@ -52,8 +52,12 @@
     2.4  
     2.5  /* Linux kernel also does not provide PRIx32... Sigh. */
     2.6  #define PRIx32 "x"
     2.7 -#define PRIx64 "llx"
     2.8  
     2.9 +#ifdef __ia64__
    2.10 +# define PRIx64 "lx"
    2.11 +#else
    2.12 +# define PRIx64 "llx"
    2.13 +#endif
    2.14  
    2.15  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
    2.16  enum {
     3.1 --- a/drivers/net/sfc/tenxpress.c	Wed Feb 20 17:44:08 2008 +0000
     3.2 +++ b/drivers/net/sfc/tenxpress.c	Wed Feb 20 18:05:47 2008 +0000
     3.3 @@ -391,9 +391,11 @@ static int tenxpress_phy_init(struct efx
     3.4  	if (rc < 0)
     3.5  		goto fail;
     3.6  
     3.7 +#ifdef CONFIG_SFC_DEBUGFS
     3.8  	rc = tenxpress_debugfs_init(efx);
     3.9  	if (rc < 0)
    3.10  		goto fail;
    3.11 +#endif
    3.12  
    3.13  	schedule_timeout_uninterruptible(HZ / 5); /* 200ms */
    3.14  
     4.1 --- a/drivers/net/sfc/txc43128_phy.c	Wed Feb 20 17:44:08 2008 +0000
     4.2 +++ b/drivers/net/sfc/txc43128_phy.c	Wed Feb 20 18:05:47 2008 +0000
     4.3 @@ -644,8 +644,8 @@ static void txc43128_phy_fini(struct efx
     4.4   * don't use LASI interrupts. Also update the BER counters and poll the lm87 */
     4.5  static int txc43128_phy_check_hw(struct efx_nic *efx)
     4.6  {
     4.7 +	struct txc43128_data *data = efx->phy_data;
     4.8  #ifdef CONFIG_SFC_DEBUGFS
     4.9 -	struct txc43128_data *data = efx->phy_data;
    4.10  	int phy = efx->mii.phy_id;
    4.11  	int timer, count, i, mmd;
    4.12  #endif
     5.1 --- a/drivers/xen/Kconfig	Wed Feb 20 17:44:08 2008 +0000
     5.2 +++ b/drivers/xen/Kconfig	Wed Feb 20 18:05:47 2008 +0000
     5.3 @@ -81,11 +81,12 @@ config XEN_NETDEV_PIPELINED_TRANSMITTER
     5.4  
     5.5  config XEN_NETDEV_ACCEL_SFC_UTIL
     5.6          tristate
     5.7 +        depends on X86
     5.8          default n
     5.9  
    5.10  config XEN_NETDEV_ACCEL_SFC_BACKEND
    5.11  	tristate "Network-device backend driver acceleration for Solarflare NICs"
    5.12 -        depends on XEN_NETDEV_BACKEND
    5.13 +        depends on XEN_NETDEV_BACKEND && SFC && SFC_RESOURCE && X86
    5.14          select XEN_NETDEV_ACCEL_SFC_UTIL
    5.15          default m
    5.16  
    5.17 @@ -194,7 +195,7 @@ config XEN_GRANT_DEV
    5.18  
    5.19  config XEN_NETDEV_ACCEL_SFC_FRONTEND
    5.20  	tristate "Network-device frontend driver acceleration for Solarflare NICs"
    5.21 -	depends on XEN_NETDEV_FRONTEND
    5.22 +	depends on XEN_NETDEV_FRONTEND && X86
    5.23          select XEN_NETDEV_ACCEL_SFC_UTIL
    5.24  	default m
    5.25  
     6.1 --- a/drivers/xen/sfc_netback/accel.c	Wed Feb 20 17:44:08 2008 +0000
     6.2 +++ b/drivers/xen/sfc_netback/accel.c	Wed Feb 20 18:05:47 2008 +0000
     6.3 @@ -71,8 +71,8 @@ static struct notifier_block netback_acc
     6.4  };
     6.5  
     6.6  
     6.7 -unsigned max_pages = NETBACK_ACCEL_DEFAULT_MAX_BUF_PAGES;
     6.8 -module_param(max_pages, int, 0666);
     6.9 +unsigned sfc_netback_max_pages = NETBACK_ACCEL_DEFAULT_MAX_BUF_PAGES;
    6.10 +module_param_named(max_pages, sfc_netback_max_pages, uint, 0666);
    6.11  MODULE_PARM_DESC(max_pages, 
    6.12  		 "The number of buffer pages to enforce on each guest");
    6.13  
     7.1 --- a/drivers/xen/sfc_netback/accel.h	Wed Feb 20 17:44:08 2008 +0000
     7.2 +++ b/drivers/xen/sfc_netback/accel.h	Wed Feb 20 18:05:47 2008 +0000
     7.3 @@ -49,7 +49,7 @@
     7.4  #define NETBACK_ACCEL_DEFAULT_MAX_MCASTS (8)
     7.5  #define NETBACK_ACCEL_DEFAULT_MAX_BUF_PAGES (384)
     7.6  /* Variable to store module parameter for max_buf_pages */
     7.7 -extern unsigned max_pages;
     7.8 +extern unsigned sfc_netback_max_pages;
     7.9  
    7.10  #define NETBACK_ACCEL_STATS 1
    7.11  
     8.1 --- a/drivers/xen/sfc_netback/accel_debugfs.c	Wed Feb 20 17:44:08 2008 +0000
     8.2 +++ b/drivers/xen/sfc_netback/accel_debugfs.c	Wed Feb 20 18:05:47 2008 +0000
     8.3 @@ -38,28 +38,6 @@ static struct netback_accel_global_dbfs 
     8.4  #endif
     8.5  #endif
     8.6  
     8.7 -/*
     8.8 - * Extend debugfs helper functions to have a u64 version
     8.9 - */ 
    8.10 -static void debugfs_u64_set(void *data, u64 val)
    8.11 -{
    8.12 -  *(u64 *)data = val;
    8.13 -}
    8.14 -
    8.15 -static u64 debugfs_u64_get(void *data)
    8.16 -{
    8.17 -  return *(u64 *)data;
    8.18 -}
    8.19 -
    8.20 -DEFINE_SIMPLE_ATTRIBUTE(fops_u64, debugfs_u64_get, debugfs_u64_set, "%llu\n");
    8.21 -
    8.22 -struct dentry *debugfs_create_u64(const char *name, mode_t mode,
    8.23 -                                  struct dentry *parent, u64 *value)
    8.24 -{
    8.25 -  return debugfs_create_file(name, mode, parent, value, &fops_u64);
    8.26 -}
    8.27 -
    8.28 -
    8.29  void netback_accel_debugfs_init(void) 
    8.30  {
    8.31  #if defined(CONFIG_DEBUG_FS)
     9.1 --- a/drivers/xen/sfc_netback/accel_xenbus.c	Wed Feb 20 17:44:08 2008 +0000
     9.2 +++ b/drivers/xen/sfc_netback/accel_xenbus.c	Wed Feb 20 18:05:47 2008 +0000
     9.3 @@ -113,7 +113,7 @@ void cfg_hw_quotas(struct xenbus_device 
     9.4  		 */
     9.5  		DPRINTK("Failed to read quotas from xenbus, using defaults\n");
     9.6  		bend->quotas.max_filters = NETBACK_ACCEL_DEFAULT_MAX_FILTERS;
     9.7 -		bend->quotas.max_buf_pages = max_pages;
     9.8 +		bend->quotas.max_buf_pages = sfc_netback_max_pages;
     9.9  		bend->quotas.max_mcasts = NETBACK_ACCEL_DEFAULT_MAX_MCASTS;
    9.10  	}
    9.11  
    10.1 --- a/drivers/xen/sfc_netfront/accel.h	Wed Feb 20 17:44:08 2008 +0000
    10.2 +++ b/drivers/xen/sfc_netfront/accel.h	Wed Feb 20 18:05:47 2008 +0000
    10.3 @@ -336,8 +336,8 @@ typedef struct netfront_accel_vnic {
    10.4  
    10.5  
    10.6  /* Module parameters */
    10.7 -extern unsigned max_pages;
    10.8 -extern unsigned buffer_split;
    10.9 +extern unsigned sfc_netfront_max_pages;
   10.10 +extern unsigned sfc_netfront_buffer_split;
   10.11  
   10.12  extern const char *frontend_name;
   10.13  extern struct netfront_accel_hooks accel_hooks;
    11.1 --- a/drivers/xen/sfc_netfront/accel_bufs.c	Wed Feb 20 17:44:08 2008 +0000
    11.2 +++ b/drivers/xen/sfc_netfront/accel_bufs.c	Wed Feb 20 18:05:47 2008 +0000
    11.3 @@ -72,12 +72,12 @@ int netfront_accel_alloc_buffer_mem(stru
    11.4  	int n, rc;
    11.5  
    11.6  	if ((rc = netfront_accel_alloc_buf_desc_blocks
    11.7 -	     (rx_manager, pages - (pages / buffer_split))) < 0) {
    11.8 +	     (rx_manager, pages - (pages / sfc_netfront_buffer_split))) < 0) {
    11.9  		goto rx_fail;
   11.10  	}
   11.11  
   11.12  	if ((rc = netfront_accel_alloc_buf_desc_blocks
   11.13 -	     (tx_manager, pages / buffer_split)) < 0) {
   11.14 +	     (tx_manager, pages / sfc_netfront_buffer_split)) < 0) {
   11.15  		goto tx_fail;
   11.16  	}
   11.17  
    12.1 --- a/drivers/xen/sfc_netfront/accel_debugfs.c	Wed Feb 20 17:44:08 2008 +0000
    12.2 +++ b/drivers/xen/sfc_netfront/accel_debugfs.c	Wed Feb 20 18:05:47 2008 +0000
    12.3 @@ -31,29 +31,6 @@
    12.4  static struct dentry *sfc_debugfs_root = NULL;
    12.5  #endif
    12.6  
    12.7 -
    12.8 -/*
    12.9 - * Extend debugfs helper functions to have a u64 version
   12.10 - */
   12.11 -static void debugfs_u64_set(void *data, u64 val)
   12.12 -{
   12.13 -  *(u64 *)data = val;
   12.14 -}
   12.15 -
   12.16 -static u64 debugfs_u64_get(void *data)
   12.17 -{
   12.18 -  return *(u64 *)data;
   12.19 -}
   12.20 -
   12.21 -DEFINE_SIMPLE_ATTRIBUTE(fops_u64, debugfs_u64_get, debugfs_u64_set, "%llu\n");
   12.22 -
   12.23 -struct dentry *debugfs_create_u64(const char *name, mode_t mode,
   12.24 -				  struct dentry *parent, u64 *value)
   12.25 -{
   12.26 -  return debugfs_create_file(name, mode, parent, value, &fops_u64);
   12.27 -}
   12.28 -
   12.29 -
   12.30  void netfront_accel_debugfs_init(void) 
   12.31  {
   12.32  #if defined(CONFIG_DEBUG_FS)
    13.1 --- a/drivers/xen/sfc_netfront/accel_msg.c	Wed Feb 20 17:44:08 2008 +0000
    13.2 +++ b/drivers/xen/sfc_netfront/accel_msg.c	Wed Feb 20 18:05:47 2008 +0000
    13.3 @@ -157,7 +157,7 @@ static int vnic_add_bufs(netfront_accel_
    13.4  	offset = msg->u.mapbufs.reqid;
    13.5  
    13.6  	if (offset < vnic->bufpages.max_pages - 
    13.7 -	    (vnic->bufpages.max_pages / buffer_split)) {
    13.8 +	    (vnic->bufpages.max_pages / sfc_netfront_buffer_split)) {
    13.9  		bufinfo = vnic->rx_bufs;
   13.10  	} else
   13.11  		bufinfo = vnic->tx_bufs;
   13.12 @@ -286,7 +286,7 @@ static int vnic_process_hello_msg(netfro
   13.13  				  struct net_accel_msg *msg)
   13.14  {
   13.15  	int err = 0;
   13.16 -	unsigned pages = max_pages;
   13.17 +	unsigned pages = sfc_netfront_max_pages;
   13.18  
   13.19  	if (vnic_check_hello_version(msg->u.hello.version) < 0) {
   13.20  		msg->id = NET_ACCEL_MSG_HELLO | NET_ACCEL_MSG_REPLY 
    14.1 --- a/drivers/xen/sfc_netfront/accel_netfront.c	Wed Feb 20 17:44:08 2008 +0000
    14.2 +++ b/drivers/xen/sfc_netfront/accel_netfront.c	Wed Feb 20 18:05:47 2008 +0000
    14.3 @@ -234,13 +234,14 @@ struct netfront_accel_hooks accel_hooks 
    14.4  };
    14.5  
    14.6  
    14.7 -unsigned max_pages = NETFRONT_ACCEL_DEFAULT_BUF_PAGES;
    14.8 -module_param (max_pages, int, 0666);
    14.9 +unsigned sfc_netfront_max_pages = NETFRONT_ACCEL_DEFAULT_BUF_PAGES;
   14.10 +module_param_named (max_pages, sfc_netfront_max_pages, uint, 0666);
   14.11  MODULE_PARM_DESC(max_pages, "Number of buffer pages to request");
   14.12  
   14.13 -unsigned buffer_split = 2;
   14.14 -module_param (buffer_split, int, 0666);
   14.15 -MODULE_PARM_DESC(buffer_split, "Fraction of buffers to use for TX, rest for RX");
   14.16 +unsigned sfc_netfront_buffer_split = 2;
   14.17 +module_param_named (buffer_split, sfc_netfront_buffer_split, uint, 0666);
   14.18 +MODULE_PARM_DESC(buffer_split, 
   14.19 +		 "Fraction of buffers to use for TX, rest for RX");
   14.20  
   14.21  
   14.22  const char *frontend_name = "sfc_netfront";
    15.1 --- a/fs/debugfs/file.c	Wed Feb 20 17:44:08 2008 +0000
    15.2 +++ b/fs/debugfs/file.c	Wed Feb 20 18:05:47 2008 +0000
    15.3 @@ -170,6 +170,51 @@ struct dentry *debugfs_create_u32(const 
    15.4  }
    15.5  EXPORT_SYMBOL_GPL(debugfs_create_u32);
    15.6  
    15.7 +
    15.8 +static void debugfs_u64_set(void *data, u64 val)
    15.9 +{
   15.10 +	*(u64 *)data = val;
   15.11 +}
   15.12 +
   15.13 +static u64 debugfs_u64_get(void *data)
   15.14 +{
   15.15 +	return *(u64 *)data;
   15.16 +}
   15.17 +DEFINE_SIMPLE_ATTRIBUTE(fops_u64, debugfs_u64_get, debugfs_u64_set, "%llu\n");
   15.18 +
   15.19 +/**
   15.20 + * debugfs_create_u64 - create a file in the debugfs filesystem that is used to read and write an unsigned 64 bit value.
   15.21 + *
   15.22 + * @name: a pointer to a string containing the name of the file to create.
   15.23 + * @mode: the permission that the file should have
   15.24 + * @parent: a pointer to the parent dentry for this file.  This should be a
   15.25 + *          directory dentry if set.  If this paramater is NULL, then the
   15.26 + *          file will be created in the root of the debugfs filesystem.
   15.27 + * @value: a pointer to the variable that the file should read to and write
   15.28 + *         from.
   15.29 + *
   15.30 + * This function creates a file in debugfs with the given name that
   15.31 + * contains the value of the variable @value.  If the @mode variable is so
   15.32 + * set, it can be read from, and written to.
   15.33 + *
   15.34 + * This function will return a pointer to a dentry if it succeeds.  This
   15.35 + * pointer must be passed to the debugfs_remove() function when the file is
   15.36 + * to be removed (no automatic cleanup happens if your module is unloaded,
   15.37 + * you are responsible here.)  If an error occurs, NULL will be returned.
   15.38 + *
   15.39 + * If debugfs is not enabled in the kernel, the value -ENODEV will be
   15.40 + * returned.  It is not wise to check for this value, but rather, check for
   15.41 + * NULL or !NULL instead as to eliminate the need for #ifdef in the calling
   15.42 + * code.
   15.43 + */
   15.44 +struct dentry *debugfs_create_u64(const char *name, mode_t mode,
   15.45 +				  struct dentry *parent, u64 *value)
   15.46 +{
   15.47 +	return debugfs_create_file(name, mode, parent, value, &fops_u64);
   15.48 +}
   15.49 +EXPORT_SYMBOL_GPL(debugfs_create_u64);
   15.50 +
   15.51 +
   15.52  static ssize_t read_file_bool(struct file *file, char __user *user_buf,
   15.53  			      size_t count, loff_t *ppos)
   15.54  {
    16.1 --- a/include/linux/debugfs.h	Wed Feb 20 17:44:08 2008 +0000
    16.2 +++ b/include/linux/debugfs.h	Wed Feb 20 18:05:47 2008 +0000
    16.3 @@ -41,6 +41,8 @@ struct dentry *debugfs_create_u16(const 
    16.4  				  struct dentry *parent, u16 *value);
    16.5  struct dentry *debugfs_create_u32(const char *name, mode_t mode,
    16.6  				  struct dentry *parent, u32 *value);
    16.7 +struct dentry *debugfs_create_u64(const char *name, mode_t mode,
    16.8 +				  struct dentry *parent, u64 *value);
    16.9  struct dentry *debugfs_create_bool(const char *name, mode_t mode,
   16.10  				  struct dentry *parent, u32 *value);
   16.11  
   16.12 @@ -94,6 +96,13 @@ static inline struct dentry *debugfs_cre
   16.13  	return ERR_PTR(-ENODEV);
   16.14  }
   16.15  
   16.16 +static inline struct dentry *debugfs_create_u64(const char *name, mode_t mode,
   16.17 +						struct dentry *parent,
   16.18 +						u64 *value)
   16.19 +{
   16.20 +	return ERR_PTR(-ENODEV);
   16.21 +}
   16.22 +
   16.23  static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode,
   16.24  						 struct dentry *parent,
   16.25  						 u32 *value)