Netdev List
 help / color / mirror / Atom feed
* Re: bridge: accept bridge own MAC address as local
From: Stephen Hemminger @ 2011-08-26 16:42 UTC (permalink / raw)
  To: David Miller; +Cc: ulrich.weber, netdev
In-Reply-To: <20110826.122917.294108473242938413.davem@davemloft.net>

On Fri, 26 Aug 2011 12:29:17 -0400 (EDT)
David Miller <davem@davemloft.net> wrote:

> From: Ulrich Weber <ulrich.weber@sophos.com>
> Date: Fri, 12 Aug 2011 13:30:24 +0200
> 
> > bridge: accept bridge own MAC address as local
> > if MAC address of bridge is manually set (BR_SET_MAC_ADDR). Otherwise
> > only MAC addresses of bridge members will work if manually set.
> > 
> > Signed-off-by: Ulrich Weber <ulrich.weber@sophos.com>
> 
> As Stephen mentioned, the real bug is that we don't create a local
> FDB entry (and get rid of the old one) when the MAC address changes.
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Another alternative is going back to restricting the mac address of
the bridge to be the same as one of the existing ports. This was how
it used to be, but some people wanted to set arbitrary addresses
(probably to deal with start up ordering issues).

^ permalink raw reply

* Re: [RFT PATCH v3 00/12] Cleanup and extension of netdev features
From: David Miller @ 2011-08-26 16:41 UTC (permalink / raw)
  To: greearb; +Cc: mirq-linux, netdev, bhutchings
In-Reply-To: <4E569CC8.9040605@candelatech.com>

From: Ben Greear <greearb@candelatech.com>
Date: Thu, 25 Aug 2011 12:04:40 -0700

> On 06/22/2011 09:04 AM, Michał Mirosław wrote:
>> v3 of a feature handling cleanup and extension series. For testing,
>> you
>> might want user-space ethtool patched with:
>>
>> http://patchwork.ozlabs.org/patch/96374/
> 
> It looks like this is not in net-next yet...any hope of this
> going in soon?

Why would it go into net-next?  It's not a kernel patch, it's a patch
for the ethool userland utility.

^ permalink raw reply

* Re: [RFT PATCH v3 00/12] Cleanup and extension of netdev features
From: Ben Greear @ 2011-08-26 16:43 UTC (permalink / raw)
  To: David Miller; +Cc: mirq-linux, netdev, bhutchings
In-Reply-To: <20110826.124107.1302583595703798441.davem@davemloft.net>

On 08/26/2011 09:41 AM, David Miller wrote:
> From: Ben Greear<greearb@candelatech.com>
> Date: Thu, 25 Aug 2011 12:04:40 -0700
> 
>> On 06/22/2011 09:04 AM, Michał Mirosław wrote:
>>> v3 of a feature handling cleanup and extension series. For testing,
>>> you
>>> might want user-space ethtool patched with:
>>>
>>> http://patchwork.ozlabs.org/patch/96374/
>>
>> It looks like this is not in net-next yet...any hope of this
>> going in soon?
> 
> Why would it go into net-next?  It's not a kernel patch, it's a patch
> for the ethool userland utility.

I meant the kernel bits in that patch series, not the link.

Sorry for not snipping enough.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply

* Re: [RFT PATCH v3 00/12] Cleanup and extension of netdev features
From: David Miller @ 2011-08-26 16:47 UTC (permalink / raw)
  To: greearb; +Cc: mirq-linux, netdev, bhutchings
In-Reply-To: <4E57CD27.8090500@candelatech.com>

From: Ben Greear <greearb@candelatech.com>
Date: Fri, 26 Aug 2011 09:43:19 -0700

> On 08/26/2011 09:41 AM, David Miller wrote:
>> From: Ben Greear<greearb@candelatech.com>
>> Date: Thu, 25 Aug 2011 12:04:40 -0700
>> 
>>> On 06/22/2011 09:04 AM, Michał Mirosław wrote:
>>>> v3 of a feature handling cleanup and extension series. For testing,
>>>> you
>>>> might want user-space ethtool patched with:
>>>>
>>>> http://patchwork.ozlabs.org/patch/96374/
>>>
>>> It looks like this is not in net-next yet...any hope of this
>>> going in soon?
>> 
>> Why would it go into net-next?  It's not a kernel patch, it's a patch
>> for the ethool userland utility.
> 
> I meant the kernel bits in that patch series, not the link.

