* Re: [PATCH 69] drivers/net/sb1250-mac.c: kmalloc + memset conversion to kcalloc
From: Jeff Garzik @ 2007-08-07 21:57 UTC (permalink / raw)
To: Mariusz Kozlowski; +Cc: linux-kernel, kernel-janitors, Andrew Morton, netdev
In-Reply-To: <200707312358.36567.m.kozlowski@tuxland.pl>
Mariusz Kozlowski wrote:
> Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
>
> drivers/net/sb1250-mac.c | 76286 -> 76199 (-87 bytes)
>
> drivers/net/sb1250-mac.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
applied
^ permalink raw reply
* Re: [PATCH 76] drivers/net/via-velocity.c: mostly kmalloc + memset conversion to kcalloc
From: Jeff Garzik @ 2007-08-07 21:57 UTC (permalink / raw)
To: Mariusz Kozlowski
Cc: linux-kernel, kernel-janitors, Andrew Morton, romieu, netdev
In-Reply-To: <200708010011.50979.m.kozlowski@tuxland.pl>
Mariusz Kozlowski wrote:
> Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
>
> drivers/net/via-velocity.c | 88263 -> 88120 (-143 bytes)
> drivers/net/via-velocity.o | 254264 -> 253828 (-436 bytes)
>
> drivers/net/via-velocity.c | 24 ++++++++++--------------
> 1 file changed, 10 insertions(+), 14 deletions(-)
applied
^ permalink raw reply
* [PATCH] xen-netfront: remove dead code
From: Jeremy Fitzhardinge @ 2007-08-07 21:56 UTC (permalink / raw)
To: Linus Torvalds
Cc: Linux Kernel Mailing List, NetDev, Adrian Bunk, Michal Piotrowski
This patch removes some residual dead code left over from removing the
"flip" receive mode. This patch doesn't change the generated output
at all, since gcc already realized it was dead.
This resolves the "regression" reported by Adrian.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Adrian Bunk <bunk@stusta.de>
Cc: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
---
drivers/net/xen-netfront.c | 37 ++-----------------------------------
1 file changed, 2 insertions(+), 35 deletions(-)
===================================================================
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -209,11 +209,9 @@ static void xennet_alloc_rx_buffers(stru
struct page *page;
int i, batch_target, notify;
RING_IDX req_prod = np->rx.req_prod_pvt;
- struct xen_memory_reservation reservation;
grant_ref_t ref;
unsigned long pfn;
void *vaddr;
- int nr_flips;
struct xen_netif_rx_request *req;
if (unlikely(!netif_carrier_ok(dev)))
@@ -263,7 +261,7 @@ no_skb:
np->rx_target = np->rx_max_target;
refill:
- for (nr_flips = i = 0; ; i++) {
+ for (i = 0; ; i++) {
skb = __skb_dequeue(&np->rx_batch);
if (skb == NULL)
break;
@@ -292,38 +290,7 @@ no_skb:
req->gref = ref;
}
- if (nr_flips != 0) {
- reservation.extent_start = np->rx_pfn_array;
- reservation.nr_extents = nr_flips;
- reservation.extent_order = 0;
- reservation.address_bits = 0;
- reservation.domid = DOMID_SELF;
-
- if (!xen_feature(XENFEAT_auto_translated_physmap)) {
- /* After all PTEs have been zapped, flush the TLB. */
- np->rx_mcl[i-1].args[MULTI_UVMFLAGS_INDEX] =
- UVMF_TLB_FLUSH|UVMF_ALL;
-
- /* Give away a batch of pages. */
- np->rx_mcl[i].op = __HYPERVISOR_memory_op;
- np->rx_mcl[i].args[0] = XENMEM_decrease_reservation;
- np->rx_mcl[i].args[1] = (unsigned long)&reservation;
-
- /* Zap PTEs and give away pages in one big
- * multicall. */
- (void)HYPERVISOR_multicall(np->rx_mcl, i+1);
-
- /* Check return status of HYPERVISOR_memory_op(). */
- if (unlikely(np->rx_mcl[i].result != i))
- panic("Unable to reduce memory reservation\n");
- } else {
- if (HYPERVISOR_memory_op(XENMEM_decrease_reservation,
- &reservation) != i)
- panic("Unable to reduce memory reservation\n");
- }
- } else {
- wmb(); /* barrier so backend seens requests */
- }
+ wmb(); /* barrier so backend seens requests */
/* Above is a suitable barrier to ensure backend will see requests. */
np->rx.req_prod_pvt = req_prod + i;
^ permalink raw reply
* Re: [PATCH 2/6] ibmveth: Implement ethtool hooks to enable/disable checksum offload
From: Brian King @ 2007-08-07 22:07 UTC (permalink / raw)
To: Jeff Garzik; +Cc: linuxppc-dev, rcjenn, santil, netdev
In-Reply-To: <46B8E891.80403@garzik.org>
Jeff Garzik wrote:
> Brian King wrote:
>> This patch adds the appropriate ethtool hooks to allow for enabling/disabling
>> of hypervisor assisted checksum offload for TCP.
>>
>> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
>> ---
>>
>> linux-2.6-bjking1/drivers/net/ibmveth.c | 118 +++++++++++++++++++++++++++++++-
>> linux-2.6-bjking1/drivers/net/ibmveth.h | 1
>> 2 files changed, 117 insertions(+), 2 deletions(-)
>>
>> diff -puN drivers/net/ibmveth.c~ibmveth_csum_offload_ethtool drivers/net/ibmveth.c
>> --- linux-2.6/drivers/net/ibmveth.c~ibmveth_csum_offload_ethtool 2007-08-01 14:55:14.000000000 -0500
>> +++ linux-2.6-bjking1/drivers/net/ibmveth.c 2007-08-01 14:55:14.000000000 -0500
>> @@ -641,12 +641,125 @@ static u32 netdev_get_link(struct net_de
>> return 1;
>> }
>>
>> +static void ibmveth_set_rx_csum_flags(struct net_device *dev, u32 data)
>> +{
>> + struct ibmveth_adapter *adapter = dev->priv;
>> +
>> + if (data)
>> + adapter->rx_csum = 1;
>> + else {
>> + adapter->rx_csum = 0;
>> + dev->features &= ~NETIF_F_IP_CSUM;
>
> why does this RX-related code clear a TX-related flag?
Its related to how the pSeries firmware works. The firmware provides an interface
to enable "checksum offload", which means both tx and rx checksum offload from
the firmware's point of view. The firmware does not support enabling checksum
offload for only rx. If I disable it for rx I have to disable it for tx as
well, otherwise the firmware will reject all future tx buffers I throw at it
that are not checksummed.
-Brian
--
Brian King
Linux on Power Virtualization
IBM Linux Technology Center
^ permalink raw reply
* Re: [RFC][BNX2X]: New driver for Broadcom 10Gb Ethernet.
From: Jeff Garzik @ 2007-08-07 22:15 UTC (permalink / raw)
To: Michael Buesch; +Cc: Michael Chan, davem, netdev, eliezert, lusinsky, eilong
In-Reply-To: <200708020006.13457.mb@bu3sch.de>
Michael Buesch wrote:
> On Wednesday 01 August 2007 10:31:17 Michael Chan wrote:
>> +static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance)
>> +{
>> + struct net_device *dev = dev_instance;
>
> You need to check if dev==NULL and bail out.
> Another driver sharing the IRQ with this might choose to pass the dev
> pointer as NULL.
NAK that advice: It is pointless having such a check in the hottest of
driver hot paths, since a large majority of drivers do not have such a
check.
It is better to fix the extremely rare oddball that passes NULL to
request_irq(), than to update all drivers to be slower due to the oddballs.
>> + struct bnx2x *bp = netdev_priv(dev);
>
> No check if the device actually _did_ generate the IRQ? Sharing...
Not for MSI
>> +static irqreturn_t bnx2x_msix_fp_int(int irq, void *fp_cookie)
>> +{
>> +
>> + struct bnx2x_fastpath *fp = fp_cookie;
>
> Check if fp==NULL
NAK
>> + struct bnx2x *bp = fp->bp;
>> + struct net_device *dev = bp->dev;
>
> No share protection either?
MSI
>> +static irqreturn_t bnx2x_interrupt(int irq, void *dev_instance)
>> +{
>> + struct net_device *dev = dev_instance;
>
> Check if dev==NULL
NAK
>> + struct bnx2x *bp = netdev_priv(dev);
>> + u16 status = bnx2x_ack_int(bp);
>> +
>> + if (unlikely(status == 0)) {
>
> That's not unlikely.
in this case, agreed
the other comments seem fairly sane, and indeed should be considered for
the existing drivers as well.
Jeff
^ permalink raw reply
* Re: [PATCH 2/6] ibmveth: Implement ethtool hooks to enable/disable checksum offload
From: Jeff Garzik @ 2007-08-07 22:16 UTC (permalink / raw)
To: brking; +Cc: linuxppc-dev, rcjenn, santil, netdev
In-Reply-To: <46B8ED10.1060701@linux.vnet.ibm.com>
Brian King wrote:
> Jeff Garzik wrote:
>> Brian King wrote:
>>> This patch adds the appropriate ethtool hooks to allow for enabling/disabling
>>> of hypervisor assisted checksum offload for TCP.
>>>
>>> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
>>> ---
>>>
>>> linux-2.6-bjking1/drivers/net/ibmveth.c | 118 +++++++++++++++++++++++++++++++-
>>> linux-2.6-bjking1/drivers/net/ibmveth.h | 1
>>> 2 files changed, 117 insertions(+), 2 deletions(-)
>>>
>>> diff -puN drivers/net/ibmveth.c~ibmveth_csum_offload_ethtool drivers/net/ibmveth.c
>>> --- linux-2.6/drivers/net/ibmveth.c~ibmveth_csum_offload_ethtool 2007-08-01 14:55:14.000000000 -0500
>>> +++ linux-2.6-bjking1/drivers/net/ibmveth.c 2007-08-01 14:55:14.000000000 -0500
>>> @@ -641,12 +641,125 @@ static u32 netdev_get_link(struct net_de
>>> return 1;
>>> }
>>>
>>> +static void ibmveth_set_rx_csum_flags(struct net_device *dev, u32 data)
>>> +{
>>> + struct ibmveth_adapter *adapter = dev->priv;
>>> +
>>> + if (data)
>>> + adapter->rx_csum = 1;
>>> + else {
>>> + adapter->rx_csum = 0;
>>> + dev->features &= ~NETIF_F_IP_CSUM;
>> why does this RX-related code clear a TX-related flag?
>
> Its related to how the pSeries firmware works. The firmware provides an interface
> to enable "checksum offload", which means both tx and rx checksum offload from
> the firmware's point of view. The firmware does not support enabling checksum
> offload for only rx. If I disable it for rx I have to disable it for tx as
> well, otherwise the firmware will reject all future tx buffers I throw at it
> that are not checksummed.
ACK once you add a comment describing this :)
^ permalink raw reply
* Re: [PATCH 2.6.23 1/3]S2IO: Making MSIX as default intr_type
From: Jeff Garzik @ 2007-08-07 22:20 UTC (permalink / raw)
To: Sivakumar Subramani; +Cc: netdev, support
In-Reply-To: <Pine.GSO.4.10.10708060525530.4004-100000@guinness>
Sivakumar Subramani wrote:
> - Making MSIX as default intr_type
> - Driver will test MSI-X by issuing test MSI-X vector and if fails it will
> fallback to INTA
>
> Signed-off-by: Sivakumar Subramani <sivakumar.subramani@neterion.com>
> Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
This patch series looks a bit big to apply this far past the merge
window. It changes behavior in the middle of a -rc stream, which is
something to avoid since we are deep into "bug fixes only" mode at this
point.
I'm open to suggestions, otherwise I can apply these to netdev#upstream
(queued for 2.6.24).
Jeff
^ permalink raw reply
* Re: Please pull 'upstream-jgarzik' branch of wireless-2.6
From: Jeff Garzik @ 2007-08-07 22:21 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, netdev
In-Reply-To: <20070806201649.GK6442@tuxdriver.com>
John W. Linville wrote:
> These are intended for 2.6.24...
>
> ---
>
> The following changes since commit fdc8f43b5e49b64b251bb48da95193a13ac0132f:
> Michael Buesch (1):
> softmac: Fix deadlock of wx_set_essid with assoc work
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git upstream-jgarzik
>
> Bill Nottingham (1):
> remove gratuitous space in airo module description
>
> Faidon Liambotis (2):
> Kconfig: order options
> Kconfig: remove references of pcmcia-cs
>
> Mariusz Kozlowski (1):
> drivers/net/wireless/prism54/oid_mgt.c: kmalloc + memset conversion to kzalloc
>
> Matthias Kaehlcke (1):
> Use mutex instead of semaphore in the Host AP driver
>
> Ulrich Kunitz (1):
> zd1211rw: monitor all packets
>
> Yoann Padioleau (1):
> dev->priv to netdev_priv(dev), for drivers/net/wireless
>
> drivers/net/wireless/Kconfig | 85 +++++++++++----------------
> drivers/net/wireless/airo.c | 4 +-
> drivers/net/wireless/arlan-proc.c | 14 ++--
> drivers/net/wireless/hostap/hostap_cs.c | 2 +-
> drivers/net/wireless/hostap/hostap_hw.c | 16 +++---
> drivers/net/wireless/hostap/hostap_ioctl.c | 14 ++--
> drivers/net/wireless/hostap/hostap_wlan.h | 3 +-
> drivers/net/wireless/orinoco_tmd.c | 2 +-
> drivers/net/wireless/prism54/isl_ioctl.c | 6 +-
> drivers/net/wireless/prism54/oid_mgt.c | 4 +-
> drivers/net/wireless/ray_cs.c | 66 +++++++++++-----------
> drivers/net/wireless/strip.c | 2 +-
> drivers/net/wireless/wl3501_cs.c | 66 +++++++++++-----------
> drivers/net/wireless/zd1211rw/zd_chip.h | 5 --
> drivers/net/wireless/zd1211rw/zd_mac.c | 44 ++++++++++++--
> 15 files changed, 172 insertions(+), 161 deletions(-)
pulled into #upstream
^ permalink raw reply
* Re: [RFC][BNX2X]: New driver for Broadcom 10Gb Ethernet.
From: Michael Buesch @ 2007-08-07 22:20 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Michael Chan, davem, netdev, eliezert, lusinsky, eilong
In-Reply-To: <46B8EF13.40109@garzik.org>
On Wednesday 08 August 2007 00:15:47 Jeff Garzik wrote:
> Michael Buesch wrote:
> > On Wednesday 01 August 2007 10:31:17 Michael Chan wrote:
> >> +static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance)
> >> +{
> >> + struct net_device *dev = dev_instance;
> >
> > You need to check if dev==NULL and bail out.
> > Another driver sharing the IRQ with this might choose to pass the dev
> > pointer as NULL.
>
> NAK that advice: It is pointless having such a check in the hottest of
> driver hot paths, since a large majority of drivers do not have such a
> check.
>
> It is better to fix the extremely rare oddball that passes NULL to
> request_irq(), than to update all drivers to be slower due to the oddballs.
Ah, well. IMO one should better go safe than Oops. ;)
It's not that an if branch takes more than 2 or 3 CPU cycles at worst.
But well, if you don't like it, I can live without it, too.
--
Greetings Michael.
^ permalink raw reply
* Re: Please pull 'libertas-upstream' branch of wireless-2.6
From: Jeff Garzik @ 2007-08-07 22:22 UTC (permalink / raw)
To: John W. Linville
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20070806203005.GL6442-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
John W. Linville wrote:
> Got a big patch bomb from the libertas guys. I tried to cherry-pick
> some of the fixes for 2.6.23, but they either were fixes to problems
> in new code or all the code cleanups made them difficult for me to
> intelligently backport.
>
> So, this is intended for 2.6.24...
>
> ---
>
> The following changes since commit d4ac2477fad0f2680e84ec12e387ce67682c5c13:
> Linus Torvalds (1):
> Linux 2.6.23-rc2
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git libertas-upstream
This is missing the patch. I looked at it locally, but please do send a
patch for review with each push, no matter how big.
pulled into #upstream
^ permalink raw reply
* Re: [PATCH] xen-netfront: remove dead code
From: Jeff Garzik @ 2007-08-07 22:25 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Linus Torvalds, Linux Kernel Mailing List, NetDev, Adrian Bunk,
Michal Piotrowski
In-Reply-To: <46B8EA9A.5020704@goop.org>
Jeremy Fitzhardinge wrote:
> This patch removes some residual dead code left over from removing the
> "flip" receive mode. This patch doesn't change the generated output
> at all, since gcc already realized it was dead.
>
> This resolves the "regression" reported by Adrian.
>
> Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
> Cc: Adrian Bunk <bunk@stusta.de>
> Cc: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
>
> ---
> drivers/net/xen-netfront.c | 37 ++-----------------------------------
> 1 file changed, 2 insertions(+), 35 deletions(-)
Please send drivers/net/* through me and netdev...
Jeff
^ permalink raw reply
* Re: [PATCH RFC]: napi_struct V5
From: Roland Dreier @ 2007-08-07 22:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev, shemminger, jgarzik, hadi, rusty
In-Reply-To: <20070805.232423.21363072.davem@davemloft.net>
Thanks for looking at ipoib... overall looks fine, just a few comments.
> --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
> +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
> @@ -281,63 +281,58 @@ static void ipoib_ib_handle_tx_wc(struct net_device *dev, struct ib_wc *wc)
> wc->status, wr_id, wc->vendor_err);
> }
>
> -int ipoib_poll(struct net_device *dev, int *budget)
> +int ipoib_poll(struct napi_struct *napi, int budget)
> +poll_more:
> + while (done < budget) {
> + int max = (budget - done);
> +
> t = min(IPOIB_NUM_WC, max);
I think this is the only place where max is used now. Might as well
kill it and put budget-done in directly. That would get rid of the
strange-looking parens in the "max =" line too.
> n = ib_poll_cq(priv->cq, t, priv->ibwc);
>
> - for (i = 0; i < n; ++i) {
> + for (i = 0; i < n; i++) {
it might be nicer to avoid noise like this in the patch.
> + if (done < budget) {
> + netif_rx_complete(dev, napi);
> if (unlikely(ib_req_notify_cq(priv->cq,
> IB_CQ_NEXT_COMP |
> IB_CQ_REPORT_MISSED_EVENTS)) &&
> - netif_rx_reschedule(dev, 0))
> - return 1;
> -
> - return 0;
> + netif_rx_reschedule(napi))
> + goto poll_more;
this goto back to the polling loop is a change in behavior. When we
were tuning NAPI, we found that returning in the missed event case and
letting the NAPI core call the poll routine later actually performed
better, because it allowed more work to pile up.
So could the code just look like:
netif_rx_complete(dev, napi);
if (unlikely(ib_req_notify_cq(priv->cq,
IB_CQ_NEXT_COMP |
IB_CQ_REPORT_MISSED_EVENTS)))
netif_rx_reschedule(napi);
and then just return done in all cases?
It doesn't seem like the return value of netif_rx_reschedule() matters
in what we would want to do. The only thing it's used for in the old
code is to decide what the poll routine should return.
- R.
^ permalink raw reply
* Re: [PATCH] xen-netfront: remove dead code
From: Jeremy Fitzhardinge @ 2007-08-07 22:37 UTC (permalink / raw)
To: Jeff Garzik
Cc: Linus Torvalds, Linux Kernel Mailing List, NetDev, Adrian Bunk,
Michal Piotrowski
In-Reply-To: <46B8F149.3090706@garzik.org>
Jeff Garzik wrote:
> Please send drivers/net/* through me and netdev...
Sure. Did you pick this patch up?
Thanks,
J
^ permalink raw reply
* RE: [PATCH 2.6.23 1/3]S2IO: Making MSIX as default intr_type
From: Ramkrishna Vepa @ 2007-08-07 22:59 UTC (permalink / raw)
To: Jeff Garzik, Sivakumar Subramani; +Cc: netdev, support
In-Reply-To: <46B8F01B.1080308@garzik.org>
Jeff,
Go ahead and apply these patches to netdev#upstream (queued for 2.6.24).
Thanks,
Ram
> -----Original Message-----
> From: Jeff Garzik [mailto:jeff@garzik.org]
> Sent: Tuesday, August 07, 2007 3:20 PM
> To: Sivakumar Subramani
> Cc: netdev@vger.kernel.org; support
> Subject: Re: [PATCH 2.6.23 1/3]S2IO: Making MSIX as default intr_type
>
> Sivakumar Subramani wrote:
> > - Making MSIX as default intr_type
> > - Driver will test MSI-X by issuing test MSI-X vector and if fails
it
> will
> > fallback to INTA
> >
> > Signed-off-by: Sivakumar Subramani
<sivakumar.subramani@neterion.com>
> > Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
>
> This patch series looks a bit big to apply this far past the merge
> window. It changes behavior in the middle of a -rc stream, which is
> something to avoid since we are deep into "bug fixes only" mode at
this
> point.
>
> I'm open to suggestions, otherwise I can apply these to
netdev#upstream
> (queued for 2.6.24).
>
> Jeff
>
^ permalink raw reply
* Re: [RFC][BNX2X]: New driver for Broadcom 10Gb Ethernet.
From: Roland Dreier @ 2007-08-07 23:04 UTC (permalink / raw)
To: Michael Buesch
Cc: Michael Chan, davem, jeff, netdev, eliezert, lusinsky, eilong
In-Reply-To: <200708020006.13457.mb@bu3sch.de>
> > +static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance)
> > +{
> > + struct net_device *dev = dev_instance;
>
> You need to check if dev==NULL and bail out.
> Another driver sharing the IRQ with this might choose to pass the dev
> pointer as NULL.
I don't really understand this. If another driver is sharing the IRQ
with a different device pointer (or even NULL), then that driver's
handler is the one that would be called. It's certainly the case that
an interrupt handler can be called for a shared interrupt generated by
another device, but a driver will never get a cookie back into its
interrupt handler different than the one it passed to request_irq().
A NULL check couldn't really help anything -- because if one driver's
dev_id can get passed into another driver's interrupt handler, the
non-NULL case would be even worse, because you would have one driver
poking into another driver's data structure. But fortunately the
kernel is smart enough not to create this mess.
(And also, MSI-X interrupts are never shared so this is doubly
irrelevant in this particular case)
- R.
^ permalink raw reply
* Re: [RFC][BNX2X]: New driver for Broadcom 10Gb Ethernet.
From: Christoph Hellwig @ 2007-08-07 23:04 UTC (permalink / raw)
To: Michael Buesch
Cc: Jeff Garzik, Michael Chan, davem, netdev, eliezert, lusinsky,
eilong
In-Reply-To: <200708080020.35701.mb@bu3sch.de>
On Wed, Aug 08, 2007 at 12:20:35AM +0200, Michael Buesch wrote:
> On Wednesday 08 August 2007 00:15:47 Jeff Garzik wrote:
> > Michael Buesch wrote:
> > > On Wednesday 01 August 2007 10:31:17 Michael Chan wrote:
> > >> +static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance)
> > >> +{
> > >> + struct net_device *dev = dev_instance;
> > >
> > > You need to check if dev==NULL and bail out.
> > > Another driver sharing the IRQ with this might choose to pass the dev
> > > pointer as NULL.
> >
> > NAK that advice: It is pointless having such a check in the hottest of
> > driver hot paths, since a large majority of drivers do not have such a
> > check.
> >
> > It is better to fix the extremely rare oddball that passes NULL to
> > request_irq(), than to update all drivers to be slower due to the oddballs.
>
> Ah, well. IMO one should better go safe than Oops. ;)
> It's not that an if branch takes more than 2 or 3 CPU cycles at worst.
> But well, if you don't like it, I can live without it, too.
Please take a look at kernel/irq/handle.c. The irq handler is
always called with the right dev_id argument. Everything would be a complete
nightmare to handle because you usually need to access the device private
data to check whether the shared irq is for this device.
^ permalink raw reply
* Re: [PATCH RFC]: napi_struct V5
From: David Miller @ 2007-08-07 23:06 UTC (permalink / raw)
To: rdreier; +Cc: netdev, shemminger, jgarzik, hadi, rusty
In-Reply-To: <adasl6vq8d1.fsf@cisco.com>
From: Roland Dreier <rdreier@cisco.com>
Date: Tue, 07 Aug 2007 15:37:30 -0700
> > n = ib_poll_cq(priv->cq, t, priv->ibwc);
> >
> > - for (i = 0; i < n; ++i) {
> > + for (i = 0; i < n; i++) {
>
> it might be nicer to avoid noise like this in the patch.
That one was just too much of an eye sore to ignore and it
effect my ability to audit the change I was making.
I mean, this is one of the first precise examples of kinds of
programming that lead to subtle bugs mentioned in The Practice of
Programming.
So this is staying in the patch, sorry.
> this goto back to the polling loop is a change in behavior. When we
> were tuning NAPI, we found that returning in the missed event case and
> letting the NAPI core call the poll routine later actually performed
> better, because it allowed more work to pile up.
You weren't using your quantum, which is what you're supposed to do.
Sometimes using your quantum correctly won't perform optimally, but in
the interest of fairness and what NAPI wants, that is what you're
supposed to do, process work until you hit budget or there is no
more work.
Look, I'm not going to back down to every single tweak in every
driver. All the drivers should handle this case consistently, and if
I have to edit every single driver to make this patch that is exactly
what I am going to do and enforce.
If you patch the ipoib driver behavior back afterwards, I will NAK
that patch every single time unless you make EVERY SINGLE OTHER DRIVER
do the same and thus retain the consistency.
^ permalink raw reply
* Re: [RFC][BNX2X]: New driver for Broadcom 10Gb Ethernet.
From: David Miller @ 2007-08-07 23:08 UTC (permalink / raw)
To: hch; +Cc: mb, jeff, mchan, netdev, eliezert, lusinsky, eilong
In-Reply-To: <20070807230458.GA9883@infradead.org>
From: Christoph Hellwig <hch@infradead.org>
Date: Wed, 8 Aug 2007 00:04:59 +0100
> Please take a look at kernel/irq/handle.c. The irq handler is
> always called with the right dev_id argument. Everything would be a complete
> nightmare to handle because you usually need to access the device private
> data to check whether the shared irq is for this device.
Absolutely.
I can't believe we're even discussing something so obvious and
wasting everyone's time.
^ permalink raw reply
* Re: [PATCH] SMSC LAN911x and LAN921x vendor driver
From: Peter Korsgaard @ 2007-08-07 23:09 UTC (permalink / raw)
To: Steve.Glendinning
Cc: Bahadir Balban, Bill Gatliff, Dustin Mcintire, ian.saturley,
netdev
In-Reply-To: <87hcnioppf.fsf@p4.be.48ers.dk>
>>>>> "Peter" == Peter Korsgaard <jacmet@sunsite.dk> writes:
Hi,
Peter> I'll give your driver a try and report back.
Ok, the driver seems to be working (after fixing up the accessor
routines for my hw setup) and performance is comparable to Dustin's
driver.
It would be nice if the driver would enable the byte swapping support
in the hw if it detects the wrong endian - Like this:
Index: linux/drivers/net/smsc911x.c
===================================================================
--- linux.orig/drivers/net/smsc911x.c
+++ linux/drivers/net/smsc911x.c
@@ -1787,6 +1787,13 @@
return -ENODEV;
}
+ /* check endian */
+ if (smsc911x_reg_read(pdata, BYTE_TEST) == 0x43218765) {
+ SMSC_TRACE("Byte test looks swapped, inverting");
+ smsc911x_reg_write(~smsc911x_reg_read(pdata, ENDIAN),
+ pdata, ENDIAN);
+ }
+
/* Default generation to zero (all workarounds apply) */
pdata->generation = 0;
--
Bye, Peter Korsgaard
^ permalink raw reply
* [ofa-general] [PATCH 0/14] nes: NetEffect 10Gb RNIC Driver
From: ggrundstrom @ 2007-08-08 0:22 UTC (permalink / raw)
To: rdreier; +Cc: netdev, ewg, general
NetEffect is proud to announce the following series of patches which contain the source code for the NE020 10Gb RNIC adapter. The driver is split into two components - a kernel driver module and a userspace library.
The code can also be found in the following git trees.
git.openfabrics.org/~glenn/libnes.git
git.openfabrics.org/~glenn/ofed_1_2.git
git.openfabrics.org/~glenn/ofascripts.git
git.openfabrics.org/~glenn/ofed_1_2_scripts.git
Requirements
============
* NE020 hardware
* RHEL4u4 or FC5
* OFED 1.2 GA
* OFED 1.2 version of MVAPICH2
Known issues
============
* DAPL only works with 1 process per node due to lack of loopback
* MPI over DAPL must use MPI shared memory loopback
Plans for next release
======================
* Plan on adding verbs loopback to enable DAPL loopback
* Increase robustness and stability
What we tested
==============
The performance results are meant to be broadly representative.
Results can vary depending on switches used, system configuration, OS used, etc.
Configuration notes:
All two node tests were performed back-to-back i.e. no switch Multinode
testing was performed using a high performance, low latency cut-through switch.
Platform: CentOS x86_64
1. cbench rotate latency and bandwidth using mvapich2 over OFA verbs:
Rotate Latency: 6.67 us
Rotate Bandwidth: 9.3 Gpbs
2. OSU bandwidth and latency tests using mvapich2 over OFA verbs:
OSU Latency: 6.74 us
OSU Bi-Bandwidth: 14.4 Gbps
3. Perftest (rdma_bw Uni-dir/Bi-dir and rdma_lat)
RDMA Bandwidth Uni-directional: 8.9 Gpbs
RDMA Bandwidth Bi-directional : 15.09 Gpbs
RDMA Latency : 5.95 us
4. NIC Testing
Iperf 4 stream Bi-directional test
Iperf -c <Srvr IP Addr> -d -M -N -i 4 -P 4 (Jumbo packets enabled) --> 10.76 Gbps
NetPerf
netperf -H <Srvr IP Addr> -T1,1 -t TCP_STREAM -l 60 -C -c (Jumbo packets enabled) --> 6.2 Gbps
Thanks,
Glenn.
^ permalink raw reply
* [git patches] net driver fixes
From: Jeff Garzik @ 2007-08-08 0:38 UTC (permalink / raw)
To: Andrew Morton, Linus Torvalds; +Cc: netdev, LKML
Please pull from 'upstream-linus' branch of
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git upstream-linus
to receive the following updates:
drivers/net/atl1/atl1_main.c | 4 +--
drivers/net/ehea/ehea.h | 2 +-
drivers/net/ehea/ehea_main.c | 44 ++++++++++----------------
drivers/net/ibmveth.c | 27 +++++++++-------
drivers/net/ibmveth.h | 3 --
drivers/net/phy/phy.c | 4 +-
drivers/net/r8169.c | 24 ++++++++++-----
drivers/net/sis190.c | 3 ++
drivers/net/smc91x.h | 4 +--
drivers/net/ucc_geth_ethtool.c | 1 -
drivers/net/ucc_geth_mii.c | 3 +-
drivers/net/wireless/bcm43xx/bcm43xx_phy.c | 2 +-
drivers/net/wireless/rtl8187_dev.c | 2 +-
drivers/net/wireless/zd1211rw/zd_mac.c | 2 +-
fs/compat_ioctl.c | 3 --
net/ieee80211/softmac/ieee80211softmac_wx.c | 11 +++++--
16 files changed, 69 insertions(+), 70 deletions(-)
Brian King (1):
ibmveth: Fix rx pool deactivate oops
Domen Puncer (2):
ucc_geth: fix section mismatch
phy layer: fix phy_mii_ioctl for autonegotiation
Francois Romieu (1):
r8169: avoid needless NAPI poll scheduling
Ingo Molnar (1):
atl1: use spin_trylock_irqsave()
Jan Altenberg (1):
ucc_geth: remove get_perm_addr from ucc_geth_ethtool.c
John W. Linville (1):
Revert "[PATCH] bcm43xx: Fix deviation from specifications in set_baseband_attenuation"
Mariusz Kozlowski (1):
drivers/net/ibmveth.c: memset fix
Masakazu Mokuno (1):
remove duplicated ioctl entries in compat_ioctl.c
Michael Buesch (1):
softmac: Fix deadlock of wx_set_essid with assoc work
Michael Wu (1):
rtl8187: ensure priv->hwaddr is always valid
Neil Muller (1):
sis190 check for ISA bridge on SiS966
Paul Mundt (1):
net: smc91x: Build fixes for general sh boards.
Roger So (1):
r8169: PHY power-on fix
Thomas Klein (3):
ehea: Fix workqueue handling
ehea: Simplify resource usage check
ehea: Eliminated some compiler warnings
Ulrich Kunitz (1):
zd1211rw: fix filter for PSPOLL frames
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c
index 56f6389..3c1984e 100644
--- a/drivers/net/atl1/atl1_main.c
+++ b/drivers/net/atl1/atl1_main.c
@@ -1704,10 +1704,8 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
}
}
- local_irq_save(flags);
- if (!spin_trylock(&adapter->lock)) {
+ if (!spin_trylock_irqsave(&adapter->lock, flags)) {
/* Can't get lock - tell upper layer to requeue */
- local_irq_restore(flags);
dev_printk(KERN_DEBUG, &adapter->pdev->dev, "tx locked\n");
return NETDEV_TX_LOCKED;
}
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 8ee2c2c..d67f97b 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -39,7 +39,7 @@
#include <asm/io.h>
#define DRV_NAME "ehea"
-#define DRV_VERSION "EHEA_0072"
+#define DRV_VERSION "EHEA_0073"
/* eHEA capability flags */
#define DLPAR_PORT_ADD_REM 1
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 58702f5..9756211 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -1326,7 +1326,6 @@ static void write_swqe2_TSO(struct sk_buff *skb,
u8 *imm_data = &swqe->u.immdata_desc.immediate_data[0];
int skb_data_size = skb->len - skb->data_len;
int headersize;
- u64 tmp_addr;
/* Packet is TCP with TSO enabled */
swqe->tx_control |= EHEA_SWQE_TSO;
@@ -1347,9 +1346,8 @@ static void write_swqe2_TSO(struct sk_buff *skb,
/* set sg1entry data */
sg1entry->l_key = lkey;
sg1entry->len = skb_data_size - headersize;
-
- tmp_addr = (u64)(skb->data + headersize);
- sg1entry->vaddr = ehea_map_vaddr(tmp_addr);
+ sg1entry->vaddr =
+ ehea_map_vaddr(skb->data + headersize);
swqe->descriptors++;
}
} else
@@ -1362,7 +1360,6 @@ static void write_swqe2_nonTSO(struct sk_buff *skb,
int skb_data_size = skb->len - skb->data_len;
u8 *imm_data = &swqe->u.immdata_desc.immediate_data[0];
struct ehea_vsgentry *sg1entry = &swqe->u.immdata_desc.sg_entry;
- u64 tmp_addr;
/* Packet is any nonTSO type
*
@@ -1379,8 +1376,8 @@ static void write_swqe2_nonTSO(struct sk_buff *skb,
/* copy sg1entry data */
sg1entry->l_key = lkey;
sg1entry->len = skb_data_size - SWQE2_MAX_IMM;
- tmp_addr = (u64)(skb->data + SWQE2_MAX_IMM);
- sg1entry->vaddr = ehea_map_vaddr(tmp_addr);
+ sg1entry->vaddr =
+ ehea_map_vaddr(skb->data + SWQE2_MAX_IMM);
swqe->descriptors++;
}
} else {
@@ -1395,7 +1392,6 @@ static inline void write_swqe2_data(struct sk_buff *skb, struct net_device *dev,
struct ehea_vsgentry *sg_list, *sg1entry, *sgentry;
skb_frag_t *frag;
int nfrags, sg1entry_contains_frag_data, i;
- u64 tmp_addr;
nfrags = skb_shinfo(skb)->nr_frags;
sg1entry = &swqe->u.immdata_desc.sg_entry;
@@ -1417,9 +1413,9 @@ static inline void write_swqe2_data(struct sk_buff *skb, struct net_device *dev,
/* copy sg1entry data */
sg1entry->l_key = lkey;
sg1entry->len = frag->size;
- tmp_addr = (u64)(page_address(frag->page)
- + frag->page_offset);
- sg1entry->vaddr = ehea_map_vaddr(tmp_addr);
+ sg1entry->vaddr =
+ ehea_map_vaddr(page_address(frag->page)
+ + frag->page_offset);
swqe->descriptors++;
sg1entry_contains_frag_data = 1;
}
@@ -1431,10 +1427,9 @@ static inline void write_swqe2_data(struct sk_buff *skb, struct net_device *dev,
sgentry->l_key = lkey;
sgentry->len = frag->size;
-
- tmp_addr = (u64)(page_address(frag->page)
- + frag->page_offset);
- sgentry->vaddr = ehea_map_vaddr(tmp_addr);
+ sgentry->vaddr =
+ ehea_map_vaddr(page_address(frag->page)
+ + frag->page_offset);
swqe->descriptors++;
}
}
@@ -2165,24 +2160,18 @@ static int ehea_clean_all_portres(struct ehea_port *port)
return ret;
}
-static void ehea_remove_adapter_mr (struct ehea_adapter *adapter)
+static void ehea_remove_adapter_mr(struct ehea_adapter *adapter)
{
- int i;
-
- for (i=0; i < EHEA_MAX_PORTS; i++)
- if (adapter->port[i])
- return;
+ if (adapter->active_ports)
+ return;
ehea_rem_mr(&adapter->mr);
}
-static int ehea_add_adapter_mr (struct ehea_adapter *adapter)
+static int ehea_add_adapter_mr(struct ehea_adapter *adapter)
{
- int i;
-
- for (i=0; i < EHEA_MAX_PORTS; i++)
- if (adapter->port[i])
- return 0;
+ if (adapter->active_ports)
+ return 0;
return ehea_reg_kernel_mr(adapter, &adapter->mr);
}
@@ -3099,6 +3088,7 @@ out:
static void __exit ehea_module_exit(void)
{
+ destroy_workqueue(ehea_driver_wq);
driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities);
ibmebus_unregister_driver(&ehea_driver);
ehea_destroy_busmap();
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index d96eb72..acba90f 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -963,7 +963,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
{
int rc, i;
struct net_device *netdev;
- struct ibmveth_adapter *adapter = NULL;
+ struct ibmveth_adapter *adapter;
unsigned char *mac_addr_p;
unsigned int *mcastFilterSize_p;
@@ -997,7 +997,6 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
SET_MODULE_OWNER(netdev);
adapter = netdev->priv;
- memset(adapter, 0, sizeof(adapter));
dev->dev.driver_data = netdev;
adapter->vdev = dev;
@@ -1280,24 +1279,28 @@ const char * buf, size_t count)
int i;
/* Make sure there is a buffer pool with buffers that
can hold a packet of the size of the MTU */
- for(i = 0; i<IbmVethNumBufferPools; i++) {
+ for (i = 0; i < IbmVethNumBufferPools; i++) {
if (pool == &adapter->rx_buff_pool[i])
continue;
if (!adapter->rx_buff_pool[i].active)
continue;
- if (mtu < adapter->rx_buff_pool[i].buff_size) {
- pool->active = 0;
- h_free_logical_lan_buffer(adapter->
- vdev->
- unit_address,
- pool->
- buff_size);
- }
+ if (mtu <= adapter->rx_buff_pool[i].buff_size)
+ break;
}
- if (pool->active) {
+
+ if (i == IbmVethNumBufferPools) {
ibmveth_error_printk("no active pool >= MTU\n");
return -EPERM;
}
+
+ pool->active = 0;
+ if (netif_running(netdev)) {
+ adapter->pool_config = 1;
+ ibmveth_close(netdev);
+ adapter->pool_config = 0;
+ if ((rc = ibmveth_open(netdev)))
+ return rc;
+ }
}
} else if (attr == &veth_num_attr) {
if (value <= 0 || value > IBMVETH_MAX_POOL_COUNT)
diff --git a/drivers/net/ibmveth.h b/drivers/net/ibmveth.h
index bb69cca..72cc15a 100644
--- a/drivers/net/ibmveth.h
+++ b/drivers/net/ibmveth.h
@@ -73,9 +73,6 @@ static inline long h_send_logical_lan(unsigned long unit_address,
#define h_change_logical_lan_mac(ua, mac) \
plpar_hcall_norets(H_CHANGE_LOGICAL_LAN_MAC, ua, mac)
-#define h_free_logical_lan_buffer(ua, bufsize) \
- plpar_hcall_norets(H_FREE_LOGICAL_LAN_BUFFER, ua, bufsize)
-
#define IbmVethNumBufferPools 5
#define IBMVETH_BUFF_OH 22 /* Overhead: 14 ethernet header + 8 opaque handle */
#define IBMVETH_MAX_MTU 68
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index f71dab3..e323efd 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -261,7 +261,7 @@ void phy_sanitize_settings(struct phy_device *phydev)
/* Sanitize settings based on PHY capabilities */
if ((features & SUPPORTED_Autoneg) == 0)
- phydev->autoneg = 0;
+ phydev->autoneg = AUTONEG_DISABLE;
idx = phy_find_valid(phy_find_setting(phydev->speed, phydev->duplex),
features);
@@ -374,7 +374,7 @@ int phy_mii_ioctl(struct phy_device *phydev,
if (mii_data->phy_id == phydev->addr) {
switch(mii_data->reg_num) {
case MII_BMCR:
- if (val & (BMCR_RESET|BMCR_ANENABLE))
+ if ((val & (BMCR_RESET|BMCR_ANENABLE)) == 0)
phydev->autoneg = AUTONEG_DISABLE;
else
phydev->autoneg = AUTONEG_ENABLE;
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index c9333b9..b85ab4a 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -725,6 +725,12 @@ static int rtl8169_set_speed_xmii(struct net_device *dev,
auto_nego |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
+ if (tp->mac_version == RTL_GIGA_MAC_VER_12) {
+ /* Vendor specific (0x1f) and reserved (0x0e) MII registers. */
+ mdio_write(ioaddr, 0x1f, 0x0000);
+ mdio_write(ioaddr, 0x0e, 0x0000);
+ }
+
tp->phy_auto_nego_reg = auto_nego;
tp->phy_1000_ctrl_reg = giga_ctrl;
@@ -2760,14 +2766,16 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
rtl8169_check_link_status(dev, tp, ioaddr);
#ifdef CONFIG_R8169_NAPI
- RTL_W16(IntrMask, tp->intr_event & ~tp->napi_event);
- tp->intr_mask = ~tp->napi_event;
-
- if (likely(netif_rx_schedule_prep(dev)))
- __netif_rx_schedule(dev);
- else if (netif_msg_intr(tp)) {
- printk(KERN_INFO "%s: interrupt %04x taken in poll\n",
- dev->name, status);
+ if (status & tp->napi_event) {
+ RTL_W16(IntrMask, tp->intr_event & ~tp->napi_event);
+ tp->intr_mask = ~tp->napi_event;
+
+ if (likely(netif_rx_schedule_prep(dev)))
+ __netif_rx_schedule(dev);
+ else if (netif_msg_intr(tp)) {
+ printk(KERN_INFO "%s: interrupt %04x in poll\n",
+ dev->name, status);
+ }
}
break;
#else
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index ec2ad9f..d470b19 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -1593,6 +1593,9 @@ static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
pci_name(pdev));
isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0965, NULL);
+ if (!isa_bridge)
+ isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0966, NULL);
+
if (!isa_bridge) {
net_probe(tp, KERN_INFO "%s: Can not find ISA bridge.\n",
pci_name(pdev));
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h
index f842944..6ff3a16 100644
--- a/drivers/net/smc91x.h
+++ b/drivers/net/smc91x.h
@@ -299,7 +299,7 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
#define SMC_CAN_USE_8BIT 1
#define SMC_CAN_USE_16BIT 1
-#define SMC_CAN_USE_32BIT 1
+#define SMC_CAN_USE_32BIT 0
#define SMC_inb(a, r) inb((a) + (r))
#define SMC_inw(a, r) inw((a) + (r))
@@ -310,8 +310,6 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
#endif /* BOARDS */
-#define set_irq_type(irq, type) do {} while (0)
-
#elif defined(CONFIG_M32R)
#define SMC_CAN_USE_8BIT 0
diff --git a/drivers/net/ucc_geth_ethtool.c b/drivers/net/ucc_geth_ethtool.c
index a8994c7..64bef7c 100644
--- a/drivers/net/ucc_geth_ethtool.c
+++ b/drivers/net/ucc_geth_ethtool.c
@@ -379,7 +379,6 @@ static const struct ethtool_ops uec_ethtool_ops = {
.get_stats_count = uec_get_stats_count,
.get_strings = uec_get_strings,
.get_ethtool_stats = uec_get_ethtool_stats,
- .get_perm_addr = ethtool_op_get_perm_addr,
};
void uec_set_ethtool_ops(struct net_device *netdev)
diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c
index 5f8c2d3..6c257b8 100644
--- a/drivers/net/ucc_geth_mii.c
+++ b/drivers/net/ucc_geth_mii.c
@@ -272,7 +272,8 @@ int __init uec_mdio_init(void)
return of_register_platform_driver(&uec_mdio_driver);
}
-void __exit uec_mdio_exit(void)
+/* called from __init ucc_geth_init, therefore can not be __exit */
+void uec_mdio_exit(void)
{
of_unregister_platform_driver(&uec_mdio_driver);
}
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
index d779199..b37f1e3 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
@@ -1638,7 +1638,7 @@ void bcm43xx_phy_set_baseband_attenuation(struct bcm43xx_private *bcm,
return;
}
- if (phy->analog == 1) {
+ if (phy->analog > 1) {
value = bcm43xx_phy_read(bcm, 0x0060) & ~0x003C;
value |= (baseband_attenuation << 2) & 0x003C;
} else {
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c
index cea8589..e61c6d5 100644
--- a/drivers/net/wireless/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl8187_dev.c
@@ -466,7 +466,7 @@ static int rtl8187_add_interface(struct ieee80211_hw *dev,
return -EOPNOTSUPP;
}
- priv->hwaddr = conf->mac_addr;
+ priv->hwaddr = conf->mac_addr ? conf->mac_addr : dev->wiphy->perm_addr;
return 0;
}
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index f6c487a..26869d1 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -822,7 +822,7 @@ static void cs_set_control(struct zd_mac *mac, struct zd_ctrlset *cs,
cs->control |= ZD_CS_MULTICAST;
/* PS-POLL */
- if (stype == IEEE80211_STYPE_PSPOLL)
+ if (ftype == IEEE80211_FTYPE_CTL && stype == IEEE80211_STYPE_PSPOLL)
cs->control |= ZD_CS_PS_POLL_FRAME;
/* Unicast data frames over the threshold should have RTS */
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 2bc1428..a6c9078 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -3161,12 +3161,9 @@ COMPATIBLE_IOCTL(SIOCSIWSENS)
COMPATIBLE_IOCTL(SIOCGIWSENS)
COMPATIBLE_IOCTL(SIOCSIWRANGE)
COMPATIBLE_IOCTL(SIOCSIWPRIV)
-COMPATIBLE_IOCTL(SIOCGIWPRIV)
COMPATIBLE_IOCTL(SIOCSIWSTATS)
-COMPATIBLE_IOCTL(SIOCGIWSTATS)
COMPATIBLE_IOCTL(SIOCSIWAP)
COMPATIBLE_IOCTL(SIOCGIWAP)
-COMPATIBLE_IOCTL(SIOCSIWSCAN)
COMPATIBLE_IOCTL(SIOCSIWRATE)
COMPATIBLE_IOCTL(SIOCGIWRATE)
COMPATIBLE_IOCTL(SIOCSIWRTS)
diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c
index f13937b..d054e92 100644
--- a/net/ieee80211/softmac/ieee80211softmac_wx.c
+++ b/net/ieee80211/softmac/ieee80211softmac_wx.c
@@ -74,8 +74,8 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev,
struct ieee80211softmac_auth_queue_item *authptr;
int length = 0;
+check_assoc_again:
mutex_lock(&sm->associnfo.mutex);
-
/* Check if we're already associating to this or another network
* If it's another network, cancel and start over with our new network
* If it's our network, ignore the change, we're already doing it!
@@ -98,13 +98,18 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev,
cancel_delayed_work(&authptr->work);
sm->associnfo.bssvalid = 0;
sm->associnfo.bssfixed = 0;
- flush_scheduled_work();
sm->associnfo.associating = 0;
sm->associnfo.associated = 0;
+ /* We must unlock to avoid deadlocks with the assoc workqueue
+ * on the associnfo.mutex */
+ mutex_unlock(&sm->associnfo.mutex);
+ flush_scheduled_work();
+ /* Avoid race! Check assoc status again. Maybe someone started an
+ * association while we flushed. */
+ goto check_assoc_again;
}
}
-
sm->associnfo.static_essid = 0;
sm->associnfo.assoc_wait = 0;
^ permalink raw reply related
* Re: [PATCH] xen-netfront: remove dead code
From: Jeff Garzik @ 2007-08-08 0:46 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Linus Torvalds, Linux Kernel Mailing List, NetDev, Adrian Bunk,
Michal Piotrowski
In-Reply-To: <46B8F433.8040708@goop.org>
Jeremy Fitzhardinge wrote:
> Jeff Garzik wrote:
>> Please send drivers/net/* through me and netdev...
>
> Sure. Did you pick this patch up?
Yes. It's in my pending-for-2.6.24 folder, since it's not a bug fix.
Jeff
^ permalink raw reply
* Re: [PATCH] xen-netfront: remove dead code
From: Jeremy Fitzhardinge @ 2007-08-08 0:45 UTC (permalink / raw)
To: Jeff Garzik
Cc: Linus Torvalds, Linux Kernel Mailing List, NetDev, Adrian Bunk,
Michal Piotrowski
In-Reply-To: <46B91248.10700@garzik.org>
Jeff Garzik wrote:
> Yes. It's in my pending-for-2.6.24 folder, since it's not a bug fix.
Great, thanks.
J
^ permalink raw reply
* [PATCH 2/14] nes: device structures and defines
From: ggrundstrom @ 2007-08-08 0:45 UTC (permalink / raw)
To: rdreier; +Cc: ewg, ggrundstrom, netdev
Main include file for device structures and defines
Signed-off-by: Glenn Grundstrom <ggrundstrom@neteffect.com>
---
diff -Nurp NULL ofa_kernel-1.2/drivers/infiniband/hw/nes/nes.h
--- NULL 1969-12-31 18:00:00.000000000 -0600
+++ ofa_kernel-1.2/drivers/infiniband/hw/nes/nes.h 2007-08-06 20:09:04.000000000 -0500
@@ -0,0 +1,525 @@
+/*
+ * Copyright (c) 2006 - 2007 NetEffect, Inc. All rights reserved.
+ * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef __NES_H
+#define __NES_H
+
+#include <linux/netdevice.h>
+#include <linux/inetdevice.h>
+#include <linux/spinlock.h>
+#include <linux/kernel.h>
+#include <linux/delay.h>
+#include <linux/pci.h>
+#include <linux/dma-mapping.h>
+#include <linux/workqueue.h>
+#include <linux/slab.h>
+#include <asm/semaphore.h>
+#include <linux/version.h>
+
+#include <rdma/ib_smi.h>
+#include <rdma/ib_verbs.h>
+#include <rdma/ib_pack.h>
+#include <rdma/rdma_cm.h>
+#include <rdma/iw_cm.h>
+
+#define TBIRD
+#define NES_TWO_PORT
+#define NES_LEGACY_INT_DETECT
+#define NES_ENABLE_CQE_READ
+#define NES_SEND_FIRST_WRITE
+
+#define QUEUE_DISCONNECTS
+
+#define DRV_BUILD "rc9.13.1"
+
+#define DRV_NAME "iw_nes"
+#define DRV_VERSION "0.4 Build " DRV_BUILD
+#define PFX DRV_NAME ": "
+
+/*
+ * NetEffect PCI vendor id and NE010 PCI device id.
+ */
+#ifndef PCI_VENDOR_ID_NETEFFECT /* not in pci.ids yet */
+#define PCI_VENDOR_ID_NETEFFECT 0x1678
+#define PCI_DEVICE_ID_NETEFFECT_NE020 0x0100
+#endif
+
+#define NE020_REV 4
+
+#define BAR_0 0
+#define BAR_1 2
+
+#define RX_BUF_SIZE (1536 + 8)
+
+#define NES_REG0_SIZE (4 * 1024)
+#define NES_TX_TIMEOUT (6*HZ)
+#define NES_FIRST_QPN 64
+#define NES_SW_CONTEXT_ALIGN 1024
+
+#define NES_NIC_MAX_NICS 16
+#define NES_MAX_ARP_TABLE_SIZE 4096
+
+#define MAX_DPC_ITERATIONS 128
+
+/* debug levels */
+#define NES_DBG_RX 0x00000001
+#define NES_DBG_RX_PKT_DUMP 0x00000002
+#define NES_DBG_TX 0x00000004
+#define NES_DBG_TX_PKT_DUMP 0x00000008
+#define NES_DBG_ALL 0xffffffff
+
+#define NES_DRV_OPT_ENABLE_MPA_VER_0 0x00000001
+#define NES_DRV_OPT_DISABLE_MPA_CRC 0x00000002
+#define NES_DRV_OPT_DISABLE_FIRST_WRITE 0x00000004
+#define NES_DRV_OPT_DISABLE_INTF 0x00000008
+#define NES_DRV_OPT_ENABLE_MSI 0x00000010
+#define NES_DRV_OPT_DUAL_LOGICAL_PORT 0x00000020
+#define NES_DRV_OPT_SUPRESS_OPTION_BC 0x00000040
+
+#define NES_AEQ_EVENT_TIMEOUT 2500
+#define NES_DISCONNECT_EVENT_TIMEOUT 2000
+
+#ifdef NES_DEBUG
+#define assert(expr) \
+if(!(expr)) { \
+ printk(KERN_ERR PFX "Assertion failed! %s, %s, %s, line %d\n", \
+ #expr, __FILE__, __FUNCTION__, __LINE__); \
+}
+#ifndef dprintk
+#define dprintk(fmt, args...) do { printk(KERN_ERR PFX fmt, ##args); } while (0)
+#endif
+#define NES_EVENT_TIMEOUT 1200000
+/* #define NES_EVENT_TIMEOUT 1200 */
+#else
+#define assert(expr) do {} while (0)
+#define dprintk(fmt, args...) do {} while (0)
+
+#define NES_EVENT_TIMEOUT 100000
+#endif
+
+#include "nes_hw.h"
+#include "nes_verbs.h"
+#include "nes_context.h"
+#include "nes_user.h"
+#include "nes_cm.h"
+
+
+extern unsigned int nes_drv_opt;
+extern unsigned int nes_debug_level;
+
+extern struct list_head nes_adapter_list;
+extern struct list_head nes_dev_list;
+
+extern int max_mtu;
+#define max_frame_len (max_mtu+ETH_HLEN)
+extern int interrupt_mod_interval;
+
+struct nes_device {
+ struct nes_adapter *nesadapter;
+ void __iomem *regs;
+ void __iomem *index_reg;
+ struct pci_dev *pcidev;
+ struct net_device *netdev[NES_NIC_MAX_NICS];
+ u64 link_status_interrupts;
+ struct tasklet_struct dpc_tasklet;
+ spinlock_t indexed_regs_lock;
+ unsigned long doorbell_start;
+ unsigned long csr_start;
+ unsigned long mac_tx_errors;
+ unsigned long mac_pause_frames_sent;
+ unsigned long mac_pause_frames_received;
+ unsigned long mac_rx_errors;
+ unsigned long mac_rx_crc_errors;
+ unsigned long mac_rx_symbol_err_frames;
+ unsigned long mac_rx_jabber_frames;
+ unsigned long mac_rx_oversized_frames;
+ unsigned long mac_rx_short_frames;
+ unsigned int mac_index;
+ unsigned int nes_stack_start;
+
+ /* Control Structures */
+ void *cqp_vbase;
+ dma_addr_t cqp_pbase;
+ u32 cqp_mem_size;
+ u8 ceq_index;
+ u8 nic_ceq_index;
+ struct nes_hw_cqp cqp;
+ struct nes_hw_cq ccq;
+ struct list_head cqp_avail_reqs;
+ struct list_head cqp_pending_reqs;
+ struct nes_cqp_request *nes_cqp_requests;
+
+ u32 int_req;
+ u32 int_stat;
+ u32 timer_int_req;
+ u32 timer_only_int_count;
+ u32 intf_int_req;
+ u32 et_rx_coalesce_usecs_irq;
+ struct list_head list;
+
+ u16 base_doorbell_index;
+ u8 msi_enabled;
+ u8 netdev_count;
+ u8 napi_isr_ran;
+ u8 disable_rx_flow_control;
+ u8 disable_tx_flow_control;
+};
+
+/* Linux kernel version interface changes */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18))
+static inline unsigned short nes_skb_lso_size(const struct sk_buff *skb)
+{
+ return(skb_shinfo(skb)->tso_size);
+}
+#define nes_skb_linearize(_skb, _type) skb_linearize(_skb, _type)
+#define NES_INIT_WORK(_work, _func, _data) INIT_WORK(_work, _func)
+#else
+static inline unsigned short nes_skb_lso_size(const struct sk_buff *skb)
+{
+ return(skb_shinfo(skb)->gso_size);
+}
+#define nes_skb_linearize(_skb, _type) skb_linearize(_skb)
+#define NES_INIT_WORK(_work, _func, _data) INIT_WORK(_work, _func)
+#endif
+
+/* Read from memory-mapped device */
+static inline u32 nes_read_indexed(struct nes_device *nesdev, u32 reg_index)
+{
+ unsigned long flags;
+ void __iomem * addr = nesdev->index_reg;
+ u32 value;
+
+ spin_lock_irqsave(&nesdev->indexed_regs_lock, flags);
+
+ /* dprintk("Reading from indexed offset %08X using address %p and %p.\n",
+ reg_index, addr, addr+4); */
+ writel(cpu_to_le32(reg_index), addr);
+ value = le32_to_cpu(readl((u8 *)addr + 4));
+
+ /* dprintk("Got %08X.\n", value); */
+ spin_unlock_irqrestore(&nesdev->indexed_regs_lock, flags);
+ return (value);
+}
+
+static inline u32 nes_read32(const void __iomem * addr)
+{
+ return(le32_to_cpu(readl(addr)));
+}
+
+static inline u16 nes_read16(const void __iomem * addr)
+{
+ return(le16_to_cpu(readw(addr)));
+}
+
+static inline u8 nes_read8(const void __iomem * addr)
+{
+ return(readb(addr));
+}
+
+/* Write to memory-mapped device */
+static inline void nes_write_indexed(struct nes_device *nesdev, u32 reg_index, u32 val)
+{
+ unsigned long flags;
+ void __iomem * addr = nesdev->index_reg;
+
+ spin_lock_irqsave(&nesdev->indexed_regs_lock, flags);
+
+ /* dprintk("Writing %08X, to indexed offset %08X using address %p and %p.\n",
+ val, reg_index, addr, addr+4); */
+ writel(cpu_to_le32(reg_index), addr);
+ writel(cpu_to_le32(val),(u8 *)addr + 4);
+
+ spin_unlock_irqrestore(&nesdev->indexed_regs_lock, flags);
+}
+
+static inline void nes_write32(void __iomem * addr, u32 val)
+{
+ /* dprintk("Writing %08X, to address %p.\n", val, addr); */
+ writel(cpu_to_le32(val), addr);
+}
+
+static inline void nes_write16(void __iomem * addr, u16 val)
+{
+ writew(cpu_to_le16(val), addr);
+}
+
+static inline void nes_write8(void __iomem * addr, u8 val)
+{
+ writeb(val, addr);
+}
+
+
+
+static inline int nes_alloc_resource(struct nes_adapter *nesadapter,
+ unsigned long *resource_array, u32 max_resources,
+ u32 *req_resource_num, u32 *next)
+{
+ unsigned long flags;
+ u32 resource_num;
+
+ spin_lock_irqsave(&nesadapter->resource_lock, flags);
+ dprintk("nes_alloc_resource: resource_array=%p, max_resources=%u,"
+ " req_resource=%u, next=%u\n",
+ resource_array, max_resources, *req_resource_num, *next);
+
+ resource_num = find_next_zero_bit(resource_array, max_resources, *next);
+ dprintk("nes_alloc_resource: resource_num=%u\n", resource_num);
+ if (resource_num >= max_resources) {
+ resource_num = find_first_zero_bit(resource_array, max_resources);
+ if (resource_num >= max_resources) {
+ printk(KERN_ERR PFX "%s: No available resourcess.\n", __FUNCTION__);
+ spin_unlock_irqrestore(&nesadapter->resource_lock, flags);
+ return(-EMFILE);
+ }
+ }
+ dprintk("%s: find_next_zero_bit returned = %u (max = %u).\n",
+ __FUNCTION__, resource_num, max_resources);
+ set_bit(resource_num, resource_array);
+ *next = resource_num+1;
+ if (*next == max_resources) {
+ *next = 0;
+ }
+ spin_unlock_irqrestore(&nesadapter->resource_lock, flags);
+ *req_resource_num = resource_num;
+ return (0);
+}
+
+static inline void nes_free_resource(struct nes_adapter *nesadapter,
+ unsigned long *resource_array, u32 resource_num)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&nesadapter->resource_lock, flags);
+ clear_bit(resource_num, resource_array);
+ spin_unlock_irqrestore(&nesadapter->resource_lock, flags);
+}
+
+static inline struct nes_vnic *to_nesvnic(struct ib_device *ibdev) {
+ return (container_of(ibdev, struct nes_ib_device, ibdev)->nesvnic);
+}
+
+static inline struct nes_pd *to_nespd(struct ib_pd *ibpd) {
+ return (container_of(ibpd, struct nes_pd, ibpd));
+}
+
+static inline struct nes_ucontext *to_nesucontext(struct ib_ucontext *ibucontext) {
+ return (container_of(ibucontext, struct nes_ucontext, ibucontext));
+}
+
+static inline struct nes_mr *to_nesmr(struct ib_mr *ibmr) {
+ return (container_of(ibmr, struct nes_mr, ibmr));
+}
+
+static inline struct nes_mr *to_nesmw(struct ib_mw *ibmw) {
+ return (container_of(ibmw, struct nes_mr, ibmw));
+}
+
+static inline struct nes_mr *to_nesfmr(struct ib_fmr *ibfmr) {
+ return (container_of(ibfmr, struct nes_mr, ibfmr));
+}
+
+static inline struct nes_cq *to_nescq(struct ib_cq *ibcq) {
+ return (container_of(ibcq, struct nes_cq, ibcq));
+}
+
+static inline struct nes_qp *to_nesqp(struct ib_qp *ibqp) {
+ return (container_of(ibqp, struct nes_qp, ibqp));
+}
+
+/* Utils */
+#define CRC32C_POLY 0x1EDC6F41
+#define ORDER 32
+#define REFIN 1
+#define REFOUT 1
+#define NES_HASH_CRC_INITAL_VALUE 0xFFFFFFFF
+#define NES_HASH_CRC_FINAL_XOR 0xFFFFFFFF
+
+/* nes.c */
+void nes_add_ref(struct ib_qp *);
+void nes_rem_ref(struct ib_qp *);
+struct ib_qp *nes_get_qp(struct ib_device *, int);
+
+/* nes_hw.c */
+struct nes_adapter *nes_init_adapter(struct nes_device *, u8);
+unsigned int nes_reset_adapter_ne010(struct nes_device *, u8 *);
+unsigned int nes_reset_adapter_ne020(struct nes_device *, u8 *);
+int nes_init_serdes(struct nes_device *, u8 port_count);
+void nes_init_csr_ne010(struct nes_device *, u8 hw_rev);
+void nes_init_csr_ne020(struct nes_device *, u8 hw_rev, u8 port_count);
+int nes_init_cqp(struct nes_device *);
+int nes_init_phy(struct nes_device *);
+int nes_init_nic_qp(struct nes_device *, struct net_device *);
+void nes_destroy_nic_qp(struct nes_vnic *);
+int nes_napi_isr(struct nes_device *);
+void nes_dpc(unsigned long);
+void nes_process_ceq(struct nes_device *, struct nes_hw_ceq *);
+void nes_process_aeq(struct nes_device *, struct nes_hw_aeq *);
+void nes_process_mac_intr(struct nes_device *, u32);
+void nes_nic_napi_ce_handler(struct nes_device *, struct nes_hw_nic_cq *);
+void nes_nic_ce_handler(struct nes_device *, struct nes_hw_nic_cq *);
+void nes_cqp_ce_handler(struct nes_device *, struct nes_hw_cq *);
+void nes_process_iwarp_aeqe(struct nes_device *, struct nes_hw_aeqe *);
+void nes_iwarp_ce_handler(struct nes_device *, struct nes_hw_cq *);
+int nes_destroy_cqp(struct nes_device *);
+int nes_nic_cm_xmit(struct sk_buff *, struct net_device *);
+
+/* nes_nic.c */
+struct net_device *nes_netdev_init(struct nes_device *, void __iomem *);
+void nes_netdev_destroy(struct net_device *);
+void nes_destroy_adapter(struct nes_adapter *);
+
+/* nes_cm.c */
+void *nes_cm_create(struct net_device *netdev);
+int nes_cm_recv(struct sk_buff *skb_p, struct net_device *netdevice);
+void nes_update_arp(unsigned char *, u32, u32, u16, u16);
+void nes_manage_arp_cache(struct net_device *, unsigned char *, u32, u32);
+void nes_sock_release(struct nes_qp *, unsigned long *);
+void nes_disconnect_worker(void *);
+void flush_wqes(struct nes_device *nesdev, struct nes_qp *nesqp, u32 which_wq, u32 wait_completion);
+int nes_manage_apbvt(struct nes_vnic *nesvnic, u32 accel_local_port,
+ u32 nic_index, u32 add_port);
+
+int nes_cm_disconn(struct nes_qp *);
+void nes_cm_disconn_worker(void *);
+
+/* nes_verbs.c */
+int nes_hw_modify_qp(struct nes_device *, struct nes_qp *, u32, u32);
+int nes_modify_qp(struct ib_qp *, struct ib_qp_attr *, int, struct ib_udata *);
+struct nes_ib_device *nes_init_ofa_device(struct net_device *);
+void nes_destroy_ofa_device(struct nes_ib_device *);
+int nes_register_ofa_device(struct nes_ib_device *);
+void nes_unregister_ofa_device(struct nes_ib_device *);
+
+/* nes_util.c */
+int nes_read_eeprom_values(struct nes_device *, struct nes_adapter *);
+void nes_write_1G_phy_reg(struct nes_device *, u8, u8, u16);
+void nes_read_1G_phy_reg(struct nes_device *, u8, u8, u16 *);
+void nes_write_10G_phy_reg(struct nes_device *, u16, u8, u16);
+void nes_read_10G_phy_reg(struct nes_device *, u16, u8);
+int nes_arp_table(struct nes_device *, u32, u8 *, u32);
+void nes_mh_fix(unsigned long);
+void nes_dump_mem(void *, int);
+u32 nes_crc32(u32, u32, u32, u32, u8 *, u32, u32, u32);
+
+extern int nes_if_count;
+extern int mpa_version;
+extern unsigned int send_first;
+
+
+#define NES_CQP_REQUEST_NOT_HOLDING_LOCK 0
+#define NES_CQP_REQUEST_HOLDING_LOCK 1
+#define NES_CQP_REQUEST_NO_DOORBELL_RING 0
+#define NES_CQP_REQUEST_RING_DOORBELL 1
+
+static inline struct nes_cqp_request
+ *nes_get_cqp_request(struct nes_device *nesdev, int holding_lock)
+{
+ unsigned long flags;
+ struct nes_cqp_request *cqp_request = NULL;
+
+ if (!holding_lock) {
+ spin_lock_irqsave(&nesdev->cqp.lock, flags);
+ }
+ if (!list_empty(&nesdev->cqp_avail_reqs)) {
+ cqp_request = list_entry(nesdev->cqp_avail_reqs.next,
+ struct nes_cqp_request, list);
+ list_del_init(&cqp_request->list);
+ }
+ if (!holding_lock) {
+ spin_unlock_irqrestore(&nesdev->cqp.lock, flags);
+ }
+
+ if (cqp_request) {
+ cqp_request->waiting = 0;
+ cqp_request->request_done = 0;
+ init_waitqueue_head(&cqp_request->waitq);
+ /* dprintk("%s: Got cqp request %p from the available list \n",
+ __FUNCTION__, cqp_request); */
+ } else
+ dprintk("%s: CQP request queue is empty.\n", __FUNCTION__);
+
+ return (cqp_request);
+}
+
+static inline void nes_post_cqp_request(struct nes_device *nesdev,
+ struct nes_cqp_request *cqp_request, int holding_lock, int ring_doorbell)
+{
+ /* caller must be holding CQP lock */
+ struct nes_hw_cqp_wqe *cqp_wqe;
+ unsigned long flags;
+ u32 cqp_head;
+
+ if (!holding_lock) {
+ spin_lock_irqsave(&nesdev->cqp.lock, flags);
+ }
+
+ if (((((nesdev->cqp.sq_tail+(nesdev->cqp.sq_size*2))-nesdev->cqp.sq_head) &
+ (nesdev->cqp.sq_size - 1)) != 1)
+ && (list_empty(&nesdev->cqp_pending_reqs))) {
+ cqp_head = nesdev->cqp.sq_head++;
+ nesdev->cqp.sq_head &= nesdev->cqp.sq_size-1;
+ cqp_wqe = &nesdev->cqp.sq_vbase[cqp_head];
+ memcpy(cqp_wqe, &cqp_request->cqp_wqe, sizeof(*cqp_wqe));
+ barrier();
+ *((struct nes_cqp_request **)&cqp_wqe->wqe_words
+ [NES_CQP_WQE_COMP_SCRATCH_LOW_IDX]) = cqp_request;
+ dprintk("%s: CQP request (opcode 0x%02X), line 1 = 0x%08X put on CQPs SQ,"
+ " request = %p, cqp_head = %u, cqp_tail = %u, cqp_size = %u,"
+ " waiting = %d, refcount = %d.\n",
+ __FUNCTION__, cqp_wqe->wqe_words[NES_CQP_WQE_OPCODE_IDX]&0x3f,
+ cqp_wqe->wqe_words[NES_CQP_WQE_ID_IDX], cqp_request,
+ nesdev->cqp.sq_head, nesdev->cqp.sq_tail, nesdev->cqp.sq_size,
+ cqp_request->waiting, atomic_read(&cqp_request->refcount));
+ } else {
+ dprintk("%s: CQP request %p (opcode 0x%02X), line 1 = 0x%08X"
+ " put on the pending queue.\n",
+ __FUNCTION__, cqp_request,
+ cqp_request->cqp_wqe.wqe_words[NES_CQP_WQE_OPCODE_IDX]&0x3f,
+ cqp_request->cqp_wqe.wqe_words[NES_CQP_WQE_ID_IDX]);
+ list_add_tail(&cqp_request->list, &nesdev->cqp_pending_reqs);
+ }
+
+ if (ring_doorbell) {
+ barrier();
+ /* Ring doorbell (1 WQEs) */
+ nes_write32(nesdev->regs+NES_WQE_ALLOC, 0x01800000 | nesdev->cqp.qp_id);
+ }
+
+ if (!holding_lock) {
+ spin_unlock_irqrestore(&nesdev->cqp.lock, flags);
+ }
+
+ return;
+}
+
+#endif /* __NES_H */
^ permalink raw reply
* Re: [patch 1/1] NetLabel: add missing rcu_dereference() calls in the LSM domain mapping hash table
From: David Miller @ 2007-08-08 0:53 UTC (permalink / raw)
To: paul.moore; +Cc: netdev
In-Reply-To: <20070807205458.599982536@hp.com>
From: "Paul Moore" <paul.moore@hp.com>
Date: Tue, 07 Aug 2007 16:54:50 -0400
> The LSM domain mapping head table pointer was not being referenced via the RCU
> safe dereferencing function, rcu_dereference(). This patch adds those missing
> calls to the NetLabel code.
>
> This has been tested using recent linux-2.6 git kernels with no visible
> regressions.
>
> Signed-off-by: Paul Moore <paul.moore@hp.com>
Patch applied, thanks Paul.
^ 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