Skip to contentSkip to conversation

cxgb3 - Parity initialization for T3C adapters

PATCH In review Divy Le Ray 3 participants 7 messages Dec 5, 2007 – Dec 14, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 cxgb3 - Parity initialization for T3C adapters

From: Divy Le Ray <[email protected]>

Add parity initialization for T3C adapters.

---

 drivers/net/cxgb3/adapter.h       |    1 
 drivers/net/cxgb3/cxgb3_main.c    |   82 ++++++++++++
 drivers/net/cxgb3/cxgb3_offload.c |   15 ++
 drivers/net/cxgb3/regs.h          |  248 +++++++++++++++++++++++++++++++++++++
 drivers/net/cxgb3/sge.c           |   24 +++-
 drivers/net/cxgb3/t3_hw.c         |  131 +++++++++++++++++---
 6 files changed, 472 insertions(+), 29 deletions(-)
drivers/net/cxgb3/adapter.h +1 -0
index 60a62f5..eb305a0 100644
@@ -71,6 +71,7 @@ enum {				/* adapter flags */
 	USING_MSI = (1 << 1),
 	USING_MSIX = (1 << 2),
 	QUEUES_BOUND = (1 << 3),
+	TP_PARITY_INIT = (1 << 4),
 };
 
 struct fl_pg_chunk {
drivers/net/cxgb3/cxgb3_main.c +82 -0

100 lines not on this page · raw message

drivers/net/cxgb3/cxgb3_offload.c +13 -2
index 650d06a..738de4b 100644
@@ -403,8 +403,6 @@ static int cxgb_offload_ctl(struct t3cdev *tdev, unsigned int req, void *data)
 static int rx_offload_blackhole(struct t3cdev *dev, struct sk_buff **skbs,
 				int n)
 {
-	CH_ERR(tdev2adap(dev), "%d unexpected offload packets, first data %u\n",
-	       n, ntohl(*(__be32 *)skbs[0]->data));
 	while (n--)
 		dev_kfree_skb_any(skbs[n]);
 	return 0;
@@ -634,6 +632,18 @@ static int do_l2t_write_rpl(struct t3cdev *dev, struct sk_buff *skb)
 	return CPL_RET_BUF_DONE;
 }
 
+static int do_rte_write_rpl(struct t3cdev *dev, struct sk_buff *skb)
+{
+	struct cpl_rte_write_rpl *rpl = cplhdr(skb);
+
+	if (rpl->status != CPL_ERR_NONE)
+		printk(KERN_ERR
+		       "Unexpected RTE_WRITE_RPL status %u for entry %u\n",
+		       rpl->status, GET_TID(rpl));
+
+	return CPL_RET_BUF_DONE;
+}
+
 static int do_act_open_rpl(struct t3cdev *dev, struct sk_buff *skb)
 {
 	struct cpl_act_open_rpl *rpl = cplhdr(skb);
@@ -1257,6 +1267,7 @@ void __init cxgb3_offload_init(void)
 
 	t3_register_cpl_handler(CPL_SMT_WRITE_RPL, do_smt_write_rpl);
 	t3_register_cpl_handler(CPL_L2T_WRITE_RPL, do_l2t_write_rpl);
+	t3_register_cpl_handler(CPL_RTE_WRITE_RPL, do_rte_write_rpl);
 	t3_register_cpl_handler(CPL_PASS_OPEN_RPL, do_stid_rpl);
 	t3_register_cpl_handler(CPL_CLOSE_LISTSRV_RPL, do_stid_rpl);
 	t3_register_cpl_handler(CPL_PASS_ACCEPT_REQ, do_cr);
drivers/net/cxgb3/regs.h +245 -3

327 lines not on this page · raw message

drivers/net/cxgb3/sge.c +20 -4
index 666c317..cef153d 100644
@@ -2443,6 +2443,15 @@ irq_handler_t t3_intr_handler(struct adapter *adap, int polling)
 	return t3_intr;
 }
 
+#define SGE_PARERR (F_CPPARITYERROR | F_OCPARITYERROR | F_RCPARITYERROR | \
+		    F_IRPARITYERROR | V_ITPARITYERROR(M_ITPARITYERROR) | \
+		    V_FLPARITYERROR(M_FLPARITYERROR) | F_LODRBPARITYERROR | \
+		    F_HIDRBPARITYERROR | F_LORCQPARITYERROR | \
+		    F_HIRCQPARITYERROR)
+#define SGE_FRAMINGERR (F_UC_REQ_FRAMINGERROR | F_R_REQ_FRAMINGERROR)
+#define SGE_FATALERR (SGE_PARERR | SGE_FRAMINGERR | F_RSPQCREDITOVERFOW | \
+		      F_RSPQDISABLED)
+
 /**
  *	t3_sge_err_intr_handler - SGE async event interrupt handler
  *	@adapter: the adapter
@@ -2453,6 +2462,13 @@ void t3_sge_err_intr_handler(struct adapter *adapter)
 {
 	unsigned int v, status = t3_read_reg(adapter, A_SG_INT_CAUSE);
 
+	if (status & SGE_PARERR)
+		CH_ALERT(adapter, "SGE parity error (0x%x)\n",
+			 status & SGE_PARERR);
+	if (status & SGE_FRAMINGERR)
+		CH_ALERT(adapter, "SGE framing error (0x%x)\n",
+			 status & SGE_FRAMINGERR);
+
 	if (status & F_RSPQCREDITOVERFOW)
 		CH_ALERT(adapter, "SGE response queue credit overflow\n");
 
@@ -2469,7 +2485,7 @@ void t3_sge_err_intr_handler(struct adapter *adapter)
 			 status & F_HIPIODRBDROPERR ? "high" : "lo");
 
 	t3_write_reg(adapter, A_SG_INT_CAUSE, status);
-	if (status & (F_RSPQCREDITOVERFOW | F_RSPQDISABLED))
+	if (status &  SGE_FATALERR)
 		t3_fatal_err(adapter);
 }
 
@@ -2781,7 +2797,7 @@ void t3_sge_init(struct adapter *adap, struct sge_params *p)
 	unsigned int ctrl, ups = ffs(pci_resource_len(adap->pdev, 2) >> 12);
 
 	ctrl = F_DROPPKT | V_PKTSHIFT(2) | F_FLMODE | F_AVOIDCQOVFL |
-	    F_CQCRDTCTRL |
+	    F_CQCRDTCTRL | F_CONGMODE | F_TNLFLMODE | F_FATLPERREN |
 	    V_HOSTPAGESIZE(PAGE_SHIFT - 11) | F_BIGENDIANINGRESS |
 	    V_USERSPACESIZE(ups ? ups - 1 : 0) | F_ISCSICOALESCING;
 #if SGE_NUM_GENBITS == 1
@@ -2790,7 +2806,6 @@ void t3_sge_init(struct adapter *adap, struct sge_params *p)
 	if (adap->params.rev > 0) {
 		if (!(adap->flags & (USING_MSIX | USING_MSI)))
 			ctrl |= F_ONEINTMULTQ | F_OPTONEINTMULTQ;
-		ctrl |= F_CQCRDTCTRL | F_AVOIDCQOVFL;
 	}
 	t3_write_reg(adap, A_SG_CONTROL, ctrl);
 	t3_write_reg(adap, A_SG_EGR_RCQ_DRB_THRSH, V_HIRCQDRBTHRSH(512) |
@@ -2798,7 +2813,8 @@ void t3_sge_init(struct adapter *adap, struct sge_params *p)
 	t3_write_reg(adap, A_SG_TIMER_TICK, core_ticks_per_usec(adap) / 10);
 	t3_write_reg(adap, A_SG_CMDQ_CREDIT_TH, V_THRESHOLD(32) |
 		     V_TIMEOUT(200 * core_ticks_per_usec(adap)));
-	t3_write_reg(adap, A_SG_HI_DRB_HI_THRSH, 1000);
+	t3_write_reg(adap, A_SG_HI_DRB_HI_THRSH,
+		     adap->params.rev < T3_REV_C ? 1000 : 500);
 	t3_write_reg(adap, A_SG_HI_DRB_LO_THRSH, 256);
 	t3_write_reg(adap, A_SG_LO_DRB_HI_THRSH, 1000);
 	t3_write_reg(adap, A_SG_LO_DRB_LO_THRSH, 256);
drivers/net/cxgb3/t3_hw.c +111 -20

266 lines not on this page · raw message

#1 lore raw
Quoted 7 lines · Divy Le Ray

From: Divy Le Ray <[email protected]>

Add parity initialization for T3C adapters.

---

Quoted 7 lines
 drivers/net/cxgb3/adapter.h       |    1 
 drivers/net/cxgb3/cxgb3_main.c    |   82 ++++++++++++
 drivers/net/cxgb3/cxgb3_offload.c |   15 ++
 drivers/net/cxgb3/regs.h          |  248 +++++++++++++++++++++++++++++++++++++
 drivers/net/cxgb3/sge.c           |   24 +++-
 drivers/net/cxgb3/t3_hw.c         |  131 +++++++++++++++++---
 6 files changed, 472 insertions(+), 29 deletions(-)

dropped patches 2-3, did not apply

#2 lore raw
Quoted 17 lines · Jeff Garzik
Quoted 7 lines · Divy Le Ray

From: Divy Le Ray <[email protected]>

Add parity initialization for T3C adapters.

---

Quoted 8 lines
 drivers/net/cxgb3/adapter.h       |    1 
 drivers/net/cxgb3/cxgb3_main.c    |   82 ++++++++++++
 drivers/net/cxgb3/cxgb3_offload.c |   15 ++
 drivers/net/cxgb3/regs.h          |  248 
+++++++++++++++++++++++++++++++++++++
 drivers/net/cxgb3/sge.c           |   24 +++-
 drivers/net/cxgb3/t3_hw.c         |  131 +++++++++++++++++---
 6 files changed, 472 insertions(+), 29 deletions(-)
Quoted 3 lines

dropped patches 2-3, did not apply

Hi Jeff,

I noticed that you applied the first one of this 3 patches series to the #upstream-fixes branch. These patches are intended to the #upstream (2.6.25) branch, as they are built on top of the last 10 patches committed - 9 from me, and the white space clean up (thanks!). May be this is the reason why they did not apply.

On this topic, I have a question: how do I get to see all the netdev-2.6 branches ? After cloning a free netdev-2.6 tree, 'git branch' shows only the master branch:

bash-3.1$ git --version
git version 1.5.3.rc4.29.g74276-dirty
-bash-3.1$ stg clone git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git netdev-2.6-fresh Cloning "git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git" into "netdev-2.6-fresh"... Initialized empty Git repository in /opt/sources/netdev-2.6-fresh/.git/
remote: Generating pack...
remote: Counting objects: 620879
Done counting 633562 objects.
remote: Deltifying 633562 objects...
remote: 100% (633562/633562) done
Indexing 633562 objects...
remote: Total 633562 (delta 517968), reused 594305 (delta 478716)
100% (633562/633562) done
Resolving 517968 deltas...
100% (517968/517968) done
Checking 23058 files out...
100% (23058/23058) done
done
-bash-3.1$ cd netdev-2.6-fresh/
-bash-3.1$ git branch
* master

Cheers,
Divy

#3 lore raw
Quoted 22 lines · Divy Le Ray
Quoted 17 lines · Jeff Garzik
Quoted 7 lines · Divy Le Ray

From: Divy Le Ray <[email protected]>

Add parity initialization for T3C adapters.

---

Quoted 8 lines
 drivers/net/cxgb3/adapter.h       |    1 
 drivers/net/cxgb3/cxgb3_main.c    |   82 ++++++++++++
 drivers/net/cxgb3/cxgb3_offload.c |   15 ++
 drivers/net/cxgb3/regs.h          |  248 
+++++++++++++++++++++++++++++++++++++
 drivers/net/cxgb3/sge.c           |   24 +++-
 drivers/net/cxgb3/t3_hw.c         |  131 +++++++++++++++++---
 6 files changed, 472 insertions(+), 29 deletions(-)
Quoted 3 lines

dropped patches 2-3, did not apply

Quoted 6 lines

Hi Jeff,

I noticed that you applied the first one of this 3 patches series to the #upstream-fixes branch. These patches are intended to the #upstream (2.6.25) branch, as they are built on top of the last 10 patches committed - 9 from me, and the white space clean up (thanks!). May be this is the reason why they did not apply.

Ah... you need to tell me these things. I looked for a kernel version in your messages but did not see one.

Does the patch #1 need to be reverted for 2.6.24?

Quoted 24 lines

On this topic, I have a question: how do I get to see all the netdev-2.6 branches ? After cloning a free netdev-2.6 tree, 'git branch' shows only the master branch:

bash-3.1$ git --version
git version 1.5.3.rc4.29.g74276-dirty
-bash-3.1$ stg clone
git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git netdev-2.6-fresh Cloning "git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git" into "netdev-2.6-fresh"... Initialized empty Git repository in /opt/sources/netdev-2.6-fresh/.git/
remote: Generating pack...
remote: Counting objects: 620879
Done counting 633562 objects.
remote: Deltifying 633562 objects...
remote: 100% (633562/633562) done
Indexing 633562 objects...
remote: Total 633562 (delta 517968), reused 594305 (delta 478716)
100% (633562/633562) done
Resolving 517968 deltas...
100% (517968/517968) done
Checking 23058 files out...
100% (23058/23058) done
done

(quoted diff) +0 -2
-bash-3.1$ cd netdev-2.6-fresh/
-bash-3.1$ git branch
Quoted 1 line

* master

git fetch -f $NETDEV_URL upstream:upstream

copies the latest upstream branch from netdev-2.6.git, and stores it as your local upstream branch.

You may do the same for #upstream-fixes too.

Jeff

#4 lore raw
Quoted 34 lines · Jeff Garzik
Quoted 24 lines · Divy Le Ray
Quoted 17 lines · Jeff Garzik
Quoted 7 lines · Divy Le Ray

From: Divy Le Ray <[email protected]>

Add parity initialization for T3C adapters.

---

Quoted 8 lines
 drivers/net/cxgb3/adapter.h       |    1
 drivers/net/cxgb3/cxgb3_main.c    |   82 ++++++++++++
 drivers/net/cxgb3/cxgb3_offload.c |   15 ++
 drivers/net/cxgb3/regs.h          |  248
+++++++++++++++++++++++++++++++++++++
 drivers/net/cxgb3/sge.c           |   24 +++-
 drivers/net/cxgb3/t3_hw.c         |  131 +++++++++++++++++---
 6 files changed, 472 insertions(+), 29 deletions(-)
Quoted 3 lines

dropped patches 2-3, did not apply

Hi Jeff,

Quoted 7 lines

I noticed that you applied the first one of this 3 patches series to the #upstream-fixes branch.
These patches are intended to the #upstream (2.6.25) branch, as they are built on top of the
last 10 patches committed - 9 from me, and the white space clean up (thanks!).
May be this is the reason why they did not apply.

Quoted 3 lines

Ah... you need to tell me these things. I looked for a kernel version in your messages but did not see one.

I had put it in the introduction mail, I should have added the kernel version in the patch titles. I'll do from now on.

Quoted 3 lines

Does the patch #1 need to be reverted for 2.6.24?

No, it can be applied to 2.6.24.
The 2 next patches seem to apply cleanly on #upstream when patch #1 is popped out the patch stack.

Quoted 5 lines
Quoted 3 lines

On this topic, I have a question: how do I get to see all the netdev-2.6 branches ?

Quoted 7 lines

git fetch -f $NETDEV_URL upstream:upstream

copies the latest upstream branch from netdev-2.6.git, and stores it as your local upstream branch.

You may do the same for #upstream-fixes too.

That made it.
Thanks a lot!

Cheers,
Divy

#5 lore raw
Quoted 40 lines · Divy Le Ray
Quoted 30 lines · Jeff Garzik
Quoted 18 lines · Divy Le Ray
Quoted 17 lines · Jeff Garzik
Quoted 15 lines · Divy Le Ray

From: Divy Le Ray <[email protected]>

Add parity initialization for T3C adapters.

---

 drivers/net/cxgb3/adapter.h       |    1
 drivers/net/cxgb3/cxgb3_main.c    |   82 ++++++++++++
 drivers/net/cxgb3/cxgb3_offload.c |   15 ++
 drivers/net/cxgb3/regs.h          |  248
+++++++++++++++++++++++++++++++++++++
 drivers/net/cxgb3/sge.c           |   24 +++-
 drivers/net/cxgb3/t3_hw.c         |  131 +++++++++++++++++---
 6 files changed, 472 insertions(+), 29 deletions(-)
Quoted 7 lines
Quoted 3 lines

dropped patches 2-3, did not apply

Hi Jeff,

I noticed that you applied the first one of this 3 patches series

to the

Quoted 2 lines

#upstream-fixes branch.
These patches are intended to the #upstream (2.6.25) branch, as

Quoted 9 lines

they are

Quoted 4 lines

built on top of the
last 10 patches committed - 9 from me, and the white space clean up (thanks!).
May be this is the reason why they did not apply.

Ah... you need to tell me these things. I looked for a kernel version in your messages but did not see one.

Quoted 9 lines

I had put it in the introduction mail, I should have added the kernel version in the patch titles. I'll do from now on.

Quoted 3 lines

Does the patch #1 need to be reverted for 2.6.24?

No, it can be applied to 2.6.24.
The 2 next patches seem to apply cleanly on #upstream when patch #1 is popped out the patch stack.

Hi Jeff,

Did you get a chance to apply these patches #upstream ?

Cheers,
Divy

#6 lore raw
In reply to Divy Le Ray
Quoted 14 lines · Divy Le Ray

On this topic, I have a question: how do I get to see all the netdev-2.6 branches ?
After cloning a free netdev-2.6 tree, 'git branch' shows only the master branch:
...
Cloning "git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git" into "netdev-2.6-fresh"...
Initialized empty Git repository in /opt/sources/netdev-2.6-fresh/.git/
...
100% (23058/23058) done
done

(quoted diff) +0 -2
-bash-3.1$ cd netdev-2.6-fresh/
-bash-3.1$ git branch
Quoted 1 line

* master

At this point,

$ git branch -r

will show you have copies of Jeff's branches in remotes/origin/.

$ git checkout -b upstream origin/upstream

would make your local upstream branch that forks from Jeff's upstream branch.