It's possible that if you go look at the threads about those kernel
patches you're find out the reason.

^ permalink raw reply

* Re: [PATCH] netpoll: fix incorrect access to skb data in __netpoll_rx
From: David Miller @ 2011-08-26 16:50 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <1314375975.2563.8.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 26 Aug 2011 18:26:15 +0200

> __netpoll_rx() doesnt properly handle skbs with small header
> 
> pskb_may_pull() or pskb_trim_rcsum() can change skb->data, we must
> reload it.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied, thanks Eric.

^ permalink raw reply

* Re: [PATCH] net: sh_eth: fix the compile error
From: David Miller @ 2011-08-26 16:50 UTC (permalink / raw)
  To: yoshihiro.shimoda.uh; +Cc: netdev, linux-sh
In-Reply-To: <4E537249.8050806@renesas.com>

From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: Tue, 23 Aug 2011 18:26:33 +0900

> Fix the following build error:
> 
>   CC      drivers/net/sh_eth.o
> drivers/net/sh_eth.c:1115: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘sh_eth_interrupt’
> drivers/net/sh_eth.c: In function ‘sh_eth_open’:
> drivers/net/sh_eth.c:1387: error: implicit declaration of function ‘request_irq’
> drivers/net/sh_eth.c:1387: error: ‘sh_eth_interrupt’ undeclared (first use in this function)
> drivers/net/sh_eth.c:1387: error: (Each undeclared identifier is reported only once
> drivers/net/sh_eth.c:1387: error: for each function it appears in.)
> drivers/net/sh_eth.c:1391: error: ‘IRQF_SHARED’ undeclared (first use in this function)
> drivers/net/sh_eth.c:1424: error: implicit declaration of function ‘free_irq’
> make[2]: *** [drivers/net/sh_eth.o] Error 1
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Applied.

^ permalink raw reply

* Re: [PATCH] net/phy: fix DP83865 phy interrupt handler
From: David Miller @ 2011-08-26 16:50 UTC (permalink / raw)
  To: peppe.cavallaro; +Cc: netdev, tshu
In-Reply-To: <1314083234-20361-1-git-send-email-peppe.cavallaro@st.com>

From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Date: Tue, 23 Aug 2011 09:07:14 +0200

> According to the DP83865 datasheet we need to clear
> the interrupt status bit by writing a 1 to the
> corresponding bit in INT_CLEAR (2:0 are reserved).
> 
> Proposed and tested by Thorsten.
> 
> Signed-off-by: Thorsten Schubert <tshu@msc-ge.com>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>

Applied.

^ permalink raw reply

* Re: [PATCH] can: ti_hecc: Fix uninitialized spinlock in probe
From: David Miller @ 2011-08-26 16:51 UTC (permalink / raw)
  To: abhilash.kv; +Cc: netdev, wg, linux-kernel, =linux-omap
In-Reply-To: <1314104757-16462-1-git-send-email-abhilash.kv@ti.com>

From: Abhilash K V <abhilash.kv@ti.com>
Date: Tue, 23 Aug 2011 18:35:57 +0530

> In ti_hecc_probe(), the spinlock  priv->mbx_lock is not
> inited, causing a spinlock lockup BUG.
> 
> Acked-by: Anant Gole <anantgole@ti.com>
> Signed-off-by: Abhilash K V <abhilash.kv@ti.com>

Applied.

^ permalink raw reply

* Re: [PATCH] can: ti_hecc: Fix unintialized variable
From: David Miller @ 2011-08-26 16:51 UTC (permalink / raw)
  To: abhilash.kv; +Cc: netdev, wg, linux-kernel, =linux-omap
In-Reply-To: <1314104748-16424-1-git-send-email-abhilash.kv@ti.com>

From: Abhilash K V <abhilash.kv@ti.com>
Date: Tue, 23 Aug 2011 18:35:48 +0530

