* Re: 2.6.36-rc7: net/bridge causes temporary network I/O lockups [2]
From: Herbert Xu @ 2010-10-18 16:16 UTC (permalink / raw)
To: Patrick Ringl; +Cc: netdev, linux-kernel, bridge
In-Reply-To: <4CB9EBC3.4070905@freenet.de>
On Sat, Oct 16, 2010 at 08:15:31PM +0200, Patrick Ringl wrote:
> Hi,
>
> okay I narrowed down the issue. I watched all function calls of the
> 'bridge' module with the help of a small systemtap probe of mine. I
> first traced a timespan where the issue did not occur, then one where it
> did and composed an intersection of these two:
I can't reproduce this problem here so I'll need your help to
track it down.
Can you see if you can relate the lock-ups to specific events
such as a particular packet being sent through the bridge?
If we can recreate the problem on demand that that helps us to
find the root cause.
You mentioned that you took packet dumps on the system. If you
can show us the packets through the bridge and its ports when
the problem occurs that would be great.
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [v2] Remaining BKL users, what to do
From: Christoph Hellwig @ 2010-10-18 16:19 UTC (permalink / raw)
To: Arnd Bergmann
Cc: codalist, ksummit-2010-discuss, autofs, linux-media, dri-devel,
Christoph Hellwig, Mikulas Patocka, Trond Myklebust,
Petr Vandrovec, Anders Larsen, Jan Kara, Evgeniy Dushistov,
Ingo Molnar, netdev, Samuel Ortiz, Arnaldo Carvalho de Melo,
linux-kernel, linux-fsdevel, Andrew Hendry, David Miller,
Jan Harkes, Bryan Schumaker
In-Reply-To: <201010181742.06678.arnd@arndb.de>
Before we get into all these fringe drivers:
- I've not seen any progrss on ->get_sb BKL removal for a while
- locks.c is probably a higher priorit, too.
^ permalink raw reply
* Re: [Bridge] EAPOL bridging
From: Stephen Hemminger @ 2010-10-18 16:38 UTC (permalink / raw)
To: Benjamin Poirier; +Cc: bridge, netdev, linux-kernel
In-Reply-To: <4CBB3B24.2000106@gmail.com>
On Sun, 17 Oct 2010 14:06:28 -0400
Benjamin Poirier <benjamin.poirier@gmail.com> wrote:
> Hello,
>
> I have some trouble bridging EAPOL frames. I'd like to do this to allow
> wired 802.1x authentication from within a kvm virtual machine. I have
> the following setup:
>
> kvm -- tap0 -- br0 -- eth1 -- 802.1x authenticator (switch) -- more network
>
> and it doesn't work. I've added a few logging rules to ebtables. I only
> see an EAPOL frame going through the INPUT chain of tap0. It seems to be
> dropped by the bridge. The EAPOL frame is an ethernet link local
> multicast frame with destination address 01-80-C2-00-00-03, "IEEE Std
> 802.1X PAE address".
>
> I've looked at http://standards.ieee.org/regauth/groupmac/tutorial.html,
> which says that frames with a destination in the range 01-80-C2-00-00-00
> to 01-80-C2-00-00-0F should not be forwarded by standard conformant
> bridges. I've also looked at net/bridge/br_input.c and br_handle_frame()
> seems quite intent on "bending" the standard when STP is disabled, but
> only for 01-80-C2-00-00-00. However there are more applications that use
> similar addresses, EAPOL included:
> http://standards.ieee.org/regauth/groupmac/Standard_Group_MAC_Address_assignments.pdf
>
> Given the current state of affairs, would it be acceptable to make the
> code more permissive by forwarding all the range of reserved group
> addresses when STP is disabled? If not, what would be the way to go
> about enabling 802.1x authentication from within a virtual machine?
>
> BTW, it seems this issue has been raised before,
> https://lists.linux-foundation.org/pipermail/bridge/2007-November/005629.html
> with the conclusion that
> > Despite what the standards say, many users are using bridging code for invisible
> > firewalls etc, and in those cases they want STP and EAPOL frames to be forwarded.
I would just take off the last byte (dest check).
--
^ permalink raw reply
* Re: [PATCH net-next] sfc: make functions static
From: Ben Hutchings @ 2010-10-18 17:05 UTC (permalink / raw)
To: Stephen Hemminger
Cc: David Miller, Steve Hodgson, Solarflare linux maintainers, netdev
In-Reply-To: <20101018082731.36cd65e4@nehalam>
On Mon, 2010-10-18 at 08:27 -0700, Stephen Hemminger wrote:
> Make local functions and variable static. Do some rearrangement
> of the string table stuff to put it where it gets used.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Ben Hutchings <bhutchings@solarflare.com>
We might have to change some of these back in future, but I suppose
there is no harm in making them static now.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [v2] Remaining BKL users, what to do
From: Arnd Bergmann @ 2010-10-18 17:38 UTC (permalink / raw)
To: Christoph Hellwig
Cc: codalist, ksummit-2010-discuss, autofs, linux-media, dri-devel,
Mikulas Patocka, Trond Myklebust, Petr Vandrovec, Anders Larsen,
Jan Kara, Evgeniy Dushistov, Ingo Molnar, netdev, Samuel Ortiz,
Arnaldo Carvalho de Melo, linux-kernel, linux-fsdevel,
Andrew Hendry, David Miller, Jan Harkes, Bryan Schumaker
In-Reply-To: <20101018161924.GA9571@infradead.org>
On Monday 18 October 2010 18:19:24 Christoph Hellwig wrote:
> Before we get into all these fringe drivers:
>
> - I've not seen any progrss on ->get_sb BKL removal for a while
Not sure what you mean. Jan Blunck did the pushdown into get_sb
last year, which is included into linux-next through my bkl/vfs
tree. Subsequent patches remove it from most file systems along with
the other BKL uses in them. If you like, I can post the series
once more, but it has been posted a few times now.
> - locks.c is probably a higher priorit, too.
As mentioned in the list, I expect the trivial final patch to
be applied in 2.6.37-rc1 after Linus has pulled the trees that
this depends on (bkl/vfs, nfs, nfsd, ceph), see below.
This is currently not in -next because of the prerequisites.
Arnd
---
diff --git a/fs/Kconfig b/fs/Kconfig
index c386a9f..25ce2dc 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -50,7 +50,6 @@ endif # BLOCK
config FILE_LOCKING
bool "Enable POSIX file locking API" if EMBEDDED
default y
- select BKL
help
This option enables standard file locking support, required
for filesystems like NFS and for the flock() system
diff --git a/fs/locks.c b/fs/locks.c
index 8b2b6ad..02b6e0e 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -142,6 +142,7 @@ int lease_break_time = 45;
static LIST_HEAD(file_lock_list);
static LIST_HEAD(blocked_list);
+static DEFINE_SPINLOCK(file_lock_lock);
/*
* Protects the two list heads above, plus the inode->i_flock list
@@ -149,13 +150,13 @@ static LIST_HEAD(blocked_list);
*/
void lock_flocks(void)
{
- lock_kernel();
+ spin_lock(&file_lock_lock);
}
EXPORT_SYMBOL_GPL(lock_flocks);
void unlock_flocks(void)
{
- unlock_kernel();
+ spin_unlock(&file_lock_lock);
}
EXPORT_SYMBOL_GPL(unlock_flocks);
^ permalink raw reply related
* Re: [Patch] Limit sysctl_tcp_mem and sysctl_udp_mem initializers to prevent integer overflows.
From: Robin Holt @ 2010-10-18 17:43 UTC (permalink / raw)
To: David Miller
Cc: holt, w, linux-kernel, netdev, kuznet, pekkas, jmorris, yoshfuji,
kaber
In-Reply-To: <20101005.145032.25126909.davem@davemloft.net>
On Tue, Oct 05, 2010 at 02:50:32PM -0700, David Miller wrote:
> From: Robin Holt <holt@sgi.com>
> Date: Sat, 02 Oct 2010 06:24:06 -0500
>
> > Subject: [Patch] Limit sysctl_tcp_mem and sysctl_udp_mem initializers to prevent integer overflows.
> >
> > On a 16TB x86_64 machine, sysctl_tcp_mem[2], sysctl_udp_mem[2], and
> > sysctl_sctp_mem[2] can integer overflow. Set limit such that they are
> > maximized without overflowing.
> >
> > Signed-off-by: Robin Holt <holt@sgi.com>
>
> Robin please resubmit this with the SCTP bits included.
David,
I did not mean to blow you off. I was not going to resubmit because
Eric's patch is the preferred direction. I had been given an indication
that my patch was preferred, but that indicator changed.
Robin
^ permalink raw reply
* Re: [Patch] Limit sysctl_tcp_mem and sysctl_udp_mem initializers to prevent integer overflows.
From: Eric Dumazet @ 2010-10-18 17:52 UTC (permalink / raw)
To: Robin Holt
Cc: David Miller, w, linux-kernel, netdev, kuznet, pekkas, jmorris,
yoshfuji, kaber
In-Reply-To: <20101018174339.GC14068@sgi.com>
Le lundi 18 octobre 2010 à 12:43 -0500, Robin Holt a écrit :
> On Tue, Oct 05, 2010 at 02:50:32PM -0700, David Miller wrote:
> > From: Robin Holt <holt@sgi.com>
> > Date: Sat, 02 Oct 2010 06:24:06 -0500
> >
> > > Subject: [Patch] Limit sysctl_tcp_mem and sysctl_udp_mem initializers to prevent integer overflows.
> > >
> > > On a 16TB x86_64 machine, sysctl_tcp_mem[2], sysctl_udp_mem[2], and
> > > sysctl_sctp_mem[2] can integer overflow. Set limit such that they are
> > > maximized without overflowing.
> > >
> > > Signed-off-by: Robin Holt <holt@sgi.com>
> >
> > Robin please resubmit this with the SCTP bits included.
>
> David,
>
> I did not mean to blow you off. I was not going to resubmit because
> Eric's patch is the preferred direction. I had been given an indication
> that my patch was preferred, but that indicator changed.
>
Maybe there is some misunderstanding.
My patch was for net-next kernels (not before 2.6.37), while yours was
applicable to previous kernels.
^ permalink raw reply
* [PATCH 1/3] net: fail alloc_netdev_mq if queue count < 1
From: Tom Herbert @ 2010-10-18 18:02 UTC (permalink / raw)
To: davem, netdev; +Cc: eric.dumazet, bhutchings
In alloc_netdev_mq fail if requested queue_count < 1.
Signed-off-by: Tom Herbert <therbert@google.com>
---
net/core/dev.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 04972a4..76db105 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5511,6 +5511,12 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
BUG_ON(strlen(name) >= sizeof(dev->name));
+ if (queue_count < 0) {
+ printk(KERN_ERR "alloc_netdev: Unable to allocate device "
+ "with zero queues.\n");
+ return NULL;
+ }
+
alloc_size = sizeof(struct net_device);
if (sizeof_priv) {
/* ensure 32-byte alignment of private area */
--
1.7.1
^ permalink raw reply related
* [PATCH 2/3] net: cleanups in RX queue allocation
From: Tom Herbert @ 2010-10-18 18:02 UTC (permalink / raw)
To: davem, netdev; +Cc: eric.dumazet, bhutchings
Clean up in RX queue allocation. In netif_set_real_num_rx_queues
return error on attempt to set zero queues, and set
dev->num_rx_queues if device not registered (similar to TX
allocation). In netif_alloc_rx_queues, do BUG_ON if queue
count is zero.
Signed-off-by: Tom Herbert <therbert@google.com>
---
net/core/dev.c | 36 +++++++++++++++++++-----------------
1 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 76db105..77b860d 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1583,6 +1583,9 @@ int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq)
{
int rc;
+ if (rxq < 1)
+ return -EINVAL;
+
if (dev->reg_state == NETREG_REGISTERED) {
ASSERT_RTNL();
@@ -1593,7 +1596,8 @@ int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq)
rxq);
if (rc)
return rc;
- }
+ } else
+ dev->num_rx_queues = rxq;
dev->real_num_rx_queues = rxq;
return 0;
@@ -5013,25 +5017,23 @@ static int netif_alloc_rx_queues(struct net_device *dev)
{
#ifdef CONFIG_RPS
unsigned int i, count = dev->num_rx_queues;
+ struct netdev_rx_queue *rx;
- if (count) {
- struct netdev_rx_queue *rx;
-
- rx = kcalloc(count, sizeof(struct netdev_rx_queue), GFP_KERNEL);
- if (!rx) {
- pr_err("netdev: Unable to allocate %u rx queues.\n",
- count);
- return -ENOMEM;
- }
- dev->_rx = rx;
+ BUG_ON(count < 1);
- /*
- * Set a pointer to first element in the array which holds the
- * reference count.
- */
- for (i = 0; i < count; i++)
- rx[i].first = rx;
+ rx = kcalloc(count, sizeof(struct netdev_rx_queue), GFP_KERNEL);
+ if (!rx) {
+ pr_err("netdev: Unable to allocate %u rx queues.\n", count);
+ return -ENOMEM;
}
+ dev->_rx = rx;
+
+ /*
+ * Set a pointer to first element in the array which holds the
+ * reference count.
+ */
+ for (i = 0; i < count; i++)
+ rx[i].first = rx;
#endif
return 0;
}
--
1.7.1
^ permalink raw reply related
* [PATCH 0/3] net: RX and TX queue allocation cleanup
From: Tom Herbert @ 2010-10-18 18:02 UTC (permalink / raw)
To: davem, netdev; +Cc: eric.dumazet, bhutchings
Move TX queue allocation to register_netdevice. Enforce
alloc_netdev_mq & netif_set_real_num_[rt]x_queues netif_alloc_rx_queues
are called with at least one queue to allocate.
^ permalink raw reply
* [PATCH 3/3] net: allocate tx queues in register_netdevice
From: Tom Herbert @ 2010-10-18 18:02 UTC (permalink / raw)
To: davem, netdev; +Cc: eric.dumazet, bhutchings
This patch introduces netif_alloc_netdev_queues which is called from
register_device instead of alloc_netdev_mq. This makes TX queue
allocation symmetric with RX allocation similarly allows drivers to
change dev->num_tx_queues after allocating netdev and before
registering it. Also, queue locks allocation is done in
netdev_init_one_queue.
Signed-off-by: Tom Herbert <therbert@google.com>
---
include/linux/netdevice.h | 4 +-
net/core/dev.c | 112 +++++++++++++++++++++++----------------------
2 files changed, 60 insertions(+), 56 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 14fbb04..880d565 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1696,8 +1696,8 @@ static inline int netif_is_multiqueue(const struct net_device *dev)
return dev->num_tx_queues > 1;
}
-extern void netif_set_real_num_tx_queues(struct net_device *dev,
- unsigned int txq);
+extern int netif_set_real_num_tx_queues(struct net_device *dev,
+ unsigned int txq);
#ifdef CONFIG_RPS
extern int netif_set_real_num_rx_queues(struct net_device *dev,
diff --git a/net/core/dev.c b/net/core/dev.c
index 77b860d..c7b8d5a 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1553,18 +1553,24 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
* Routine to help set real_num_tx_queues. To avoid skbs mapped to queues
* greater then real_num_tx_queues stale skbs on the qdisc must be flushed.
*/
-void netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq)
+int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq)
{
- unsigned int real_num = dev->real_num_tx_queues;
+ if (txq < 1)
+ return -EINVAL;
- if (unlikely(txq > dev->num_tx_queues))
- ;
- else if (txq > real_num)
- dev->real_num_tx_queues = txq;
- else if (txq < real_num) {
- dev->real_num_tx_queues = txq;
- qdisc_reset_all_tx_gt(dev, txq);
- }
+ if (dev->reg_state == NETREG_REGISTERED) {
+ ASSERT_RTNL();
+
+ if (txq > dev->num_tx_queues)
+ return -EINVAL;
+
+ if (txq < dev->real_num_tx_queues)
+ qdisc_reset_all_tx_gt(dev, txq);
+ } else
+ dev->num_tx_queues = txq;
+
+ dev->real_num_tx_queues = txq;
+ return 0;
}
EXPORT_SYMBOL(netif_set_real_num_tx_queues);
@@ -4932,20 +4938,6 @@ static void rollback_registered(struct net_device *dev)
rollback_registered_many(&single);
}
-static void __netdev_init_queue_locks_one(struct net_device *dev,
- struct netdev_queue *dev_queue,
- void *_unused)
-{
- spin_lock_init(&dev_queue->_xmit_lock);
- netdev_set_xmit_lockdep_class(&dev_queue->_xmit_lock, dev->type);
- dev_queue->xmit_lock_owner = -1;
-}
-
-static void netdev_init_queue_locks(struct net_device *dev)
-{
- netdev_for_each_tx_queue(dev, __netdev_init_queue_locks_one, NULL);
-}
-
unsigned long netdev_fix_features(unsigned long features, const char *name)
{
/* Fix illegal SG+CSUM combinations. */
@@ -5038,6 +5030,41 @@ static int netif_alloc_rx_queues(struct net_device *dev)
return 0;
}
+static int netif_alloc_netdev_queues(struct net_device *dev)
+{
+ unsigned int count = dev->num_tx_queues;
+ struct netdev_queue *tx;
+
+ BUG_ON(count < 1);
+
+ tx = kcalloc(count, sizeof(struct netdev_queue), GFP_KERNEL);
+ if (!tx) {
+ pr_err("netdev: Unable to allocate %u tx queues.\n",
+ count);
+ return -ENOMEM;
+ }
+ dev->_tx = tx;
+ return 0;
+}
+
+static void netdev_init_one_queue(struct net_device *dev,
+ struct netdev_queue *queue,
+ void *_unused)
+{
+ queue->dev = dev;
+
+ /* Initialize queue lock */
+ spin_lock_init(&queue->_xmit_lock);
+ netdev_set_xmit_lockdep_class(&queue->_xmit_lock, dev->type);
+ queue->xmit_lock_owner = -1;
+}
+
+static void netdev_init_queues(struct net_device *dev)
+{
+ netdev_for_each_tx_queue(dev, netdev_init_one_queue, NULL);
+ spin_lock_init(&dev->tx_global_lock);
+}
+
/**
* register_netdevice - register a network device
* @dev: device to register
@@ -5071,7 +5098,6 @@ int register_netdevice(struct net_device *dev)
spin_lock_init(&dev->addr_list_lock);
netdev_set_addr_lockdep_class(dev);
- netdev_init_queue_locks(dev);
dev->iflink = -1;
@@ -5079,6 +5105,12 @@ int register_netdevice(struct net_device *dev)
if (ret)
goto out;
+ ret = netif_alloc_netdev_queues(dev);
+ if (ret)
+ goto out;
+
+ netdev_init_queues(dev);
+
/* Init, if this function is available */
if (dev->netdev_ops->ndo_init) {
ret = dev->netdev_ops->ndo_init(dev);
@@ -5460,19 +5492,6 @@ struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
}
EXPORT_SYMBOL(dev_get_stats);
-static void netdev_init_one_queue(struct net_device *dev,
- struct netdev_queue *queue,
- void *_unused)
-{
- queue->dev = dev;
-}
-
-static void netdev_init_queues(struct net_device *dev)
-{
- netdev_for_each_tx_queue(dev, netdev_init_one_queue, NULL);
- spin_lock_init(&dev->tx_global_lock);
-}
-
struct netdev_queue *dev_ingress_queue_create(struct net_device *dev)
{
struct netdev_queue *queue = dev_ingress_queue(dev);
@@ -5484,7 +5503,6 @@ struct netdev_queue *dev_ingress_queue_create(struct net_device *dev)
if (!queue)
return NULL;
netdev_init_one_queue(dev, queue, NULL);
- __netdev_init_queue_locks_one(dev, queue, NULL);
queue->qdisc = &noop_qdisc;
queue->qdisc_sleeping = &noop_qdisc;
rcu_assign_pointer(dev->ingress_queue, queue);
@@ -5506,7 +5524,6 @@ struct netdev_queue *dev_ingress_queue_create(struct net_device *dev)
struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
void (*setup)(struct net_device *), unsigned int queue_count)
{
- struct netdev_queue *tx;
struct net_device *dev;
size_t alloc_size;
struct net_device *p;
@@ -5534,20 +5551,12 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
return NULL;
}
- tx = kcalloc(queue_count, sizeof(struct netdev_queue), GFP_KERNEL);
- if (!tx) {
- printk(KERN_ERR "alloc_netdev: Unable to allocate "
- "tx qdiscs.\n");
- goto free_p;
- }
-
-
dev = PTR_ALIGN(p, NETDEV_ALIGN);
dev->padded = (char *)dev - (char *)p;
dev->pcpu_refcnt = alloc_percpu(int);
if (!dev->pcpu_refcnt)
- goto free_tx;
+ goto free_p;
if (dev_addr_init(dev))
goto free_pcpu;
@@ -5557,7 +5566,6 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
dev_net_set(dev, &init_net);
- dev->_tx = tx;
dev->num_tx_queues = queue_count;
dev->real_num_tx_queues = queue_count;
@@ -5568,8 +5576,6 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
dev->gso_max_size = GSO_MAX_SIZE;
- netdev_init_queues(dev);
-
INIT_LIST_HEAD(&dev->ethtool_ntuple_list.list);
dev->ethtool_ntuple_list.count = 0;
INIT_LIST_HEAD(&dev->napi_list);
@@ -5580,8 +5586,6 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
strcpy(dev->name, name);
return dev;
-free_tx:
- kfree(tx);
free_pcpu:
free_percpu(dev->pcpu_refcnt);
free_p:
--
1.7.1
^ permalink raw reply related
* Re: [Patch] Limit sysctl_tcp_mem and sysctl_udp_mem initializers to prevent integer overflows.
From: Robin Holt @ 2010-10-18 18:34 UTC (permalink / raw)
To: Eric Dumazet
Cc: Robin Holt, David Miller, w, linux-kernel, netdev, kuznet, pekkas,
jmorris, yoshfuji, kaber
In-Reply-To: <1287424348.2359.1.camel@edumazet-laptop>
On Mon, Oct 18, 2010 at 07:52:28PM +0200, Eric Dumazet wrote:
> Le lundi 18 octobre 2010 à 12:43 -0500, Robin Holt a écrit :
> > On Tue, Oct 05, 2010 at 02:50:32PM -0700, David Miller wrote:
> > > From: Robin Holt <holt@sgi.com>
> > > Date: Sat, 02 Oct 2010 06:24:06 -0500
> > >
> > > > Subject: [Patch] Limit sysctl_tcp_mem and sysctl_udp_mem initializers to prevent integer overflows.
> > > >
> > > > On a 16TB x86_64 machine, sysctl_tcp_mem[2], sysctl_udp_mem[2], and
> > > > sysctl_sctp_mem[2] can integer overflow. Set limit such that they are
> > > > maximized without overflowing.
> > > >
> > > > Signed-off-by: Robin Holt <holt@sgi.com>
> > >
> > > Robin please resubmit this with the SCTP bits included.
> >
> > David,
> >
> > I did not mean to blow you off. I was not going to resubmit because
> > Eric's patch is the preferred direction. I had been given an indication
> > that my patch was preferred, but that indicator changed.
> >
>
> Maybe there is some misunderstanding.
>
> My patch was for net-next kernels (not before 2.6.37), while yours was
> applicable to previous kernels.
Ah. I will resubmit then.
Sorry for the confusion,
Robin
^ permalink raw reply
* [PATCH] ethtool: add get permanent address option
From: Stephen Hemminger @ 2010-10-18 18:41 UTC (permalink / raw)
To: Jeff Garzik, Jeff Garzik, netdev
Add command level support for showing permanent address.
The ioctl has been around for a long time but there was
no option to display it.
Note: MAX_ADDR_LEN is defined in netdevice.h but including
netdevice.h leads to multiple definition errors with if.h.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
ethtool.8 | 6 ++++++
ethtool.c | 36 +++++++++++++++++++++++++++++++++++-
2 files changed, 41 insertions(+), 1 deletions(-)
diff --git a/ethtool.8 b/ethtool.8
index 3ca403c..84d5cc0 100644
--- a/ethtool.8
+++ b/ethtool.8
@@ -176,6 +176,9 @@ ethtool \- Display or change ethernet card settings
.I ethX
.RI [ N ]
+.B ethtool \-P|\-\-show-permaddr
+.I ethX
+
.B ethtool \-r|\-\-negotiate
.I ethX
@@ -388,6 +391,9 @@ blinking one or more LEDs on the specific ethernet port.
.B N
Length of time to perform phys-id, in seconds.
.TP
+.B \-P \-\-show-permaddr
+Queries the specified ethernet device for permanent hardware address.
+.TP
.B \-r \-\-negotiate
Restarts auto-negotiation on the specified ethernet device, if
auto-negotiation is enabled.
diff --git a/ethtool.c b/ethtool.c
index 6b2b7c8..845e65d 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -51,6 +51,9 @@
#ifndef SIOCETHTOOL
#define SIOCETHTOOL 0x8946
#endif
+#ifndef MAX_ADDR_LEN
+#define MAX_ADDR_LEN 32
+#endif
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#endif
@@ -107,6 +110,8 @@ static int do_srxfhindir(int fd, struct ifreq *ifr);
static int do_srxntuple(int fd, struct ifreq *ifr);
static int do_grxntuple(int fd, struct ifreq *ifr);
static int do_flash(int fd, struct ifreq *ifr);
+static int do_permaddr(int fd, struct ifreq *ifr);
+
static int send_ioctl(int fd, struct ifreq *ifr);
static enum {
@@ -136,6 +141,7 @@ static enum {
MODE_SNTUPLE,
MODE_GNTUPLE,
MODE_FLASHDEV,
+ MODE_PERMADDR,
} mode = MODE_GSET;
static struct option {
@@ -247,6 +253,8 @@ static struct option {
"action <queue or drop>\n" },
{ "-u", "--show-ntuple", MODE_GNTUPLE,
"Get Rx ntuple filters and actions\n" },
+ { "-P", "--show-permaddr", MODE_PERMADDR,
+ "Show permanent hardware address" },
{ "-h", "--help", MODE_HELP, "Show this help" },
{}
};
@@ -750,7 +758,8 @@ static void parse_cmdline(int argc, char **argp)
(mode == MODE_SNTUPLE) ||
(mode == MODE_GNTUPLE) ||
(mode == MODE_PHYS_ID) ||
- (mode == MODE_FLASHDEV)) {
+ (mode == MODE_FLASHDEV) |
+ (mode == MODE_PERMADDR)) {
devname = argp[i];
break;
}
@@ -1868,6 +1877,8 @@ static int doit(void)
return do_grxntuple(fd, &ifr);
} else if (mode == MODE_FLASHDEV) {
return do_flash(fd, &ifr);
+ } else if (mode == MODE_PERMADDR) {
+ return do_permaddr(fd, &ifr);
}
return 69;
@@ -2950,6 +2961,29 @@ static int do_flash(int fd, struct ifreq *ifr)
return err;
}
+static int do_permaddr(int fd, struct ifreq *ifr)
+{
+ int i, err;
+ struct ethtool_perm_addr *epaddr;
+
+ epaddr = malloc(sizeof(struct ethtool_perm_addr) + MAX_ADDR_LEN);
+ epaddr->cmd = ETHTOOL_GPERMADDR;
+ epaddr->size = MAX_ADDR_LEN;
+ ifr->ifr_data = (caddr_t)epaddr;
+
+ err = send_ioctl(fd, ifr);
+ if (err < 0)
+ perror("Cannot read permanent address\n");
+ else {
+ printf("Permanent address:");
+ for (i = 0; i < epaddr->size; i++)
+ printf("%c%02x", (i == 0) ? ' ' : ':',
+ epaddr->data[i]);
+ printf("\n");
+ }
+ return err;
+}
+
static int do_srxntuple(int fd, struct ifreq *ifr)
{
int err;
--
1.7.1
^ permalink raw reply related
* Re: [Ksummit-2010-discuss] [v2] Remaining BKL users, what to do
From: Greg KH @ 2010-10-18 18:43 UTC (permalink / raw)
To: Arnd Bergmann
Cc: codalist, ksummit-2010-discuss, autofs, Jan Harkes, Samuel Ortiz,
Jan Kara, Arnaldo Carvalho de Melo, netdev, Anders Larsen,
linux-kernel, dri-devel, Bryan Schumaker, Christoph Hellwig,
Petr Vandrovec, Mikulas Patocka, linux-fsdevel, Evgeniy Dushistov,
Ingo Molnar, Andrew Hendry, linux-media
In-Reply-To: <201010181742.06678.arnd@arndb.de>
On Mon, Oct 18, 2010 at 05:42:06PM +0200, Arnd Bergmann wrote:
>
> Out of the remaining modules, I guess i810/i830, adfs, hpfs and ufs might end
> up not getting fixed at all, we can either mark them non-SMP or move them
> to drivers/staging once all the others are done.
I recommend moving them to staging, and then retire them from there if
no one steps up to maintain them.
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH] vmxnet3: remove set_flag_le{16,64} functions
From: Harvey Harrison @ 2010-10-18 18:44 UTC (permalink / raw)
To: Shreyas Bhatewara; +Cc: netdev@vger.kernel.org, shemminger@vyatta.com
In-Reply-To: <89E2752CFA8EC044846EB8499819134102BD7E1856@EXCH-MBX-4.vmware.com>
On Sat, Oct 16, 2010 at 8:57 AM, Shreyas Bhatewara
<sbhatewara@vmware.com> wrote:
> This hunk is wrong, UPT1_F_RXVLAN should be reset here.
>
> I fail to understand why set/reset functions were not good enough and why this opencoding is required. I agree with your earlier suggestion about replacing two conversions with *data |= cpu_to_le16(flag); though.
>
>
There's nothing really _wrong_ with them, they are a bit special-case,
and they are incomplete in that there is only 16/64 and
no 32 bit version. And the naming is usually set/clear rather than set/reset.
That, and they are used so infrequently, why not just define the
constants as little endian and then it's just
use regular bitwise math which is common everywhere in networking?
Then others reading your driver don't have
to go look at a special-case set/reset function...it's just or'ing a flag.
I'll send a patch this evening so you can see what it would look like.
Harvey
^ permalink raw reply
* Re: Linux 2.6.35/TIPC 2.0 ABI breaking changes [was: TIPC 2.0 and TIPC_SUB_SERVICE]
From: Leandro Lucarella @ 2010-10-18 18:46 UTC (permalink / raw)
To: Jon Maloy
Cc: davem, netdev, tipc-discussion@lists.sourceforge.net,
linux-kernel
In-Reply-To: <20101018150422.GV8781@llucax.com.ar>
Leandro Lucarella, el 18 de octubre a las 12:04 me escribiste:
> This means D can't be used to write code that uses TIPC if you target
> kernels >= 2.6.35 (unless they write their own bindings, or at least use
> a custom TIPC_SUB_SERVICE constant). I could change the TIPC_SUB_SERVICE
> value, but then people using older kernels will be screwed. Another
> option is to use the version statement (kind of like C's #ifdef):
>
> version (TIPC_2_0)
> const TIPC_SUB_SERVICE = 0x00;
> else
> const TIPC_SUB_SERVICE = 0x02;
I keep finding problems with this change. Another, no D-related, problem
with this change is old code could be silently (and very subtly) broken
if they check for TIPC_SUB_SERVICE as a flag with something like:
if (s.filter & TIPC_SUB_SERVICE)
/* do something */
Because TIPC_SUB_SERVICE has changed its semantics, not just its value,
and the new value (0x00) will give you always 0 in that test. This one
is really tricky, because the application code will fail silently, there
will be no dmesg indication of a failure, nor the connection to the
topology service be closed. You might get a compiler warning if you're
lucky.
--
Leandro Lucarella (AKA luca) http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
Novocaine for the soul
you better give me something
to fill the hole
before I sputter out
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
^ permalink raw reply
* Re: [PATCH] ethtool: add get permanent address option
From: Ben Hutchings @ 2010-10-18 19:52 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Jeff Garzik, netdev
In-Reply-To: <20101018114139.71073a40@nehalam>
On Mon, 2010-10-18 at 11:41 -0700, Stephen Hemminger wrote:
> Add command level support for showing permanent address.
> The ioctl has been around for a long time but there was
> no option to display it.
>
> Note: MAX_ADDR_LEN is defined in netdevice.h but including
> netdevice.h leads to multiple definition errors with if.h.
[...]
> @@ -2950,6 +2961,29 @@ static int do_flash(int fd, struct ifreq *ifr)
> return err;
> }
>
> +static int do_permaddr(int fd, struct ifreq *ifr)
> +{
> + int i, err;
> + struct ethtool_perm_addr *epaddr;
> +
> + epaddr = malloc(sizeof(struct ethtool_perm_addr) + MAX_ADDR_LEN);
> + epaddr->cmd = ETHTOOL_GPERMADDR;
> + epaddr->size = MAX_ADDR_LEN;
> + ifr->ifr_data = (caddr_t)epaddr;
> +
> + err = send_ioctl(fd, ifr);
> + if (err < 0)
> + perror("Cannot read permanent address\n");
[...]
Don't include a newline in the argument to perror().
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [RFC PATCH 1/7] ebtables: Allow filtering of hardware accelerated vlan frames.
From: Ben Hutchings @ 2010-10-18 19:58 UTC (permalink / raw)
To: Jesse Gross; +Cc: davem, netdev
In-Reply-To: <1287000177-7126-2-git-send-email-jesse@nicira.com>
On Wed, 2010-10-13 at 13:02 -0700, Jesse Gross wrote:
> An upcoming commit will allow packets with hardware vlan acceleration
> information to be passed though more parts of the network stack, including
> packets trunked through the bridge. This adds support for matching and
> filtering those packets through ebtables.
>
> Signed-off-by: Jesse Gross <jesse@nicira.com>
> ---
> net/bridge/br_netfilter.c | 16 +++++++++-------
> net/bridge/netfilter/ebt_vlan.c | 38 +++++++++++++++++++++++---------------
> net/bridge/netfilter/ebtables.c | 15 +++++++++++----
> 3 files changed, 43 insertions(+), 26 deletions(-)
>
> diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
> index 7f9ce96..d6a4fec 100644
> --- a/net/bridge/br_netfilter.c
> +++ b/net/bridge/br_netfilter.c
> @@ -64,22 +64,24 @@ static int brnf_filter_pppoe_tagged __read_mostly = 0;
>
> static inline __be16 vlan_proto(const struct sk_buff *skb)
> {
> - return vlan_eth_hdr(skb)->h_vlan_encapsulated_proto;
> + if (skb->protocol == htons(ETH_P_8021Q))
> + return vlan_eth_hdr(skb)->h_vlan_encapsulated_proto;
> + else if (vlan_tx_tag_present(skb))
> + return skb->protocol;
If there are two levels of VLAN-encapsulation, this will return either
the inner or outer tag depending on whether VLAN acceleration is being
used. It should behave consistently.
> + else
> + return 0;
> }
>
> #define IS_VLAN_IP(skb) \
> - (skb->protocol == htons(ETH_P_8021Q) && \
> - vlan_proto(skb) == htons(ETH_P_IP) && \
> + (vlan_proto(skb) == htons(ETH_P_IP) && \
> brnf_filter_vlan_tagged)
>
> #define IS_VLAN_IPV6(skb) \
> - (skb->protocol == htons(ETH_P_8021Q) && \
> - vlan_proto(skb) == htons(ETH_P_IPV6) &&\
> + (vlan_proto(skb) == htons(ETH_P_IPV6) &&\
> brnf_filter_vlan_tagged)
>
> #define IS_VLAN_ARP(skb) \
> - (skb->protocol == htons(ETH_P_8021Q) && \
> - vlan_proto(skb) == htons(ETH_P_ARP) && \
> + (vlan_proto(skb) == htons(ETH_P_ARP) && \
> brnf_filter_vlan_tagged)
>
> static inline __be16 pppoe_proto(const struct sk_buff *skb)
> diff --git a/net/bridge/netfilter/ebt_vlan.c b/net/bridge/netfilter/ebt_vlan.c
> index 87b53b3..a39d92d 100644
> --- a/net/bridge/netfilter/ebt_vlan.c
> +++ b/net/bridge/netfilter/ebt_vlan.c
> @@ -39,8 +39,6 @@ static bool
> ebt_vlan_mt(const struct sk_buff *skb, struct xt_action_param *par)
> {
> const struct ebt_vlan_info *info = par->matchinfo;
> - const struct vlan_hdr *fp;
> - struct vlan_hdr _frame;
>
> unsigned short TCI; /* Whole TCI, given from parsed frame */
> unsigned short id; /* VLAN ID, given from frame TCI */
> @@ -48,21 +46,31 @@ ebt_vlan_mt(const struct sk_buff *skb, struct xt_action_param *par)
> /* VLAN encapsulated Type/Length field, given from orig frame */
> __be16 encap;
>
> - fp = skb_header_pointer(skb, 0, sizeof(_frame), &_frame);
> - if (fp == NULL)
> - return false;
> -
> - /* Tag Control Information (TCI) consists of the following elements:
> - * - User_priority. The user_priority field is three bits in length,
> - * interpreted as a binary number.
> - * - Canonical Format Indicator (CFI). The Canonical Format Indicator
> - * (CFI) is a single bit flag value. Currently ignored.
> - * - VLAN Identifier (VID). The VID is encoded as
> - * an unsigned binary number. */
> - TCI = ntohs(fp->h_vlan_TCI);
> + if (skb->protocol == htons(ETH_P_8021Q)) {
> + const struct vlan_hdr *fp;
> + struct vlan_hdr _frame;
> +
> + fp = skb_header_pointer(skb, 0, sizeof(_frame), &_frame);
> + if (fp == NULL)
> + return false;
> +
> + /* Tag Control Information (TCI) consists of the following elements:
> + * - User_priority. The user_priority field is three bits in length,
> + * interpreted as a binary number.
> + * - Canonical Format Indicator (CFI). The Canonical Format Indicator
> + * (CFI) is a single bit flag value. Currently ignored.
> + * - VLAN Identifier (VID). The VID is encoded as
> + * an unsigned binary number. */
> + TCI = ntohs(fp->h_vlan_TCI);
> +
> + encap = fp->h_vlan_encapsulated_proto;
> + } else {
> + TCI = vlan_tx_tag_get(skb);
> + encap = skb->protocol;
> + }
> +
[...]
This has the same problem.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* [PATCH] ethtool: add get permanent address option (v2)
From: Stephen Hemminger @ 2010-10-18 20:11 UTC (permalink / raw)
To: Ben Hutchings, Jeff Garzik; +Cc: netdev
In-Reply-To: <1287431541.2252.556.camel@achroite.uk.solarflarecom.com>
Add command level support for showing permanent address.
The ioctl has been around for a long time but there was
no option to display it.
Note: MAX_ADDR_LEN is defined in netdevice.h but including
netdevice.h leads to multiple definition errors with if.h.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
Fix perror(), memory leak and indenting (v2)
ethtool.8 | 6 ++++++
ethtool.c | 38 +++++++++++++++++++++++++++++++++++++-
2 files changed, 43 insertions(+), 1 deletions(-)
diff --git a/ethtool.8 b/ethtool.8
index 3ca403c..84d5cc0 100644
--- a/ethtool.8
+++ b/ethtool.8
@@ -176,6 +176,9 @@ ethtool \- Display or change ethernet card settings
.I ethX
.RI [ N ]
+.B ethtool \-P|\-\-show-permaddr
+.I ethX
+
.B ethtool \-r|\-\-negotiate
.I ethX
@@ -388,6 +391,9 @@ blinking one or more LEDs on the specific ethernet port.
.B N
Length of time to perform phys-id, in seconds.
.TP
+.B \-P \-\-show-permaddr
+Queries the specified ethernet device for permanent hardware address.
+.TP
.B \-r \-\-negotiate
Restarts auto-negotiation on the specified ethernet device, if
auto-negotiation is enabled.
diff --git a/ethtool.c b/ethtool.c
index 6b2b7c8..1326f54 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -51,6 +51,9 @@
#ifndef SIOCETHTOOL
#define SIOCETHTOOL 0x8946
#endif
+#ifndef MAX_ADDR_LEN
+#define MAX_ADDR_LEN 32
+#endif
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#endif
@@ -107,6 +110,8 @@ static int do_srxfhindir(int fd, struct ifreq *ifr);
static int do_srxntuple(int fd, struct ifreq *ifr);
static int do_grxntuple(int fd, struct ifreq *ifr);
static int do_flash(int fd, struct ifreq *ifr);
+static int do_permaddr(int fd, struct ifreq *ifr);
+
static int send_ioctl(int fd, struct ifreq *ifr);
static enum {
@@ -136,6 +141,7 @@ static enum {
MODE_SNTUPLE,
MODE_GNTUPLE,
MODE_FLASHDEV,
+ MODE_PERMADDR,
} mode = MODE_GSET;
static struct option {
@@ -247,6 +253,8 @@ static struct option {
"action <queue or drop>\n" },
{ "-u", "--show-ntuple", MODE_GNTUPLE,
"Get Rx ntuple filters and actions\n" },
+ { "-P", "--show-permaddr", MODE_PERMADDR,
+ "Show permanent hardware address" },
{ "-h", "--help", MODE_HELP, "Show this help" },
{}
};
@@ -750,7 +758,8 @@ static void parse_cmdline(int argc, char **argp)
(mode == MODE_SNTUPLE) ||
(mode == MODE_GNTUPLE) ||
(mode == MODE_PHYS_ID) ||
- (mode == MODE_FLASHDEV)) {
+ (mode == MODE_FLASHDEV) |
+ (mode == MODE_PERMADDR)) {
devname = argp[i];
break;
}
@@ -1868,6 +1877,8 @@ static int doit(void)
return do_grxntuple(fd, &ifr);
} else if (mode == MODE_FLASHDEV) {
return do_flash(fd, &ifr);
+ } else if (mode == MODE_PERMADDR) {
+ return do_permaddr(fd, &ifr);
}
return 69;
@@ -2950,6 +2961,31 @@ static int do_flash(int fd, struct ifreq *ifr)
return err;
}
+static int do_permaddr(int fd, struct ifreq *ifr)
+{
+ int i, err;
+ struct ethtool_perm_addr *epaddr;
+
+ epaddr = malloc(sizeof(struct ethtool_perm_addr) + MAX_ADDR_LEN);
+ epaddr->cmd = ETHTOOL_GPERMADDR;
+ epaddr->size = MAX_ADDR_LEN;
+ ifr->ifr_data = (caddr_t)epaddr;
+
+ err = send_ioctl(fd, ifr);
+ if (err < 0)
+ perror("Cannot read permanent address");
+ else {
+ printf("Permanent address:");
+ for (i = 0; i < epaddr->size; i++)
+ printf("%c%02x", (i == 0) ? ' ' : ':',
+ epaddr->data[i]);
+ printf("\n");
+ }
+ free(epaddr);
+
+ return err;
+}
+
static int do_srxntuple(int fd, struct ifreq *ifr)
{
int err;
--
1.7.1
^ permalink raw reply related
* Re: [PATCH] ethtool: add get permanent address option (v2)
From: Joe Perches @ 2010-10-18 20:16 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Ben Hutchings, Jeff Garzik, netdev
In-Reply-To: <20101018131104.02681d60@nehalam>
On Mon, 2010-10-18 at 13:11 -0700, Stephen Hemminger wrote:
> diff --git a/ethtool.c b/ethtool.c
[]
> @@ -750,7 +758,8 @@ static void parse_cmdline(int argc, char **argp)
> (mode == MODE_SNTUPLE) ||
> (mode == MODE_GNTUPLE) ||
> (mode == MODE_PHYS_ID) ||
> - (mode == MODE_FLASHDEV)) {
> + (mode == MODE_FLASHDEV) |
> + (mode == MODE_PERMADDR)) {
One more vertical bar please.
^ permalink raw reply
* Re: [PATCH net-next] vxge: make functions local and remove dead code
From: Jon Mason @ 2010-10-18 20:28 UTC (permalink / raw)
To: Stephen Hemminger
Cc: David Miller, netdev@vger.kernel.org, Ramkrishna Vepa,
Sivakumar Subramani, Sreenivasa Honnur
In-Reply-To: <20101015102110.056690c6@nehalam>
On Fri, Oct 15, 2010 at 10:21:10AM -0700, Stephen Hemminger wrote:
> Use results of make namespacecheck to make functions local and
> remove code that is not used.
>
> Also rename initialize_ethtool_ops to vxge_initialize_ethtool_ops.
>
> Compile tested only.
These all look sane. I have a patchset coming out soon that has some
of these changes, and I was going to make the rest of the changes
below in the following series (per your earlier e-mail). I would
prefer to release those before applying this patch, as it touches many
things.
Thanks,
Jon
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> ---
> drivers/net/vxge/vxge-config.c | 332 +++++++++++++++++++++++++++++-----------
> drivers/net/vxge/vxge-config.h | 227 ---------------------------
> drivers/net/vxge/vxge-ethtool.c | 2
> drivers/net/vxge/vxge-main.c | 64 ++++---
> drivers/net/vxge/vxge-main.h | 59 -------
> drivers/net/vxge/vxge-traffic.c | 101 +-----------
> drivers/net/vxge/vxge-traffic.h | 134 ----------------
> 7 files changed, 304 insertions(+), 615 deletions(-)
>
> --- a/drivers/net/vxge/vxge-config.c 2010-10-15 09:10:06.686399147 -0700
> +++ b/drivers/net/vxge/vxge-config.c 2010-10-15 10:15:51.420682586 -0700
> @@ -20,6 +20,179 @@
> #include "vxge-traffic.h"
> #include "vxge-config.h"
>
> +static enum vxge_hw_status
> +__vxge_hw_fifo_create(
> + struct __vxge_hw_vpath_handle *vpath_handle,
> + struct vxge_hw_fifo_attr *attr);
> +
> +static enum vxge_hw_status
> +__vxge_hw_fifo_abort(
> + struct __vxge_hw_fifo *fifoh);
> +
> +static enum vxge_hw_status
> +__vxge_hw_fifo_reset(
> + struct __vxge_hw_fifo *ringh);
> +
> +static enum vxge_hw_status
> +__vxge_hw_fifo_delete(
> + struct __vxge_hw_vpath_handle *vpath_handle);
> +
> +static struct __vxge_hw_blockpool_entry *
> +__vxge_hw_blockpool_block_allocate(struct __vxge_hw_device *hldev,
> + u32 size);
> +
> +static void
> +__vxge_hw_blockpool_block_free(struct __vxge_hw_device *hldev,
> + struct __vxge_hw_blockpool_entry *entry);
> +
> +static void vxge_hw_blockpool_block_add(struct __vxge_hw_device *devh,
> + void *block_addr,
> + u32 length,
> + struct pci_dev *dma_h,
> + struct pci_dev *acc_handle);
> +
> +static enum vxge_hw_status
> +__vxge_hw_blockpool_create(struct __vxge_hw_device *hldev,
> + struct __vxge_hw_blockpool *blockpool,
> + u32 pool_size,
> + u32 pool_max);
> +
> +static void
> +__vxge_hw_blockpool_destroy(struct __vxge_hw_blockpool *blockpool);
> +
> +static void *
> +__vxge_hw_blockpool_malloc(struct __vxge_hw_device *hldev,
> + u32 size,
> + struct vxge_hw_mempool_dma *dma_object);
> +
> +static void
> +__vxge_hw_blockpool_free(struct __vxge_hw_device *hldev,
> + void *memblock,
> + u32 size,
> + struct vxge_hw_mempool_dma *dma_object);
> +
> +
> +static struct __vxge_hw_channel*
> +__vxge_hw_channel_allocate(struct __vxge_hw_vpath_handle *vph,
> + enum __vxge_hw_channel_type type, u32 length,
> + u32 per_dtr_space, void *userdata);
> +
> +static void
> +__vxge_hw_channel_free(
> + struct __vxge_hw_channel *channel);
> +
> +static enum vxge_hw_status
> +__vxge_hw_channel_initialize(
> + struct __vxge_hw_channel *channel);
> +
> +static enum vxge_hw_status
> +__vxge_hw_channel_reset(
> + struct __vxge_hw_channel *channel);
> +
> +static enum vxge_hw_status __vxge_hw_ring_delete(struct __vxge_hw_vpath_handle *vp);
> +
> +static enum vxge_hw_status
> +__vxge_hw_device_fifo_config_check(struct vxge_hw_fifo_config *fifo_config);
> +
> +static enum vxge_hw_status
> +__vxge_hw_device_config_check(struct vxge_hw_device_config *new_config);
> +
> +static void
> +__vxge_hw_device_id_get(struct __vxge_hw_device *hldev);
> +
> +static void
> +__vxge_hw_device_host_info_get(struct __vxge_hw_device *hldev);
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_card_info_get(
> + u32 vp_id,
> + struct vxge_hw_vpath_reg __iomem *vpath_reg,
> + struct vxge_hw_device_hw_info *hw_info);
> +
> +static enum vxge_hw_status
> +__vxge_hw_device_initialize(struct __vxge_hw_device *hldev);
> +
> +static void
> +__vxge_hw_device_pci_e_init(struct __vxge_hw_device *hldev);
> +
> +static enum vxge_hw_status
> +__vxge_hw_device_reg_addr_get(struct __vxge_hw_device *hldev);
> +
> +static enum vxge_hw_status
> +__vxge_hw_device_register_poll(
> + void __iomem *reg,
> + u64 mask, u32 max_millis);
> +
> +static inline enum vxge_hw_status
> +__vxge_hw_pio_mem_write64(u64 val64, void __iomem *addr,
> + u64 mask, u32 max_millis)
> +{
> + __vxge_hw_pio_mem_write32_lower((u32)vxge_bVALn(val64, 32, 32), addr);
> + wmb();
> +
> + __vxge_hw_pio_mem_write32_upper((u32)vxge_bVALn(val64, 0, 32), addr);
> + wmb();
> +
> + return __vxge_hw_device_register_poll(addr, mask, max_millis);
> +}
> +
> +static struct vxge_hw_mempool*
> +__vxge_hw_mempool_create(struct __vxge_hw_device *devh, u32 memblock_size,
> + u32 item_size, u32 private_size, u32 items_initial,
> + u32 items_max, struct vxge_hw_mempool_cbs *mp_callback,
> + void *userdata);
> +static void __vxge_hw_mempool_destroy(struct vxge_hw_mempool *mempool);
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_stats_get(struct __vxge_hw_virtualpath *vpath,
> + struct vxge_hw_vpath_stats_hw_info *hw_stats);
> +
> +static enum vxge_hw_status
> +vxge_hw_vpath_stats_enable(struct __vxge_hw_vpath_handle *vpath_handle);
> +
> +static enum vxge_hw_status
> +__vxge_hw_legacy_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg);
> +
> +static u64
> +__vxge_hw_vpath_pci_func_mode_get(u32 vp_id,
> + struct vxge_hw_vpath_reg __iomem *vpath_reg);
> +
> +static u32
> +__vxge_hw_vpath_func_id_get(u32 vp_id, struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg);
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_addr_get(u32 vp_id, struct vxge_hw_vpath_reg __iomem *vpath_reg,
> + u8 (macaddr)[ETH_ALEN], u8 (macaddr_mask)[ETH_ALEN]);
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath);
> +
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_sw_reset(struct __vxge_hw_device *devh, u32 vp_id);
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_fw_ver_get(u32 vp_id, struct vxge_hw_vpath_reg __iomem *vpath_reg,
> + struct vxge_hw_device_hw_info *hw_info);
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_mac_configure(struct __vxge_hw_device *devh, u32 vp_id);
> +
> +static void
> +__vxge_hw_vp_terminate(struct __vxge_hw_device *devh, u32 vp_id);
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_stats_access(struct __vxge_hw_virtualpath *vpath,
> + u32 operation, u32 offset, u64 *stat);
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_xmac_tx_stats_get(struct __vxge_hw_virtualpath *vpath,
> + struct vxge_hw_xmac_vpath_tx_stats *vpath_tx_stats);
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_xmac_rx_stats_get(struct __vxge_hw_virtualpath *vpath,
> + struct vxge_hw_xmac_vpath_rx_stats *vpath_rx_stats);
> +
> /*
> * __vxge_hw_channel_allocate - Allocate memory for channel
> * This function allocates required memory for the channel and various arrays
> @@ -190,7 +363,7 @@ __vxge_hw_device_pci_e_init(struct __vxg
> * Will poll certain register for specified amount of time.
> * Will poll until masked bit is not cleared.
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_device_register_poll(void __iomem *reg, u64 mask, u32 max_millis)
> {
> u64 val64;
> @@ -221,7 +394,7 @@ __vxge_hw_device_register_poll(void __io
> * in progress
> * This routine checks the vpath reset in progress register is turned zero
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_device_vpath_reset_in_prog_check(u64 __iomem *vpath_rst_in_prog)
> {
> enum vxge_hw_status status;
> @@ -236,7 +409,7 @@ __vxge_hw_device_vpath_reset_in_prog_che
> * This routine sets the swapper and reads the toc pointer and returns the
> * memory mapped address of the toc
> */
> -struct vxge_hw_toc_reg __iomem *
> +static struct vxge_hw_toc_reg __iomem *
> __vxge_hw_device_toc_get(void __iomem *bar0)
> {
> u64 val64;
> @@ -779,7 +952,7 @@ exit:
> * vxge_hw_device_xmac_aggr_stats_get - Get the Statistics on aggregate port
> * Get the Statistics on aggregate port
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> vxge_hw_device_xmac_aggr_stats_get(struct __vxge_hw_device *hldev, u32 port,
> struct vxge_hw_xmac_aggr_stats *aggr_stats)
> {
> @@ -814,7 +987,7 @@ exit:
> * vxge_hw_device_xmac_port_stats_get - Get the Statistics on a port
> * Get the Statistics on port
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> vxge_hw_device_xmac_port_stats_get(struct __vxge_hw_device *hldev, u32 port,
> struct vxge_hw_xmac_port_stats *port_stats)
> {
> @@ -952,20 +1125,6 @@ u32 vxge_hw_device_trace_level_get(struc
> return 0;
> #endif
> }
> -/*
> - * vxge_hw_device_debug_mask_get - Get the debug mask
> - * This routine returns the current debug mask set
> - */
> -u32 vxge_hw_device_debug_mask_get(struct __vxge_hw_device *hldev)
> -{
> -#if defined(VXGE_DEBUG_TRACE_MASK) || defined(VXGE_DEBUG_ERR_MASK)
> - if (hldev == NULL)
> - return 0;
> - return hldev->debug_module_mask;
> -#else
> - return 0;
> -#endif
> -}
>
> /*
> * vxge_hw_getpause_data -Pause frame frame generation and reception.
> @@ -1090,7 +1249,7 @@ __vxge_hw_ring_block_next_pointer_set(u8
> * first block
> * Returns the dma address of the first RxD block
> */
> -u64 __vxge_hw_ring_first_block_address_get(struct __vxge_hw_ring *ring)
> +static u64 __vxge_hw_ring_first_block_address_get(struct __vxge_hw_ring *ring)
> {
> struct vxge_hw_mempool_dma *dma_object;
>
> @@ -1252,7 +1411,7 @@ exit:
> * This function creates Ring and initializes it.
> *
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_ring_create(struct __vxge_hw_vpath_handle *vp,
> struct vxge_hw_ring_attr *attr)
> {
> @@ -1363,7 +1522,7 @@ exit:
> * __vxge_hw_ring_abort - Returns the RxD
> * This function terminates the RxDs of ring
> */
> -enum vxge_hw_status __vxge_hw_ring_abort(struct __vxge_hw_ring *ring)
> +static enum vxge_hw_status __vxge_hw_ring_abort(struct __vxge_hw_ring *ring)
> {
> void *rxdh;
> struct __vxge_hw_channel *channel;
> @@ -1392,7 +1551,7 @@ enum vxge_hw_status __vxge_hw_ring_abort
> * __vxge_hw_ring_reset - Resets the ring
> * This function resets the ring during vpath reset operation
> */
> -enum vxge_hw_status __vxge_hw_ring_reset(struct __vxge_hw_ring *ring)
> +static enum vxge_hw_status __vxge_hw_ring_reset(struct __vxge_hw_ring *ring)
> {
> enum vxge_hw_status status = VXGE_HW_OK;
> struct __vxge_hw_channel *channel;
> @@ -1419,7 +1578,7 @@ exit:
> * __vxge_hw_ring_delete - Removes the ring
> * This function freeup the memory pool and removes the ring
> */
> -enum vxge_hw_status __vxge_hw_ring_delete(struct __vxge_hw_vpath_handle *vp)
> +static enum vxge_hw_status __vxge_hw_ring_delete(struct __vxge_hw_vpath_handle *vp)
> {
> struct __vxge_hw_ring *ring = vp->vpath->ringh;
>
> @@ -1438,7 +1597,7 @@ enum vxge_hw_status __vxge_hw_ring_delet
> * __vxge_hw_mempool_grow
> * Will resize mempool up to %num_allocate value.
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_mempool_grow(struct vxge_hw_mempool *mempool, u32 num_allocate,
> u32 *num_allocated)
> {
> @@ -1527,7 +1686,7 @@ exit:
> * with size enough to hold %items_initial number of items. Memory is
> * DMA-able but client must map/unmap before interoperating with the device.
> */
> -struct vxge_hw_mempool*
> +static struct vxge_hw_mempool*
> __vxge_hw_mempool_create(
> struct __vxge_hw_device *devh,
> u32 memblock_size,
> @@ -1644,7 +1803,7 @@ exit:
> /*
> * vxge_hw_mempool_destroy
> */
> -void __vxge_hw_mempool_destroy(struct vxge_hw_mempool *mempool)
> +static void __vxge_hw_mempool_destroy(struct vxge_hw_mempool *mempool)
> {
> u32 i, j;
> struct __vxge_hw_device *devh = mempool->devh;
> @@ -1700,7 +1859,7 @@ __vxge_hw_device_fifo_config_check(struc
> * __vxge_hw_device_vpath_config_check - Check vpath configuration.
> * Check the vpath configuration
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_device_vpath_config_check(struct vxge_hw_vp_config *vp_config)
> {
> enum vxge_hw_status status;
> @@ -1922,7 +2081,7 @@ vxge_hw_device_config_default_get(struct
> * _hw_legacy_swapper_set - Set the swapper bits for the legacy secion.
> * Set the swapper bits appropriately for the lagacy section.
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_legacy_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg)
> {
> u64 val64;
> @@ -1977,7 +2136,7 @@ __vxge_hw_legacy_swapper_set(struct vxge
> * __vxge_hw_vpath_swapper_set - Set the swapper bits for the vpath.
> * Set the swapper bits appropriately for the vpath.
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_vpath_swapper_set(struct vxge_hw_vpath_reg __iomem *vpath_reg)
> {
> #ifndef __BIG_ENDIAN
> @@ -1996,7 +2155,7 @@ __vxge_hw_vpath_swapper_set(struct vxge_
> * __vxge_hw_kdfc_swapper_set - Set the swapper bits for the kdfc.
> * Set the swapper bits appropriately for the vpath.
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_kdfc_swapper_set(
> struct vxge_hw_legacy_reg __iomem *legacy_reg,
> struct vxge_hw_vpath_reg __iomem *vpath_reg)
> @@ -2021,28 +2180,6 @@ __vxge_hw_kdfc_swapper_set(
> }
>
> /*
> - * vxge_hw_mgmt_device_config - Retrieve device configuration.
> - * Get device configuration. Permits to retrieve at run-time configuration
> - * values that were used to initialize and configure the device.
> - */
> -enum vxge_hw_status
> -vxge_hw_mgmt_device_config(struct __vxge_hw_device *hldev,
> - struct vxge_hw_device_config *dev_config, int size)
> -{
> -
> - if ((hldev == NULL) || (hldev->magic != VXGE_HW_DEVICE_MAGIC))
> - return VXGE_HW_ERR_INVALID_DEVICE;
> -
> - if (size != sizeof(struct vxge_hw_device_config))
> - return VXGE_HW_ERR_VERSION_CONFLICT;
> -
> - memcpy(dev_config, &hldev->config,
> - sizeof(struct vxge_hw_device_config));
> -
> - return VXGE_HW_OK;
> -}
> -
> -/*
> * vxge_hw_mgmt_reg_read - Read Titan register.
> */
> enum vxge_hw_status
> @@ -2438,7 +2575,7 @@ exit:
> * __vxge_hw_fifo_abort - Returns the TxD
> * This function terminates the TxDs of fifo
> */
> -enum vxge_hw_status __vxge_hw_fifo_abort(struct __vxge_hw_fifo *fifo)
> +static enum vxge_hw_status __vxge_hw_fifo_abort(struct __vxge_hw_fifo *fifo)
> {
> void *txdlh;
>
> @@ -2466,7 +2603,7 @@ enum vxge_hw_status __vxge_hw_fifo_abort
> * __vxge_hw_fifo_reset - Resets the fifo
> * This function resets the fifo during vpath reset operation
> */
> -enum vxge_hw_status __vxge_hw_fifo_reset(struct __vxge_hw_fifo *fifo)
> +static enum vxge_hw_status __vxge_hw_fifo_reset(struct __vxge_hw_fifo *fifo)
> {
> enum vxge_hw_status status = VXGE_HW_OK;
>
> @@ -2501,7 +2638,7 @@ enum vxge_hw_status __vxge_hw_fifo_delet
> * in pci config space.
> * Read from the vpath pci config space.
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_vpath_pci_read(struct __vxge_hw_virtualpath *vpath,
> u32 phy_func_0, u32 offset, u32 *val)
> {
> @@ -2542,7 +2679,7 @@ exit:
> * __vxge_hw_vpath_func_id_get - Get the function id of the vpath.
> * Returns the function number of the vpath.
> */
> -u32
> +static u32
> __vxge_hw_vpath_func_id_get(u32 vp_id,
> struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg)
> {
> @@ -2573,7 +2710,7 @@ __vxge_hw_read_rts_ds(struct vxge_hw_vpa
> * __vxge_hw_vpath_card_info_get - Get the serial numbers,
> * part number and product description.
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_vpath_card_info_get(
> u32 vp_id,
> struct vxge_hw_vpath_reg __iomem *vpath_reg,
> @@ -2695,7 +2832,7 @@ __vxge_hw_vpath_card_info_get(
> * __vxge_hw_vpath_fw_ver_get - Get the fw version
> * Returns FW Version
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_vpath_fw_ver_get(
> u32 vp_id,
> struct vxge_hw_vpath_reg __iomem *vpath_reg,
> @@ -2789,7 +2926,7 @@ exit:
> * __vxge_hw_vpath_pci_func_mode_get - Get the pci mode
> * Returns pci function mode
> */
> -u64
> +static u64
> __vxge_hw_vpath_pci_func_mode_get(
> u32 vp_id,
> struct vxge_hw_vpath_reg __iomem *vpath_reg)
> @@ -2995,7 +3132,7 @@ exit:
> * __vxge_hw_vpath_addr_get - Get the hw address entry for this vpath
> * from MAC address table.
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_vpath_addr_get(
> u32 vp_id, struct vxge_hw_vpath_reg __iomem *vpath_reg,
> u8 (macaddr)[ETH_ALEN], u8 (macaddr_mask)[ETH_ALEN])
> @@ -3347,7 +3484,7 @@ __vxge_hw_vpath_mgmt_read(
> * This routine checks the vpath_rst_in_prog register to see if
> * adapter completed the reset process for the vpath
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath)
> {
> enum vxge_hw_status status;
> @@ -3365,7 +3502,7 @@ __vxge_hw_vpath_reset_check(struct __vxg
> * __vxge_hw_vpath_reset
> * This routine resets the vpath on the device
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_vpath_reset(struct __vxge_hw_device *hldev, u32 vp_id)
> {
> u64 val64;
> @@ -3383,7 +3520,7 @@ __vxge_hw_vpath_reset(struct __vxge_hw_d
> * __vxge_hw_vpath_sw_reset
> * This routine resets the vpath structures
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_vpath_sw_reset(struct __vxge_hw_device *hldev, u32 vp_id)
> {
> enum vxge_hw_status status = VXGE_HW_OK;
> @@ -3408,7 +3545,7 @@ exit:
> * This routine configures the prc registers of virtual path using the config
> * passed
> */
> -void
> +static void
> __vxge_hw_vpath_prc_configure(struct __vxge_hw_device *hldev, u32 vp_id)
> {
> u64 val64;
> @@ -3480,7 +3617,7 @@ __vxge_hw_vpath_prc_configure(struct __v
> * This routine configures the kdfc registers of virtual path using the
> * config passed
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_vpath_kdfc_configure(struct __vxge_hw_device *hldev, u32 vp_id)
> {
> u64 val64;
> @@ -3553,7 +3690,7 @@ exit:
> * __vxge_hw_vpath_mac_configure
> * This routine configures the mac of virtual path using the config passed
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_vpath_mac_configure(struct __vxge_hw_device *hldev, u32 vp_id)
> {
> u64 val64;
> @@ -3621,7 +3758,7 @@ __vxge_hw_vpath_mac_configure(struct __v
> * This routine configures the tim registers of virtual path using the config
> * passed
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_vpath_tim_configure(struct __vxge_hw_device *hldev, u32 vp_id)
> {
> u64 val64;
> @@ -3897,7 +4034,7 @@ vxge_hw_vpath_tti_ci_set(struct __vxge_h
> * This routine is the final phase of init which initializes the
> * registers of the vpath using the configuration passed.
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_vpath_initialize(struct __vxge_hw_device *hldev, u32 vp_id)
> {
> u64 val64;
> @@ -3966,7 +4103,7 @@ exit:
> * This routine is the initial phase of init which resets the vpath and
> * initializes the software support structures.
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_vp_initialize(struct __vxge_hw_device *hldev, u32 vp_id,
> struct vxge_hw_vp_config *config)
> {
> @@ -4022,7 +4159,7 @@ exit:
> * __vxge_hw_vp_terminate - Terminate Virtual Path structure
> * This routine closes all channels it opened and freeup memory
> */
> -void
> +static void
> __vxge_hw_vp_terminate(struct __vxge_hw_device *hldev, u32 vp_id)
> {
> struct __vxge_hw_virtualpath *vpath;
> @@ -4384,7 +4521,7 @@ vxge_hw_vpath_enable(struct __vxge_hw_vp
> * Enable the DMA vpath statistics. The function is to be called to re-enable
> * the adapter to update stats into the host memory
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> vxge_hw_vpath_stats_enable(struct __vxge_hw_vpath_handle *vp)
> {
> enum vxge_hw_status status = VXGE_HW_OK;
> @@ -4409,7 +4546,7 @@ exit:
> * __vxge_hw_vpath_stats_access - Get the statistics from the given location
> * and offset and perform an operation
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_vpath_stats_access(struct __vxge_hw_virtualpath *vpath,
> u32 operation, u32 offset, u64 *stat)
> {
> @@ -4445,7 +4582,7 @@ vpath_stats_access_exit:
> /*
> * __vxge_hw_vpath_xmac_tx_stats_get - Get the TX Statistics of a vpath
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_vpath_xmac_tx_stats_get(
> struct __vxge_hw_virtualpath *vpath,
> struct vxge_hw_xmac_vpath_tx_stats *vpath_tx_stats)
> @@ -4478,9 +4615,9 @@ exit:
> /*
> * __vxge_hw_vpath_xmac_rx_stats_get - Get the RX Statistics of a vpath
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_vpath_xmac_rx_stats_get(struct __vxge_hw_virtualpath *vpath,
> - struct vxge_hw_xmac_vpath_rx_stats *vpath_rx_stats)
> + struct vxge_hw_xmac_vpath_rx_stats *vpath_rx_stats)
> {
> u64 *val64;
> enum vxge_hw_status status = VXGE_HW_OK;
> @@ -4509,9 +4646,9 @@ exit:
> /*
> * __vxge_hw_vpath_stats_get - Get the vpath hw statistics.
> */
> -enum vxge_hw_status __vxge_hw_vpath_stats_get(
> - struct __vxge_hw_virtualpath *vpath,
> - struct vxge_hw_vpath_stats_hw_info *hw_stats)
> +static enum vxge_hw_status
> +__vxge_hw_vpath_stats_get(struct __vxge_hw_virtualpath *vpath,
> + struct vxge_hw_vpath_stats_hw_info *hw_stats)
> {
> u64 val64;
> enum vxge_hw_status status = VXGE_HW_OK;
> @@ -4643,6 +4780,32 @@ exit:
> return status;
> }
>
> +
> +static void vxge_os_dma_malloc_async(struct pci_dev *pdev, void *devh,
> + unsigned long size)
> +{
> + gfp_t flags;
> + void *vaddr;
> +
> + if (in_interrupt())
> + flags = GFP_ATOMIC | GFP_DMA;
> + else
> + flags = GFP_KERNEL | GFP_DMA;
> +
> + vaddr = kmalloc((size), flags);
> +
> + vxge_hw_blockpool_block_add(devh, vaddr, size, pdev, pdev);
> +}
> +
> +static void vxge_os_dma_free(struct pci_dev *pdev, const void *vaddr,
> + struct pci_dev **p_dma_acch)
> +{
> + unsigned long misaligned = *(unsigned long *)p_dma_acch;
> + u8 *tmp = (u8 *)vaddr;
> + tmp -= misaligned;
> + kfree((void *)tmp);
> +}
> +
> /*
> * __vxge_hw_blockpool_create - Create block pool
> */
> @@ -4845,12 +5008,11 @@ void __vxge_hw_blockpool_blocks_remove(s
> * vxge_hw_blockpool_block_add - callback for vxge_os_dma_malloc_async
> * Adds a block to block pool
> */
> -void vxge_hw_blockpool_block_add(
> - struct __vxge_hw_device *devh,
> - void *block_addr,
> - u32 length,
> - struct pci_dev *dma_h,
> - struct pci_dev *acc_handle)
> +static void vxge_hw_blockpool_block_add(struct __vxge_hw_device *devh,
> + void *block_addr,
> + u32 length,
> + struct pci_dev *dma_h,
> + struct pci_dev *acc_handle)
> {
> struct __vxge_hw_blockpool *blockpool;
> struct __vxge_hw_blockpool_entry *entry = NULL;
> --- a/drivers/net/vxge/vxge-config.h 2010-10-15 09:10:06.766402819 -0700
> +++ b/drivers/net/vxge/vxge-config.h 2010-10-15 10:14:19.925408165 -0700
> @@ -183,11 +183,6 @@ struct vxge_hw_device_version {
> char version[VXGE_HW_FW_STRLEN];
> };
>
> -u64
> -__vxge_hw_vpath_pci_func_mode_get(
> - u32 vp_id,
> - struct vxge_hw_vpath_reg __iomem *vpath_reg);
> -
> /**
> * struct vxge_hw_fifo_config - Configuration of fifo.
> * @enable: Is this fifo to be commissioned
> @@ -1426,9 +1421,6 @@ struct vxge_hw_rth_hash_types {
> u8 hash_type_ipv6ex_en;
> };
>
> -u32
> -vxge_hw_device_debug_mask_get(struct __vxge_hw_device *devh);
> -
> void vxge_hw_device_debug_set(
> struct __vxge_hw_device *devh,
> enum vxge_debug_level level,
> @@ -1440,9 +1432,6 @@ vxge_hw_device_error_level_get(struct __
> u32
> vxge_hw_device_trace_level_get(struct __vxge_hw_device *devh);
>
> -u32
> -vxge_hw_device_debug_mask_get(struct __vxge_hw_device *devh);
> -
> /**
> * vxge_hw_ring_rxd_size_get - Get the size of ring descriptor.
> * @buf_mode: Buffer mode (1, 3 or 5)
> @@ -1817,60 +1806,10 @@ struct vxge_hw_vpath_attr {
> struct vxge_hw_fifo_attr fifo_attr;
> };
>
> -enum vxge_hw_status
> -__vxge_hw_blockpool_create(struct __vxge_hw_device *hldev,
> - struct __vxge_hw_blockpool *blockpool,
> - u32 pool_size,
> - u32 pool_max);
> -
> -void
> -__vxge_hw_blockpool_destroy(struct __vxge_hw_blockpool *blockpool);
> -
> -struct __vxge_hw_blockpool_entry *
> -__vxge_hw_blockpool_block_allocate(struct __vxge_hw_device *hldev,
> - u32 size);
> -
> -void
> -__vxge_hw_blockpool_block_free(struct __vxge_hw_device *hldev,
> - struct __vxge_hw_blockpool_entry *entry);
> -
> -void *
> -__vxge_hw_blockpool_malloc(struct __vxge_hw_device *hldev,
> - u32 size,
> - struct vxge_hw_mempool_dma *dma_object);
> -
> -void
> -__vxge_hw_blockpool_free(struct __vxge_hw_device *hldev,
> - void *memblock,
> - u32 size,
> - struct vxge_hw_mempool_dma *dma_object);
> -
> -enum vxge_hw_status
> -__vxge_hw_device_fifo_config_check(struct vxge_hw_fifo_config *fifo_config);
> -
> -enum vxge_hw_status
> -__vxge_hw_device_config_check(struct vxge_hw_device_config *new_config);
> -
> -enum vxge_hw_status
> -vxge_hw_mgmt_device_config(struct __vxge_hw_device *devh,
> - struct vxge_hw_device_config *dev_config, int size);
> -
> enum vxge_hw_status __devinit vxge_hw_device_hw_info_get(
> void __iomem *bar0,
> struct vxge_hw_device_hw_info *hw_info);
>
> -enum vxge_hw_status
> -__vxge_hw_vpath_fw_ver_get(
> - u32 vp_id,
> - struct vxge_hw_vpath_reg __iomem *vpath_reg,
> - struct vxge_hw_device_hw_info *hw_info);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_card_info_get(
> - u32 vp_id,
> - struct vxge_hw_vpath_reg __iomem *vpath_reg,
> - struct vxge_hw_device_hw_info *hw_info);
> -
> enum vxge_hw_status __devinit vxge_hw_device_config_default_get(
> struct vxge_hw_device_config *device_config);
>
> @@ -1954,38 +1893,6 @@ out:
> return vaddr;
> }
>
> -extern void vxge_hw_blockpool_block_add(
> - struct __vxge_hw_device *devh,
> - void *block_addr,
> - u32 length,
> - struct pci_dev *dma_h,
> - struct pci_dev *acc_handle);
> -
> -static inline void vxge_os_dma_malloc_async(struct pci_dev *pdev, void *devh,
> - unsigned long size)
> -{
> - gfp_t flags;
> - void *vaddr;
> -
> - if (in_interrupt())
> - flags = GFP_ATOMIC | GFP_DMA;
> - else
> - flags = GFP_KERNEL | GFP_DMA;
> -
> - vaddr = kmalloc((size), flags);
> -
> - vxge_hw_blockpool_block_add(devh, vaddr, size, pdev, pdev);
> -}
> -
> -static inline void vxge_os_dma_free(struct pci_dev *pdev, const void *vaddr,
> - struct pci_dev **p_dma_acch)
> -{
> - unsigned long misaligned = *(unsigned long *)p_dma_acch;
> - u8 *tmp = (u8 *)vaddr;
> - tmp -= misaligned;
> - kfree((void *)tmp);
> -}
> -
> /*
> * __vxge_hw_mempool_item_priv - will return pointer on per item private space
> */
> @@ -2010,40 +1917,6 @@ __vxge_hw_mempool_item_priv(
> (*memblock_item_idx) * mempool->items_priv_size;
> }
>
> -enum vxge_hw_status
> -__vxge_hw_mempool_grow(
> - struct vxge_hw_mempool *mempool,
> - u32 num_allocate,
> - u32 *num_allocated);
> -
> -struct vxge_hw_mempool*
> -__vxge_hw_mempool_create(
> - struct __vxge_hw_device *devh,
> - u32 memblock_size,
> - u32 item_size,
> - u32 private_size,
> - u32 items_initial,
> - u32 items_max,
> - struct vxge_hw_mempool_cbs *mp_callback,
> - void *userdata);
> -
> -struct __vxge_hw_channel*
> -__vxge_hw_channel_allocate(struct __vxge_hw_vpath_handle *vph,
> - enum __vxge_hw_channel_type type, u32 length,
> - u32 per_dtr_space, void *userdata);
> -
> -void
> -__vxge_hw_channel_free(
> - struct __vxge_hw_channel *channel);
> -
> -enum vxge_hw_status
> -__vxge_hw_channel_initialize(
> - struct __vxge_hw_channel *channel);
> -
> -enum vxge_hw_status
> -__vxge_hw_channel_reset(
> - struct __vxge_hw_channel *channel);
> -
> /*
> * __vxge_hw_fifo_txdl_priv - Return the max fragments allocated
> * for the fifo.
> @@ -2065,9 +1938,6 @@ enum vxge_hw_status vxge_hw_vpath_open(
> struct vxge_hw_vpath_attr *attr,
> struct __vxge_hw_vpath_handle **vpath_handle);
>
> -enum vxge_hw_status
> -__vxge_hw_device_vpath_reset_in_prog_check(u64 __iomem *vpath_rst_in_prog);
> -
> enum vxge_hw_status vxge_hw_vpath_close(
> struct __vxge_hw_vpath_handle *vpath_handle);
>
> @@ -2089,54 +1959,9 @@ enum vxge_hw_status vxge_hw_vpath_mtu_se
> struct __vxge_hw_vpath_handle *vpath_handle,
> u32 new_mtu);
>
> -enum vxge_hw_status vxge_hw_vpath_stats_enable(
> - struct __vxge_hw_vpath_handle *vpath_handle);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_stats_access(
> - struct __vxge_hw_virtualpath *vpath,
> - u32 operation,
> - u32 offset,
> - u64 *stat);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_xmac_tx_stats_get(
> - struct __vxge_hw_virtualpath *vpath,
> - struct vxge_hw_xmac_vpath_tx_stats *vpath_tx_stats);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_xmac_rx_stats_get(
> - struct __vxge_hw_virtualpath *vpath,
> - struct vxge_hw_xmac_vpath_rx_stats *vpath_rx_stats);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_stats_get(
> - struct __vxge_hw_virtualpath *vpath,
> - struct vxge_hw_vpath_stats_hw_info *hw_stats);
> -
> void
> vxge_hw_vpath_rx_doorbell_init(struct __vxge_hw_vpath_handle *vp);
>
> -enum vxge_hw_status
> -__vxge_hw_device_vpath_config_check(struct vxge_hw_vp_config *vp_config);
> -
> -void
> -__vxge_hw_device_pci_e_init(struct __vxge_hw_device *hldev);
> -
> -enum vxge_hw_status
> -__vxge_hw_legacy_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_swapper_set(struct vxge_hw_vpath_reg __iomem *vpath_reg);
> -
> -enum vxge_hw_status
> -__vxge_hw_kdfc_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg,
> - struct vxge_hw_vpath_reg __iomem *vpath_reg);
> -
> -enum vxge_hw_status
> -__vxge_hw_device_register_poll(
> - void __iomem *reg,
> - u64 mask, u32 max_millis);
>
> #ifndef readq
> static inline u64 readq(void __iomem *addr)
> @@ -2168,62 +1993,12 @@ static inline void __vxge_hw_pio_mem_wri
> writel(val, addr);
> }
>
> -static inline enum vxge_hw_status
> -__vxge_hw_pio_mem_write64(u64 val64, void __iomem *addr,
> - u64 mask, u32 max_millis)
> -{
> - enum vxge_hw_status status = VXGE_HW_OK;
> -
> - __vxge_hw_pio_mem_write32_lower((u32)vxge_bVALn(val64, 32, 32), addr);
> - wmb();
> - __vxge_hw_pio_mem_write32_upper((u32)vxge_bVALn(val64, 0, 32), addr);
> - wmb();
> -
> - status = __vxge_hw_device_register_poll(addr, mask, max_millis);
> - return status;
> -}
> -
> -struct vxge_hw_toc_reg __iomem *
> -__vxge_hw_device_toc_get(void __iomem *bar0);
> -
> -enum vxge_hw_status
> -__vxge_hw_device_reg_addr_get(struct __vxge_hw_device *hldev);
> -
> -void
> -__vxge_hw_device_id_get(struct __vxge_hw_device *hldev);
> -
> -void
> -__vxge_hw_device_host_info_get(struct __vxge_hw_device *hldev);
> -
> enum vxge_hw_status
> vxge_hw_device_flick_link_led(struct __vxge_hw_device *devh, u64 on_off);
>
> enum vxge_hw_status
> -__vxge_hw_device_initialize(struct __vxge_hw_device *hldev);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_pci_read(
> - struct __vxge_hw_virtualpath *vpath,
> - u32 phy_func_0,
> - u32 offset,
> - u32 *val);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_addr_get(
> - u32 vp_id,
> - struct vxge_hw_vpath_reg __iomem *vpath_reg,
> - u8 (macaddr)[ETH_ALEN],
> - u8 (macaddr_mask)[ETH_ALEN]);
> -
> -u32
> -__vxge_hw_vpath_func_id_get(
> - u32 vp_id, struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath);
> -
> -enum vxge_hw_status
> vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask);
> +
> /**
> * vxge_debug
> * @level: level of debug verbosity.
> --- a/drivers/net/vxge/vxge-main.c 2010-10-15 09:10:06.734401351 -0700
> +++ b/drivers/net/vxge/vxge-main.c 2010-10-15 10:13:44.000142249 -0700
> @@ -82,6 +82,16 @@ module_param_array(bw_percentage, uint,
>
> static struct vxge_drv_config *driver_config;
>
> +static enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev,
> + struct macInfo *mac);
> +static enum vxge_hw_status vxge_del_mac_addr(struct vxgedev *vdev,
> + struct macInfo *mac);
> +static int vxge_mac_list_add(struct vxge_vpath *vpath, struct macInfo *mac);
> +static int vxge_mac_list_del(struct vxge_vpath *vpath, struct macInfo *mac);
> +static enum vxge_hw_status vxge_restore_vpath_vid_table(struct vxge_vpath *vpath);
> +static enum vxge_hw_status vxge_restore_vpath_mac_addr(struct vxge_vpath *vpath);
> +static enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev);
> +
> static inline int is_vxge_card_up(struct vxgedev *vdev)
> {
> return test_bit(__VXGE_STATE_CARD_UP, &vdev->state);
> @@ -138,7 +148,7 @@ static inline void VXGE_COMPLETE_ALL_RX(
> * This function is called during interrupt context to notify link up state
> * change.
> */
> -void
> +static void
> vxge_callback_link_up(struct __vxge_hw_device *hldev)
> {
> struct net_device *dev = hldev->ndev;
> @@ -162,7 +172,7 @@ vxge_callback_link_up(struct __vxge_hw_d
> * This function is called during interrupt context to notify link down state
> * change.
> */
> -void
> +static void
> vxge_callback_link_down(struct __vxge_hw_device *hldev)
> {
> struct net_device *dev = hldev->ndev;
> @@ -354,7 +364,7 @@ static inline void vxge_post(int *dtr_cn
> * If the interrupt is because of a received frame or if the receive ring
> * contains fresh as yet un-processed frames, this function is called.
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> vxge_rx_1b_compl(struct __vxge_hw_ring *ringh, void *dtr,
> u8 t_code, void *userdata)
> {
> @@ -531,7 +541,7 @@ vxge_rx_1b_compl(struct __vxge_hw_ring *
> * freed and frees all skbs whose data have already DMA'ed into the NICs
> * internal memory.
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr,
> enum vxge_hw_fifo_tcode t_code, void *userdata,
> struct sk_buff ***skb_ptr, int nr_skb, int *more)
> @@ -1246,7 +1256,7 @@ static int vxge_set_mac_addr(struct net_
> *
> * Enables the interrupts for the vpath
> */
> -void vxge_vpath_intr_enable(struct vxgedev *vdev, int vp_id)
> +static void vxge_vpath_intr_enable(struct vxgedev *vdev, int vp_id)
> {
> struct vxge_vpath *vpath = &vdev->vpaths[vp_id];
> int msix_id = 0;
> @@ -1279,7 +1289,7 @@ void vxge_vpath_intr_enable(struct vxged
> *
> * Disables the interrupts for the vpath
> */
> -void vxge_vpath_intr_disable(struct vxgedev *vdev, int vp_id)
> +static void vxge_vpath_intr_disable(struct vxgedev *vdev, int vp_id)
> {
> struct vxge_vpath *vpath = &vdev->vpaths[vp_id];
> int msix_id;
> @@ -1553,7 +1563,7 @@ out:
> *
> * driver may reset the chip on events of serr, eccerr, etc
> */
> -int vxge_reset(struct vxgedev *vdev)
> +static int vxge_reset(struct vxgedev *vdev)
> {
> return do_vxge_reset(vdev, VXGE_LL_FULL_RESET);
> }
> @@ -1724,7 +1734,7 @@ static enum vxge_hw_status vxge_rth_conf
> return status;
> }
>
> -int vxge_mac_list_add(struct vxge_vpath *vpath, struct macInfo *mac)
> +static int vxge_mac_list_add(struct vxge_vpath *vpath, struct macInfo *mac)
> {
> struct vxge_mac_addrs *new_mac_entry;
> u8 *mac_address = NULL;
> @@ -1757,7 +1767,8 @@ int vxge_mac_list_add(struct vxge_vpath
> }
>
> /* Add a mac address to DA table */
> -enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev, struct macInfo *mac)
> +static enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev,
> + struct macInfo *mac)
> {
> enum vxge_hw_status status = VXGE_HW_OK;
> struct vxge_vpath *vpath;
> @@ -1782,7 +1793,7 @@ enum vxge_hw_status vxge_add_mac_addr(st
> return status;
> }
>
> -int vxge_mac_list_del(struct vxge_vpath *vpath, struct macInfo *mac)
> +static int vxge_mac_list_del(struct vxge_vpath *vpath, struct macInfo *mac)
> {
> struct list_head *entry, *next;
> u64 del_mac = 0;
> @@ -1807,7 +1818,8 @@ int vxge_mac_list_del(struct vxge_vpath
> return FALSE;
> }
> /* delete a mac address from DA table */
> -enum vxge_hw_status vxge_del_mac_addr(struct vxgedev *vdev, struct macInfo *mac)
> +static enum vxge_hw_status vxge_del_mac_addr(struct vxgedev *vdev,
> + struct macInfo *mac)
> {
> enum vxge_hw_status status = VXGE_HW_OK;
> struct vxge_vpath *vpath;
> @@ -1854,7 +1866,7 @@ static vxge_search_mac_addr_in_da_table(
> }
>
> /* Store all vlan ids from the list to the vid table */
> -enum vxge_hw_status vxge_restore_vpath_vid_table(struct vxge_vpath *vpath)
> +static enum vxge_hw_status vxge_restore_vpath_vid_table(struct vxge_vpath *vpath)
> {
> enum vxge_hw_status status = VXGE_HW_OK;
> struct vxgedev *vdev = vpath->vdev;
> @@ -1874,7 +1886,7 @@ enum vxge_hw_status vxge_restore_vpath_v
> }
>
> /* Store all mac addresses from the list to the DA table */
> -enum vxge_hw_status vxge_restore_vpath_mac_addr(struct vxge_vpath *vpath)
> +static enum vxge_hw_status vxge_restore_vpath_mac_addr(struct vxge_vpath *vpath)
> {
> enum vxge_hw_status status = VXGE_HW_OK;
> struct macInfo mac_info;
> @@ -1916,7 +1928,7 @@ enum vxge_hw_status vxge_restore_vpath_m
> }
>
> /* reset vpaths */
> -enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev)
> +static enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev)
> {
> enum vxge_hw_status status = VXGE_HW_OK;
> struct vxge_vpath *vpath;
> @@ -1948,7 +1960,7 @@ enum vxge_hw_status vxge_reset_all_vpath
> }
>
> /* close vpaths */
> -void vxge_close_vpaths(struct vxgedev *vdev, int index)
> +static void vxge_close_vpaths(struct vxgedev *vdev, int index)
> {
> struct vxge_vpath *vpath;
> int i;
> @@ -1966,7 +1978,7 @@ void vxge_close_vpaths(struct vxgedev *v
> }
>
> /* open vpaths */
> -int vxge_open_vpaths(struct vxgedev *vdev)
> +static int vxge_open_vpaths(struct vxgedev *vdev)
> {
> struct vxge_hw_vpath_attr attr;
> enum vxge_hw_status status;
> @@ -2517,7 +2529,7 @@ static void vxge_poll_vp_lockup(unsigned
> * Return value: '0' on success and an appropriate (-)ve integer as
> * defined in errno.h file on failure.
> */
> -int
> +static int
> vxge_open(struct net_device *dev)
> {
> enum vxge_hw_status status;
> @@ -2721,7 +2733,7 @@ out0:
> }
>
> /* Loop throught the mac address list and delete all the entries */
> -void vxge_free_mac_add_list(struct vxge_vpath *vpath)
> +static void vxge_free_mac_add_list(struct vxge_vpath *vpath)
> {
>
> struct list_head *entry, *next;
> @@ -2745,7 +2757,7 @@ static void vxge_napi_del_all(struct vxg
> }
> }
>
> -int do_vxge_close(struct net_device *dev, int do_io)
> +static int do_vxge_close(struct net_device *dev, int do_io)
> {
> enum vxge_hw_status status;
> struct vxgedev *vdev;
> @@ -2856,7 +2868,7 @@ int do_vxge_close(struct net_device *dev
> * Return value: '0' on success and an appropriate (-)ve integer as
> * defined in errno.h file on failure.
> */
> -int
> +static int
> vxge_close(struct net_device *dev)
> {
> do_vxge_close(dev, 1);
> @@ -3113,10 +3125,10 @@ static const struct net_device_ops vxge_
> #endif
> };
>
> -int __devinit vxge_device_register(struct __vxge_hw_device *hldev,
> - struct vxge_config *config,
> - int high_dma, int no_of_vpath,
> - struct vxgedev **vdev_out)
> +static int __devinit vxge_device_register(struct __vxge_hw_device *hldev,
> + struct vxge_config *config,
> + int high_dma, int no_of_vpath,
> + struct vxgedev **vdev_out)
> {
> struct net_device *ndev;
> enum vxge_hw_status status = VXGE_HW_OK;
> @@ -3164,7 +3176,7 @@ int __devinit vxge_device_register(struc
>
> ndev->watchdog_timeo = VXGE_LL_WATCH_DOG_TIMEOUT;
>
> - initialize_ethtool_ops(ndev);
> + vxge_initialize_ethtool_ops(ndev);
>
> /* Allocate memory for vpath */
> vdev->vpaths = kzalloc((sizeof(struct vxge_vpath)) *
> @@ -3249,7 +3261,7 @@ _out0:
> *
> * This function will unregister and free network device
> */
> -void
> +static void
> vxge_device_unregister(struct __vxge_hw_device *hldev)
> {
> struct vxgedev *vdev;
> --- a/drivers/net/vxge/vxge-main.h 2010-10-15 09:10:06.802404471 -0700
> +++ b/drivers/net/vxge/vxge-main.h 2010-10-15 10:13:51.232396166 -0700
> @@ -396,64 +396,7 @@ struct vxge_tx_priv {
> mod_timer(&timer, (jiffies + exp)); \
> } while (0);
>
> -int __devinit vxge_device_register(struct __vxge_hw_device *devh,
> - struct vxge_config *config,
> - int high_dma, int no_of_vpath,
> - struct vxgedev **vdev);
> -
> -void vxge_device_unregister(struct __vxge_hw_device *devh);
> -
> -void vxge_vpath_intr_enable(struct vxgedev *vdev, int vp_id);
> -
> -void vxge_vpath_intr_disable(struct vxgedev *vdev, int vp_id);
> -
> -void vxge_callback_link_up(struct __vxge_hw_device *devh);
> -
> -void vxge_callback_link_down(struct __vxge_hw_device *devh);
> -
> -enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev,
> - struct macInfo *mac);
> -
> -int vxge_mac_list_del(struct vxge_vpath *vpath, struct macInfo *mac);
> -
> -int vxge_reset(struct vxgedev *vdev);
> -
> -enum vxge_hw_status
> -vxge_rx_1b_compl(struct __vxge_hw_ring *ringh, void *dtr,
> - u8 t_code, void *userdata);
> -
> -enum vxge_hw_status
> -vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr,
> - enum vxge_hw_fifo_tcode t_code, void *userdata,
> - struct sk_buff ***skb_ptr, int nr_skbs, int *more);
> -
> -int vxge_close(struct net_device *dev);
> -
> -int vxge_open(struct net_device *dev);
> -
> -void vxge_close_vpaths(struct vxgedev *vdev, int index);
> -
> -int vxge_open_vpaths(struct vxgedev *vdev);
> -
> -enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev);
> -
> -enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev,
> - struct macInfo *mac);
> -
> -enum vxge_hw_status vxge_del_mac_addr(struct vxgedev *vdev,
> - struct macInfo *mac);
> -
> -int vxge_mac_list_add(struct vxge_vpath *vpath,
> - struct macInfo *mac);
> -
> -void vxge_free_mac_add_list(struct vxge_vpath *vpath);
> -
> -enum vxge_hw_status vxge_restore_vpath_mac_addr(struct vxge_vpath *vpath);
> -
> -enum vxge_hw_status vxge_restore_vpath_vid_table(struct vxge_vpath *vpath);
> -
> -int do_vxge_close(struct net_device *dev, int do_io);
> -extern void initialize_ethtool_ops(struct net_device *ndev);
> +extern void vxge_initialize_ethtool_ops(struct net_device *ndev);
> /**
> * #define VXGE_DEBUG_INIT: debug for initialization functions
> * #define VXGE_DEBUG_TX : debug transmit related functions
> --- a/drivers/net/vxge/vxge-traffic.c 2010-10-15 09:10:06.750402084 -0700
> +++ b/drivers/net/vxge/vxge-traffic.c 2010-10-15 09:36:10.750557049 -0700
> @@ -17,6 +17,13 @@
> #include "vxge-config.h"
> #include "vxge-main.h"
>
> +static enum vxge_hw_status
> +__vxge_hw_device_handle_error(struct __vxge_hw_device *hldev,
> + u32 vp_id, enum vxge_hw_event type);
> +static enum vxge_hw_status
> +__vxge_hw_vpath_alarm_process(struct __vxge_hw_virtualpath *vpath,
> + u32 skip_alarms);
> +
> /*
> * vxge_hw_vpath_intr_enable - Enable vpath interrupts.
> * @vp: Virtual Path handle.
> @@ -513,7 +520,7 @@ exit:
> * Link up indication handler. The function is invoked by HW when
> * Titan indicates that the link is up for programmable amount of time.
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_device_handle_link_up_ind(struct __vxge_hw_device *hldev)
> {
> /*
> @@ -538,7 +545,7 @@ exit:
> * Link down indication handler. The function is invoked by HW when
> * Titan indicates that the link is down.
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_device_handle_link_down_ind(struct __vxge_hw_device *hldev)
> {
> /*
> @@ -564,7 +571,7 @@ exit:
> *
> * Handle error.
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> __vxge_hw_device_handle_error(
> struct __vxge_hw_device *hldev,
> u32 vp_id,
> @@ -646,7 +653,7 @@ void vxge_hw_device_clear_tx_rx(struct _
> * it swaps the reserve and free arrays.
> *
> */
> -enum vxge_hw_status
> +static enum vxge_hw_status
> vxge_hw_channel_dtr_alloc(struct __vxge_hw_channel *channel, void **dtrh)
> {
> void **tmp_arr;
> @@ -692,7 +699,8 @@ _alloc_after_swap:
> * Posts a dtr to work array.
> *
> */
> -void vxge_hw_channel_dtr_post(struct __vxge_hw_channel *channel, void *dtrh)
> +static void vxge_hw_channel_dtr_post(struct __vxge_hw_channel *channel,
> + void *dtrh)
> {
> vxge_assert(channel->work_arr[channel->post_index] == NULL);
>
> @@ -1658,37 +1666,6 @@ exit:
> }
>
> /**
> - * vxge_hw_vpath_vid_get_next - Get the next vid entry for this vpath
> - * from vlan id table.
> - * @vp: Vpath handle.
> - * @vid: Buffer to return vlan id
> - *
> - * Returns the next vlan id in the list for this vpath.
> - * see also: vxge_hw_vpath_vid_get
> - *
> - */
> -enum vxge_hw_status
> -vxge_hw_vpath_vid_get_next(struct __vxge_hw_vpath_handle *vp, u64 *vid)
> -{
> - u64 data;
> - enum vxge_hw_status status = VXGE_HW_OK;
> -
> - if (vp == NULL) {
> - status = VXGE_HW_ERR_INVALID_HANDLE;
> - goto exit;
> - }
> -
> - status = __vxge_hw_vpath_rts_table_get(vp,
> - VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION_LIST_NEXT_ENTRY,
> - VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL_VID,
> - 0, vid, &data);
> -
> - *vid = VXGE_HW_RTS_ACCESS_STEER_DATA0_GET_VLAN_ID(*vid);
> -exit:
> - return status;
> -}
> -
> -/**
> * vxge_hw_vpath_vid_delete - Delete the vlan id entry for this vpath
> * to vlan id table.
> * @vp: Vpath handle.
> @@ -1898,9 +1875,9 @@ exit:
> * Process vpath alarms.
> *
> */
> -enum vxge_hw_status __vxge_hw_vpath_alarm_process(
> - struct __vxge_hw_virtualpath *vpath,
> - u32 skip_alarms)
> +static enum vxge_hw_status
> +__vxge_hw_vpath_alarm_process(struct __vxge_hw_virtualpath *vpath,
> + u32 skip_alarms)
> {
> u64 val64;
> u64 alarm_status;
> @@ -2265,36 +2242,6 @@ vxge_hw_vpath_msix_mask(struct __vxge_hw
> }
>
> /**
> - * vxge_hw_vpath_msix_clear - Clear MSIX Vector.
> - * @vp: Virtual Path handle.
> - * @msix_id: MSI ID
> - *
> - * The function clears the msix interrupt for the given msix_id
> - *
> - * Returns: 0,
> - * Otherwise, VXGE_HW_ERR_WRONG_IRQ if the msix index is out of range
> - * status.
> - * See also:
> - */
> -void
> -vxge_hw_vpath_msix_clear(struct __vxge_hw_vpath_handle *vp, int msix_id)
> -{
> - struct __vxge_hw_device *hldev = vp->vpath->hldev;
> - if (hldev->config.intr_mode ==
> - VXGE_HW_INTR_MODE_MSIX_ONE_SHOT) {
> - __vxge_hw_pio_mem_write32_upper(
> - (u32)vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32),
> - &hldev->common_reg->
> - clr_msix_one_shot_vec[msix_id%4]);
> - } else {
> - __vxge_hw_pio_mem_write32_upper(
> - (u32)vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32),
> - &hldev->common_reg->
> - clear_msix_mask_vect[msix_id%4]);
> - }
> -}
> -
> -/**
> * vxge_hw_vpath_msix_unmask - Unmask the MSIX Vector.
> * @vp: Virtual Path handle.
> * @msix_id: MSI ID
> @@ -2316,22 +2263,6 @@ vxge_hw_vpath_msix_unmask(struct __vxge_
> }
>
> /**
> - * vxge_hw_vpath_msix_mask_all - Mask all MSIX vectors for the vpath.
> - * @vp: Virtual Path handle.
> - *
> - * The function masks all msix interrupt for the given vpath
> - *
> - */
> -void
> -vxge_hw_vpath_msix_mask_all(struct __vxge_hw_vpath_handle *vp)
> -{
> -
> - __vxge_hw_pio_mem_write32_upper(
> - (u32)vxge_bVALn(vxge_mBIT(vp->vpath->vp_id), 0, 32),
> - &vp->vpath->hldev->common_reg->set_msix_mask_all_vect);
> -}
> -
> -/**
> * vxge_hw_vpath_inta_mask_tx_rx - Mask Tx and Rx interrupts.
> * @vp: Virtual Path handle.
> *
> --- a/drivers/net/vxge/vxge-traffic.h 2010-10-15 09:10:06.834405939 -0700
> +++ b/drivers/net/vxge/vxge-traffic.h 2010-10-15 10:14:43.870258247 -0700
> @@ -1749,14 +1749,6 @@ vxge_hw_mrpcim_stats_access(
> u64 *stat);
>
> enum vxge_hw_status
> -vxge_hw_device_xmac_aggr_stats_get(struct __vxge_hw_device *devh, u32 port,
> - struct vxge_hw_xmac_aggr_stats *aggr_stats);
> -
> -enum vxge_hw_status
> -vxge_hw_device_xmac_port_stats_get(struct __vxge_hw_device *devh, u32 port,
> - struct vxge_hw_xmac_port_stats *port_stats);
> -
> -enum vxge_hw_status
> vxge_hw_device_xmac_stats_get(struct __vxge_hw_device *devh,
> struct vxge_hw_xmac_stats *xmac_stats);
>
> @@ -2117,49 +2109,10 @@ struct __vxge_hw_ring_rxd_priv {
> #endif
> };
>
> -/* ========================= RING PRIVATE API ============================= */
> -u64
> -__vxge_hw_ring_first_block_address_get(
> - struct __vxge_hw_ring *ringh);
> -
> -enum vxge_hw_status
> -__vxge_hw_ring_create(
> - struct __vxge_hw_vpath_handle *vpath_handle,
> - struct vxge_hw_ring_attr *attr);
> -
> -enum vxge_hw_status
> -__vxge_hw_ring_abort(
> - struct __vxge_hw_ring *ringh);
> -
> -enum vxge_hw_status
> -__vxge_hw_ring_reset(
> - struct __vxge_hw_ring *ringh);
> -
> -enum vxge_hw_status
> -__vxge_hw_ring_delete(
> - struct __vxge_hw_vpath_handle *vpath_handle);
> -
> /* ========================= FIFO PRIVATE API ============================= */
>
> struct vxge_hw_fifo_attr;
>
> -enum vxge_hw_status
> -__vxge_hw_fifo_create(
> - struct __vxge_hw_vpath_handle *vpath_handle,
> - struct vxge_hw_fifo_attr *attr);
> -
> -enum vxge_hw_status
> -__vxge_hw_fifo_abort(
> - struct __vxge_hw_fifo *fifoh);
> -
> -enum vxge_hw_status
> -__vxge_hw_fifo_reset(
> - struct __vxge_hw_fifo *ringh);
> -
> -enum vxge_hw_status
> -__vxge_hw_fifo_delete(
> - struct __vxge_hw_vpath_handle *vpath_handle);
> -
> struct vxge_hw_mempool_cbs {
> void (*item_func_alloc)(
> struct vxge_hw_mempool *mempoolh,
> @@ -2169,10 +2122,6 @@ struct vxge_hw_mempool_cbs {
> u32 is_last);
> };
>
> -void
> -__vxge_hw_mempool_destroy(
> - struct vxge_hw_mempool *mempool);
> -
> #define VXGE_HW_VIRTUAL_PATH_HANDLE(vpath) \
> ((struct __vxge_hw_vpath_handle *)(vpath)->vpath_handles.next)
>
> @@ -2195,61 +2144,10 @@ __vxge_hw_vpath_rts_table_set(
> u64 data2);
>
> enum vxge_hw_status
> -__vxge_hw_vpath_reset(
> - struct __vxge_hw_device *devh,
> - u32 vp_id);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_sw_reset(
> - struct __vxge_hw_device *devh,
> - u32 vp_id);
> -
> -enum vxge_hw_status
> __vxge_hw_vpath_enable(
> struct __vxge_hw_device *devh,
> u32 vp_id);
>
> -void
> -__vxge_hw_vpath_prc_configure(
> - struct __vxge_hw_device *devh,
> - u32 vp_id);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_kdfc_configure(
> - struct __vxge_hw_device *devh,
> - u32 vp_id);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_mac_configure(
> - struct __vxge_hw_device *devh,
> - u32 vp_id);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_tim_configure(
> - struct __vxge_hw_device *devh,
> - u32 vp_id);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_initialize(
> - struct __vxge_hw_device *devh,
> - u32 vp_id);
> -
> -enum vxge_hw_status
> -__vxge_hw_vp_initialize(
> - struct __vxge_hw_device *devh,
> - u32 vp_id,
> - struct vxge_hw_vp_config *config);
> -
> -void
> -__vxge_hw_vp_terminate(
> - struct __vxge_hw_device *devh,
> - u32 vp_id);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_alarm_process(
> - struct __vxge_hw_virtualpath *vpath,
> - u32 skip_alarms);
> -
> void vxge_hw_device_intr_enable(
> struct __vxge_hw_device *devh);
>
> @@ -2321,11 +2219,6 @@ vxge_hw_vpath_vid_get(
> u64 *vid);
>
> enum vxge_hw_status
> -vxge_hw_vpath_vid_get_next(
> - struct __vxge_hw_vpath_handle *vpath_handle,
> - u64 *vid);
> -
> -enum vxge_hw_status
> vxge_hw_vpath_vid_delete(
> struct __vxge_hw_vpath_handle *vpath_handle,
> u64 vid);
> @@ -2387,16 +2280,9 @@ vxge_hw_vpath_msix_mask(struct __vxge_hw
> void vxge_hw_device_flush_io(struct __vxge_hw_device *devh);
>
> void
> -vxge_hw_vpath_msix_clear(struct __vxge_hw_vpath_handle *vpath_handle,
> - int msix_id);
> -
> -void
> vxge_hw_vpath_msix_unmask(struct __vxge_hw_vpath_handle *vpath_handle,
> int msix_id);
>
> -void
> -vxge_hw_vpath_msix_mask_all(struct __vxge_hw_vpath_handle *vpath_handle);
> -
> enum vxge_hw_status vxge_hw_vpath_intr_enable(
> struct __vxge_hw_vpath_handle *vpath_handle);
>
> @@ -2415,12 +2301,6 @@ vxge_hw_channel_msix_mask(struct __vxge_
> void
> vxge_hw_channel_msix_unmask(struct __vxge_hw_channel *channelh, int msix_id);
>
> -enum vxge_hw_status
> -vxge_hw_channel_dtr_alloc(struct __vxge_hw_channel *channel, void **dtrh);
> -
> -void
> -vxge_hw_channel_dtr_post(struct __vxge_hw_channel *channel, void *dtrh);
> -
> void
> vxge_hw_channel_dtr_try_complete(struct __vxge_hw_channel *channel,
> void **dtrh);
> @@ -2436,18 +2316,4 @@ vxge_hw_channel_dtr_count(struct __vxge_
> void
> vxge_hw_vpath_tti_ci_set(struct __vxge_hw_device *hldev, u32 vp_id);
>
> -/* ========================== PRIVATE API ================================= */
> -
> -enum vxge_hw_status
> -__vxge_hw_device_handle_link_up_ind(struct __vxge_hw_device *hldev);
> -
> -enum vxge_hw_status
> -__vxge_hw_device_handle_link_down_ind(struct __vxge_hw_device *hldev);
> -
> -enum vxge_hw_status
> -__vxge_hw_device_handle_error(
> - struct __vxge_hw_device *hldev,
> - u32 vp_id,
> - enum vxge_hw_event type);
> -
> #endif
> --- a/drivers/net/vxge/vxge-ethtool.c 2010-10-15 09:10:06.718400615 -0700
> +++ b/drivers/net/vxge/vxge-ethtool.c 2010-10-15 10:13:39.927999492 -0700
> @@ -1142,7 +1142,7 @@ static const struct ethtool_ops vxge_eth
> .get_ethtool_stats = vxge_get_ethtool_stats,
> };
>
> -void initialize_ethtool_ops(struct net_device *ndev)
> +void vxge_initialize_ethtool_ops(struct net_device *ndev)
> {
> SET_ETHTOOL_OPS(ndev, &vxge_ethtool_ops);
> }
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: 2.6.36-rc7: net/bridge causes temporary network I/O lockups [2]
From: Patrick Ringl @ 2010-10-18 20:37 UTC (permalink / raw)
To: Herbert Xu; +Cc: Patrick Ringl, netdev, linux-kernel, bridge
In-Reply-To: <20101018161656.GA2403@gondor.apana.org.au>
[-- Attachment #1: Type: text/plain, Size: 1352 bytes --]
On 10/18/2010 06:16 PM, Herbert Xu wrote:
> On Sat, Oct 16, 2010 at 08:15:31PM +0200, Patrick Ringl wrote:
>
>> Hi,
>>
>> okay I narrowed down the issue. I watched all function calls of the
>> 'bridge' module with the help of a small systemtap probe of mine. I
>> first traced a timespan where the issue did not occur, then one where it
>> did and composed an intersection of these two:
>>
> I can't reproduce this problem here so I'll need your help to
> track it down.
>
> Can you see if you can relate the lock-ups to specific events
> such as a particular packet being sent through the bridge?
>
The problem is definitely somewhere in the 2.6.34 commit regarding IGMP
snooping (when disabling it, everything works). I have attached a
tcpdump log of data coming through the bridge and data coming through an
attached port (eth1). The lockups are easily spotted, since I use mtr to
constantly ping the problematic machine, and there aren't any
incoming/outgoing packets during the lockup.
> If we can recreate the problem on demand that that helps us to
> find the root cause.
>
> You mentioned that you took packet dumps on the system. If you
> can show us the packets through the bridge and its ports when
> the problem occurs that would be great.
>
> Thanks,
>
Anything else I could possibly provide? :-)
regards,
Patrick
[-- Attachment #2: dump_br0 --]
[-- Type: application/octet-stream, Size: 2764 bytes --]
[-- Attachment #3: dump_eth1 --]
[-- Type: application/octet-stream, Size: 2806 bytes --]
^ permalink raw reply
* GET BACK FRIEND
From: info lawfirm @ 2010-10-18 10:11 UTC (permalink / raw)
To: info
Friend i need you
for a claim of inheritace
get back for more information
^ permalink raw reply
* Re: Linux 2.6.35/TIPC 2.0 ABI breaking changes [was: TIPC 2.0 and TIPC_SUB_SERVICE]
From: Paul Gortmaker @ 2010-10-18 20:42 UTC (permalink / raw)
To: Leandro Lucarella
Cc: Jon Maloy, davem, tipc-discussion@lists.sourceforge.net,
linux-kernel, netdev
In-Reply-To: <20101018184628.GX8781@llucax.com.ar>
On Mon, Oct 18, 2010 at 2:46 PM, Leandro Lucarella <luca@llucax.com.ar> wrote:
> Leandro Lucarella, el 18 de octubre a las 12:04 me escribiste:
>> This means D can't be used to write code that uses TIPC if you target
>> kernels >= 2.6.35 (unless they write their own bindings, or at least use
>> a custom TIPC_SUB_SERVICE constant). I could change the TIPC_SUB_SERVICE
>> value, but then people using older kernels will be screwed. Another
>> option is to use the version statement (kind of like C's #ifdef):
>>
>> version (TIPC_2_0)
>> const TIPC_SUB_SERVICE = 0x00;
>> else
>> const TIPC_SUB_SERVICE = 0x02;
>
> I keep finding problems with this change. Another, no D-related, problem
> with this change is old code could be silently (and very subtly) broken
> if they check for TIPC_SUB_SERVICE as a flag with something like:
>
> if (s.filter & TIPC_SUB_SERVICE)
> /* do something */
>
> Because TIPC_SUB_SERVICE has changed its semantics, not just its value,
> and the new value (0x00) will give you always 0 in that test. This one
> is really tricky, because the application code will fail silently, there
> will be no dmesg indication of a failure, nor the connection to the
> topology service be closed. You might get a compiler warning if you're
> lucky.
If you have access to the user space code in question, you can just
switch behaviour semantics based on the results of a uname call, knowing
that this change was included in versions since approx last Feb. There
is also /proc/version which can be parsed manually if you prefer.
If you have kernel code/modules, you can do the same/similar things with
the KERNEL_VERSION and its support macros.
In either case, you don't have to restrict yourself to information that is
specific to and/or exported just from TIPC itself.
Hope that helps,
Paul.
>
> --
> Leandro Lucarella (AKA luca) http://llucax.com.ar/
> ----------------------------------------------------------------------
> GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05)
> ----------------------------------------------------------------------
> Novocaine for the soul
> you better give me something
> to fill the hole
> before I sputter out
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [PATCH 1/3] net: fail alloc_netdev_mq if queue count < 1
From: Ben Hutchings @ 2010-10-18 21:33 UTC (permalink / raw)
To: Tom Herbert; +Cc: davem, netdev, eric.dumazet
In-Reply-To: <alpine.DEB.1.00.1010181055300.16090@pokey.mtv.corp.google.com>
On Mon, 2010-10-18 at 11:02 -0700, Tom Herbert wrote:
> In alloc_netdev_mq fail if requested queue_count < 1.
>
> Signed-off-by: Tom Herbert <therbert@google.com>
> ---
> net/core/dev.c | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 04972a4..76db105 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -5511,6 +5511,12 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
>
> BUG_ON(strlen(name) >= sizeof(dev->name));
>
> + if (queue_count < 0) {
> + printk(KERN_ERR "alloc_netdev: Unable to allocate device "
> + "with zero queues.\n");
Off by one?
Ben.
> + return NULL;
> + }
> +
> alloc_size = sizeof(struct net_device);
> if (sizeof_priv) {
> /* ensure 32-byte alignment of private area */
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox