Skip to content

Commit

Permalink
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/jgarzik/netdev-2.6

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (52 commits)
  netxen: do_rom_fast_write error handling
  natsemi: Fix detection of vanilla natsemi cards
  net: remove a collection of unneeded #undef REALLY_SLOW_IO stuff
  chelsio: Fix non-NAPI compile
  cxgb3 - Feed Rx free list with pages
  cxgb3 - Recovery from HW starvation of response queue entries.
  cxgb3 - Unmap offload packets when they are freed
  cxgb3 - FW version update
  cxgb3 - private ioctl cleanup
  cxgb3 - manage sysfs attributes per port
  S2IO: Restoring the mac address in s2io_reset
  S2IO: Avoid printing the Enhanced statistics for Xframe I card.
  S2IO: Making LED off during LINK_DOWN notification.
  S2IO: Added a loadable parameter to enable or disable vlan stripping in frame.
  S2IO: Optimized the delay to wait for command completion
  S2IO: Fixes for MSI and MSIX
  qla3xxx: Bumping driver version number
  qla3xxx: Kernic Panic on pSeries under stress conditions
  qla3xxx: bugfix tx reset after stress conditions.
  qla3xxx: Check return code from pci_map_single() in ql_release_to_lrg_buf_free_list(), ql_populate_free_queue(), ql_alloc_large_buffers(), and ql3xxx_send()
  ...
  • Loading branch information
Linus Torvalds committed Feb 27, 2007
2 parents 6c1586b + f8dfdd5 commit ce27002
Show file tree
Hide file tree
Showing 37 changed files with 1,679 additions and 814 deletions.
4 changes: 2 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3177,8 +3177,8 @@ L: linux-kernel@vger.kernel.org ?
S: Supported

SPIDERNET NETWORK DRIVER for CELL
P: Jim Lewis
M: jim@jklewis.com
P: Linas Vepstas
M: linas@austin.ibm.com
L: netdev@vger.kernel.org
S: Supported

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2245,7 +2245,7 @@ config BNX2