> In ti_hecc_xmit(), local variable "data" is not initialized before
> being used.
> This initialization got inadvertently removed in the following patch:
> 
> 	can: Unify droping of invalid tx skbs and netdev stats
> 
> Acked-by: Anant Gole <anantgole@ti.com>
> Signed-off-by: Abhilash K V <abhilash.kv@ti.com>

Applied.

^ permalink raw reply

* Re: [PATCH 1/2] bnx2x: resurrect RX hashing
From: David Miller @ 2011-08-26 16:51 UTC (permalink / raw)
  To: mschmidt; +Cc: netdev, vladz, eilong, dmitry, mirq-linux
In-Reply-To: <20110823161530.24707.67923.stgit@dhcp-29-224.brq.redhat.com>

From: Michal Schmidt <mschmidt@redhat.com>
Date: Tue, 23 Aug 2011 18:15:32 +0200

> bnx2x used to be able to set rxhash, but this was lost in the conversion
> to hw_features (commit 66371c441).
> Restore it and enable it by default.
> 
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] bnx2x: Add new PHY BCM54616
From: David Miller @ 2011-08-26 16:51 UTC (permalink / raw)
  To: yanivr; +Cc: eilong, netdev
In-Reply-To: <1314117204.28819.13.camel@lb-tlvb-dmitry>

From: "Yaniv Rosner" <yanivr@broadcom.com>
Date: Tue, 23 Aug 2011 19:33:24 +0300

> The BCM54616 PHY is very similar to the 54618SE, only without EEE support, which will not be activated due to querying the actual PHY type.
> This check is already done by reading a dedicated PHY register.
> 
> Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>

Applied.

^ permalink raw reply

* Re: [patch -next] bna: unlock on error path in pnad_pci_probe()
From: David Miller @ 2011-08-26 16:51 UTC (permalink / raw)
  To: error27; +Cc: rmody, ddutt, netdev, kernel-janitors
In-Reply-To: <20110824112922.GC5975@shale.localdomain>

From: Dan Carpenter <error27@gmail.com>
Date: Wed, 24 Aug 2011 14:29:22 +0300

> We introduced a new lock here, so there was error path which needs
> an unlock now.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCH] cassini: init before use in cas_interruptN.
From: David Miller @ 2011-08-26 16:52 UTC (permalink / raw)
  To: romieu; +Cc: thomas.jarosch, netdev
In-Reply-To: <20110825150249.GA21897@electric-eye.fr.zoreil.com>

From: Francois Romieu <romieu@fr.zoreil.com>
Date: Thu, 25 Aug 2011 17:02:49 +0200

> Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
> Spotted-by: Thomas Jarosch <thomas.jarosch@intra2net.com>

Applied, thanks!

>  David, any opinion regarding the removal of the USE_NAPI #ifdef
>  in this driver ?

No objections to removing it.

^ permalink raw reply

* Re: [patch -next] bna: off by one in bfa_msgq_rspq_pi_update()
From: David Miller @ 2011-08-26 16:51 UTC (permalink / raw)
  To: error27; +Cc: rmody, ddutt, netdev, kernel-janitors
In-Reply-To: <20110824113028.GD5975@shale.localdomain>

From: Dan Carpenter <error27@gmail.com>
Date: Wed, 24 Aug 2011 14:30:28 +0300

> The rspq->rsphdlr[] array has BFI_MC_MAX elements, so this test was
> off by one.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] net_sched: sfb: optimize enqueue on full queue
From: David Miller @ 2011-08-26 16:53 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <1314289292.2387.45.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 25 Aug 2011 18:21:32 +0200

> In case SFB queue is full (hard limit reached), there is no point
> spending time to compute hash and maximum qlen/p_mark.
> 
> We instead just early drop packet.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied.

^ permalink raw reply

* Re: Traffic shaping - class ID 16bit limit?
From: David Miller @ 2011-08-26 16:53 UTC (permalink / raw)
  To: exa.exa; +Cc: shemminger, netdev
In-Reply-To: <CAO0uZ+_6xC0gymfbu28PRK4SaVgkGaSbbe-PgXvZ4h-cPp8k2A@mail.gmail.com>

From: Miroslav Kratochvil <exa.exa@gmail.com>
Date: Thu, 25 Aug 2011 19:06:58 +0200

