* [PATCH 2/2] drivers/net/ax88796.c: Return error code in failure
From: Julia Lawall @ 2010-10-18 14:11 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: kernel-janitors, netdev, linux-kernel
In this code, 0 is returned on failure, even though other
failures return -ENOMEM or other similar values.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@a@
identifier alloc;
identifier ret;
constant C;
expression x;
@@
x = alloc(...);
if (x == NULL) { <+... \(ret = -C; \| return -C; \) ...+> }
@@
identifier f, a.alloc;
expression ret;
expression x,e1,e2,e3;
@@
ret = 0
... when != ret = e1
*x = alloc(...)
... when != ret = e2
if (x == NULL) { ... when != ret = e3
return ret;
}
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
Another call to platform_get_resource in the same function uses -ENXIO, so
I have used the same value here.
drivers/net/ax88796.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ax88796.c b/drivers/net/ax88796.c
index 20e946b..b6da4cf 100644
--- a/drivers/net/ax88796.c
+++ b/drivers/net/ax88796.c
@@ -864,6 +864,7 @@ static int ax_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (res == NULL) {
dev_err(&pdev->dev, "no IRQ specified\n");
+ ret = -ENXIO;
goto exit_mem;
}
^ permalink raw reply related
* Re: [PATCH 6/8] can: mcp251x: Don't use pdata->model for chip selection anymore
From: Marc Zyngier @ 2010-10-18 13:49 UTC (permalink / raw)
To: Marc Kleine-Budde; +Cc: socketcan-core, netdev, Christian Pellegrin
In-Reply-To: <1287408674-15412-7-git-send-email-mkl@pengutronix.de>
On Mon, 18 Oct 2010 15:31:12 +0200, Marc Kleine-Budde <mkl@pengutronix.de>
wrote:
> Since commit e446630c960946b5c1762e4eadb618becef599e7, i.e. v2.6.35-rc1,
> the mcp251x chip model can be selected via the modalias member in the
> struct spi_board_info. The driver stores the actual model in the
> struct mcp251x_platform_data.
>
> From the driver point of view the platform_data should be read only.
> Since all in-tree users of the mcp251x have already been converted to
> the modalias method, this patch moves the "model" member from the
> struct mcp251x_platform_data to the driver's private data structure.
>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> Cc: Christian Pellegrin <chripell@fsfe.org>
> Cc: Marc Zyngier <maz@misterjones.org>
Acked-by: Marc Zyngier <maz@misterjones.org>
--
Who you jivin' with that Cosmik Debris?
^ permalink raw reply
* Re: [PATCH V3 0/8] can: mcp251x: fix and optimize driver
From: David Miller @ 2010-10-18 14:12 UTC (permalink / raw)
To: mkl-bIcnvbaLZ9MEGnE8C9+IrQ
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1287408674-15412-1-git-send-email-mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
From: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Date: Mon, 18 Oct 2010 15:31:06 +0200
> Moin,
>
> this series of patches improves the mcp251x driver. It first fixes the
> local_softirq_pending problem. Then the amount of SPI transfers is reduced
> in order to optimise the driver. A further patch cleans up the chip model
> selection.
>
> This series has been tested with a mcp2515 on i.MX35.
>
> Please review, test and consider to apply.
...
> git://git.pengutronix.de/git/mkl/linux-2.6.git can/mcp251x-for-net-next
Pulled, thanks.
^ permalink raw reply
* Re: [PATCH 6/8] can: mcp251x: Don't use pdata->model for chip selection anymore
From: Marc Kleine-Budde @ 2010-10-18 14:14 UTC (permalink / raw)
To: Marc Zyngier
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <d4c9d3f3d2843bd9cdb4cbb6a75236ce@localhost>
[-- Attachment #1.1: Type: text/plain, Size: 1349 bytes --]
On 10/18/2010 03:49 PM, Marc Zyngier wrote:
>
> On Mon, 18 Oct 2010 15:31:12 +0200, Marc Kleine-Budde <mkl@pengutronix.de>
> wrote:
>> Since commit e446630c960946b5c1762e4eadb618becef599e7, i.e. v2.6.35-rc1,
>> the mcp251x chip model can be selected via the modalias member in the
>> struct spi_board_info. The driver stores the actual model in the
>> struct mcp251x_platform_data.
>>
>> From the driver point of view the platform_data should be read only.
>> Since all in-tree users of the mcp251x have already been converted to
>> the modalias method, this patch moves the "model" member from the
>> struct mcp251x_platform_data to the driver's private data structure.
>>
>> Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
>> Cc: Christian Pellegrin <chripell-VaTbYqLCNhc@public.gmane.org>
>> Cc: Marc Zyngier <maz-20xNzvSXLT6hUMvJH42dtQ@public.gmane.org>
>
> Acked-by: Marc Zyngier <maz-20xNzvSXLT6hUMvJH42dtQ@public.gmane.org>
Thanks, but I was to slow to push your Ack, David has pulled already.
cheers, Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
[-- Attachment #2: Type: text/plain, Size: 188 bytes --]
_______________________________________________
Socketcan-core mailing list
Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
https://lists.berlios.de/mailman/listinfo/socketcan-core
^ permalink raw reply
* Re: [PATCH] qlcnic: update ethtool stats
From: David Miller @ 2010-10-18 14:23 UTC (permalink / raw)
To: amit.salecha; +Cc: netdev, ameen.rahman, anirban.chakraborty
In-Reply-To: <1287402468-10249-1-git-send-email-amit.salecha@qlogic.com>
From: Amit Kumar Salecha <amit.salecha@qlogic.com>
Date: Mon, 18 Oct 2010 04:47:48 -0700
> Added statistics for Nic Partition supported adapter.
> These statistics are maintined in device.
>
> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Applied.
^ permalink raw reply
* Re: [PATCH NEXT 1/2] netxen: fix race in tx stop queue
From: David Miller @ 2010-10-18 14:23 UTC (permalink / raw)
To: amit.salecha; +Cc: netdev, ameen.rahman, anirban.chakraborty, rajesh.borundia
In-Reply-To: <1287403422-10431-1-git-send-email-amit.salecha@qlogic.com>
From: Amit Kumar Salecha <amit.salecha@qlogic.com>
Date: Mon, 18 Oct 2010 05:03:41 -0700
> From: Rajesh Borundia <rajesh.borundia@qlogic.com>
>
> There is race between netif_stop_queue and netif_stopped_queue
> check.So check once again if buffers are available to avoid race.
> With above logic we can also get rid of tx lock in process_cmd_ring.
>
> Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Applied.
^ permalink raw reply
* Re: [PATCH NEXT 2/2] netxen: mask correctable error
From: David Miller @ 2010-10-18 14:23 UTC (permalink / raw)
To: amit.salecha; +Cc: netdev, ameen.rahman, anirban.chakraborty
In-Reply-To: <1287403422-10431-2-git-send-email-amit.salecha@qlogic.com>
From: Amit Kumar Salecha <amit.salecha@qlogic.com>
Date: Mon, 18 Oct 2010 05:03:42 -0700
> HW workaround:
> Disable logging of correctable error for some NX3031 based adapter.
>
> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Applied.
^ permalink raw reply
* Re: [PATCH] IPv4: route.c: Change checks against 0xffffffff to ipv4_is_lbcast()
From: David Miller @ 2010-10-18 14:23 UTC (permalink / raw)
To: awalls; +Cc: netdev, linux-kernel, kuznet, jmorris, kaber
In-Reply-To: <1287364282.2320.20.camel@morgan.silverblock.net>
From: Andy Walls <awalls@md.metrocast.net>
Date: Sun, 17 Oct 2010 21:11:22 -0400
>
> Change a few checks against the hardcoded broadcast address,
> 0xffffffff, to ipv4_is_lbcast(). Remove some existing checks
> using ipv4_is_lbcast() that are now obviously superfluous.
>
> Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Applied.
^ permalink raw reply
* Re: [RFC PATCH 1/9] ipvs network name space aware
From: Daniel Lezcano @ 2010-10-18 14:26 UTC (permalink / raw)
To: Hans Schillstrom
Cc: lvs-devel@vger.kernel.org, netdev@vger.kernel.org,
netfilter-devel@vger.kernel.org, horms@verge.net.au, ja@ssi.bg,
wensong@linux-vs.org
In-Reply-To: <201010181523.49568.hans.schillstrom@ericsson.com>
On 10/18/2010 03:23 PM, Hans Schillstrom wrote:
> On Monday 18 October 2010 13:37:38 Daniel Lezcano wrote:
>
>> On 10/18/2010 11:54 AM, Hans Schillstrom wrote:
>>
>>> On Monday 18 October 2010 10:59:25 Daniel Lezcano wrote:
>>>
>>>
>>>> On 10/08/2010 01:16 PM, Hans Schillstrom wrote:
>>>>
>>>>
>>>>> This part contains the include files
>>>>> where include/net/netns/ip_vs.h is new and contains all moved vars.
>>>>>
>>>>> SUMMARY
>>>>>
>>>>> include/net/ip_vs.h | 136 ++++---
>>>>> include/net/net_namespace.h | 2 +
>>>>> include/net/netns/ip_vs.h | 112 +++++
>>>>>
>>>>> Signed-off-by:Hans Schillstrom<hans.schillstrom@ericsson.com>
>>>>> ---
>>>>>
>>>>>
>>>>>
>>>>>
>>>> [ ... ]
>>>>
>>>>
>>>>
>>>>> #ifdef CONFIG_IP_VS_IPV6
>>>>> diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
>>>>> index bd10a79..b59cdc5 100644
>>>>> --- a/include/net/net_namespace.h
>>>>> +++ b/include/net/net_namespace.h
>>>>> @@ -15,6 +15,7 @@
>>>>> #include<net/netns/ipv4.h>
>>>>> #include<net/netns/ipv6.h>
>>>>> #include<net/netns/dccp.h>
>>>>> +#include<net/netns/ip_vs.h>
>>>>> #include<net/netns/x_tables.h>
>>>>> #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
>>>>> #include<net/netns/conntrack.h>
>>>>> @@ -91,6 +92,7 @@ struct net {
>>>>> struct sk_buff_head wext_nlevents;
>>>>> #endif
>>>>> struct net_generic *gen;
>>>>> + struct netns_ipvs *ipvs;
>>>>> };
>>>>>
>>>>>
>>>>>
>>>> IMHO, it would be better to use the net_generic infra-structure instead
>>>> of adding a new field in the netns structure.
>>>>
>>>>
>>>>
>>>>
>>> I realized that to, but the performance penalty is quite high with net_generic :-(
>>> But on the other hand if you are going to backport it, (without recompiling the kernel)
>>> you gonna need it!
>>>
>>>
>> Hmm, yes. We don't want to have the init_net_ns performances to be impacted.
>>
>> You use here a pointer which will be dereferenced like the net_generic,
>> I don't think there will be
>> a big difference between using net_generic and using a pointer in the
>> net namespace structure.
>>
>> The difference is the id usage, but this one is based on the idr which
>> is quite fast.
>>
>>
> I'm not so sure about that, have a look at net_generic and rcu_read_lock
> and compare
> ipvs = net->ipvs;
> vs.
> ipvs = net_generic(net, id)
>
> static inline void *net_generic(struct net *net, int id)
> {
> struct net_generic *ng;
> void *ptr;
>
> rcu_read_lock();
> ng = rcu_dereference(net->gen);
> BUG_ON(id == 0 || id> ng->len);
> ptr = ng->ptr[id - 1];
> rcu_read_unlock();
>
> return ptr;
> }
> ...
> static inline void rcu_read_lock(void)
> {
> __rcu_read_lock();
> __acquire(RCU);
> rcu_read_acquire();
> }
>
Yep, right. In fact I don't really like the net_generic and an ipvs ptr.
I am not sure it is adequate for this component.
> Another way of doing it is to pass the ipvs ptr instead of the net ptr,
> and add *net to the ipvs struct.
>
>
>> We should experiment a bit here to compare both solutions.
>>
> Agre
>
>>
> I single stepped through the rcu_read_lock() on a x86_64
> and it's quite many "stepi" that you need to enter :-(
>
>
>> IMHO, we can (1) create a non-pointer netns_ipvs field in the net
>> namespace structure or (2) use a pointer [with net_generic].
>>
>> (1) is the faster but with the drawback of having a bigger memory
>> footprint even if the ipvs module is not loaded.
>> In this case we have to take care of what we store in the netns_ipvs
>> structure, that is reduce the per namespace table and so. At the first
>> glance, I think we can reduce this to the sysctls and a very few data,
>> for example using global tables tagged with the namespace and we don't
>> break the cacheline alignment optimization.
>>
>> (2) is slower but as the memory is allocated and freed when the module
>> is loaded/unloaded. What I don't like with this approach is we add some
>> overhead even if the netns is not compiled in the kernel.
>>
>>
> or (3)
> Like (1) with data that needs to be cache aligned in "struct net"
> and the rest in an ipvs struct.
>
Ah, right. That could be a nice solution.
> Global hash tables or not ?
>
In the past, we used global hash tables because of the cacheline miss.
^ permalink raw reply
* Re: [PATCH 2/3] cxgb4: function namespace cleanup (v2)
From: David Miller @ 2010-10-18 14:31 UTC (permalink / raw)
To: swise; +Cc: dm, shemminger, divy, leedom, netdev
In-Reply-To: <4CBA6DC8.4010104@opengridcomputing.com>
From: Steve Wise <swise@opengridcomputing.com>
Date: Sat, 16 Oct 2010 22:30:16 -0500
> I'll add a patch this week to utilize the tcp stats.
Ok, thanks Steve.
Stephen, please respin the two cxgb4 patches without the
tcp stat function removal.
^ permalink raw reply
* Re: [PATCH 2/3] cxgb4: function namespace cleanup (v2)
From: Stephen Hemminger @ 2010-10-18 14:47 UTC (permalink / raw)
To: Steve Wise
Cc: Dimitris Michailidis, Divy Le Ray, David S. Miller, Casey Leedom,
netdev
In-Reply-To: <4CBA6DC8.4010104@opengridcomputing.com>
On Sat, 16 Oct 2010 22:30:16 -0500
Steve Wise <swise@opengridcomputing.com> wrote:
>
> On 10/16/2010 1:16 AM, Dimitris Michailidis wrote:
> > Stephen Hemminger wrote:
> >> On Fri, 15 Oct 2010 18:11:42 -0700
> >> Dimitris Michailidis <dm@chelsio.com> wrote:
> >>
> >>> Stephen Hemminger wrote:
> >>>> Make functions only used in one file local.
> >>>> Remove lots of dead code, relating to unsupported functions
> >>>> in mainline driver like RSS, IPv6, and TCP offload.
> >>> Thanks, this looks OK. One exception, cxgb4_get_tcp_stats was
> >>> intended to be used by the rdma driver. I see that driver doesn't
> >>> call it presently but if you don't mind can we give Steve a few
> >>> hours to tell us if he has any imminent plans to use it. If he
> >>> doesn't offer to do something to use it for .37 it goes.
> >>
> >> The kernel source tree is not your development place holder tree.
> >> At least #ifdef the code out for now.
> >
> > I am trying to protect Stephen Rothwell's time by checking that the IB
> > folks don't plan to add a call to this in their tree while we remove
> > the function in net-next. There's supposed to be a call in the IB
> > driver. I don't know why there isn't one or whether they are planning
> > to fix it for .37. I see the potential for a linux-next conflict and
> > I am trying to avoid it. #ifdef doesn't help, if it's not needed we
> > can remove it for good.
>
> I'll add a patch this week to utilize the tcp stats.
In cxgb4 only or both cxgb3 and cxgb4?
^ permalink raw reply
* Re: [PATCH 2/3] cxgb4: function namespace cleanup (v2)
From: Steve Wise @ 2010-10-18 14:53 UTC (permalink / raw)
To: Stephen Hemminger
Cc: Dimitris Michailidis, Divy Le Ray, David S. Miller, Casey Leedom,
netdev
In-Reply-To: <20101018074713.0d0b91fd@nehalam>
On 10/18/2010 09:47 AM, Stephen Hemminger wrote:
> On Sat, 16 Oct 2010 22:30:16 -0500
> Steve Wise<swise@opengridcomputing.com> wrote:
>
>
>> On 10/16/2010 1:16 AM, Dimitris Michailidis wrote:
>>
>>> Stephen Hemminger wrote:
>>>
>>>> On Fri, 15 Oct 2010 18:11:42 -0700
>>>> Dimitris Michailidis<dm@chelsio.com> wrote:
>>>>
>>>>
>>>>> Stephen Hemminger wrote:
>>>>>
>>>>>> Make functions only used in one file local.
>>>>>> Remove lots of dead code, relating to unsupported functions
>>>>>> in mainline driver like RSS, IPv6, and TCP offload.
>>>>>>
>>>>> Thanks, this looks OK. One exception, cxgb4_get_tcp_stats was
>>>>> intended to be used by the rdma driver. I see that driver doesn't
>>>>> call it presently but if you don't mind can we give Steve a few
>>>>> hours to tell us if he has any imminent plans to use it. If he
>>>>> doesn't offer to do something to use it for .37 it goes.
>>>>>
>>>> The kernel source tree is not your development place holder tree.
>>>> At least #ifdef the code out for now.
>>>>
>>> I am trying to protect Stephen Rothwell's time by checking that the IB
>>> folks don't plan to add a call to this in their tree while we remove
>>> the function in net-next. There's supposed to be a call in the IB
>>> driver. I don't know why there isn't one or whether they are planning
>>> to fix it for .37. I see the potential for a linux-next conflict and
>>> I am trying to avoid it. #ifdef doesn't help, if it's not needed we
>>> can remove it for good.
>>>
>> I'll add a patch this week to utilize the tcp stats.
>>
> In cxgb4 only or both cxgb3 and cxgb4?
>
iw_cxgb3 already uses the cxgb3 TCP MIB.
Steve.
^ permalink raw reply
* Re: [net-next-2.6 PATCH] igbvf: Remove unneeded pm_qos* calls
From: David Miller @ 2010-10-18 15:12 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bphilips, gregory.v.rose
In-Reply-To: <20101016032547.1925.27290.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 15 Oct 2010 20:26:47 -0700
> From: Greg Rose <gregory.v.rose@intel.com>
>
> Power Management Quality of Service is not supported or used by the VF
> driver.
>
> Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH] igb: fix stats handling
From: David Miller @ 2010-10-18 15:12 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bphilips, eric.dumazet
In-Reply-To: <20101016032707.1925.10161.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 15 Oct 2010 20:27:10 -0700
> From: Eric Dumazet <eric.dumazet@gmail.com>
>
> There are currently some problems with igb.
>
> - On 32bit arches, maintaining 64bit counters without proper
> synchronization between writers and readers.
>
> - Stats updated every two seconds, as reported by Jesper.
> (Jesper provided a patch for this)
>
> - Potential problem between worker thread and ethtool -S
>
> This patch uses u64_stats_sync, and convert everything to be 64bit safe,
> SMP safe, even on 32bit arches. It integrates Jesper idea of providing
> accurate stats at the time user reads them.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> Tested-by: Emil Tantilov <emil.s.tantilov@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH] e1000e: Fix for offline diag test failure at first call
From: David Miller @ 2010-10-18 15:12 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bphilips, carolyn.wyborny, bruce.w.allan
In-Reply-To: <20101016033452.2174.51928.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 15 Oct 2010 20:35:31 -0700
> From: Carolyn Wyborny <carolyn.wyborny@intel.com>
>
> Move link test call to later in the offline sequence, move the
> restore settings block to afterwards and add another reset to ensure
> the hardware is in a known state afterwards.
>
> Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
> Acked-by: Bruce Allan <bruce.w.allan@intel.com>
> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: openvswitch/flow WAS ( Re: [rfc] Merging the Open vSwitch datapath
From: Simon Horman @ 2010-10-18 15:20 UTC (permalink / raw)
To: jamal; +Cc: Jesse Gross, Ben Pfaff, netdev, ovs-team
In-Reply-To: <1287404217.3664.182.camel@bigi>
On Mon, Oct 18, 2010 at 08:16:57AM -0400, jamal wrote:
>
> On Sat, 2010-10-16 at 12:33 -0700, Jesse Gross wrote:
> > On Sat, Oct 16, 2010 at 4:35 AM, jamal <hadi@cyberus.ca> wrote:
[ snip ]
> > 2. A mechanism to send/receive packets to/from userspace. This is an
> > important component that Open vSwitch adds to the pipeline. This will
> > probably expand in the future to suit different applications, like the
> > security processing that I talked about.
>
> There are many ways to skin that proverbial cat. I guess it will depend
> on whether you are redirecting or merely copying a whole packet, or part
> of it (while storing a part in the kernel) etc. Example for a scheme
> that works using netlink look at the netfilter examples. You could use
> pf_packet if merely requiring copies. One simple scheme i have used is
> to have the mirred action redirect to a tun device on which a user space
> daemon is listening. If you look at the mirred action - there is an
> option to redirect to a named socket which was never implemented because
> workarounds exist.
As I understand things, the packet goes from the kernel to userspace
and then (typically) comes back again.
I guess that it would be possible to send a copy of the headers
to user-sapce while the packet is quarantined in the kernel pending
a response from user-space. I say only the headers, as typically
that is all user-space needs to make a decision, though I guess it
may need the body to make some types of decisions. I have no idea
if such a scheme would be desirable in any circumstances.
^ permalink raw reply
* Re: [PATCH] bonding: various fixes for bonding, netpoll & netconsole (v3)
From: David Miller @ 2010-10-18 15:25 UTC (permalink / raw)
To: nhorman; +Cc: netdev, bonding-devel, fubar, andy, amwang
In-Reply-To: <1287021713-1750-1-git-send-email-nhorman@tuxdriver.com>
From: nhorman@tuxdriver.com
Date: Wed, 13 Oct 2010 22:01:48 -0400
> Version 3, taking the following changes into account:
...
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Applied, thanks Neil.
^ permalink raw reply
* Re: [PATCH] bonding: various fixes for bonding, netpoll & netconsole (v3)
From: David Miller @ 2010-10-18 15:27 UTC (permalink / raw)
To: nhorman; +Cc: netdev, bonding-devel, fubar, andy, amwang
In-Reply-To: <20101018.082529.115920035.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Mon, 18 Oct 2010 08:25:29 -0700 (PDT)
> From: nhorman@tuxdriver.com
> Date: Wed, 13 Oct 2010 22:01:48 -0400
>
>> Version 3, taking the following changes into account:
> ...
>> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
>
> Applied, thanks Neil.
This doesn't build with netpoll disable:
drivers/net/bonding/bond_main.c: In function ‘bond_start_xmit’:
drivers/net/bonding/bond_main.c:4578: error: expected expression before ‘)’ token
I'll fix this up but please properly build test your
changes next time.
^ permalink raw reply
* [PATCH net-next] sfc: make functions static
From: Stephen Hemminger @ 2010-10-18 15:27 UTC (permalink / raw)
To: David Miller, Ben Hutchings, Steve Hodgson
Cc: Solarflare linux maintainers, netdev
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>
---
drivers/net/sfc/efx.c | 16 +++-------------
drivers/net/sfc/efx.h | 10 +---------
drivers/net/sfc/ethtool.c | 10 +++++-----
drivers/net/sfc/falcon_xmac.c | 2 +-
drivers/net/sfc/mac.h | 1 -
drivers/net/sfc/mcdi.c | 4 ++--
drivers/net/sfc/mcdi.h | 2 --
drivers/net/sfc/mcdi_phy.c | 3 ++-
drivers/net/sfc/net_driver.h | 5 -----
drivers/net/sfc/nic.c | 2 +-
drivers/net/sfc/selftest.c | 10 ++++++++++
drivers/net/sfc/siena.c | 2 +-
12 files changed, 26 insertions(+), 41 deletions(-)
--- a/drivers/net/sfc/efx.c 2010-10-15 16:26:45.752054196 -0700
+++ b/drivers/net/sfc/efx.c 2010-10-15 16:41:10.902928754 -0700
@@ -68,14 +68,6 @@ const char *efx_loopback_mode_names[] =
[LOOPBACK_PHYXS_WS] = "PHYXS_WS",
};
-/* Interrupt mode names (see INT_MODE())) */
-const unsigned int efx_interrupt_mode_max = EFX_INT_MODE_MAX;
-const char *efx_interrupt_mode_names[] = {
- [EFX_INT_MODE_MSIX] = "MSI-X",
- [EFX_INT_MODE_MSI] = "MSI",
- [EFX_INT_MODE_LEGACY] = "legacy",
-};
-
const unsigned int efx_reset_type_max = RESET_TYPE_MAX;
const char *efx_reset_type_names[] = {
[RESET_TYPE_INVISIBLE] = "INVISIBLE",
@@ -128,7 +120,7 @@ static int napi_weight = 64;
* - Check the on-board hardware monitor;
* - Poll the link state and reconfigure the hardware as necessary.
*/
-unsigned int efx_monitor_interval = 1 * HZ;
+static unsigned int efx_monitor_interval = 1 * HZ;
/* This controls whether or not the driver will initialise devices
* with invalid MAC addresses stored in the EEPROM or flash. If true,
@@ -2180,10 +2172,8 @@ int efx_port_dummy_op_int(struct efx_nic
return 0;
}
void efx_port_dummy_op_void(struct efx_nic *efx) {}
-void efx_port_dummy_op_set_id_led(struct efx_nic *efx, enum efx_led_mode mode)
-{
-}
-bool efx_port_dummy_op_poll(struct efx_nic *efx)
+
+static bool efx_port_dummy_op_poll(struct efx_nic *efx)
{
return false;
}
--- a/drivers/net/sfc/efx.h 2010-10-15 16:33:49.707120362 -0700
+++ b/drivers/net/sfc/efx.h 2010-10-15 16:38:52.625979128 -0700
@@ -88,10 +88,6 @@ extern int efx_reconfigure_port(struct e
extern int __efx_reconfigure_port(struct efx_nic *efx);
/* Ethtool support */
-extern int efx_ethtool_get_settings(struct net_device *net_dev,
- struct ethtool_cmd *ecmd);
-extern int efx_ethtool_set_settings(struct net_device *net_dev,
- struct ethtool_cmd *ecmd);
extern const struct ethtool_ops efx_ethtool_ops;
/* Reset handling */
@@ -107,9 +103,7 @@ extern void efx_init_irq_moderation(stru
/* Dummy PHY ops for PHY drivers */
extern int efx_port_dummy_op_int(struct efx_nic *efx);
extern void efx_port_dummy_op_void(struct efx_nic *efx);
-extern void
-efx_port_dummy_op_set_id_led(struct efx_nic *efx, enum efx_led_mode mode);
-extern bool efx_port_dummy_op_poll(struct efx_nic *efx);
+
/* MTD */
#ifdef CONFIG_SFC_MTD
@@ -122,8 +116,6 @@ static inline void efx_mtd_rename(struct
static inline void efx_mtd_remove(struct efx_nic *efx) {}
#endif
-extern unsigned int efx_monitor_interval;
-
static inline void efx_schedule_channel(struct efx_channel *channel)
{
netif_vdbg(channel->efx, intr, channel->efx->net_dev,
--- a/drivers/net/sfc/ethtool.c 2010-10-15 16:30:43.840446292 -0700
+++ b/drivers/net/sfc/ethtool.c 2010-10-15 16:33:11.385745045 -0700
@@ -187,8 +187,8 @@ static int efx_ethtool_phys_id(struct ne
}
/* This must be called with rtnl_lock held. */
-int efx_ethtool_get_settings(struct net_device *net_dev,
- struct ethtool_cmd *ecmd)
+static int efx_ethtool_get_settings(struct net_device *net_dev,
+ struct ethtool_cmd *ecmd)
{
struct efx_nic *efx = netdev_priv(net_dev);
struct efx_link_state *link_state = &efx->link_state;
@@ -211,8 +211,8 @@ int efx_ethtool_get_settings(struct net_
}
/* This must be called with rtnl_lock held. */
-int efx_ethtool_set_settings(struct net_device *net_dev,
- struct ethtool_cmd *ecmd)
+static int efx_ethtool_set_settings(struct net_device *net_dev,
+ struct ethtool_cmd *ecmd)
{
struct efx_nic *efx = netdev_priv(net_dev);
int rc;
@@ -891,7 +891,7 @@ static int efx_ethtool_set_wol(struct ne
return efx->type->set_wol(efx, wol->wolopts);
}
-extern int efx_ethtool_reset(struct net_device *net_dev, u32 *flags)
+static int efx_ethtool_reset(struct net_device *net_dev, u32 *flags)
{
struct efx_nic *efx = netdev_priv(net_dev);
enum reset_type method;
--- a/drivers/net/sfc/falcon_xmac.c 2010-10-15 16:31:54.590987837 -0700
+++ b/drivers/net/sfc/falcon_xmac.c 2010-10-15 16:32:04.819355160 -0700
@@ -143,7 +143,7 @@ static bool falcon_xmac_link_ok(struct e
efx_mdio_phyxgxs_lane_sync(efx));
}
-void falcon_reconfigure_xmac_core(struct efx_nic *efx)
+static void falcon_reconfigure_xmac_core(struct efx_nic *efx)
{
unsigned int max_frame_len;
efx_oword_t reg;
--- a/drivers/net/sfc/mcdi.c 2010-10-15 16:32:14.415699761 -0700
+++ b/drivers/net/sfc/mcdi.c 2010-10-15 16:32:24.576064590 -0700
@@ -1093,8 +1093,8 @@ int efx_mcdi_reset_mc(struct efx_nic *ef
return rc;
}
-int efx_mcdi_wol_filter_set(struct efx_nic *efx, u32 type,
- const u8 *mac, int *id_out)
+static int efx_mcdi_wol_filter_set(struct efx_nic *efx, u32 type,
+ const u8 *mac, int *id_out)
{
u8 inbuf[MC_CMD_WOL_FILTER_SET_IN_LEN];
u8 outbuf[MC_CMD_WOL_FILTER_SET_OUT_LEN];
--- a/drivers/net/sfc/mcdi_phy.c 2010-10-15 16:32:37.700535811 -0700
+++ b/drivers/net/sfc/mcdi_phy.c 2010-10-15 16:32:49.312952707 -0700
@@ -713,7 +713,8 @@ static int efx_mcdi_phy_run_tests(struct
return 0;
}
-const char *efx_mcdi_phy_test_name(struct efx_nic *efx, unsigned int index)
+static const char *efx_mcdi_phy_test_name(struct efx_nic *efx,
+ unsigned int index)
{
struct efx_mcdi_phy_data *phy_cfg = efx->phy_data;
--- a/drivers/net/sfc/net_driver.h 2010-10-15 16:28:56.320581376 -0700
+++ b/drivers/net/sfc/net_driver.h 2010-10-15 16:36:37.289130428 -0700
@@ -387,11 +387,6 @@ extern const unsigned int efx_loopback_m
#define LOOPBACK_MODE(efx) \
STRING_TABLE_LOOKUP((efx)->loopback_mode, efx_loopback_mode)
-extern const char *efx_interrupt_mode_names[];
-extern const unsigned int efx_interrupt_mode_max;
-#define INT_MODE(efx) \
- STRING_TABLE_LOOKUP(efx->interrupt_mode, efx_interrupt_mode)
-
extern const char *efx_reset_type_names[];
extern const unsigned int efx_reset_type_max;
#define RESET_TYPE(type) \
--- a/drivers/net/sfc/nic.c 2010-10-15 16:33:00.257345589 -0700
+++ b/drivers/net/sfc/nic.c 2010-10-15 16:33:09.229667656 -0700
@@ -653,7 +653,7 @@ void efx_nic_eventq_read_ack(struct efx_
}
/* Use HW to insert a SW defined event */
-void efx_generate_event(struct efx_channel *channel, efx_qword_t *event)
+static void efx_generate_event(struct efx_channel *channel, efx_qword_t *event)
{
efx_oword_t drv_ev_reg;
--- a/drivers/net/sfc/siena.c 2010-10-15 16:33:22.902158396 -0700
+++ b/drivers/net/sfc/siena.c 2010-10-15 16:33:34.690581475 -0700
@@ -129,7 +129,7 @@ static int siena_probe_port(struct efx_n
return 0;
}
-void siena_remove_port(struct efx_nic *efx)
+static void siena_remove_port(struct efx_nic *efx)
{
efx->phy_op->remove(efx);
efx_nic_free_buffer(efx, &efx->stats_buffer);
--- a/drivers/net/sfc/mac.h 2010-10-15 16:37:35.923231638 -0700
+++ b/drivers/net/sfc/mac.h 2010-10-15 16:38:35.625370285 -0700
@@ -15,7 +15,6 @@
extern struct efx_mac_operations falcon_xmac_operations;
extern struct efx_mac_operations efx_mcdi_mac_operations;
-extern void falcon_reconfigure_xmac_core(struct efx_nic *efx);
extern int efx_mcdi_mac_stats(struct efx_nic *efx, dma_addr_t dma_addr,
u32 dma_len, int enable, int clear);
--- a/drivers/net/sfc/mcdi.h 2010-10-15 16:39:01.902311312 -0700
+++ b/drivers/net/sfc/mcdi.h 2010-10-15 16:39:14.482761784 -0700
@@ -121,8 +121,6 @@ extern int efx_mcdi_handle_assertion(str
extern void efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode);
extern int efx_mcdi_reset_port(struct efx_nic *efx);
extern int efx_mcdi_reset_mc(struct efx_nic *efx);
-extern int efx_mcdi_wol_filter_set(struct efx_nic *efx, u32 type,
- const u8 *mac, int *id_out);
extern int efx_mcdi_wol_filter_set_magic(struct efx_nic *efx,
const u8 *mac, int *id_out);
extern int efx_mcdi_wol_filter_get_magic(struct efx_nic *efx, int *id_out);
--- a/drivers/net/sfc/selftest.c 2010-10-15 16:38:07.788373215 -0700
+++ b/drivers/net/sfc/selftest.c 2010-10-15 16:38:32.453256674 -0700
@@ -48,6 +48,16 @@ static const unsigned char payload_sourc
static const char payload_msg[] =
"Hello world! This is an Efx loopback test in progress!";
+/* Interrupt mode names */
+static const unsigned int efx_interrupt_mode_max = EFX_INT_MODE_MAX;
+static const char *efx_interrupt_mode_names[] = {
+ [EFX_INT_MODE_MSIX] = "MSI-X",
+ [EFX_INT_MODE_MSI] = "MSI",
+ [EFX_INT_MODE_LEGACY] = "legacy",
+};
+#define INT_MODE(efx) \
+ STRING_TABLE_LOOKUP(efx->interrupt_mode, efx_interrupt_mode)
+
/**
* efx_loopback_state - persistent state during a loopback selftest
* @flush: Drop all packets in efx_loopback_rx_packet
^ permalink raw reply
* [PATCH net-next-2.6] mlx4: make functions local and remove dead code.
From: Stephen Hemminger @ 2010-10-18 15:30 UTC (permalink / raw)
To: David Miller, Yevgeny Petrilin; +Cc: netdev
There is a whole section of code in this driver related to vlan tables
which is not accessed from any kernel code.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
drivers/net/mlx4/cq.c | 3 +
drivers/net/mlx4/en_rx.c | 3 -
drivers/net/mlx4/icm.c | 28 ------------
drivers/net/mlx4/icm.h | 2
drivers/net/mlx4/mlx4_en.h | 3 -
drivers/net/mlx4/port.c | 97 --------------------------------------------
include/linux/mlx4/device.h | 3 -
7 files changed, 6 insertions(+), 133 deletions(-)
--- a/drivers/net/mlx4/en_rx.c 2010-10-15 16:06:32.842275374 -0700
+++ b/drivers/net/mlx4/en_rx.c 2010-10-15 16:06:44.642682840 -0700
@@ -524,7 +524,8 @@ out_loopback:
dev_kfree_skb_any(skb);
}
-int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int budget)
+static int mlx4_en_process_rx_cq(struct net_device *dev,
+ struct mlx4_en_cq *cq, int budget)
{
struct mlx4_en_priv *priv = netdev_priv(dev);
struct mlx4_cqe *cqe;
--- a/drivers/net/mlx4/icm.c 2010-10-15 16:03:02.783025372 -0700
+++ b/drivers/net/mlx4/icm.c 2010-10-15 16:08:09.977629991 -0700
@@ -210,38 +210,12 @@ static int mlx4_MAP_ICM(struct mlx4_dev
return mlx4_map_cmd(dev, MLX4_CMD_MAP_ICM, icm, virt);
}
-int mlx4_UNMAP_ICM(struct mlx4_dev *dev, u64 virt, u32 page_count)
+static int mlx4_UNMAP_ICM(struct mlx4_dev *dev, u64 virt, u32 page_count)
{
return mlx4_cmd(dev, virt, page_count, 0, MLX4_CMD_UNMAP_ICM,
MLX4_CMD_TIME_CLASS_B);
}
-int mlx4_MAP_ICM_page(struct mlx4_dev *dev, u64 dma_addr, u64 virt)
-{
- struct mlx4_cmd_mailbox *mailbox;
- __be64 *inbox;
- int err;
-
- mailbox = mlx4_alloc_cmd_mailbox(dev);
- if (IS_ERR(mailbox))
- return PTR_ERR(mailbox);
- inbox = mailbox->buf;
-
- inbox[0] = cpu_to_be64(virt);
- inbox[1] = cpu_to_be64(dma_addr);
-
- err = mlx4_cmd(dev, mailbox->dma, 1, 0, MLX4_CMD_MAP_ICM,
- MLX4_CMD_TIME_CLASS_B);
-
- mlx4_free_cmd_mailbox(dev, mailbox);
-
- if (!err)
- mlx4_dbg(dev, "Mapped page at %llx to %llx for ICM.\n",
- (unsigned long long) dma_addr, (unsigned long long) virt);
-
- return err;
-}
-
int mlx4_MAP_ICM_AUX(struct mlx4_dev *dev, struct mlx4_icm *icm)
{
return mlx4_map_cmd(dev, MLX4_CMD_MAP_ICM_AUX, icm, -1);
--- a/drivers/net/mlx4/icm.h 2010-10-15 16:05:35.580298413 -0700
+++ b/drivers/net/mlx4/icm.h 2010-10-15 16:05:54.912965820 -0700
@@ -128,8 +128,6 @@ static inline unsigned long mlx4_icm_siz
return sg_dma_len(&iter->chunk->mem[iter->page_idx]);
}
-int mlx4_UNMAP_ICM(struct mlx4_dev *dev, u64 virt, u32 page_count);
-int mlx4_MAP_ICM_page(struct mlx4_dev *dev, u64 dma_addr, u64 virt);
int mlx4_MAP_ICM_AUX(struct mlx4_dev *dev, struct mlx4_icm *icm);
int mlx4_UNMAP_ICM_AUX(struct mlx4_dev *dev);
--- a/drivers/net/mlx4/port.c 2010-10-15 16:03:13.639399914 -0700
+++ b/drivers/net/mlx4/port.c 2010-10-15 16:11:09.571835685 -0700
@@ -161,103 +161,6 @@ out:
}
EXPORT_SYMBOL_GPL(mlx4_unregister_mac);
-static int mlx4_set_port_vlan_table(struct mlx4_dev *dev, u8 port,
- __be32 *entries)
-{
- struct mlx4_cmd_mailbox *mailbox;
- u32 in_mod;
- int err;
-
- mailbox = mlx4_alloc_cmd_mailbox(dev);
- if (IS_ERR(mailbox))
- return PTR_ERR(mailbox);
-
- memcpy(mailbox->buf, entries, MLX4_VLAN_TABLE_SIZE);
- in_mod = MLX4_SET_PORT_VLAN_TABLE << 8 | port;
- err = mlx4_cmd(dev, mailbox->dma, in_mod, 1, MLX4_CMD_SET_PORT,
- MLX4_CMD_TIME_CLASS_B);
-
- mlx4_free_cmd_mailbox(dev, mailbox);
-
- return err;
-}
-
-int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index)
-{
- struct mlx4_vlan_table *table = &mlx4_priv(dev)->port[port].vlan_table;
- int i, err = 0;
- int free = -1;
-
- mutex_lock(&table->mutex);
- for (i = MLX4_VLAN_REGULAR; i < MLX4_MAX_VLAN_NUM; i++) {
- if (free < 0 && (table->refs[i] == 0)) {
- free = i;
- continue;
- }
-
- if (table->refs[i] &&
- (vlan == (MLX4_VLAN_MASK &
- be32_to_cpu(table->entries[i])))) {
- /* Vlan already registered, increase refernce count */
- *index = i;
- ++table->refs[i];
- goto out;
- }
- }
-
- if (table->total == table->max) {
- /* No free vlan entries */
- err = -ENOSPC;
- goto out;
- }
-
- /* Register new MAC */
- table->refs[free] = 1;
- table->entries[free] = cpu_to_be32(vlan | MLX4_VLAN_VALID);
-
- err = mlx4_set_port_vlan_table(dev, port, table->entries);
- if (unlikely(err)) {
- mlx4_warn(dev, "Failed adding vlan: %u\n", vlan);
- table->refs[free] = 0;
- table->entries[free] = 0;
- goto out;
- }
-
- *index = free;
- ++table->total;
-out:
- mutex_unlock(&table->mutex);
- return err;
-}
-EXPORT_SYMBOL_GPL(mlx4_register_vlan);
-
-void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index)
-{
- struct mlx4_vlan_table *table = &mlx4_priv(dev)->port[port].vlan_table;
-
- if (index < MLX4_VLAN_REGULAR) {
- mlx4_warn(dev, "Trying to free special vlan index %d\n", index);
- return;
- }
-
- mutex_lock(&table->mutex);
- if (!table->refs[index]) {
- mlx4_warn(dev, "No vlan entry for index %d\n", index);
- goto out;
- }
- if (--table->refs[index]) {
- mlx4_dbg(dev, "Have more references for index %d,"
- "no need to modify vlan table\n", index);
- goto out;
- }
- table->entries[index] = 0;
- mlx4_set_port_vlan_table(dev, port, table->entries);
- --table->total;
-out:
- mutex_unlock(&table->mutex);
-}
-EXPORT_SYMBOL_GPL(mlx4_unregister_vlan);
-
int mlx4_get_port_ib_caps(struct mlx4_dev *dev, u8 port, __be32 *caps)
{
struct mlx4_cmd_mailbox *inmailbox, *outmailbox;
--- a/include/linux/mlx4/device.h 2010-10-15 16:07:38.204532549 -0700
+++ b/include/linux/mlx4/device.h 2010-10-15 16:07:44.988766865 -0700
@@ -474,9 +474,6 @@ int mlx4_multicast_detach(struct mlx4_de
int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index);
void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int index);
-int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index);
-void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index);
-
int mlx4_map_phys_fmr(struct mlx4_dev *dev, struct mlx4_fmr *fmr, u64 *page_list,
int npages, u64 iova, u32 *lkey, u32 *rkey);
int mlx4_fmr_alloc(struct mlx4_dev *dev, u32 pd, u32 access, int max_pages,
--- a/drivers/net/mlx4/mlx4_en.h 2010-10-15 16:08:26.146188502 -0700
+++ b/drivers/net/mlx4/mlx4_en.h 2010-10-15 16:08:31.706380578 -0700
@@ -518,9 +518,6 @@ void mlx4_en_destroy_rx_ring(struct mlx4
int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv);
void mlx4_en_deactivate_rx_ring(struct mlx4_en_priv *priv,
struct mlx4_en_rx_ring *ring);
-int mlx4_en_process_rx_cq(struct net_device *dev,
- struct mlx4_en_cq *cq,
- int budget);
int mlx4_en_poll_rx_cq(struct napi_struct *napi, int budget);
void mlx4_en_fill_qp_context(struct mlx4_en_priv *priv, int size, int stride,
int is_tx, int rss, int qpn, int cqn,
--- a/drivers/net/mlx4/cq.c 2010-10-15 16:02:59.774921596 -0700
+++ b/drivers/net/mlx4/cq.c 2010-10-15 16:11:49.937227452 -0700
@@ -73,6 +73,9 @@ struct mlx4_cq_context {
#define MLX4_CQ_STATE_ARMED_SOL ( 6 << 8)
#define MLX4_EQ_STATE_FIRED (10 << 8)
+static int mlx4_ib_umem_write_mtt(struct mlx4_ib_dev *dev, struct mlx4_mtt *mtt,
+ struct ib_umem *umem);
+
void mlx4_cq_completion(struct mlx4_dev *dev, u32 cqn)
{
struct mlx4_cq *cq;
^ permalink raw reply
* [PATCH 2/3] cxgb4: function namespace cleanup (v3)
From: Stephen Hemminger @ 2010-10-18 15:39 UTC (permalink / raw)
To: David Miller; +Cc: swise, dm, divy, leedom, netdev
In-Reply-To: <20101018.073145.189710492.davem@davemloft.net>
Make functions only used in one file local.
Remove lots of dead code, relating to unsupported functions
in mainline driver like RSS, IPv6, and TCP offload.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
Patch against version in linux-next. It keeps the hooks
necessary for iscsi and get_tcp_stats.
drivers/net/cxgb4/cxgb4.h | 15 -
drivers/net/cxgb4/cxgb4_main.c | 68 --------
drivers/net/cxgb4/cxgb4_uld.h | 6
drivers/net/cxgb4/l2t.c | 34 ----
drivers/net/cxgb4/l2t.h | 3
drivers/net/cxgb4/t4_hw.c | 332 -----------------------------------------
6 files changed, 3 insertions(+), 455 deletions(-)
--- a/drivers/net/cxgb4/cxgb4_main.c 2010-10-18 08:33:48.369371944 -0700
+++ b/drivers/net/cxgb4/cxgb4_main.c 2010-10-18 08:34:44.910406405 -0700
@@ -880,7 +880,7 @@ void *t4_alloc_mem(size_t size)
/*
* Free memory allocated through alloc_mem().
*/
-void t4_free_mem(void *addr)
+static void t4_free_mem(void *addr)
{
if (is_vmalloc_addr(addr))
vfree(addr);
@@ -2206,8 +2206,8 @@ static void mk_tid_release(struct sk_buf
* Queue a TID release request and if necessary schedule a work queue to
* process it.
*/
-void cxgb4_queue_tid_release(struct tid_info *t, unsigned int chan,
- unsigned int tid)
+static void cxgb4_queue_tid_release(struct tid_info *t, unsigned int chan,
+ unsigned int tid)
{
void **p = &t->tid_tab[tid];
struct adapter *adap = container_of(t, struct adapter, tids);
@@ -2222,7 +2222,6 @@ void cxgb4_queue_tid_release(struct tid_
}
spin_unlock_bh(&adap->tid_release_lock);
}
-EXPORT_SYMBOL(cxgb4_queue_tid_release);
/*
* Process the list of pending TID release requests.
@@ -2355,48 +2354,6 @@ int cxgb4_create_server(const struct net
EXPORT_SYMBOL(cxgb4_create_server);
/**
- * cxgb4_create_server6 - create an IPv6 server
- * @dev: the device
- * @stid: the server TID
- * @sip: local IPv6 address to bind server to
- * @sport: the server's TCP port
- * @queue: queue to direct messages from this server to
- *
- * Create an IPv6 server for the given port and address.
- * Returns <0 on error and one of the %NET_XMIT_* values on success.
- */
-int cxgb4_create_server6(const struct net_device *dev, unsigned int stid,
- const struct in6_addr *sip, __be16 sport,
- unsigned int queue)
-{
- unsigned int chan;
- struct sk_buff *skb;
- struct adapter *adap;
- struct cpl_pass_open_req6 *req;
-
- skb = alloc_skb(sizeof(*req), GFP_KERNEL);
- if (!skb)
- return -ENOMEM;
-
- adap = netdev2adap(dev);
- req = (struct cpl_pass_open_req6 *)__skb_put(skb, sizeof(*req));
- INIT_TP_WR(req, 0);
- OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_PASS_OPEN_REQ6, stid));
- req->local_port = sport;
- req->peer_port = htons(0);
- req->local_ip_hi = *(__be64 *)(sip->s6_addr);
- req->local_ip_lo = *(__be64 *)(sip->s6_addr + 8);
- req->peer_ip_hi = cpu_to_be64(0);
- req->peer_ip_lo = cpu_to_be64(0);
- chan = rxq_to_chan(&adap->sge, queue);
- req->opt0 = cpu_to_be64(TX_CHAN(chan));
- req->opt1 = cpu_to_be64(CONN_POLICY_ASK |
- SYN_RSS_ENABLE | SYN_RSS_QUEUE(queue));
- return t4_mgmt_tx(adap, skb);
-}
-EXPORT_SYMBOL(cxgb4_create_server6);
-
-/**
* cxgb4_best_mtu - find the entry in the MTU table closest to an MTU
* @mtus: the HW MTU table
* @mtu: the target MTU
@@ -2455,25 +2412,6 @@ unsigned int cxgb4_port_idx(const struct
}
EXPORT_SYMBOL(cxgb4_port_idx);
-/**
- * cxgb4_netdev_by_hwid - return the net device of a HW port
- * @pdev: identifies the adapter
- * @id: the HW port id
- *
- * Return the net device associated with the interface with the given HW
- * id.
- */
-struct net_device *cxgb4_netdev_by_hwid(struct pci_dev *pdev, unsigned int id)
-{
- const struct adapter *adap = pci_get_drvdata(pdev);
-
- if (!adap || id >= NCHAN)
- return NULL;
- id = adap->chan_map[id];
- return id < MAX_NPORTS ? adap->port[id] : NULL;
-}
-EXPORT_SYMBOL(cxgb4_netdev_by_hwid);
-
void cxgb4_get_tcp_stats(struct pci_dev *pdev, struct tp_tcp_stats *v4,
struct tp_tcp_stats *v6)
{
--- a/drivers/net/cxgb4/cxgb4_uld.h 2010-10-18 08:33:48.339371406 -0700
+++ b/drivers/net/cxgb4/cxgb4_uld.h 2010-10-18 08:34:44.910406405 -0700
@@ -139,16 +139,11 @@ int cxgb4_alloc_stid(struct tid_info *t,
void cxgb4_free_atid(struct tid_info *t, unsigned int atid);
void cxgb4_free_stid(struct tid_info *t, unsigned int stid, int family);
void cxgb4_remove_tid(struct tid_info *t, unsigned int qid, unsigned int tid);
-void cxgb4_queue_tid_release(struct tid_info *t, unsigned int chan,
- unsigned int tid);
struct in6_addr;
int cxgb4_create_server(const struct net_device *dev, unsigned int stid,
__be32 sip, __be16 sport, unsigned int queue);
-int cxgb4_create_server6(const struct net_device *dev, unsigned int stid,
- const struct in6_addr *sip, __be16 sport,
- unsigned int queue);
static inline void set_wr_txq(struct sk_buff *skb, int prio, int queue)
{
@@ -233,7 +228,6 @@ int cxgb4_ofld_send(struct net_device *d
unsigned int cxgb4_port_chan(const struct net_device *dev);
unsigned int cxgb4_port_viid(const struct net_device *dev);
unsigned int cxgb4_port_idx(const struct net_device *dev);
-struct net_device *cxgb4_netdev_by_hwid(struct pci_dev *pdev, unsigned int id);
unsigned int cxgb4_best_mtu(const unsigned short *mtus, unsigned short mtu,
unsigned int *idx);
void cxgb4_get_tcp_stats(struct pci_dev *pdev, struct tp_tcp_stats *v4,
--- a/drivers/net/cxgb4/cxgb4.h 2010-10-18 08:33:48.319371031 -0700
+++ b/drivers/net/cxgb4/cxgb4.h 2010-10-18 08:34:44.910406405 -0700
@@ -592,7 +592,6 @@ void t4_os_portmod_changed(const struct
void t4_os_link_changed(struct adapter *adap, int port_id, int link_stat);
void *t4_alloc_mem(size_t size);
-void t4_free_mem(void *addr);
void t4_free_sge_resources(struct adapter *adap);
irq_handler_t t4_intr_handler(struct adapter *adap);
@@ -651,7 +650,6 @@ static inline int t4_wr_mbox_ns(struct a
void t4_intr_enable(struct adapter *adapter);
void t4_intr_disable(struct adapter *adapter);
-void t4_intr_clear(struct adapter *adapter);
int t4_slow_intr_handler(struct adapter *adapter);
int t4_wait_dev_ready(struct adapter *adap);
@@ -664,24 +662,16 @@ int t4_check_fw_version(struct adapter *
int t4_prep_adapter(struct adapter *adapter);
int t4_port_init(struct adapter *adap, int mbox, int pf, int vf);
void t4_fatal_err(struct adapter *adapter);
-int t4_set_trace_filter(struct adapter *adapter, const struct trace_params *tp,
- int filter_index, int enable);
-void t4_get_trace_filter(struct adapter *adapter, struct trace_params *tp,
- int filter_index, int *enabled);
int t4_config_rss_range(struct adapter *adapter, int mbox, unsigned int viid,
int start, int n, const u16 *rspq, unsigned int nrspq);
int t4_config_glbl_rss(struct adapter *adapter, int mbox, unsigned int mode,
unsigned int flags);
-int t4_read_rss(struct adapter *adapter, u16 *entries);
int t4_mc_read(struct adapter *adap, u32 addr, __be32 *data, u64 *parity);
int t4_edc_read(struct adapter *adap, int idx, u32 addr, __be32 *data,
u64 *parity);
void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p);
-void t4_get_lb_stats(struct adapter *adap, int idx, struct lb_port_stats *p);
-
void t4_read_mtu_tbl(struct adapter *adap, u16 *mtus, u8 *mtu_log);
-void t4_tp_get_err_stats(struct adapter *adap, struct tp_err_stats *st);
void t4_tp_get_tcp_stats(struct adapter *adap, struct tp_tcp_stats *v4,
struct tp_tcp_stats *v6);
void t4_load_mtus(struct adapter *adap, const unsigned short *mtus,
@@ -711,8 +701,6 @@ int t4_cfg_pfvf(struct adapter *adap, un
int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port,
unsigned int pf, unsigned int vf, unsigned int nmac, u8 *mac,
unsigned int *rss_size);
-int t4_free_vi(struct adapter *adap, unsigned int mbox, unsigned int pf,
- unsigned int vf, unsigned int viid);
int t4_set_rxmode(struct adapter *adap, unsigned int mbox, unsigned int viid,
int mtu, int promisc, int all_multi, int bcast, int vlanex,
bool sleep_ok);
@@ -731,9 +719,6 @@ int t4_mdio_rd(struct adapter *adap, uns
unsigned int mmd, unsigned int reg, u16 *valp);
int t4_mdio_wr(struct adapter *adap, unsigned int mbox, unsigned int phy_addr,
unsigned int mmd, unsigned int reg, u16 val);
-int t4_iq_start_stop(struct adapter *adap, unsigned int mbox, bool start,
- unsigned int pf, unsigned int vf, unsigned int iqid,
- unsigned int fl0id, unsigned int fl1id);
int t4_iq_free(struct adapter *adap, unsigned int mbox, unsigned int pf,
unsigned int vf, unsigned int iqtype, unsigned int iqid,
unsigned int fl0id, unsigned int fl1id);
--- a/drivers/net/cxgb4/l2t.c 2010-10-18 08:33:48.349371585 -0700
+++ b/drivers/net/cxgb4/l2t.c 2010-10-18 08:34:44.920406584 -0700
@@ -481,40 +481,6 @@ void t4_l2t_update(struct adapter *adap,
handle_failed_resolution(adap, arpq);
}
-/*
- * Allocate an L2T entry for use by a switching rule. Such entries need to be
- * explicitly freed and while busy they are not on any hash chain, so normal
- * address resolution updates do not see them.
- */
-struct l2t_entry *t4_l2t_alloc_switching(struct l2t_data *d)
-{
- struct l2t_entry *e;
-
- write_lock_bh(&d->lock);
- e = alloc_l2e(d);
- if (e) {
- spin_lock(&e->lock); /* avoid race with t4_l2t_free */
- e->state = L2T_STATE_SWITCHING;
- atomic_set(&e->refcnt, 1);
- spin_unlock(&e->lock);
- }
- write_unlock_bh(&d->lock);
- return e;
-}
-
-/*
- * Sets/updates the contents of a switching L2T entry that has been allocated
- * with an earlier call to @t4_l2t_alloc_switching.
- */
-int t4_l2t_set_switching(struct adapter *adap, struct l2t_entry *e, u16 vlan,
- u8 port, u8 *eth_addr)
-{
- e->vlan = vlan;
- e->lport = port;
- memcpy(e->dmac, eth_addr, ETH_ALEN);
- return write_l2e(adap, e, 0);
-}
-
struct l2t_data *t4_init_l2t(void)
{
int i;
--- a/drivers/net/cxgb4/l2t.h 2010-10-18 08:33:48.329371216 -0700
+++ b/drivers/net/cxgb4/l2t.h 2010-10-18 08:34:44.920406584 -0700
@@ -100,9 +100,6 @@ struct l2t_entry *cxgb4_l2t_get(struct l
unsigned int priority);
void t4_l2t_update(struct adapter *adap, struct neighbour *neigh);
-struct l2t_entry *t4_l2t_alloc_switching(struct l2t_data *d);
-int t4_l2t_set_switching(struct adapter *adap, struct l2t_entry *e, u16 vlan,
- u8 port, u8 *eth_addr);
struct l2t_data *t4_init_l2t(void);
void do_l2t_write_rpl(struct adapter *p, const struct cpl_l2t_write_rpl *rpl);
--- a/drivers/net/cxgb4/t4_hw.c 2010-10-18 08:33:48.309370846 -0700
+++ b/drivers/net/cxgb4/t4_hw.c 2010-10-18 08:34:44.920406584 -0700
@@ -120,30 +120,6 @@ static void t4_read_indirect(struct adap
}
}
-#if 0
-/**
- * t4_write_indirect - write indirectly addressed registers
- * @adap: the adapter
- * @addr_reg: register holding the indirect addresses
- * @data_reg: register holding the value for the indirect registers
- * @vals: values to write
- * @nregs: how many indirect registers to write
- * @start_idx: address of first indirect register to write
- *
- * Writes a sequential block of registers that are accessed indirectly
- * through an address/data register pair.
- */
-static void t4_write_indirect(struct adapter *adap, unsigned int addr_reg,
- unsigned int data_reg, const u32 *vals,
- unsigned int nregs, unsigned int start_idx)
-{
- while (nregs--) {
- t4_write_reg(adap, addr_reg, start_idx++);
- t4_write_reg(adap, data_reg, *vals++);
- }
-}
-#endif
-
/*
* Get the reply to a mailbox command and store it in @rpl in big-endian order.
*/
@@ -1560,44 +1536,6 @@ void t4_intr_disable(struct adapter *ada
}
/**
- * t4_intr_clear - clear all interrupts
- * @adapter: the adapter whose interrupts should be cleared
- *
- * Clears all interrupts. The caller must be a PCI function managing
- * global interrupts.
- */
-void t4_intr_clear(struct adapter *adapter)
-{
- static const unsigned int cause_reg[] = {
- SGE_INT_CAUSE1, SGE_INT_CAUSE2, SGE_INT_CAUSE3,
- PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS,
- PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS,
- PCIE_NONFAT_ERR, PCIE_INT_CAUSE,
- MC_INT_CAUSE,
- MA_INT_WRAP_STATUS, MA_PARITY_ERROR_STATUS, MA_INT_CAUSE,
- EDC_INT_CAUSE, EDC_REG(EDC_INT_CAUSE, 1),
- CIM_HOST_INT_CAUSE, CIM_HOST_UPACC_INT_CAUSE,
- MYPF_REG(CIM_PF_HOST_INT_CAUSE),
- TP_INT_CAUSE,
- ULP_RX_INT_CAUSE, ULP_TX_INT_CAUSE,
- PM_RX_INT_CAUSE, PM_TX_INT_CAUSE,
- MPS_RX_PERR_INT_CAUSE,
- CPL_INTR_CAUSE,
- MYPF_REG(PL_PF_INT_CAUSE),
- PL_PL_INT_CAUSE,
- LE_DB_INT_CAUSE,
- };
-
- unsigned int i;
-
- for (i = 0; i < ARRAY_SIZE(cause_reg); ++i)
- t4_write_reg(adapter, cause_reg[i], 0xffffffff);
-
- t4_write_reg(adapter, PL_INT_CAUSE, GLBL_INTR_MASK);
- (void) t4_read_reg(adapter, PL_INT_CAUSE); /* flush */
-}
-
-/**
* hash_mac_addr - return the hash value of a MAC address
* @addr: the 48-bit Ethernet MAC address
*
@@ -1709,36 +1647,6 @@ int t4_config_glbl_rss(struct adapter *a
return t4_wr_mbox(adapter, mbox, &c, sizeof(c), NULL);
}
-/* Read an RSS table row */
-static int rd_rss_row(struct adapter *adap, int row, u32 *val)
-{
- t4_write_reg(adap, TP_RSS_LKP_TABLE, 0xfff00000 | row);
- return t4_wait_op_done_val(adap, TP_RSS_LKP_TABLE, LKPTBLROWVLD, 1,
- 5, 0, val);
-}
-
-/**
- * t4_read_rss - read the contents of the RSS mapping table
- * @adapter: the adapter
- * @map: holds the contents of the RSS mapping table
- *
- * Reads the contents of the RSS hash->queue mapping table.
- */
-int t4_read_rss(struct adapter *adapter, u16 *map)
-{
- u32 val;
- int i, ret;
-
- for (i = 0; i < RSS_NENTRIES / 2; ++i) {
- ret = rd_rss_row(adapter, i, &val);
- if (ret)
- return ret;
- *map++ = LKPTBLQUEUE0_GET(val);
- *map++ = LKPTBLQUEUE1_GET(val);
- }
- return 0;
-}
-
/**
* t4_tp_get_tcp_stats - read TP's TCP MIB counters
* @adap: the adapter
@@ -1779,29 +1687,6 @@ void t4_tp_get_tcp_stats(struct adapter
}
/**
- * t4_tp_get_err_stats - read TP's error MIB counters
- * @adap: the adapter
- * @st: holds the counter values
- *
- * Returns the values of TP's error counters.
- */
-void t4_tp_get_err_stats(struct adapter *adap, struct tp_err_stats *st)
-{
- t4_read_indirect(adap, TP_MIB_INDEX, TP_MIB_DATA, st->macInErrs,
- 12, TP_MIB_MAC_IN_ERR_0);
- t4_read_indirect(adap, TP_MIB_INDEX, TP_MIB_DATA, st->tnlCongDrops,
- 8, TP_MIB_TNL_CNG_DROP_0);
- t4_read_indirect(adap, TP_MIB_INDEX, TP_MIB_DATA, st->tnlTxDrops,
- 4, TP_MIB_TNL_DROP_0);
- t4_read_indirect(adap, TP_MIB_INDEX, TP_MIB_DATA, st->ofldVlanDrops,
- 4, TP_MIB_OFD_VLN_DROP_0);
- t4_read_indirect(adap, TP_MIB_INDEX, TP_MIB_DATA, st->tcp6InErrs,
- 4, TP_MIB_TCP_V6IN_ERR_0);
- t4_read_indirect(adap, TP_MIB_INDEX, TP_MIB_DATA, &st->ofldNoNeigh,
- 2, TP_MIB_OFD_ARP_DROP);
-}
-
-/**
* t4_read_mtu_tbl - returns the values in the HW path MTU table
* @adap: the adapter
* @mtus: where to store the MTU values
@@ -1916,122 +1801,6 @@ void t4_load_mtus(struct adapter *adap,
}
/**
- * t4_set_trace_filter - configure one of the tracing filters
- * @adap: the adapter
- * @tp: the desired trace filter parameters
- * @idx: which filter to configure
- * @enable: whether to enable or disable the filter
- *
- * Configures one of the tracing filters available in HW. If @enable is
- * %0 @tp is not examined and may be %NULL.
- */
-int t4_set_trace_filter(struct adapter *adap, const struct trace_params *tp,
- int idx, int enable)
-{
- int i, ofst = idx * 4;
- u32 data_reg, mask_reg, cfg;
- u32 multitrc = TRCMULTIFILTER;
-
- if (!enable) {
- t4_write_reg(adap, MPS_TRC_FILTER_MATCH_CTL_A + ofst, 0);
- goto out;
- }
-
- if (tp->port > 11 || tp->invert > 1 || tp->skip_len > 0x1f ||
- tp->skip_ofst > 0x1f || tp->min_len > 0x1ff ||
- tp->snap_len > 9600 || (idx && tp->snap_len > 256))
- return -EINVAL;
-
- if (tp->snap_len > 256) { /* must be tracer 0 */
- if ((t4_read_reg(adap, MPS_TRC_FILTER_MATCH_CTL_A + 4) |
- t4_read_reg(adap, MPS_TRC_FILTER_MATCH_CTL_A + 8) |
- t4_read_reg(adap, MPS_TRC_FILTER_MATCH_CTL_A + 12)) & TFEN)
- return -EINVAL; /* other tracers are enabled */
- multitrc = 0;
- } else if (idx) {
- i = t4_read_reg(adap, MPS_TRC_FILTER_MATCH_CTL_B);
- if (TFCAPTUREMAX_GET(i) > 256 &&
- (t4_read_reg(adap, MPS_TRC_FILTER_MATCH_CTL_A) & TFEN))
- return -EINVAL;
- }
-
- /* stop the tracer we'll be changing */
- t4_write_reg(adap, MPS_TRC_FILTER_MATCH_CTL_A + ofst, 0);
-
- /* disable tracing globally if running in the wrong single/multi mode */
- cfg = t4_read_reg(adap, MPS_TRC_CFG);
- if ((cfg & TRCEN) && multitrc != (cfg & TRCMULTIFILTER)) {
- t4_write_reg(adap, MPS_TRC_CFG, cfg ^ TRCEN);
- t4_read_reg(adap, MPS_TRC_CFG); /* flush */
- msleep(1);
- if (!(t4_read_reg(adap, MPS_TRC_CFG) & TRCFIFOEMPTY))
- return -ETIMEDOUT;
- }
- /*
- * At this point either the tracing is enabled and in the right mode or
- * disabled.
- */
-
- idx *= (MPS_TRC_FILTER1_MATCH - MPS_TRC_FILTER0_MATCH);
- data_reg = MPS_TRC_FILTER0_MATCH + idx;
- mask_reg = MPS_TRC_FILTER0_DONT_CARE + idx;
-
- for (i = 0; i < TRACE_LEN / 4; i++, data_reg += 4, mask_reg += 4) {
- t4_write_reg(adap, data_reg, tp->data[i]);
- t4_write_reg(adap, mask_reg, ~tp->mask[i]);
- }
- t4_write_reg(adap, MPS_TRC_FILTER_MATCH_CTL_B + ofst,
- TFCAPTUREMAX(tp->snap_len) |
- TFMINPKTSIZE(tp->min_len));
- t4_write_reg(adap, MPS_TRC_FILTER_MATCH_CTL_A + ofst,
- TFOFFSET(tp->skip_ofst) | TFLENGTH(tp->skip_len) |
- TFPORT(tp->port) | TFEN |
- (tp->invert ? TFINVERTMATCH : 0));
-
- cfg &= ~TRCMULTIFILTER;
- t4_write_reg(adap, MPS_TRC_CFG, cfg | TRCEN | multitrc);
-out: t4_read_reg(adap, MPS_TRC_CFG); /* flush */
- return 0;
-}
-
-/**
- * t4_get_trace_filter - query one of the tracing filters
- * @adap: the adapter
- * @tp: the current trace filter parameters
- * @idx: which trace filter to query
- * @enabled: non-zero if the filter is enabled
- *
- * Returns the current settings of one of the HW tracing filters.
- */
-void t4_get_trace_filter(struct adapter *adap, struct trace_params *tp, int idx,
- int *enabled)
-{
- u32 ctla, ctlb;
- int i, ofst = idx * 4;
- u32 data_reg, mask_reg;
-
- ctla = t4_read_reg(adap, MPS_TRC_FILTER_MATCH_CTL_A + ofst);
- ctlb = t4_read_reg(adap, MPS_TRC_FILTER_MATCH_CTL_B + ofst);
-
- *enabled = !!(ctla & TFEN);
- tp->snap_len = TFCAPTUREMAX_GET(ctlb);
- tp->min_len = TFMINPKTSIZE_GET(ctlb);
- tp->skip_ofst = TFOFFSET_GET(ctla);
- tp->skip_len = TFLENGTH_GET(ctla);
- tp->invert = !!(ctla & TFINVERTMATCH);
- tp->port = TFPORT_GET(ctla);
-
- ofst = (MPS_TRC_FILTER1_MATCH - MPS_TRC_FILTER0_MATCH) * idx;
- data_reg = MPS_TRC_FILTER0_MATCH + ofst;
- mask_reg = MPS_TRC_FILTER0_DONT_CARE + ofst;
-
- for (i = 0; i < TRACE_LEN / 4; i++, data_reg += 4, mask_reg += 4) {
- tp->mask[i] = ~t4_read_reg(adap, mask_reg);
- tp->data[i] = t4_read_reg(adap, data_reg) & tp->mask[i];
- }
-}
-
-/**
* get_mps_bg_map - return the buffer groups associated with a port
* @adap: the adapter
* @idx: the port index
@@ -2133,52 +1902,6 @@ void t4_get_port_stats(struct adapter *a
}
/**
- * t4_get_lb_stats - collect loopback port statistics
- * @adap: the adapter
- * @idx: the loopback port index
- * @p: the stats structure to fill
- *
- * Return HW statistics for the given loopback port.
- */
-void t4_get_lb_stats(struct adapter *adap, int idx, struct lb_port_stats *p)
-{
- u32 bgmap = get_mps_bg_map(adap, idx);
-
-#define GET_STAT(name) \
- t4_read_reg64(adap, PORT_REG(idx, MPS_PORT_STAT_LB_PORT_##name##_L))
-#define GET_STAT_COM(name) t4_read_reg64(adap, MPS_STAT_##name##_L)
-
- p->octets = GET_STAT(BYTES);
- p->frames = GET_STAT(FRAMES);
- p->bcast_frames = GET_STAT(BCAST);
- p->mcast_frames = GET_STAT(MCAST);
- p->ucast_frames = GET_STAT(UCAST);
- p->error_frames = GET_STAT(ERROR);
-
- p->frames_64 = GET_STAT(64B);
- p->frames_65_127 = GET_STAT(65B_127B);
- p->frames_128_255 = GET_STAT(128B_255B);
- p->frames_256_511 = GET_STAT(256B_511B);
- p->frames_512_1023 = GET_STAT(512B_1023B);
- p->frames_1024_1518 = GET_STAT(1024B_1518B);
- p->frames_1519_max = GET_STAT(1519B_MAX);
- p->drop = t4_read_reg(adap, PORT_REG(idx,
- MPS_PORT_STAT_LB_PORT_DROP_FRAMES));
-
- p->ovflow0 = (bgmap & 1) ? GET_STAT_COM(RX_BG_0_LB_DROP_FRAME) : 0;
- p->ovflow1 = (bgmap & 2) ? GET_STAT_COM(RX_BG_1_LB_DROP_FRAME) : 0;
- p->ovflow2 = (bgmap & 4) ? GET_STAT_COM(RX_BG_2_LB_DROP_FRAME) : 0;
- p->ovflow3 = (bgmap & 8) ? GET_STAT_COM(RX_BG_3_LB_DROP_FRAME) : 0;
- p->trunc0 = (bgmap & 1) ? GET_STAT_COM(RX_BG_0_LB_TRUNC_FRAME) : 0;
- p->trunc1 = (bgmap & 2) ? GET_STAT_COM(RX_BG_1_LB_TRUNC_FRAME) : 0;
- p->trunc2 = (bgmap & 4) ? GET_STAT_COM(RX_BG_2_LB_TRUNC_FRAME) : 0;
- p->trunc3 = (bgmap & 8) ? GET_STAT_COM(RX_BG_3_LB_TRUNC_FRAME) : 0;
-
-#undef GET_STAT
-#undef GET_STAT_COM
-}
-
-/**
* t4_wol_magic_enable - enable/disable magic packet WoL
* @adap: the adapter
* @port: the physical port index
@@ -2584,30 +2307,6 @@ int t4_alloc_vi(struct adapter *adap, un
}
/**
- * t4_free_vi - free a virtual interface
- * @adap: the adapter
- * @mbox: mailbox to use for the FW command
- * @pf: the PF owning the VI
- * @vf: the VF owning the VI
- * @viid: virtual interface identifiler
- *
- * Free a previously allocated virtual interface.
- */
-int t4_free_vi(struct adapter *adap, unsigned int mbox, unsigned int pf,
- unsigned int vf, unsigned int viid)
-{
- struct fw_vi_cmd c;
-
- memset(&c, 0, sizeof(c));
- c.op_to_vfn = htonl(FW_CMD_OP(FW_VI_CMD) | FW_CMD_REQUEST |
- FW_CMD_EXEC | FW_VI_CMD_PFN(pf) |
- FW_VI_CMD_VFN(vf));
- c.alloc_to_len16 = htonl(FW_VI_CMD_FREE | FW_LEN16(c));
- c.type_viid = htons(FW_VI_CMD_VIID(viid));
- return t4_wr_mbox(adap, mbox, &c, sizeof(c), &c);
-}
-
-/**
* t4_set_rxmode - set Rx properties of a virtual interface
* @adap: the adapter
* @mbox: mailbox to use for the FW command
@@ -2832,37 +2531,6 @@ int t4_identify_port(struct adapter *ada
return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
}
-/**
- * t4_iq_start_stop - enable/disable an ingress queue and its FLs
- * @adap: the adapter
- * @mbox: mailbox to use for the FW command
- * @start: %true to enable the queues, %false to disable them
- * @pf: the PF owning the queues
- * @vf: the VF owning the queues
- * @iqid: ingress queue id
- * @fl0id: FL0 queue id or 0xffff if no attached FL0
- * @fl1id: FL1 queue id or 0xffff if no attached FL1
- *
- * Starts or stops an ingress queue and its associated FLs, if any.
- */
-int t4_iq_start_stop(struct adapter *adap, unsigned int mbox, bool start,
- unsigned int pf, unsigned int vf, unsigned int iqid,
- unsigned int fl0id, unsigned int fl1id)
-{
- struct fw_iq_cmd c;
-
- memset(&c, 0, sizeof(c));
- c.op_to_vfn = htonl(FW_CMD_OP(FW_IQ_CMD) | FW_CMD_REQUEST |
- FW_CMD_EXEC | FW_IQ_CMD_PFN(pf) |
- FW_IQ_CMD_VFN(vf));
- c.alloc_to_len16 = htonl(FW_IQ_CMD_IQSTART(start) |
- FW_IQ_CMD_IQSTOP(!start) | FW_LEN16(c));
- c.iqid = htons(iqid);
- c.fl0id = htons(fl0id);
- c.fl1id = htons(fl1id);
- return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
-}
-
/**
* t4_iq_free - free an ingress queue and its FLs
* @adap: the adapter
^ permalink raw reply
* [v2] Remaining BKL users, what to do
From: Arnd Bergmann @ 2010-10-18 15:42 UTC (permalink / raw)
To: codalist, ksummit-2010-discuss
Cc: 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: <201009161632.59210.arnd@arndb.de>
This is a update on the current progress for the BKL removal, reflecting
what is currently in linux-next.
Maybe we can briefly discuss this at the kernel summit to decide if we
want a quick death of the BKL, i.e. fixing/disabling/staging-out the
remaining users in 2.6.38 or rather leave them there indefinitely.
On Thursday 16 September 2010, Arnd Bergmann wrote:
> The big kernel lock is gone from almost all code in linux-next, this is
> the status of what I think will happen to the remaining users:
>
> drivers/gpu/drm/i810/{i810,i830}_dma.c:
> Fixable, but needs someone with the hardware to test. Can probably be
> marked CONFIG_BROKEN_ON_SMP if nobody cares.
Still open, no good solution for this.
> drivers/media/video (V4L):
> Mauro is working on it, some drivers get moved to staging while the
> others get fixed. An easy workaround would be possible by adding
> per-driver mutexes, but Mauro wants to it properly by locking all
> the right places.
Progressing well, patches are being worked on.
> fs/adfs:
> Probably not hard to fix, but needs someone to test it.
> adfs has only seen janitorial fixes for the last 5 years.
> Do we know of any users?
Nobody replied.
> fs/autofs:
> Pretty much dead, replaced by autofs4. I'd suggest moving this
> to drivers/staging in 2.6.37 and letting it die there.
Now in staging.
> fs/coda:
> Coda seems to have an active community, but not all of their
> code is actually part of linux (pioctl!), while the last official
> release is missing many of the cleanups that were don in Linux.
> Not sure what to do, if someone is interested, the best way might
> be a fresh start with a merger of the mainline linux and the
> coda.cs.cmu.edu codebase in drivers/staging.
> Just removing the BKL without the Coda community seems like a heap
> of pointless work.
Jan Harkes showed interest, looks like this will get fixed eventually,
but probably not in time for 2.6.37.
> fs/freevxfs:
> Uses the BKL in readdir and lookup, should be easy to fix. Christoph?
Still waiting for confirmation from Christoph Hellwig that the BKL
is not needed here. I can do the patch to remove it then.
> fs/hpfs:
> Looks fixable, if anyone cares. Maybe it's time for retirement in
> drivers/staging though. The web page only has a Link to the
> linux-2.2 version.
No replies.
> fs/lockd:
> Trond writes that he has someone working on BKL removal here.
Bryan Schumaker took care of this, looks like the locking is independent
of the fs/locks.c locking now, although it still uses the BKL internally.
I assume that this will get fixed as well, doesn't seem hard. As long
as lockd uses the BKL, both nfs and nfsd depend on the BKL implicitly.
> fs/locks.c:
> Patch is under discussion, blocked by work on fs/lockd currently.
No longer blocked now, both lockd and ceph can deal with this converted
to spinlocks. I will follow up with the final patch once they hit mainline.
> fs/ncpfs:
> Should be fixable if Petr still cares about it. Otherwise suggest
> moving to drivers/staging if there are no users left.
Fixed by Petr Vandrovec.
> fs/qnx4:
> Should be easy to fix, there are only a few places in the code that
> use the BKL. Anders?
Anders Larsen volunteered.
> fs/smbfs:
> Last I heard this was considered obsolete. Should be move it to
> drivers/staging now?
Now in staging.
> fs/udf:
> Not completely trivial, but probably necessary to fix. Project web
> site is dead, I hope that Jan Kara can be motivated to fix it though.
Jan Kara volunteered to do it.
> fs/ufs:
> Evgeniy Dushistov is maintaining this, I hope he can take care of
> getting rid of the BKL in UFS.
No replies.
> kernel/trace/blktrace.c:
> Should be easy. Ingo? Steven?
Done.
> net/appletalk:
> net/ipx/af_ipx.c:
> net/irda/af_irda.c:
> Can probably be saved from retirement in drivers/staging if the
> maintainers still care.
Samuel Ortiz fixed irda.
David Miller volunteered to do appletalk and ipx.
> net/x25:
> Andrew Hendry has started working on it.
Patches have shown up in -next now, I suppose Andrew will finish it soon.
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.
Arnd
^ permalink raw reply
* Re: [PATCH] bonding: various fixes for bonding, netpoll & netconsole (v3)
From: Neil Horman @ 2010-10-18 15:57 UTC (permalink / raw)
To: David Miller; +Cc: netdev, bonding-devel, fubar, andy, amwang
In-Reply-To: <20101018.082728.48512103.davem@davemloft.net>
On Mon, Oct 18, 2010 at 08:27:28AM -0700, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Mon, 18 Oct 2010 08:25:29 -0700 (PDT)
>
> > From: nhorman@tuxdriver.com
> > Date: Wed, 13 Oct 2010 22:01:48 -0400
> >
> >> Version 3, taking the following changes into account:
> > ...
> >> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> >
> > Applied, thanks Neil.
>
> This doesn't build with netpoll disable:
>
> drivers/net/bonding/bond_main.c: In function ‘bond_start_xmit’:
> drivers/net/bonding/bond_main.c:4578: error: expected expression before ‘)’ token
>
> I'll fix this up but please properly build test your
> changes next time.
I apologize Dave, I thought I had tested with CONFIG_NET_POLL_CONTROLLER turned
off, but apparently it just got re-enabled automatically because I had
CONFIG_NETPOLL on. I'll check that more carefully in the future.
Neil
P.S. I've got some minor cleanup patches to this series (little things that I
missed) in the next day or so.
Thanks!
Neil
^ permalink raw reply
* Linux 2.6.35/TIPC 2.0 ABI breaking changes [was: TIPC 2.0 and TIPC_SUB_SERVICE]
From: Leandro Lucarella @ 2010-10-18 15:04 UTC (permalink / raw)
To: Jon Maloy
Cc: Peter Litov, tipc-discussion@lists.sourceforge.net, davem,
linux-kernel, netdev
In-Reply-To: <0434463FDA60A94FA978ACA44617682DEE8446A03B@EUSAACMS0702.eamcs.ericsson.se>
Jon Maloy, el 4 de octubre a las 11:08 me escribiste:
> Hi Peter,
> Adding the version as a sockopt is a very is a very good idea.
> But actually, you can find out the version, and get around the two-binary problem aready now:
>
> Check if TIPC_SUB_SERVICE is zero. If it is, the version is 2.0,
> otherwise it is pre-2.0, and you should use the TIPC_SUB_SERVICE with
> a value of 1.
> A little hackish, maybe, but it would solve your problem (which is
> temporary anyway) provided you can alter and recompile your code.
>
> And, since you are anyway altering the code, you should take the
> opportunity to add the necessary byte-order conversions, since
> TIPC-1.6/7 are forward compatible in that respect.
>
> The only reason to introduce what Luca is suggesting, compatiblity
> code in the driver itself, is that you wouldn't need recompile your
> old apps.
> lf that is an absolute requirement we could do that, but our initial
> assessment was that most people recompile their code when moving to
> a new kernel. We may be wrong there, of course.
I thought the kernel usually went to great lengths to ensure old
userspace binaries work with newer kernels.
Since this, as you mention, is not hard to do, and does not impose
a penalty on new code, why not do it?
> It is also uncertain whether David M would accept such a change, or if
> he would see it as a way of sneaking back a functionality he already
> threw out.
By the way, this doesn't work at all for the "bindings" I've done to the
D programming language. D is ABI compatible with C, but not source
compatible, so to add TIPC support to D, I had to write all the constant
values again, in a D source file[1].
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;
But then, *users* (I mean *end-users* not developers) will need to use
a compiler switch to select for which kernel they would like to compile
their applications, which I find unacceptable.
I think is really very harsh too to force people to recompile their
applications if they want to switch to a newer/older kernel to try
something out.
What I expected is to have something like 2 port names assigned to the
topology services instead of one, TIPC_TOP_SRV which is compatible with
TIPC 1 and marked as deprecated, and TIPC_TOP_SRV2 which only accepts
the TIPC 2.0 standard. Then, nothing of this would have happened.
And I think breaking changes should be discussed (or at least announced)
in this list more thoughtfully before including them in a Linux kernel
release. Is really a shame to be at a point where no matter what is
done, at least a couple of kernel releases will be binary incompatible
with old TIPC applications.
[1] http://www.dsource.org/projects/phobos/browser/trunk/phobos/std/c/linux/tipc.d
PS: Since this is David Miller's call, I'm Cc-ing him (and other kernel
mailing lists), as it makes no sense to speculate about what he
thinks if we can just ask him.
--
Leandro Lucarella (AKA luca) http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
I'll take a quiet life,
a handshake of carbon monoxide,
with no alarms and no surprises,
no alarms and no surprises.
^ permalink raw reply
* 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
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