config SPIDER_NET
tristate "Spider Gigabit Ethernet driver"
depends on PCI && PPC_IBM_CELL_BLADE
depends on PCI && (PPC_IBM_CELL_BLADE || PPC_CELLEB)
select FW_LOADER
help
This driver supports the Gigabit Ethernet chips present on the
Expand Down
1 change: 1 addition & 0 deletions drivers/net/chelsio/sge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1696,6 +1696,7 @@ irqreturn_t t1_interrupt(int irq, void *cookie)
{
int work_done;
struct adapter *adapter = cookie;
struct respQ *Q = &adapter->sge->respQ;

spin_lock(&adapter->async_lock);

Expand Down
11 changes: 10 additions & 1 deletion drivers/net/cxgb3/adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,25 @@ enum { /* adapter flags */
struct rx_desc;
struct rx_sw_desc;

struct sge_fl_page {
struct skb_frag_struct frag;
unsigned char *va;
};

struct sge_fl { /* SGE per free-buffer list state */
unsigned int buf_size; /* size of each Rx buffer */
unsigned int credits; /* # of available Rx buffers */
unsigned int size; /* capacity of free list */
unsigned int cidx; /* consumer index */
unsigned int pidx; /* producer index */
unsigned int gen; /* free list generation */
unsigned int cntxt_id; /* SGE context id for the free list */
struct sge_fl_page page;
struct rx_desc *desc; /* address of HW Rx descriptor ring */
struct rx_sw_desc *sdesc; /* address of SW Rx descriptor ring */
dma_addr_t phys_addr; /* physical address of HW ring start */
unsigned int cntxt_id; /* SGE context id for the free list */
unsigned long empty; /* # of times queue ran out of buffers */
unsigned long alloc_failed; /* # of times buffer allocation failed */
};

/*
Expand Down Expand Up @@ -121,6 +128,8 @@ struct sge_rspq { /* state for an SGE response queue */
unsigned long empty; /* # of times queue ran out of credits */
unsigned long nomem; /* # of responses deferred due to no mem */
unsigned long unhandled_irqs; /* # of spurious intrs */
unsigned long starved;
unsigned long restarted;
};

struct tx_desc;
Expand Down
33 changes: 11 additions & 22 deletions drivers/net/cxgb3/cxgb3_ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,17 @@
* Ioctl commands specific to this driver.
*/
enum {
CHELSIO_SETREG = 1024,
CHELSIO_GETREG,
CHELSIO_SETTPI,
CHELSIO_GETTPI,
CHELSIO_GETMTUTAB,
CHELSIO_SETMTUTAB,
CHELSIO_GETMTU,
CHELSIO_SET_PM,
CHELSIO_GET_PM,
CHELSIO_GET_TCAM,
CHELSIO_SET_TCAM,
CHELSIO_GET_TCB,
CHELSIO_GET_MEM,
CHELSIO_LOAD_FW,
CHELSIO_GET_PROTO,
CHELSIO_SET_PROTO,
CHELSIO_SET_TRACE_FILTER,
CHELSIO_SET_QSET_PARAMS,
CHELSIO_GET_QSET_PARAMS,
CHELSIO_SET_QSET_NUM,
CHELSIO_GET_QSET_NUM,
CHELSIO_SET_PKTSCHED,
CHELSIO_GETMTUTAB = 1029,
CHELSIO_SETMTUTAB = 1030,
CHELSIO_SET_PM = 1032,
CHELSIO_GET_PM = 1033,
CHELSIO_GET_MEM = 1038,
CHELSIO_LOAD_FW = 1041,
CHELSIO_SET_TRACE_FILTER = 1044,
CHELSIO_SET_QSET_PARAMS = 1045,
CHELSIO_GET_QSET_PARAMS = 1046,
CHELSIO_SET_QSET_NUM = 1047,
CHELSIO_GET_QSET_NUM = 1048,
};

struct ch_reg {
Expand Down
69 changes: 16 additions & 53 deletions drivers/net/cxgb3/cxgb3_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,27 +434,25 @@ static int setup_sge_qsets(struct adapter *adap)

static ssize_t attr_show(struct device *d, struct device_attribute *attr,
char *buf,
ssize_t(*format) (struct adapter *, char *))
ssize_t(*format) (struct net_device *, char *))
{
ssize_t len;
struct adapter *adap = to_net_dev(d)->priv;

/* Synchronize with ioctls that may shut down the device */
rtnl_lock();
len = (*format) (adap, buf);
len = (*format) (to_net_dev(d), buf);
rtnl_unlock();
return len;
}

static ssize_t attr_store(struct device *d, struct device_attribute *attr,
const char *buf, size_t len,
ssize_t(*set) (struct adapter *, unsigned int),
ssize_t(*set) (struct net_device *, unsigned int),
unsigned int min_val, unsigned int max_val)
{
char *endp;
ssize_t ret;
unsigned int val;
struct adapter *adap = to_net_dev(d)->priv;

if (!capable(CAP_NET_ADMIN))
return -EPERM;
Expand All @@ -464,16 +462,17 @@ static ssize_t attr_store(struct device *d, struct device_attribute *attr,
return -EINVAL;

rtnl_lock();
ret = (*set) (adap, val);
ret = (*set) (to_net_dev(d), val);
if (!ret)
ret = len;
rtnl_unlock();
return ret;
}

#define CXGB3_SHOW(name, val_expr) \
static ssize_t format_##name(struct adapter *adap, char *buf) \
static ssize_t format_##name(struct net_device *dev, char *buf) \
{ \
struct adapter *adap = dev->priv; \
return sprintf(buf, "%u\n", val_expr); \
} \
static ssize_t show_##name(struct device *d, struct device_attribute *attr, \
Expand All @@ -482,8 +481,10 @@ static ssize_t show_##name(struct device *d, struct device_attribute *attr, \
return attr_show(d, attr, buf, format_##name); \
}

static ssize_t set_nfilters(struct adapter *adap, unsigned int val)
static ssize_t set_nfilters(struct net_device *dev, unsigned int val)
{
struct adapter *adap = dev->priv;

if (adap->flags & FULL_INIT_DONE)
return -EBUSY;
if (val && adap->params.rev == 0)
Expand All @@ -500,8 +501,10 @@ static ssize_t store_nfilters(struct device *d, struct device_attribute *attr,
return attr_store(d, attr, buf, len, set_nfilters, 0, ~0);
}

static ssize_t set_nservers(struct adapter *adap, unsigned int val)
static ssize_t set_nservers(struct net_device *dev, unsigned int val)
{
struct adapter *adap = dev->priv;

if (adap->flags & FULL_INIT_DONE)
return -EBUSY;
if (val > t3_mc5_size(&adap->mc5) - adap->params.mc5.nfilters)
Expand Down Expand Up @@ -1549,32 +1552,6 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
return -EFAULT;

switch (cmd) {
case CHELSIO_SETREG:{
struct ch_reg edata;

if (!capable(CAP_NET_ADMIN))
return -EPERM;
if (copy_from_user(&edata, useraddr, sizeof(edata)))
return -EFAULT;
if ((edata.addr & 3) != 0
|| edata.addr >= adapter->mmio_len)
return -EINVAL;
writel(edata.val, adapter->regs + edata.addr);
break;
}
case CHELSIO_GETREG:{
struct ch_reg edata;

if (copy_from_user(&edata, useraddr, sizeof(edata)))
return -EFAULT;
if ((edata.addr & 3) != 0
|| edata.addr >= adapter->mmio_len)
return -EINVAL;
edata.val = readl(adapter->regs + edata.addr);
if (copy_to_user(useraddr, &edata, sizeof(edata)))
return -EFAULT;
break;
}
case CHELSIO_SET_QSET_PARAMS:{
int i;
struct qset_params *q;
Expand Down Expand Up @@ -1838,10 +1815,10 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
return -EINVAL;

/*
* Version scheme:
* bits 0..9: chip version
* bits 10..15: chip revision
*/
* Version scheme:
* bits 0..9: chip version
* bits 10..15: chip revision
*/
t.version = 3 | (adapter->params.rev << 10);
if (copy_to_user(useraddr, &t, sizeof(t)))
return -EFAULT;
Expand Down Expand Up @@ -1890,20 +1867,6 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
t.trace_rx);
break;
}
case CHELSIO_SET_PKTSCHED:{
struct ch_pktsched_params p;

if (!capable(CAP_NET_ADMIN))
return -EPERM;
if (!adapter->open_device_map)
return -EAGAIN; /* uP and SGE must be running */
if (copy_from_user(&p, useraddr, sizeof(p)))
return -EFAULT;
send_pktsched_cmd(adapter, p.sched, p.idx, p.min, p.max,
p.binding);
break;

}
default:
return -EOPNOTSUPP;
}
Expand Down
Loading

0 comments on commit ce27002

Please sign in to comment.