>>> Technically the ClassID seems to be "hardcoded" as a 16bit value, but
>>> after some source searching, I haven't found any good reason for it to
>>> be 16-bit only.
>>
>> Granted it was a poor choice in the initial design.
>> It is wired into the API and changing it would be quite painful.
>>
> 
> I was feeling something like that would come.
> 
> If I get it correctly, the API change would consist of:
> 
> - some netlink protocol change
> - slight modification of qdisc_class_hash
> - modifications in all (four?) hierarchical schedulers
> - tiny expansion of userspace tc utility

There is precedence as we had to make the routing table rule ID larger
and were successfully able to do so using netlink attributes.

^ permalink raw reply

* Re: [PATCH net-next-2.6] e1000: save skb counts in TX to avoid cache misses
From: David Miller @ 2011-08-26 16:55 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: dnelson, netdev, andy
In-Reply-To: <1314330760.2097.39.camel@jtkirshe-mobl>

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 25 Aug 2011 20:52:39 -0700

> On Thu, 2011-08-25 at 17:39 -0700, Dean Nelson wrote:
>> Virtual Machines with emulated e1000 network adapter running on
>> Parallels'
>> server were seeing kernel panics due to the e1000 driver dereferencing
>> an
>> unexpected NULL pointer retrieved from buffer_info->skb.
>> 
>> The problem has been addressed for the e1000e driver, but not for the
>> e1000.
>> Since the two drivers share similar code in the affected area, a port
>> of the
>> following e1000e driver commit solves the issue for the e1000 driver:
>> 
>> commit 9ed318d546a29d7a591dbe648fd1a2efe3be1180
>> Author: Tom Herbert <therbert@google.com>
>> Date:   Wed May 5 14:02:27 2010 +0000
>> 
>>     e1000e: save skb counts in TX to avoid cache misses
>> 
>>     In e1000_tx_map, precompute number of segements and bytecounts
>> which
>>     are derived from fields in skb; these are stored in buffer_info.
>> When
>>     cleaning tx in e1000_clean_tx_irq use the values in the associated
>>     buffer_info for statistics counting, this eliminates cache misses
>>     on skb fields.
>> 
>> 
>> Signed-off-by: Dean Nelson <dnelson@redhat.com> 
> 
> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied, thanks.

^ permalink raw reply

* [patch 1/2] 9p: move dereference after NULL check
From: Dan Carpenter @ 2011-08-26 16:55 UTC (permalink / raw)
  To: Eric Van Hensbergen
  Cc: David S. Miller, Venkateswararao Jujjuri, Aneesh Kumar K.V,
	M. Mohan Kumar, open list:NETWORKING [GENERAL], kernel-janitors

We dereferenced "req->tc" and "req->rc" before checking for NULL.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/net/9p/client.c b/net/9p/client.c
index 3f8c046..b0bcace 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -248,10 +248,8 @@ static struct p9_req_t *p9_tag_alloc(struct p9_client *c, u16 tag, int max_size)
 		init_waitqueue_head(req->wq);
 		req->tc = kmalloc(sizeof(struct p9_fcall) + alloc_msize,
 				  GFP_NOFS);
-		req->tc->capacity = alloc_msize;
 		req->rc = kmalloc(sizeof(struct p9_fcall) + alloc_msize,
 				  GFP_NOFS);
-		req->rc->capacity = alloc_msize;
 		if ((!req->tc) || (!req->rc)) {
 			printk(KERN_ERR "Couldn't grow tag array\n");
 			kfree(req->tc);
@@ -261,6 +259,8 @@ static struct p9_req_t *p9_tag_alloc(struct p9_client *c, u16 tag, int max_size)
 			req->wq = NULL;
 			return ERR_PTR(-ENOMEM);
 		}
+		req->tc->capacity = alloc_msize;
+		req->rc->capacity = alloc_msize;
 		req->tc->sdata = (char *) req->tc + sizeof(struct p9_fcall);
 		req->rc->sdata = (char *) req->rc + sizeof(struct p9_fcall);
 	}

^ permalink raw reply related

