Re: [PATCH 2/2] cxgb3 - Parity initialization for T3C adapters
Divy Le Ray wrote: Jeff Garzik wrote: Divy Le Ray wrote: > Jeff Garzik wrote: >> Divy Le Ray wrote: >>> From: Divy Le Ray <[EMAIL PROTECTED]> >>> >>> Add parity initialization for T3C adapters. >>> >>> Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> >>> --- >>> >>> 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 >> >> > > 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. 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. 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 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] cxgb3 - Parity initialization for T3C adapters
Divy Le Ray <[EMAIL PROTECTED]> writes: > 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 > -bash-3.1$ cd netdev-2.6-fresh/ > -bash-3.1$ git branch > * 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. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] cxgb3 - Parity initialization for T3C adapters
Jeff Garzik wrote: Divy Le Ray wrote: > Jeff Garzik wrote: >> Divy Le Ray wrote: >>> From: Divy Le Ray <[EMAIL PROTECTED]> >>> >>> Add parity initialization for T3C adapters. >>> >>> Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> >>> --- >>> >>> 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 >> >> > > 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. 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. 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. > On this topic, I have a question: how do I get to see all the netdev-2.6 > branches ? 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 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] cxgb3 - Parity initialization for T3C adapters
Divy Le Ray wrote: Jeff Garzik wrote: Divy Le Ray wrote: From: Divy Le Ray <[EMAIL PROTECTED]> Add parity initialization for T3C adapters. Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> --- 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 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? 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 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 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] cxgb3 - Parity initialization for T3C adapters
Jeff Garzik wrote: Divy Le Ray wrote: From: Divy Le Ray <[EMAIL PROTECTED]> Add parity initialization for T3C adapters. Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> --- 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 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 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] cxgb3 - Parity initialization for T3C adapters
Divy Le Ray wrote: From: Divy Le Ray <[EMAIL PROTECTED]> Add parity initialization for T3C adapters. Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> --- 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 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/2] cxgb3 - Parity initialization for T3C adapters
From: Divy Le Ray <[EMAIL PROTECTED]> Add parity initialization for T3C adapters. Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> --- 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(-) diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h index 60a62f5..eb305a0 100644 --- a/drivers/net/cxgb3/adapter.h +++ b/drivers/net/cxgb3/adapter.h @@ -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 { diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index 944423c..d1aa777 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c @@ -306,6 +306,77 @@ static int request_msix_data_irqs(struct adapter *adap) return 0; } +static int await_mgmt_replies(struct adapter *adap, unsigned long init_cnt, + unsigned long n) +{ + int attempts = 5; + + while (adap->sge.qs[0].rspq.offload_pkts < init_cnt + n) { + if (!--attempts) + return -ETIMEDOUT; + msleep(10); + } + return 0; +} + +static int init_tp_parity(struct adapter *adap) +{ + int i; + struct sk_buff *skb; + struct cpl_set_tcb_field *greq; + unsigned long cnt = adap->sge.qs[0].rspq.offload_pkts; + + t3_tp_set_offload_mode(adap, 1); + + for (i = 0; i < 16; i++) { + struct cpl_smt_write_req *req; + + skb = alloc_skb(sizeof(*req), GFP_KERNEL | __GFP_NOFAIL); + req = (struct cpl_smt_write_req *)__skb_put(skb, sizeof(*req)); + memset(req, 0, sizeof(*req)); + req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); + OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SMT_WRITE_REQ, i)); + req->iff = i; + t3_mgmt_tx(adap, skb); + } + + for (i = 0; i < 2048; i++) { + struct cpl_l2t_write_req *req; + + skb = alloc_skb(sizeof(*req), GFP_KERNEL | __GFP_NOFAIL); + req = (struct cpl_l2t_write_req *)__skb_put(skb, sizeof(*req)); + memset(req, 0, sizeof(*req)); + req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); + OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ, i)); + req->params = htonl(V_L2T_W_IDX(i)); + t3_mgmt_tx(adap, skb); + } + + for (i = 0; i < 2048; i++) { + struct cpl_rte_write_req *req; + + skb = alloc_skb(sizeof(*req), GFP_KERNEL | __GFP_NOFAIL); + req = (struct cpl_rte_write_req *)__skb_put(skb, sizeof(*req)); + memset(req, 0, sizeof(*req)); + req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); + OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_RTE_WRITE_REQ, i)); + req->l2t_idx = htonl(V_L2T_W_IDX(i)); + t3_mgmt_tx(adap, skb); + } + + skb = alloc_skb(sizeof(*greq), GFP_KERNEL | __GFP_NOFAIL); + greq = (struct cpl_set_tcb_field *)__skb_put(skb, sizeof(*greq)); + memset(greq, 0, sizeof(*greq)); + greq->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); + OPCODE_TID(greq) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, 0)); + greq->mask = cpu_to_be64(1); + t3_mgmt_tx(adap, skb); + + i = await_mgmt_replies(adap, cnt, 16 + 2048 + 2048 + 1); + t3_tp_set_offload_mode(adap, 0); + return i; +} + /** * setup_rss - configure RSS * @adap: the adapter @@ -817,6 +888,7 @@ static int cxgb_up(struct adapter *adap) if (err) goto out; + t3_set_reg_field(adap, A_TP_PARA_REG5, 0, F_RXDDPOFFINIT); t3_write_reg(adap, A_ULPRX_TDDP_PSZ, V_HPZ0(PAGE_SHIFT - 12)); err = setup_sge_qsets(adap); @@ -856,6 +928,16 @@ static int cxgb_up(struct adapter *adap) t3_sge_start(adap); t3_intr_enable(adap); + if (adap->params.rev >= T3_REV_C && !(adap->flags & TP_PARITY_INIT) && + is_offload(adap) && init_tp_parity(adap) == 0) + adap->flags |= TP_PARITY_INIT; + + if (adap->flags & TP_PARITY_INIT) { + t3_write_reg(adap, A_TP_INT_CAUSE, +F_CMCACHEPERR | F_ARPLUTPERR); + t3_write_reg(adap, A_TP_INT_ENABLE, 0x7fbf); + } + if ((adap->flags & (USING_MSIX | QUEUES_BOUND)) == USING_MSIX) bind_qsets(adap); adap->flags |= QUEUES_BOUND; diff --git a/drive