* [patch 2/2] 9p: change an int to unsigned int
From: Dan Carpenter @ 2011-08-26 16:57 UTC (permalink / raw)
  To: Eric Van Hensbergen
  Cc: David S. Miller, Venkateswararao Jujjuri (JV), Aneesh Kumar K.V,
	M. Mohan Kumar, Stephen Hemminger, open list:NETWORKING [GENERAL],
	kernel-janitors

The size of things should be unsigned because negative sizes are
silly.  My concern is the the limit checks don't take negative values
into consideration in p9_client_create()
	if (clnt->msize > clnt->trans_mod->maxsize)
		clnt->msize = clnt->trans_mod->maxsize;
and in p9_tag_alloc()
	int alloc_msize = min(c->msize, max_size);

I don't know if this is exported to user space?  Hopefully it's not
too late to change this.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index 55ce72c..d479d7d 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -151,7 +151,7 @@ struct p9_req_t {
 
 struct p9_client {
 	spinlock_t lock; /* protect client structure */
-	int msize;
+	unsigned int msize;
 	unsigned char proto_version;
 	struct p9_trans_module *trans_mod;
 	enum p9_trans_status status;

^ permalink raw reply related

* Re: [PATCH net-next 0/2] Duplication of #define with mii.h.
From: David Miller @ 2011-08-26 17:13 UTC (permalink / raw)
  To: romieu; +Cc: netdev
In-Reply-To: <20110825092019.GA21777@electric-eye.fr.zoreil.com>

From: Francois Romieu <romieu@fr.zoreil.com>
Date: Thu, 25 Aug 2011 11:20:19 +0200

> Please pull from branch 'davem-next.mii' in repository
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/romieu/netdev-2.6.git davem-next.mii
> 
> to get the changes below.
> 
> The sunbmac changes are not compile tested. Sunbmac changeset is on top of the
> stack so it can be instantly removed if untrusted. Building a packaged rpm for a
> cross sparc-linux compiler quickly turned more interesting than expected.

I'll pull this and sanity check the build on sparc, thanks!

^ permalink raw reply

* Re: [RFT PATCH v3 00/12] Cleanup and extension of netdev features
From: Michał Mirosław @ 2011-08-26 18:41 UTC (permalink / raw)
  To: Ben Greear; +Cc: netdev, David S. Miller, Ben Hutchings, Jeff Kirsher
In-Reply-To: <4E569CC8.9040605@candelatech.com>

On Thu, Aug 25, 2011 at 12:04:40PM -0700, Ben Greear wrote:
> On 06/22/2011 09:04 AM, Michał Mirosław wrote:
> >v3 of a feature handling cleanup and extension series. For testing, you
> >might want user-space ethtool patched with:
> >http://patchwork.ozlabs.org/patch/96374/
> It looks like this is not in net-next yet...any hope of this
> going in soon?

It's because the series depends on finishing conversions of all drivers
to ndo_fix/set_features. e1000e, igbvf, ixgb, ixgbevf are pending.

BTW, Jeff, what is the status of those conversions? Last version of ixgbe
patch from Donald Skidmore (sent about a month ago) was mostly ready IIUC.

Best Regards,
Michał Mirosław

^ permalink raw reply

* Re: [RFC PATCH] common receive API + r8169 use
From: Michał Mirosław @ 2011-08-26 18:44 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Stephen Hemminger, netdev
In-Reply-To: <1312822029.2531.5.camel@edumazet-laptop>

On Mon, Aug 08, 2011 at 06:47:09PM +0200, Eric Dumazet wrote:
> Le mardi 02 août 2011 à 23:43 +0200, Michał Mirosław a écrit :
> > I don't have fast enough transmitter yet, so have no real data. Eric's
> > testing showed dramatic reduction in CPU usage after changing igb to use
> > build_skb().  Inlined version of this patch should give similar results.
> > 
> > Eric: can you share the igb changes? I have no hardware for it, but could
> > merge our changes for you to test.
> I am just coming back from one vacation period, I'll send patches before
> another one, maybe tomorrow, stay tuned ;)

Still tuned in, but receiving no signal. ;-)

Best Regards,
Michał Mirosław

^ permalink raw reply

* [PATCH 2/3 net-next] cnic: Add timeout for ramrod replies.
From: Michael Chan @ 2011-08-26 19:45 UTC (permalink / raw)
  To: davem; +Cc: netdev, Michael Chan
In-Reply-To: <1314387941-2126-1-git-send-email-mchan@broadcom.com>

If the bnx2x device has encountered parity errors, the chip will not DMA
any replies.  Using wait_event_timeout() will allow us to make forward
progress and let bnx2x reset the chip.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
---
 drivers/net/ethernet/broadcom/cnic.c      |   17 ++++++++++-------
 drivers/net/ethernet/broadcom/cnic.h      |    2 ++
 drivers/net/ethernet/broadcom/cnic_defs.h |    1 +
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c
index 73060f4..6f10c69 100644
--- a/drivers/net/ethernet/broadcom/cnic.c
+++ b/drivers/net/ethernet/broadcom/cnic.c
@@ -1875,12 +1875,12 @@ static int cnic_bnx2x_destroy_ramrod(struct cnic_dev *dev, u32 l5_cid)
 				  hw_cid, NONE_CONNECTION_TYPE, &l5_data);
 
 	if (ret == 0) {
-		wait_event(ctx->waitq, ctx->wait_cond);
+		wait_event_timeout(ctx->waitq, ctx->wait_cond, CNIC_RAMROD_TMO);
 		if (unlikely(test_bit(CTX_FL_CID_ERROR, &ctx->ctx_flags)))
 			return -EBUSY;
 	}
 
-	return ret;
+	return 0;
 }
 
 static int cnic_bnx2x_iscsi_destroy(struct cnic_dev *dev, struct kwqe *kwqe)
@@ -2428,17 +2428,20 @@ static int cnic_bnx2x_fcoe_destroy(struct cnic_dev *dev, struct kwqe *kwqe)
 	init_waitqueue_head(&ctx->waitq);
 	ctx->wait_cond = 0;
 
+	memset(&kcqe, 0, sizeof(kcqe));
+	kcqe.completion_status = FCOE_KCQE_COMPLETION_STATUS_ERROR;
 	memset(&l5_data, 0, sizeof(l5_data));
 	ret = cnic_submit_kwqe_16(dev, FCOE_RAMROD_CMD_ID_TERMINATE_CONN, cid,
 				  FCOE_CONNECTION_TYPE, &l5_data);
 	if (ret == 0) {
-		wait_event(ctx->waitq, ctx->wait_cond);
-		set_bit(CTX_FL_DELETE_WAIT, &ctx->ctx_flags);
-		queue_delayed_work(cnic_wq, &cp->delete_task,
-				   msecs_to_jiffies(2000));
+		wait_event_timeout(ctx->waitq, ctx->wait_cond, CNIC_RAMROD_TMO);
+		if (ctx->wait_cond)
+			kcqe.completion_status = 0;
 	}
 
-	memset(&kcqe, 0, sizeof(kcqe));
+	set_bit(CTX_FL_DELETE_WAIT, &ctx->ctx_flags);
+	queue_delayed_work(cnic_wq, &cp->delete_task, msecs_to_jiffies(2000));
+
 	kcqe.op_code = FCOE_KCQE_OPCODE_DESTROY_CONN;
 	kcqe.fcoe_conn_id = req->conn_id;
 	kcqe.fcoe_conn_context_id = cid;
diff --git a/drivers/net/ethernet/broadcom/cnic.h b/drivers/net/ethernet/broadcom/cnic.h
index 15b1c09..3032809 100644
--- a/drivers/net/ethernet/broadcom/cnic.h
+++ b/drivers/net/ethernet/broadcom/cnic.h
@@ -474,5 +474,7 @@ struct bnx2x_bd_chain_next {
 	  MAX_STAT_COUNTER_ID_E1))
 #endif
 
+#define CNIC_RAMROD_TMO			(HZ / 4)
+
 #endif
 
diff --git a/drivers/net/ethernet/broadcom/cnic_defs.h b/drivers/net/ethernet/broadcom/cnic_defs.h
index e47d210..239de89 100644
--- a/drivers/net/ethernet/broadcom/cnic_defs.h
+++ b/drivers/net/ethernet/broadcom/cnic_defs.h
@@ -67,6 +67,7 @@
 #define FCOE_KWQE_OPCODE_DESTROY		(10)
 #define FCOE_KWQE_OPCODE_STAT			(11)
 
+#define FCOE_KCQE_COMPLETION_STATUS_ERROR	(0x1)
 #define FCOE_KCQE_COMPLETION_STATUS_CTX_ALLOC_FAILURE	(0x3)
 
 /* KCQ (kernel completion queue) response op codes */
-- 
1.7.1

^ permalink raw reply related

* [PATCH 3/3 net-next] net: Define NETDEV_FCOE_WWNN, NETDEV_FCOE_WWPN only when CONFIG_LIBFCOE is enabled
From: Michael Chan @ 2011-08-26 19:45 UTC (permalink / raw)
  To: davem; +Cc: netdev, Michael Chan, Yi Zou, Bhanu Prakash Gollapudi
In-Reply-To: <1314387941-2126-2-git-send-email-mchan@broadcom.com>

From: Bhanu Prakash Gollapudi <bprakash@broadcom.com>

bnx2fc driver calls netdev->netdev_ops->ndo_fcoe_get_wwn() and it may not
be defined with the current Kconfig dependencies.  ndo_fcoe_get_wwn is
dependent on CONFIG_FCOE, but bnx2fc does not select CONFIG_FCOE, as it does
not depend on fcoe driver. Since both fcoe and bnx2fc drivers select
CONFIG_LIBFCOE, define NETDEV_FCOE_WWNN and NETDEV_FCOE_WWPN when
CONFIG_LIBFCOE is defined.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: Yi Zou <yi.zou@intel.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
 include/linux/netdevice.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 125f9fb..0a7f619 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -922,11 +922,15 @@ struct net_device_ops {
 						       u16 xid,
 						       struct scatterlist *sgl,
 						       unsigned int sgc);
+#endif
+
+#if defined(CONFIG_LIBFCOE) || defined(CONFIG_LIBFCOE_MODULE)
 #define NETDEV_FCOE_WWNN 0
 #define NETDEV_FCOE_WWPN 1
 	int			(*ndo_fcoe_get_wwn)(struct net_device *dev,
 						    u64 *wwn, int type);
 #endif
+
 #ifdef CONFIG_RFS_ACCEL
 	int			(*ndo_rx_flow_steer)(struct net_device *dev,
 						     const struct sk_buff *skb,
-- 
1.7.1

^ permalink raw reply related

* [PATCH 1/3 net-next] cnic, bnx2fc: Increase maximum FCoE sessions.
From: Michael Chan @ 2011-08-26 19:45 UTC (permalink / raw)
  To: davem; +Cc: netdev, Michael Chan, Bhanu Prakash Gollapudi

Increase it to NVRAM configured limit or 1024 whichever is less.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
---
 drivers/net/ethernet/broadcom/cnic.c |   14 ++++++++------
 drivers/net/ethernet/broadcom/cnic.h |    2 +-
 drivers/scsi/bnx2fc/bnx2fc.h         |    2 +-
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c
index 7698161..73060f4 100644
--- a/drivers/net/ethernet/broadcom/cnic.c
+++ b/drivers/net/ethernet/broadcom/cnic.c
@@ -1177,7 +1177,7 @@ static int cnic_alloc_bnx2x_resc(struct cnic_dev *dev)
 	cp->fcoe_start_cid = start_cid + MAX_ISCSI_TBL_SZ;
 
 	if (BNX2X_CHIP_IS_E2_PLUS(cp->chip_id)) {
-		cp->max_cid_space += BNX2X_FCOE_NUM_CONNECTIONS;
+		cp->max_cid_space += dev->max_fcoe_conn;
 		cp->fcoe_init_cid = ethdev->fcoe_init_cid;
 		if (!cp->fcoe_init_cid)
 			cp->fcoe_init_cid = 0x10;
@@ -2280,7 +2280,7 @@ static int cnic_bnx2x_fcoe_ofld1(struct cnic_dev *dev, struct kwqe *wqes[],
 	*work = 4;
 
 	l5_cid = req1->fcoe_conn_id;
-	if (l5_cid >= BNX2X_FCOE_NUM_CONNECTIONS)
+	if (l5_cid >= dev->max_fcoe_conn)
 		goto err_reply;
 
 	l5_cid += BNX2X_FCOE_L5_CID_BASE;
@@ -2384,7 +2384,7 @@ static int cnic_bnx2x_fcoe_disable(struct cnic_dev *dev, struct kwqe *kwqe)
 	req = (struct fcoe_kwqe_conn_enable_disable *) kwqe;
 	cid = req->context_id;
 	l5_cid = req->conn_id;
-	if (l5_cid >= BNX2X_FCOE_NUM_CONNECTIONS)
+	if (l5_cid >= dev->max_fcoe_conn)
 		return -EINVAL;
 
 	l5_cid += BNX2X_FCOE_L5_CID_BASE;
@@ -2418,7 +2418,7 @@ static int cnic_bnx2x_fcoe_destroy(struct cnic_dev *dev, struct kwqe *kwqe)
 	req = (struct fcoe_kwqe_conn_destroy *) kwqe;
 	cid = req->context_id;
 	l5_cid = req->conn_id;
-	if (l5_cid >= BNX2X_FCOE_NUM_CONNECTIONS)
+	if (l5_cid >= dev->max_fcoe_conn)
 		return -EINVAL;
 
 	l5_cid += BNX2X_FCOE_L5_CID_BASE;
@@ -4850,8 +4850,7 @@ static int cnic_start_bnx2x_hw(struct cnic_dev *dev)
 		return -ENOMEM;
 
 	if (BNX2X_CHIP_IS_E2_PLUS(cp->chip_id)) {
-		ret = cnic_init_id_tbl(&cp->fcoe_cid_tbl,
-					BNX2X_FCOE_NUM_CONNECTIONS,
+		ret = cnic_init_id_tbl(&cp->fcoe_cid_tbl, dev->max_fcoe_conn,
 					cp->fcoe_start_cid, 0);
 
 		if (ret)
@@ -5292,6 +5291,9 @@ static struct cnic_dev *init_bnx2x_cnic(struct net_device *dev)
 	    !(ethdev->drv_state & CNIC_DRV_STATE_NO_FCOE))
 		cdev->max_fcoe_conn = ethdev->max_fcoe_conn;
 
+	if (cdev->max_fcoe_conn > BNX2X_FCOE_NUM_CONNECTIONS)
+		cdev->max_fcoe_conn = BNX2X_FCOE_NUM_CONNECTIONS;
+
 	memcpy(cdev->mac_addr, ethdev->iscsi_mac, 6);
 
 	cp->cnic_ops = &cnic_bnx2x_ops;
diff --git a/drivers/net/ethernet/broadcom/cnic.h b/drivers/net/ethernet/broadcom/cnic.h
index 7a2928f..15b1c09 100644
--- a/drivers/net/ethernet/broadcom/cnic.h
+++ b/drivers/net/ethernet/broadcom/cnic.h
@@ -373,7 +373,7 @@ struct bnx2x_bd_chain_next {
 #define BNX2X_ISCSI_PBL_NOT_CACHED	0xff
 #define BNX2X_ISCSI_PDU_HEADER_NOT_CACHED	0xff
 
-#define BNX2X_FCOE_NUM_CONNECTIONS	128
+#define BNX2X_FCOE_NUM_CONNECTIONS	1024
 
 #define BNX2X_FCOE_L5_CID_BASE		MAX_ISCSI_TBL_SZ
 
diff --git a/drivers/scsi/bnx2fc/bnx2fc.h b/drivers/scsi/bnx2fc/bnx2fc.h
index 5613e8a..dd335a2 100644
--- a/drivers/scsi/bnx2fc/bnx2fc.h
+++ b/drivers/scsi/bnx2fc/bnx2fc.h
@@ -81,7 +81,7 @@
 #define BNX2FC_RQ_WQES_MAX	16
 #define BNX2FC_CQ_WQES_MAX	(BNX2FC_SQ_WQES_MAX + BNX2FC_RQ_WQES_MAX)
 
-#define BNX2FC_NUM_MAX_SESS	128
+#define BNX2FC_NUM_MAX_SESS	1024
 #define BNX2FC_NUM_MAX_SESS_LOG	(ilog2(BNX2FC_NUM_MAX_SESS))
 
 #define BNX2FC_MAX_OUTSTANDING_CMNDS	2048
-- 
1.7.1

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox