Re: [Fwd: Re: [PATCH 1/10] cxgb3 - main header files]
On Thu, 2007-02-01 at 20:48 -0800, Roland Dreier wrote: > > Have you had a chance to review this? > > Still on my list. > > Can we trade? Can you look at the IPoIB connected mode stuff in the > ipoib-cm branch in > > git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git > > and let me know if you see anything you don't like? > > - R. Ok. I'll review the IPoIB connected mode code. Steve. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Fwd: Re: [PATCH 1/10] cxgb3 - main header files]
On Thu, 2007-02-01 at 20:48 -0800, Roland Dreier wrote: Have you had a chance to review this? Still on my list. Can we trade? Can you look at the IPoIB connected mode stuff in the ipoib-cm branch in git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git and let me know if you see anything you don't like? - R. Ok. I'll review the IPoIB connected mode code. Steve. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Fwd: Re: [PATCH 1/10] cxgb3 - main header files]
> Have you had a chance to review this? Still on my list. Can we trade? Can you look at the IPoIB connected mode stuff in the ipoib-cm branch in git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git and let me know if you see anything you don't like? - R. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Fwd: Re: [PATCH 1/10] cxgb3 - main header files]
On Fri, 2007-01-19 at 09:07 -0800, Roland Dreier wrote: > > Jeff has pulled in the Chelsio Ethernet driver. If you are ready to > > merge in the RDMA driver, you can pull it from > > Yes, I saw that... OK, I'll get serious about reviewing the RDMA stuff. Hey Roland, Have you had a chance to review this? Thanks, Steve. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Fwd: Re: [PATCH 1/10] cxgb3 - main header files]
On Fri, 2007-01-19 at 09:07 -0800, Roland Dreier wrote: Jeff has pulled in the Chelsio Ethernet driver. If you are ready to merge in the RDMA driver, you can pull it from Yes, I saw that... OK, I'll get serious about reviewing the RDMA stuff. Hey Roland, Have you had a chance to review this? Thanks, Steve. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Fwd: Re: [PATCH 1/10] cxgb3 - main header files]
Have you had a chance to review this? Still on my list. Can we trade? Can you look at the IPoIB connected mode stuff in the ipoib-cm branch in git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git and let me know if you see anything you don't like? - R. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Fwd: Re: [PATCH 1/10] cxgb3 - main header files]
> Jeff has pulled in the Chelsio Ethernet driver. If you are ready to > merge in the RDMA driver, you can pull it from Yes, I saw that... OK, I'll get serious about reviewing the RDMA stuff. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Fwd: Re: [PATCH 1/10] cxgb3 - main header files]
Hey Roland, Jeff has pulled in the Chelsio Ethernet driver. If you are ready to merge in the RDMA driver, you can pull it from git://staging.openfabrics.org/~swise/cxgb3.git for-roland Thanks, Steve. Forwarded Message From: Jeff Garzik <[EMAIL PROTECTED]> To: Divy Le Ray <[EMAIL PROTECTED]> Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, [EMAIL PROTECTED] Subject: Re: [PATCH 1/10] cxgb3 - main header files Date: Thu, 18 Jan 2007 22:05:02 -0500 Divy Le Ray wrote: > Jeff Garzik wrote: >> Divy Le Ray wrote: >>> From: Divy Le Ray <[EMAIL PROTECTED]> >>> >>> This patch implements the main header files of >>> the Chelsio T3 network driver. >>> >>> Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> >> >> Once you think it's ready, email me a URL to a single patch that adds >> the driver to the latest linux-2.6.git kernel. Include in the email a >> description of the driver and signed-off-by line, which will get >> directly included in the git changelog. >> >> Adding new drivers is a bit special, because we want to merge it as a >> single changeset, but that would create a patch too large to review on >> the common kernel mailing lists. > Jeff, > > You can grab the monolithic patch at this URL: > http://service.chelsio.com/kernel.org/cxgb3.patch.bz2 applied to netdev-2.6.git#upstream I'm really counting on Chelsio to actively maintain this driver, unlike the abandonware you guys first submitted. Jeff - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Fwd: Re: [PATCH 1/10] cxgb3 - main header files]
Hey Roland, Jeff has pulled in the Chelsio Ethernet driver. If you are ready to merge in the RDMA driver, you can pull it from git://staging.openfabrics.org/~swise/cxgb3.git for-roland Thanks, Steve. Forwarded Message From: Jeff Garzik [EMAIL PROTECTED] To: Divy Le Ray [EMAIL PROTECTED] Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, [EMAIL PROTECTED] Subject: Re: [PATCH 1/10] cxgb3 - main header files Date: Thu, 18 Jan 2007 22:05:02 -0500 Divy Le Ray wrote: Jeff Garzik wrote: Divy Le Ray wrote: From: Divy Le Ray [EMAIL PROTECTED] This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray [EMAIL PROTECTED] Once you think it's ready, email me a URL to a single patch that adds the driver to the latest linux-2.6.git kernel. Include in the email a description of the driver and signed-off-by line, which will get directly included in the git changelog. Adding new drivers is a bit special, because we want to merge it as a single changeset, but that would create a patch too large to review on the common kernel mailing lists. Jeff, You can grab the monolithic patch at this URL: http://service.chelsio.com/kernel.org/cxgb3.patch.bz2 applied to netdev-2.6.git#upstream I'm really counting on Chelsio to actively maintain this driver, unlike the abandonware you guys first submitted. Jeff - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [Fwd: Re: [PATCH 1/10] cxgb3 - main header files]
Jeff has pulled in the Chelsio Ethernet driver. If you are ready to merge in the RDMA driver, you can pull it from Yes, I saw that... OK, I'll get serious about reviewing the RDMA stuff. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
Divy Le Ray wrote: Jeff Garzik wrote: Divy Le Ray wrote: From: Divy Le Ray <[EMAIL PROTECTED]> This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> Once you think it's ready, email me a URL to a single patch that adds the driver to the latest linux-2.6.git kernel. Include in the email a description of the driver and signed-off-by line, which will get directly included in the git changelog. Adding new drivers is a bit special, because we want to merge it as a single changeset, but that would create a patch too large to review on the common kernel mailing lists. Jeff, You can grab the monolithic patch at this URL: http://service.chelsio.com/kernel.org/cxgb3.patch.bz2 applied to netdev-2.6.git#upstream I'm really counting on Chelsio to actively maintain this driver, unlike the abandonware you guys first submitted. Jeff - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
Divy Le Ray wrote: Jeff Garzik wrote: Divy Le Ray wrote: From: Divy Le Ray [EMAIL PROTECTED] This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray [EMAIL PROTECTED] Once you think it's ready, email me a URL to a single patch that adds the driver to the latest linux-2.6.git kernel. Include in the email a description of the driver and signed-off-by line, which will get directly included in the git changelog. Adding new drivers is a bit special, because we want to merge it as a single changeset, but that would create a patch too large to review on the common kernel mailing lists. Jeff, You can grab the monolithic patch at this URL: http://service.chelsio.com/kernel.org/cxgb3.patch.bz2 applied to netdev-2.6.git#upstream I'm really counting on Chelsio to actively maintain this driver, unlike the abandonware you guys first submitted. Jeff - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [openib-general] [PATCH 1/10] cxgb3 - main header files
> > In the interest of expediting this I'll go implement it... > > Steve. > Here it is. I think this is the correct way to solve the issue (now that I've implemented it :). This is a delta from the driver patch series just for reviewing purposes. commit e6053f2aee764b21e28cbb19f52995cb413cf733 Author: Steve Wise <[EMAIL PROTECTED]> Date: Tue Jan 9 13:06:13 2007 -0600 Chelsio-specific solution for copying in the user cq_index. - at cq_create time, user lib passes in the address of its cq rptr u32. - kernel saves this address in the iwch_cq struct. - kernel copies in the rptr value in iwch_req_notify_cq(). Signed-off-by: Steve Wise <[EMAIL PROTECTED]> diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c index ab99202..28be418 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_provider.c +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c @@ -143,6 +143,7 @@ static struct ib_cq *iwch_create_cq(stru struct iwch_dev *rhp; struct iwch_cq *chp; struct iwch_create_cq_resp uresp; + struct iwch_create_cq_req ureq; PDBG("%s ib_dev %p entries %d\n", __FUNCTION__, ibdev, entries); rhp = to_iwch_dev(ibdev); @@ -150,6 +151,14 @@ static struct ib_cq *iwch_create_cq(stru if (!chp) return ERR_PTR(-ENOMEM); + if (context) { + if (ib_copy_from_udata(, udata, sizeof (ureq))) { + kfree(chp); + return ERR_PTR(-EFAULT); + } + chp->user_rptr_addr = (u32 *)(unsigned long)ureq.user_rptr_addr; + } + if (t3a_device(rhp)) { /* @@ -269,15 +278,14 @@ static int iwch_resize_cq(struct ib_cq * return ret; } -static int iwch_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify notify, - struct ib_udata *udata) +static int iwch_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify notify) { struct iwch_dev *rhp; struct iwch_cq *chp; enum t3_cq_opcode cq_op; int err; unsigned long flag; - struct iwch_req_notify_cq ucmd; + u32 rptr; chp = to_iwch_cq(ibcq); rhp = chp->rhp; @@ -285,11 +293,11 @@ static int iwch_arm_cq(struct ib_cq *ibc cq_op = CQ_ARM_SE; else cq_op = CQ_ARM_AN; - if (udata && t3b_device(rhp)) { - if (ib_copy_from_udata(, udata, sizeof ucmd)) + if (chp->user_rptr_addr) { + if (get_user(rptr, chp->user_rptr_addr)) return -EFAULT; spin_lock_irqsave(>lock, flag); - chp->cq.rptr = ucmd.rptr; + chp->cq.rptr = rptr; } else spin_lock_irqsave(>lock, flag); PDBG("%s rptr 0x%x\n", __FUNCTION__, chp->cq.rptr); diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.h b/drivers/infiniband/hw/cxgb3/iwch_provider.h index f339427..d9d94e3 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_provider.h +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.h @@ -105,6 +105,7 @@ struct iwch_cq { spinlock_t lock; atomic_t refcnt; wait_queue_head_t wait; + u32 *user_rptr_addr; }; static inline struct iwch_cq *to_iwch_cq(struct ib_cq *ibcq) diff --git a/drivers/infiniband/hw/cxgb3/iwch_user.h b/drivers/infiniband/hw/cxgb3/iwch_user.h index 4e4b9c9..e8ff061 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_user.h +++ b/drivers/infiniband/hw/cxgb3/iwch_user.h @@ -42,6 +42,9 @@ #define IWCH_UVERBS_ABI_VERSION 1 * In particular do not use pointer types -- pass pointers in __u64 * instead. */ +struct iwch_create_cq_req { + __u64 user_rptr_addr; +}; struct iwch_create_cq_resp { __u64 physaddr; @@ -61,8 +64,4 @@ struct iwch_create_qp_resp { struct iwch_reg_user_mr_resp { __u32 pbl_addr; }; - -struct iwch_req_notify_cq { - __u32 rptr; -}; #endif - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: [openib-general] [PATCH 1/10] cxgb3 - main header files
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Michael S. Tsirkin > Sent: Tuesday, January 09, 2007 5:57 AM > To: Steve Wise > Cc: netdev@vger.kernel.org; Roland Dreier; Divy Le Ray; > linux-kernel@vger.kernel.org; openib-general > Subject: Re: [openib-general] [PATCH 1/10] cxgb3 - main header files > > > We also need to decide on the ib_req_notify_cq() issue. > > Let's clarify - do you oppose doing copy_from_user from a > fixed address passed in during setup? > > If OK with you, this seems the best way as it is the least > controversial and least disruptive one. > To clarfiy my understanding of this issue: A device MAY implement ib_req_notify_cq by updating a location directly from user mode. Any of the techniques that apply to other user allocated objects, such as the Send Queue, can be applied here. Even those the proposed changes would be about as low impact and benign as possible, the fact that there are valid solutions without an API changes leans heavily towards using those solutions. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
> The time for adding new stuff to 2.6.20 is /long/ past. We stop > adding things like new drivers when Linus releases 2.6.X-rc1. Well, in the past I think new drivers have been added after the merge window, given that there's no chance of regressions (old kernel == no support for device X, so even if the new driver is buggy it's no worse than the old kernel). (eg a quick git scan shows commit 0f64478c added a USB driver between 2.6.19-rc2 and 2.6.19-rc3, and I'm sure you can find lots of other examples) Anyway, you answered my question. I wasn't pushing to include the driver now, I just wanted to know what you were planning to do. Thanks. - R. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
Roland Dreier wrote: > > You can grab the monolithic patch at this URL: > > http://service.chelsio.com/kernel.org/cxgb3.patch.bz2 > > this is in my queue, thanks. Sorry I didn't indicate that earlier. When do you plan to merge it? For 2.6.20 or .21? The time for adding new stuff to 2.6.20 is /long/ past. We stop adding things like new drivers when Linus releases 2.6.X-rc1. Jeff - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
> > You can grab the monolithic patch at this URL: > > http://service.chelsio.com/kernel.org/cxgb3.patch.bz2 > > this is in my queue, thanks. Sorry I didn't indicate that earlier. When do you plan to merge it? For 2.6.20 or .21? I'm trying to understand when the RDMA stuff that depends on the ethernet driver can be merged. Thanks, Roland - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
On Tue, 2007-01-09 at 15:57 +0200, Michael S. Tsirkin wrote: > > We also need to decide on the ib_req_notify_cq() issue. > > Let's clarify - do you oppose doing copy_from_user from a fixed > address passed in during setup? > So far its been you and I arguing over this issue. Before I go implement it and retest everything, I'd like some indication that anyone else thinks its the right thing to do vs adding the extra parameter to ib_req_notify_cq(). > If OK with you, this seems the best way as it is the least controversial > and least disruptive one. > In the interest of expediting this I'll go implement it... Steve. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
> We also need to decide on the ib_req_notify_cq() issue. Let's clarify - do you oppose doing copy_from_user from a fixed address passed in during setup? If OK with you, this seems the best way as it is the least controversial and least disruptive one. -- MST - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
Roland, The T3 Ethernet driver is queued for inclusion into Jeff's tree. How do you want to merge in the RDMA driver? I can give you a single monolithic patch if you want. We also need to decide on the ib_req_notify_cq() issue. Steve. On Tue, 2007-01-09 at 05:28 -0500, Jeff Garzik wrote: > Divy Le Ray wrote: > > Jeff Garzik wrote: > >> Divy Le Ray wrote: > >>> From: Divy Le Ray <[EMAIL PROTECTED]> > >>> > >>> This patch implements the main header files of > >>> the Chelsio T3 network driver. > >>> > >>> Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> > >> > >> Once you think it's ready, email me a URL to a single patch that adds > >> the driver to the latest linux-2.6.git kernel. Include in the email a > >> description of the driver and signed-off-by line, which will get > >> directly included in the git changelog. > >> > >> Adding new drivers is a bit special, because we want to merge it as a > >> single changeset, but that would create a patch too large to review on > >> the common kernel mailing lists. > > Jeff, > > > > You can grab the monolithic patch at this URL: > > http://service.chelsio.com/kernel.org/cxgb3.patch.bz2 > > this is in my queue, thanks. Sorry I didn't indicate that earlier. > > Jeff > > > - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
Divy Le Ray wrote: Jeff Garzik wrote: Divy Le Ray wrote: From: Divy Le Ray <[EMAIL PROTECTED]> This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> Once you think it's ready, email me a URL to a single patch that adds the driver to the latest linux-2.6.git kernel. Include in the email a description of the driver and signed-off-by line, which will get directly included in the git changelog. Adding new drivers is a bit special, because we want to merge it as a single changeset, but that would create a patch too large to review on the common kernel mailing lists. Jeff, You can grab the monolithic patch at this URL: http://service.chelsio.com/kernel.org/cxgb3.patch.bz2 this is in my queue, thanks. Sorry I didn't indicate that earlier. Jeff - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
Jeff Garzik wrote: Divy Le Ray wrote: From: Divy Le Ray <[EMAIL PROTECTED]> This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> Once you think it's ready, email me a URL to a single patch that adds the driver to the latest linux-2.6.git kernel. Include in the email a description of the driver and signed-off-by line, which will get directly included in the git changelog. Adding new drivers is a bit special, because we want to merge it as a single changeset, but that would create a patch too large to review on the common kernel mailing lists. Jeff, You can grab the monolithic patch at this URL: http://service.chelsio.com/kernel.org/cxgb3.patch.bz2 This patch adds support for the latest 1G/10G Chelsio adapter, T3. It is required by the T3 RDMA driver Steve Wise submitted. Here is a brief description of its content: drivers/net/cxgb3/adapter.h, drivers/net/cxgb3/common.h, drivers/net/cxgb3/cxgb3_ioctl.h, drivers/net/cxgb3/firmware_exports.h: main header files drivers/net/cxgb3/cxgb3_main.c main source file drivers/net/cxgb3/t3_hw.c HW access routines drivers/net/cxgb3/sge.c, drivers/net/cxgb3/sge_defs.h scatter/gather engine drivers/net/cxgb3/ael1002.c, drivers/net/cxgb3/mc5.c, drivers/net/cxgb3/vsc8211.c, drivers/net/cxgb3/xgmac.c on board memory, MAC and PHY management drivers/net/cxgb3/cxgb3_ctl_defs.h, drivers/net/cxgb3/cxgb3_defs.h, drivers/net/cxgb3/cxgb3_offload.h, drivers/net/cxgb3/l2t.h, drivers/net/cxgb3/t3_cpl.h, drivers/net/cxgb3/t3cdev.h offload operations header files drivers/net/cxgb3/cxgb3_offload.c, drivers/net/cxgb3/l2t.c offload capabilities drivers/net/cxgb3/regs.h register definitions drivers/net/Kconfig drivers/net/Makefile drivers/net/cxgb3/Makefile drivers/net/cxgb3/version.h build files and versioning Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> --- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
Jeff Garzik wrote: Divy Le Ray wrote: From: Divy Le Ray [EMAIL PROTECTED] This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray [EMAIL PROTECTED] Once you think it's ready, email me a URL to a single patch that adds the driver to the latest linux-2.6.git kernel. Include in the email a description of the driver and signed-off-by line, which will get directly included in the git changelog. Adding new drivers is a bit special, because we want to merge it as a single changeset, but that would create a patch too large to review on the common kernel mailing lists. Jeff, You can grab the monolithic patch at this URL: http://service.chelsio.com/kernel.org/cxgb3.patch.bz2 This patch adds support for the latest 1G/10G Chelsio adapter, T3. It is required by the T3 RDMA driver Steve Wise submitted. Here is a brief description of its content: drivers/net/cxgb3/adapter.h, drivers/net/cxgb3/common.h, drivers/net/cxgb3/cxgb3_ioctl.h, drivers/net/cxgb3/firmware_exports.h: main header files drivers/net/cxgb3/cxgb3_main.c main source file drivers/net/cxgb3/t3_hw.c HW access routines drivers/net/cxgb3/sge.c, drivers/net/cxgb3/sge_defs.h scatter/gather engine drivers/net/cxgb3/ael1002.c, drivers/net/cxgb3/mc5.c, drivers/net/cxgb3/vsc8211.c, drivers/net/cxgb3/xgmac.c on board memory, MAC and PHY management drivers/net/cxgb3/cxgb3_ctl_defs.h, drivers/net/cxgb3/cxgb3_defs.h, drivers/net/cxgb3/cxgb3_offload.h, drivers/net/cxgb3/l2t.h, drivers/net/cxgb3/t3_cpl.h, drivers/net/cxgb3/t3cdev.h offload operations header files drivers/net/cxgb3/cxgb3_offload.c, drivers/net/cxgb3/l2t.c offload capabilities drivers/net/cxgb3/regs.h register definitions drivers/net/Kconfig drivers/net/Makefile drivers/net/cxgb3/Makefile drivers/net/cxgb3/version.h build files and versioning Signed-off-by: Divy Le Ray [EMAIL PROTECTED] --- - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
Divy Le Ray wrote: Jeff Garzik wrote: Divy Le Ray wrote: From: Divy Le Ray [EMAIL PROTECTED] This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray [EMAIL PROTECTED] Once you think it's ready, email me a URL to a single patch that adds the driver to the latest linux-2.6.git kernel. Include in the email a description of the driver and signed-off-by line, which will get directly included in the git changelog. Adding new drivers is a bit special, because we want to merge it as a single changeset, but that would create a patch too large to review on the common kernel mailing lists. Jeff, You can grab the monolithic patch at this URL: http://service.chelsio.com/kernel.org/cxgb3.patch.bz2 this is in my queue, thanks. Sorry I didn't indicate that earlier. Jeff - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
You can grab the monolithic patch at this URL: http://service.chelsio.com/kernel.org/cxgb3.patch.bz2 this is in my queue, thanks. Sorry I didn't indicate that earlier. When do you plan to merge it? For 2.6.20 or .21? I'm trying to understand when the RDMA stuff that depends on the ethernet driver can be merged. Thanks, Roland - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
Roland Dreier wrote: You can grab the monolithic patch at this URL: http://service.chelsio.com/kernel.org/cxgb3.patch.bz2 this is in my queue, thanks. Sorry I didn't indicate that earlier. When do you plan to merge it? For 2.6.20 or .21? The time for adding new stuff to 2.6.20 is /long/ past. We stop adding things like new drivers when Linus releases 2.6.X-rc1. Jeff - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
The time for adding new stuff to 2.6.20 is /long/ past. We stop adding things like new drivers when Linus releases 2.6.X-rc1. Well, in the past I think new drivers have been added after the merge window, given that there's no chance of regressions (old kernel == no support for device X, so even if the new driver is buggy it's no worse than the old kernel). (eg a quick git scan shows commit 0f64478c added a USB driver between 2.6.19-rc2 and 2.6.19-rc3, and I'm sure you can find lots of other examples) Anyway, you answered my question. I wasn't pushing to include the driver now, I just wanted to know what you were planning to do. Thanks. - R. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
Roland, The T3 Ethernet driver is queued for inclusion into Jeff's tree. How do you want to merge in the RDMA driver? I can give you a single monolithic patch if you want. We also need to decide on the ib_req_notify_cq() issue. Steve. On Tue, 2007-01-09 at 05:28 -0500, Jeff Garzik wrote: Divy Le Ray wrote: Jeff Garzik wrote: Divy Le Ray wrote: From: Divy Le Ray [EMAIL PROTECTED] This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray [EMAIL PROTECTED] Once you think it's ready, email me a URL to a single patch that adds the driver to the latest linux-2.6.git kernel. Include in the email a description of the driver and signed-off-by line, which will get directly included in the git changelog. Adding new drivers is a bit special, because we want to merge it as a single changeset, but that would create a patch too large to review on the common kernel mailing lists. Jeff, You can grab the monolithic patch at this URL: http://service.chelsio.com/kernel.org/cxgb3.patch.bz2 this is in my queue, thanks. Sorry I didn't indicate that earlier. Jeff - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
We also need to decide on the ib_req_notify_cq() issue. Let's clarify - do you oppose doing copy_from_user from a fixed address passed in during setup? If OK with you, this seems the best way as it is the least controversial and least disruptive one. -- MST - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
On Tue, 2007-01-09 at 15:57 +0200, Michael S. Tsirkin wrote: We also need to decide on the ib_req_notify_cq() issue. Let's clarify - do you oppose doing copy_from_user from a fixed address passed in during setup? So far its been you and I arguing over this issue. Before I go implement it and retest everything, I'd like some indication that anyone else thinks its the right thing to do vs adding the extra parameter to ib_req_notify_cq(). If OK with you, this seems the best way as it is the least controversial and least disruptive one. In the interest of expediting this I'll go implement it... Steve. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: [openib-general] [PATCH 1/10] cxgb3 - main header files
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael S. Tsirkin Sent: Tuesday, January 09, 2007 5:57 AM To: Steve Wise Cc: netdev@vger.kernel.org; Roland Dreier; Divy Le Ray; linux-kernel@vger.kernel.org; openib-general Subject: Re: [openib-general] [PATCH 1/10] cxgb3 - main header files We also need to decide on the ib_req_notify_cq() issue. Let's clarify - do you oppose doing copy_from_user from a fixed address passed in during setup? If OK with you, this seems the best way as it is the least controversial and least disruptive one. To clarfiy my understanding of this issue: A device MAY implement ib_req_notify_cq by updating a location directly from user mode. Any of the techniques that apply to other user allocated objects, such as the Send Queue, can be applied here. Even those the proposed changes would be about as low impact and benign as possible, the fact that there are valid solutions without an API changes leans heavily towards using those solutions. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [openib-general] [PATCH 1/10] cxgb3 - main header files
In the interest of expediting this I'll go implement it... Steve. Here it is. I think this is the correct way to solve the issue (now that I've implemented it :). This is a delta from the driver patch series just for reviewing purposes. commit e6053f2aee764b21e28cbb19f52995cb413cf733 Author: Steve Wise [EMAIL PROTECTED] Date: Tue Jan 9 13:06:13 2007 -0600 Chelsio-specific solution for copying in the user cq_index. - at cq_create time, user lib passes in the address of its cq rptr u32. - kernel saves this address in the iwch_cq struct. - kernel copies in the rptr value in iwch_req_notify_cq(). Signed-off-by: Steve Wise [EMAIL PROTECTED] diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c index ab99202..28be418 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_provider.c +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c @@ -143,6 +143,7 @@ static struct ib_cq *iwch_create_cq(stru struct iwch_dev *rhp; struct iwch_cq *chp; struct iwch_create_cq_resp uresp; + struct iwch_create_cq_req ureq; PDBG(%s ib_dev %p entries %d\n, __FUNCTION__, ibdev, entries); rhp = to_iwch_dev(ibdev); @@ -150,6 +151,14 @@ static struct ib_cq *iwch_create_cq(stru if (!chp) return ERR_PTR(-ENOMEM); + if (context) { + if (ib_copy_from_udata(ureq, udata, sizeof (ureq))) { + kfree(chp); + return ERR_PTR(-EFAULT); + } + chp-user_rptr_addr = (u32 *)(unsigned long)ureq.user_rptr_addr; + } + if (t3a_device(rhp)) { /* @@ -269,15 +278,14 @@ static int iwch_resize_cq(struct ib_cq * return ret; } -static int iwch_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify notify, - struct ib_udata *udata) +static int iwch_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify notify) { struct iwch_dev *rhp; struct iwch_cq *chp; enum t3_cq_opcode cq_op; int err; unsigned long flag; - struct iwch_req_notify_cq ucmd; + u32 rptr; chp = to_iwch_cq(ibcq); rhp = chp-rhp; @@ -285,11 +293,11 @@ static int iwch_arm_cq(struct ib_cq *ibc cq_op = CQ_ARM_SE; else cq_op = CQ_ARM_AN; - if (udata t3b_device(rhp)) { - if (ib_copy_from_udata(ucmd, udata, sizeof ucmd)) + if (chp-user_rptr_addr) { + if (get_user(rptr, chp-user_rptr_addr)) return -EFAULT; spin_lock_irqsave(chp-lock, flag); - chp-cq.rptr = ucmd.rptr; + chp-cq.rptr = rptr; } else spin_lock_irqsave(chp-lock, flag); PDBG(%s rptr 0x%x\n, __FUNCTION__, chp-cq.rptr); diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.h b/drivers/infiniband/hw/cxgb3/iwch_provider.h index f339427..d9d94e3 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_provider.h +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.h @@ -105,6 +105,7 @@ struct iwch_cq { spinlock_t lock; atomic_t refcnt; wait_queue_head_t wait; + u32 *user_rptr_addr; }; static inline struct iwch_cq *to_iwch_cq(struct ib_cq *ibcq) diff --git a/drivers/infiniband/hw/cxgb3/iwch_user.h b/drivers/infiniband/hw/cxgb3/iwch_user.h index 4e4b9c9..e8ff061 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_user.h +++ b/drivers/infiniband/hw/cxgb3/iwch_user.h @@ -42,6 +42,9 @@ #define IWCH_UVERBS_ABI_VERSION 1 * In particular do not use pointer types -- pass pointers in __u64 * instead. */ +struct iwch_create_cq_req { + __u64 user_rptr_addr; +}; struct iwch_create_cq_resp { __u64 physaddr; @@ -61,8 +64,4 @@ struct iwch_create_qp_resp { struct iwch_reg_user_mr_resp { __u32 pbl_addr; }; - -struct iwch_req_notify_cq { - __u32 rptr; -}; #endif - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
On Wed, 2006-12-27 at 00:52 -0800, Divy Le Ray wrote: > Jeff, > > You can grab the monolithic patch at this URL: > http://service.chelsio.com/kernel.org/cxgb3.patch.bz2 > > This patch adds support for the latest 1G/10G Chelsio adapter, T3. > It is required by the T3 RDMA driver Steve Wise submitted. does this patch still contain all the private ioctls? They are being ripped out from another new driver, and cxgb3 should probably have the same treatment... - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
Jeff, You can grab the monolithic patch at this URL: http://service.chelsio.com/kernel.org/cxgb3.patch.bz2 This patch adds support for the latest 1G/10G Chelsio adapter, T3. It is required by the T3 RDMA driver Steve Wise submitted. Here is a brief description of its content: drivers/net/cxgb3/adapter.h, drivers/net/cxgb3/common.h, drivers/net/cxgb3/cxgb3_ioctl.h, drivers/net/cxgb3/firmware_exports.h: main header files drivers/net/cxgb3/cxgb3_main.c main source file drivers/net/cxgb3/t3_hw.c HW access routines drivers/net/cxgb3/sge.c, drivers/net/cxgb3/sge_defs.h scatter/gather engine drivers/net/cxgb3/ael1002.c, drivers/net/cxgb3/mc5.c, drivers/net/cxgb3/vsc8211.c, drivers/net/cxgb3/xgmac.c on board memory, MAC and PHY management drivers/net/cxgb3/cxgb3_ctl_defs.h, drivers/net/cxgb3/cxgb3_defs.h, drivers/net/cxgb3/cxgb3_offload.h, drivers/net/cxgb3/l2t.h, drivers/net/cxgb3/t3_cpl.h, drivers/net/cxgb3/t3cdev.h offload operations header files drivers/net/cxgb3/cxgb3_offload.c, drivers/net/cxgb3/l2t.c offload capabilities drivers/net/cxgb3/regs.h register definitions drivers/net/Kconfig drivers/net/Makefile drivers/net/cxgb3/Makefile drivers/net/cxgb3/version.h build files and versioning Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> --- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
Jeff, You can grab the monolithic patch at this URL: http://service.chelsio.com/kernel.org/cxgb3.patch.bz2 This patch adds support for the latest 1G/10G Chelsio adapter, T3. It is required by the T3 RDMA driver Steve Wise submitted. Here is a brief description of its content: drivers/net/cxgb3/adapter.h, drivers/net/cxgb3/common.h, drivers/net/cxgb3/cxgb3_ioctl.h, drivers/net/cxgb3/firmware_exports.h: main header files drivers/net/cxgb3/cxgb3_main.c main source file drivers/net/cxgb3/t3_hw.c HW access routines drivers/net/cxgb3/sge.c, drivers/net/cxgb3/sge_defs.h scatter/gather engine drivers/net/cxgb3/ael1002.c, drivers/net/cxgb3/mc5.c, drivers/net/cxgb3/vsc8211.c, drivers/net/cxgb3/xgmac.c on board memory, MAC and PHY management drivers/net/cxgb3/cxgb3_ctl_defs.h, drivers/net/cxgb3/cxgb3_defs.h, drivers/net/cxgb3/cxgb3_offload.h, drivers/net/cxgb3/l2t.h, drivers/net/cxgb3/t3_cpl.h, drivers/net/cxgb3/t3cdev.h offload operations header files drivers/net/cxgb3/cxgb3_offload.c, drivers/net/cxgb3/l2t.c offload capabilities drivers/net/cxgb3/regs.h register definitions drivers/net/Kconfig drivers/net/Makefile drivers/net/cxgb3/Makefile drivers/net/cxgb3/version.h build files and versioning Signed-off-by: Divy Le Ray [EMAIL PROTECTED] --- - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
On Wed, 2006-12-27 at 00:52 -0800, Divy Le Ray wrote: Jeff, You can grab the monolithic patch at this URL: http://service.chelsio.com/kernel.org/cxgb3.patch.bz2 This patch adds support for the latest 1G/10G Chelsio adapter, T3. It is required by the T3 RDMA driver Steve Wise submitted. does this patch still contain all the private ioctls? They are being ripped out from another new driver, and cxgb3 should probably have the same treatment... - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
Divy Le Ray wrote: From: Divy Le Ray <[EMAIL PROTECTED]> This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> Once you think it's ready, email me a URL to a single patch that adds the driver to the latest linux-2.6.git kernel. Include in the email a description of the driver and signed-off-by line, which will get directly included in the git changelog. Adding new drivers is a bit special, because we want to merge it as a single changeset, but that would create a patch too large to review on the common kernel mailing lists. Jeff - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
Divy Le Ray wrote: From: Divy Le Ray [EMAIL PROTECTED] This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray [EMAIL PROTECTED] Once you think it's ready, email me a URL to a single patch that adds the driver to the latest linux-2.6.git kernel. Include in the email a description of the driver and signed-off-by line, which will get directly included in the git changelog. Adding new drivers is a bit special, because we want to merge it as a single changeset, but that would create a patch too large to review on the common kernel mailing lists. Jeff - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/10] cxgb3 - main header files
From: Divy Le Ray <[EMAIL PROTECTED]> This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> --- drivers/net/cxgb3/adapter.h | 255 drivers/net/cxgb3/common.h | 709 ++ drivers/net/cxgb3/cxgb3_ioctl.h | 165 drivers/net/cxgb3/firmware_exports.h | 144 +++ 4 files changed, 1273 insertions(+), 0 deletions(-) diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h new file mode 100755 index 000..16643f6 --- /dev/null +++ b/drivers/net/cxgb3/adapter.h @@ -0,0 +1,255 @@ +/* + * This file is part of the Chelsio T3 Ethernet driver for Linux. + * + * Copyright (C) 2003-2006 Chelsio Communications. All rights reserved. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file included in this + * release for licensing terms and conditions. + */ + +/* This file should not be included directly. Include common.h instead. */ + +#ifndef __T3_ADAPTER_H__ +#define __T3_ADAPTER_H__ + +#include +#include +#include +#include +#include +#include "t3cdev.h" +#include +#include +#include + +typedef irqreturn_t(*intr_handler_t) (int, void *); + +struct vlan_group; + +struct port_info { + struct vlan_group *vlan_grp; + const struct port_type_info *port_type; + u8 port_id; + u8 rx_csum_offload; + u8 nqsets; + u8 first_qset; + struct cphy phy; + struct cmac mac; + struct link_config link_config; + struct net_device_stats netstats; + int activity; +}; + +enum { /* adapter flags */ + FULL_INIT_DONE = (1 << 0), + USING_MSI = (1 << 1), + USING_MSIX = (1 << 2), +}; + +struct rx_desc; +struct rx_sw_desc; + +struct sge_fl {/* SGE per free-buffer list state */ + unsigned int buf_size; /* size of each Rx buffer */ + unsigned int credits; /* # of available Rx buffers */ + unsigned int size; /* capacity of free list */ + unsigned int cidx; /* consumer index */ + unsigned int pidx; /* producer index */ + unsigned int gen; /* free list generation */ + struct rx_desc *desc; /* address of HW Rx descriptor ring */ + struct rx_sw_desc *sdesc; /* address of SW Rx descriptor ring */ + dma_addr_t phys_addr; /* physical address of HW ring start */ + unsigned int cntxt_id; /* SGE context id for the free list */ + unsigned long empty;/* # of times queue ran out of buffers */ +}; + +/* + * Bundle size for grouping offload RX packets for delivery to the stack. + * Don't make this too big as we do prefetch on each packet in a bundle. + */ +# define RX_BUNDLE_SIZE 8 + +struct rsp_desc; + +struct sge_rspq { /* state for an SGE response queue */ + unsigned int credits; /* # of pending response credits */ + unsigned int size; /* capacity of response queue */ + unsigned int cidx; /* consumer index */ + unsigned int gen; /* current generation bit */ + unsigned int polling; /* is the queue serviced through NAPI? */ + unsigned int holdoff_tmr; /* interrupt holdoff timer in 100ns */ + unsigned int next_holdoff; /* holdoff time for next interrupt */ + struct rsp_desc *desc; /* address of HW response ring */ + dma_addr_t phys_addr; /* physical address of the ring */ + unsigned int cntxt_id; /* SGE context id for the response q */ + spinlock_t lock;/* guards response processing */ + struct sk_buff *rx_head;/* offload packet receive queue head */ + struct sk_buff *rx_tail;/* offload packet receive queue tail */ + + unsigned long offload_pkts; + unsigned long offload_bundles; + unsigned long eth_pkts; /* # of ethernet packets */ + unsigned long pure_rsps;/* # of pure (non-data) responses */ + unsigned long imm_data; /* responses with immediate data */ + unsigned long rx_drops; /* # of packets dropped due to no mem */ + unsigned long async_notif; /* # of asynchronous notification events */ + unsigned long empty;/* # of times queue ran out of credits */ + unsigned long nomem;/* # of responses deferred due to no mem */ + unsigned long unhandled_irqs; /* # of spurious intrs */ +}; + +struct tx_desc; +struct tx_sw_desc; + +struct sge_txq { /* state for an SGE Tx queue */ + unsigned long flags;/* HW DMA fetch status */ + unsigned int in_use;/* # of in-use Tx descriptors */ + unsigned int size; /* # of descriptors */ + unsigned int processed; /* total # of descs HW has processed */ + unsigned int cleaned; /* total # of
[PATCH 1/10] cxgb3 - main header files
From: Divy Le Ray [EMAIL PROTECTED] This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray [EMAIL PROTECTED] --- drivers/net/cxgb3/adapter.h | 255 drivers/net/cxgb3/common.h | 709 ++ drivers/net/cxgb3/cxgb3_ioctl.h | 165 drivers/net/cxgb3/firmware_exports.h | 144 +++ 4 files changed, 1273 insertions(+), 0 deletions(-) diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h new file mode 100755 index 000..16643f6 --- /dev/null +++ b/drivers/net/cxgb3/adapter.h @@ -0,0 +1,255 @@ +/* + * This file is part of the Chelsio T3 Ethernet driver for Linux. + * + * Copyright (C) 2003-2006 Chelsio Communications. All rights reserved. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file included in this + * release for licensing terms and conditions. + */ + +/* This file should not be included directly. Include common.h instead. */ + +#ifndef __T3_ADAPTER_H__ +#define __T3_ADAPTER_H__ + +#include linux/pci.h +#include linux/spinlock.h +#include linux/interrupt.h +#include linux/timer.h +#include linux/cache.h +#include t3cdev.h +#include asm/semaphore.h +#include asm/bitops.h +#include asm/io.h + +typedef irqreturn_t(*intr_handler_t) (int, void *); + +struct vlan_group; + +struct port_info { + struct vlan_group *vlan_grp; + const struct port_type_info *port_type; + u8 port_id; + u8 rx_csum_offload; + u8 nqsets; + u8 first_qset; + struct cphy phy; + struct cmac mac; + struct link_config link_config; + struct net_device_stats netstats; + int activity; +}; + +enum { /* adapter flags */ + FULL_INIT_DONE = (1 0), + USING_MSI = (1 1), + USING_MSIX = (1 2), +}; + +struct rx_desc; +struct rx_sw_desc; + +struct sge_fl {/* SGE per free-buffer list state */ + unsigned int buf_size; /* size of each Rx buffer */ + unsigned int credits; /* # of available Rx buffers */ + unsigned int size; /* capacity of free list */ + unsigned int cidx; /* consumer index */ + unsigned int pidx; /* producer index */ + unsigned int gen; /* free list generation */ + struct rx_desc *desc; /* address of HW Rx descriptor ring */ + struct rx_sw_desc *sdesc; /* address of SW Rx descriptor ring */ + dma_addr_t phys_addr; /* physical address of HW ring start */ + unsigned int cntxt_id; /* SGE context id for the free list */ + unsigned long empty;/* # of times queue ran out of buffers */ +}; + +/* + * Bundle size for grouping offload RX packets for delivery to the stack. + * Don't make this too big as we do prefetch on each packet in a bundle. + */ +# define RX_BUNDLE_SIZE 8 + +struct rsp_desc; + +struct sge_rspq { /* state for an SGE response queue */ + unsigned int credits; /* # of pending response credits */ + unsigned int size; /* capacity of response queue */ + unsigned int cidx; /* consumer index */ + unsigned int gen; /* current generation bit */ + unsigned int polling; /* is the queue serviced through NAPI? */ + unsigned int holdoff_tmr; /* interrupt holdoff timer in 100ns */ + unsigned int next_holdoff; /* holdoff time for next interrupt */ + struct rsp_desc *desc; /* address of HW response ring */ + dma_addr_t phys_addr; /* physical address of the ring */ + unsigned int cntxt_id; /* SGE context id for the response q */ + spinlock_t lock;/* guards response processing */ + struct sk_buff *rx_head;/* offload packet receive queue head */ + struct sk_buff *rx_tail;/* offload packet receive queue tail */ + + unsigned long offload_pkts; + unsigned long offload_bundles; + unsigned long eth_pkts; /* # of ethernet packets */ + unsigned long pure_rsps;/* # of pure (non-data) responses */ + unsigned long imm_data; /* responses with immediate data */ + unsigned long rx_drops; /* # of packets dropped due to no mem */ + unsigned long async_notif; /* # of asynchronous notification events */ + unsigned long empty;/* # of times queue ran out of credits */ + unsigned long nomem;/* # of responses deferred due to no mem */ + unsigned long unhandled_irqs; /* # of spurious intrs */ +}; + +struct tx_desc; +struct tx_sw_desc; + +struct sge_txq { /* state for an SGE Tx queue */ + unsigned long flags;/* HW DMA fetch status */ + unsigned int in_use;/* # of in-use Tx descriptors */ + unsigned int size; /* # of descriptors */ + unsigned int
[PATCH 1/10] cxgb3 - main header files
From: Divy Le Ray <[EMAIL PROTECTED]> This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> --- drivers/net/cxgb3/adapter.h | 255 drivers/net/cxgb3/common.h | 709 ++ drivers/net/cxgb3/cxgb3_ioctl.h | 165 drivers/net/cxgb3/firmware_exports.h | 144 +++ 4 files changed, 1273 insertions(+), 0 deletions(-) diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h new file mode 100755 index 000..16643f6 --- /dev/null +++ b/drivers/net/cxgb3/adapter.h @@ -0,0 +1,255 @@ +/* + * This file is part of the Chelsio T3 Ethernet driver for Linux. + * + * Copyright (C) 2003-2006 Chelsio Communications. All rights reserved. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file included in this + * release for licensing terms and conditions. + */ + +/* This file should not be included directly. Include common.h instead. */ + +#ifndef __T3_ADAPTER_H__ +#define __T3_ADAPTER_H__ + +#include +#include +#include +#include +#include +#include "t3cdev.h" +#include +#include +#include + +typedef irqreturn_t(*intr_handler_t) (int, void *); + +struct vlan_group; + +struct port_info { + struct vlan_group *vlan_grp; + const struct port_type_info *port_type; + u8 port_id; + u8 rx_csum_offload; + u8 nqsets; + u8 first_qset; + struct cphy phy; + struct cmac mac; + struct link_config link_config; + struct net_device_stats netstats; + int activity; +}; + +enum { /* adapter flags */ + FULL_INIT_DONE = (1 << 0), + USING_MSI = (1 << 1), + USING_MSIX = (1 << 2), +}; + +struct rx_desc; +struct rx_sw_desc; + +struct sge_fl {/* SGE per free-buffer list state */ + unsigned int buf_size; /* size of each Rx buffer */ + unsigned int credits; /* # of available Rx buffers */ + unsigned int size; /* capacity of free list */ + unsigned int cidx; /* consumer index */ + unsigned int pidx; /* producer index */ + unsigned int gen; /* free list generation */ + struct rx_desc *desc; /* address of HW Rx descriptor ring */ + struct rx_sw_desc *sdesc; /* address of SW Rx descriptor ring */ + dma_addr_t phys_addr; /* physical address of HW ring start */ + unsigned int cntxt_id; /* SGE context id for the free list */ + unsigned long empty;/* # of times queue ran out of buffers */ +}; + +/* + * Bundle size for grouping offload RX packets for delivery to the stack. + * Don't make this too big as we do prefetch on each packet in a bundle. + */ +# define RX_BUNDLE_SIZE 8 + +struct rsp_desc; + +struct sge_rspq { /* state for an SGE response queue */ + unsigned int credits; /* # of pending response credits */ + unsigned int size; /* capacity of response queue */ + unsigned int cidx; /* consumer index */ + unsigned int gen; /* current generation bit */ + unsigned int polling; /* is the queue serviced through NAPI? */ + unsigned int holdoff_tmr; /* interrupt holdoff timer in 100ns */ + unsigned int next_holdoff; /* holdoff time for next interrupt */ + struct rsp_desc *desc; /* address of HW response ring */ + dma_addr_t phys_addr; /* physical address of the ring */ + unsigned int cntxt_id; /* SGE context id for the response q */ + spinlock_t lock;/* guards response processing */ + struct sk_buff *rx_head;/* offload packet receive queue head */ + struct sk_buff *rx_tail;/* offload packet receive queue tail */ + + unsigned long offload_pkts; + unsigned long offload_bundles; + unsigned long eth_pkts; /* # of ethernet packets */ + unsigned long pure_rsps;/* # of pure (non-data) responses */ + unsigned long imm_data; /* responses with immediate data */ + unsigned long rx_drops; /* # of packets dropped due to no mem */ + unsigned long async_notif; /* # of asynchronous notification events */ + unsigned long empty;/* # of times queue ran out of credits */ + unsigned long nomem;/* # of responses deferred due to no mem */ + unsigned long unhandled_irqs; /* # of spurious intrs */ +}; + +struct tx_desc; +struct tx_sw_desc; + +struct sge_txq { /* state for an SGE Tx queue */ + unsigned long flags;/* HW DMA fetch status */ + unsigned int in_use;/* # of in-use Tx descriptors */ + unsigned int size; /* # of descriptors */ + unsigned int processed; /* total # of descs HW has processed */ + unsigned int cleaned; /* total # of
[PATCH 1/10] cxgb3 - main header files
From: Divy Le Ray [EMAIL PROTECTED] This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray [EMAIL PROTECTED] --- drivers/net/cxgb3/adapter.h | 255 drivers/net/cxgb3/common.h | 709 ++ drivers/net/cxgb3/cxgb3_ioctl.h | 165 drivers/net/cxgb3/firmware_exports.h | 144 +++ 4 files changed, 1273 insertions(+), 0 deletions(-) diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h new file mode 100755 index 000..16643f6 --- /dev/null +++ b/drivers/net/cxgb3/adapter.h @@ -0,0 +1,255 @@ +/* + * This file is part of the Chelsio T3 Ethernet driver for Linux. + * + * Copyright (C) 2003-2006 Chelsio Communications. All rights reserved. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file included in this + * release for licensing terms and conditions. + */ + +/* This file should not be included directly. Include common.h instead. */ + +#ifndef __T3_ADAPTER_H__ +#define __T3_ADAPTER_H__ + +#include linux/pci.h +#include linux/spinlock.h +#include linux/interrupt.h +#include linux/timer.h +#include linux/cache.h +#include t3cdev.h +#include asm/semaphore.h +#include asm/bitops.h +#include asm/io.h + +typedef irqreturn_t(*intr_handler_t) (int, void *); + +struct vlan_group; + +struct port_info { + struct vlan_group *vlan_grp; + const struct port_type_info *port_type; + u8 port_id; + u8 rx_csum_offload; + u8 nqsets; + u8 first_qset; + struct cphy phy; + struct cmac mac; + struct link_config link_config; + struct net_device_stats netstats; + int activity; +}; + +enum { /* adapter flags */ + FULL_INIT_DONE = (1 0), + USING_MSI = (1 1), + USING_MSIX = (1 2), +}; + +struct rx_desc; +struct rx_sw_desc; + +struct sge_fl {/* SGE per free-buffer list state */ + unsigned int buf_size; /* size of each Rx buffer */ + unsigned int credits; /* # of available Rx buffers */ + unsigned int size; /* capacity of free list */ + unsigned int cidx; /* consumer index */ + unsigned int pidx; /* producer index */ + unsigned int gen; /* free list generation */ + struct rx_desc *desc; /* address of HW Rx descriptor ring */ + struct rx_sw_desc *sdesc; /* address of SW Rx descriptor ring */ + dma_addr_t phys_addr; /* physical address of HW ring start */ + unsigned int cntxt_id; /* SGE context id for the free list */ + unsigned long empty;/* # of times queue ran out of buffers */ +}; + +/* + * Bundle size for grouping offload RX packets for delivery to the stack. + * Don't make this too big as we do prefetch on each packet in a bundle. + */ +# define RX_BUNDLE_SIZE 8 + +struct rsp_desc; + +struct sge_rspq { /* state for an SGE response queue */ + unsigned int credits; /* # of pending response credits */ + unsigned int size; /* capacity of response queue */ + unsigned int cidx; /* consumer index */ + unsigned int gen; /* current generation bit */ + unsigned int polling; /* is the queue serviced through NAPI? */ + unsigned int holdoff_tmr; /* interrupt holdoff timer in 100ns */ + unsigned int next_holdoff; /* holdoff time for next interrupt */ + struct rsp_desc *desc; /* address of HW response ring */ + dma_addr_t phys_addr; /* physical address of the ring */ + unsigned int cntxt_id; /* SGE context id for the response q */ + spinlock_t lock;/* guards response processing */ + struct sk_buff *rx_head;/* offload packet receive queue head */ + struct sk_buff *rx_tail;/* offload packet receive queue tail */ + + unsigned long offload_pkts; + unsigned long offload_bundles; + unsigned long eth_pkts; /* # of ethernet packets */ + unsigned long pure_rsps;/* # of pure (non-data) responses */ + unsigned long imm_data; /* responses with immediate data */ + unsigned long rx_drops; /* # of packets dropped due to no mem */ + unsigned long async_notif; /* # of asynchronous notification events */ + unsigned long empty;/* # of times queue ran out of credits */ + unsigned long nomem;/* # of responses deferred due to no mem */ + unsigned long unhandled_irqs; /* # of spurious intrs */ +}; + +struct tx_desc; +struct tx_sw_desc; + +struct sge_txq { /* state for an SGE Tx queue */ + unsigned long flags;/* HW DMA fetch status */ + unsigned int in_use;/* # of in-use Tx descriptors */ + unsigned int size; /* # of descriptors */ + unsigned int
[PATCH 1/10] cxgb3 - main header files
From: Divy Le Ray <[EMAIL PROTECTED]> This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> --- drivers/net/cxgb3/adapter.h | 255 drivers/net/cxgb3/common.h | 709 ++ drivers/net/cxgb3/cxgb3_ioctl.h | 165 drivers/net/cxgb3/firmware_exports.h | 144 +++ 4 files changed, 1273 insertions(+), 0 deletions(-) diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h new file mode 100755 index 000..16643f6 --- /dev/null +++ b/drivers/net/cxgb3/adapter.h @@ -0,0 +1,255 @@ +/* + * This file is part of the Chelsio T3 Ethernet driver for Linux. + * + * Copyright (C) 2003-2006 Chelsio Communications. All rights reserved. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file included in this + * release for licensing terms and conditions. + */ + +/* This file should not be included directly. Include common.h instead. */ + +#ifndef __T3_ADAPTER_H__ +#define __T3_ADAPTER_H__ + +#include +#include +#include +#include +#include +#include "t3cdev.h" +#include +#include +#include + +typedef irqreturn_t(*intr_handler_t) (int, void *); + +struct vlan_group; + +struct port_info { + struct vlan_group *vlan_grp; + const struct port_type_info *port_type; + u8 port_id; + u8 rx_csum_offload; + u8 nqsets; + u8 first_qset; + struct cphy phy; + struct cmac mac; + struct link_config link_config; + struct net_device_stats netstats; + int activity; +}; + +enum { /* adapter flags */ + FULL_INIT_DONE = (1 << 0), + USING_MSI = (1 << 1), + USING_MSIX = (1 << 2), +}; + +struct rx_desc; +struct rx_sw_desc; + +struct sge_fl {/* SGE per free-buffer list state */ + unsigned int buf_size; /* size of each Rx buffer */ + unsigned int credits; /* # of available Rx buffers */ + unsigned int size; /* capacity of free list */ + unsigned int cidx; /* consumer index */ + unsigned int pidx; /* producer index */ + unsigned int gen; /* free list generation */ + struct rx_desc *desc; /* address of HW Rx descriptor ring */ + struct rx_sw_desc *sdesc; /* address of SW Rx descriptor ring */ + dma_addr_t phys_addr; /* physical address of HW ring start */ + unsigned int cntxt_id; /* SGE context id for the free list */ + unsigned long empty;/* # of times queue ran out of buffers */ +}; + +/* + * Bundle size for grouping offload RX packets for delivery to the stack. + * Don't make this too big as we do prefetch on each packet in a bundle. + */ +# define RX_BUNDLE_SIZE 8 + +struct rsp_desc; + +struct sge_rspq { /* state for an SGE response queue */ + unsigned int credits; /* # of pending response credits */ + unsigned int size; /* capacity of response queue */ + unsigned int cidx; /* consumer index */ + unsigned int gen; /* current generation bit */ + unsigned int polling; /* is the queue serviced through NAPI? */ + unsigned int holdoff_tmr; /* interrupt holdoff timer in 100ns */ + unsigned int next_holdoff; /* holdoff time for next interrupt */ + struct rsp_desc *desc; /* address of HW response ring */ + dma_addr_t phys_addr; /* physical address of the ring */ + unsigned int cntxt_id; /* SGE context id for the response q */ + spinlock_t lock;/* guards response processing */ + struct sk_buff *rx_head;/* offload packet receive queue head */ + struct sk_buff *rx_tail;/* offload packet receive queue tail */ + + unsigned long offload_pkts; + unsigned long offload_bundles; + unsigned long eth_pkts; /* # of ethernet packets */ + unsigned long pure_rsps;/* # of pure (non-data) responses */ + unsigned long imm_data; /* responses with immediate data */ + unsigned long rx_drops; /* # of packets dropped due to no mem */ + unsigned long async_notif; /* # of asynchronous notification events */ + unsigned long empty;/* # of times queue ran out of credits */ + unsigned long nomem;/* # of responses deferred due to no mem */ + unsigned long unhandled_irqs; /* # of spurious intrs */ +}; + +struct tx_desc; +struct tx_sw_desc; + +struct sge_txq { /* state for an SGE Tx queue */ + unsigned long flags;/* HW DMA fetch status */ + unsigned int in_use;/* # of in-use Tx descriptors */ + unsigned int size; /* # of descriptors */ + unsigned int processed; /* total # of descs HW has processed */ + unsigned int cleaned; /* total # of
[PATCH 1/10] cxgb3 - main header files
From: Divy Le Ray [EMAIL PROTECTED] This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray [EMAIL PROTECTED] --- drivers/net/cxgb3/adapter.h | 255 drivers/net/cxgb3/common.h | 709 ++ drivers/net/cxgb3/cxgb3_ioctl.h | 165 drivers/net/cxgb3/firmware_exports.h | 144 +++ 4 files changed, 1273 insertions(+), 0 deletions(-) diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h new file mode 100755 index 000..16643f6 --- /dev/null +++ b/drivers/net/cxgb3/adapter.h @@ -0,0 +1,255 @@ +/* + * This file is part of the Chelsio T3 Ethernet driver for Linux. + * + * Copyright (C) 2003-2006 Chelsio Communications. All rights reserved. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file included in this + * release for licensing terms and conditions. + */ + +/* This file should not be included directly. Include common.h instead. */ + +#ifndef __T3_ADAPTER_H__ +#define __T3_ADAPTER_H__ + +#include linux/pci.h +#include linux/spinlock.h +#include linux/interrupt.h +#include linux/timer.h +#include linux/cache.h +#include t3cdev.h +#include asm/semaphore.h +#include asm/bitops.h +#include asm/io.h + +typedef irqreturn_t(*intr_handler_t) (int, void *); + +struct vlan_group; + +struct port_info { + struct vlan_group *vlan_grp; + const struct port_type_info *port_type; + u8 port_id; + u8 rx_csum_offload; + u8 nqsets; + u8 first_qset; + struct cphy phy; + struct cmac mac; + struct link_config link_config; + struct net_device_stats netstats; + int activity; +}; + +enum { /* adapter flags */ + FULL_INIT_DONE = (1 0), + USING_MSI = (1 1), + USING_MSIX = (1 2), +}; + +struct rx_desc; +struct rx_sw_desc; + +struct sge_fl {/* SGE per free-buffer list state */ + unsigned int buf_size; /* size of each Rx buffer */ + unsigned int credits; /* # of available Rx buffers */ + unsigned int size; /* capacity of free list */ + unsigned int cidx; /* consumer index */ + unsigned int pidx; /* producer index */ + unsigned int gen; /* free list generation */ + struct rx_desc *desc; /* address of HW Rx descriptor ring */ + struct rx_sw_desc *sdesc; /* address of SW Rx descriptor ring */ + dma_addr_t phys_addr; /* physical address of HW ring start */ + unsigned int cntxt_id; /* SGE context id for the free list */ + unsigned long empty;/* # of times queue ran out of buffers */ +}; + +/* + * Bundle size for grouping offload RX packets for delivery to the stack. + * Don't make this too big as we do prefetch on each packet in a bundle. + */ +# define RX_BUNDLE_SIZE 8 + +struct rsp_desc; + +struct sge_rspq { /* state for an SGE response queue */ + unsigned int credits; /* # of pending response credits */ + unsigned int size; /* capacity of response queue */ + unsigned int cidx; /* consumer index */ + unsigned int gen; /* current generation bit */ + unsigned int polling; /* is the queue serviced through NAPI? */ + unsigned int holdoff_tmr; /* interrupt holdoff timer in 100ns */ + unsigned int next_holdoff; /* holdoff time for next interrupt */ + struct rsp_desc *desc; /* address of HW response ring */ + dma_addr_t phys_addr; /* physical address of the ring */ + unsigned int cntxt_id; /* SGE context id for the response q */ + spinlock_t lock;/* guards response processing */ + struct sk_buff *rx_head;/* offload packet receive queue head */ + struct sk_buff *rx_tail;/* offload packet receive queue tail */ + + unsigned long offload_pkts; + unsigned long offload_bundles; + unsigned long eth_pkts; /* # of ethernet packets */ + unsigned long pure_rsps;/* # of pure (non-data) responses */ + unsigned long imm_data; /* responses with immediate data */ + unsigned long rx_drops; /* # of packets dropped due to no mem */ + unsigned long async_notif; /* # of asynchronous notification events */ + unsigned long empty;/* # of times queue ran out of credits */ + unsigned long nomem;/* # of responses deferred due to no mem */ + unsigned long unhandled_irqs; /* # of spurious intrs */ +}; + +struct tx_desc; +struct tx_sw_desc; + +struct sge_txq { /* state for an SGE Tx queue */ + unsigned long flags;/* HW DMA fetch status */ + unsigned int in_use;/* # of in-use Tx descriptors */ + unsigned int size; /* # of descriptors */ + unsigned int
[PATCH 1/10] cxgb3 - main header files
From: Divy Le Ray <[EMAIL PROTECTED]> This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> --- drivers/net/cxgb3/adapter.h | 255 drivers/net/cxgb3/common.h | 710 ++ drivers/net/cxgb3/cxgb3_ioctl.h | 165 drivers/net/cxgb3/firmware_exports.h | 144 +++ 4 files changed, 1274 insertions(+), 0 deletions(-) diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h new file mode 100755 index 000..16643f6 --- /dev/null +++ b/drivers/net/cxgb3/adapter.h @@ -0,0 +1,255 @@ +/* + * This file is part of the Chelsio T3 Ethernet driver for Linux. + * + * Copyright (C) 2003-2006 Chelsio Communications. All rights reserved. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file included in this + * release for licensing terms and conditions. + */ + +/* This file should not be included directly. Include common.h instead. */ + +#ifndef __T3_ADAPTER_H__ +#define __T3_ADAPTER_H__ + +#include +#include +#include +#include +#include +#include "t3cdev.h" +#include +#include +#include + +typedef irqreturn_t(*intr_handler_t) (int, void *); + +struct vlan_group; + +struct port_info { + struct vlan_group *vlan_grp; + const struct port_type_info *port_type; + u8 port_id; + u8 rx_csum_offload; + u8 nqsets; + u8 first_qset; + struct cphy phy; + struct cmac mac; + struct link_config link_config; + struct net_device_stats netstats; + int activity; +}; + +enum { /* adapter flags */ + FULL_INIT_DONE = (1 << 0), + USING_MSI = (1 << 1), + USING_MSIX = (1 << 2), +}; + +struct rx_desc; +struct rx_sw_desc; + +struct sge_fl {/* SGE per free-buffer list state */ + unsigned int buf_size; /* size of each Rx buffer */ + unsigned int credits; /* # of available Rx buffers */ + unsigned int size; /* capacity of free list */ + unsigned int cidx; /* consumer index */ + unsigned int pidx; /* producer index */ + unsigned int gen; /* free list generation */ + struct rx_desc *desc; /* address of HW Rx descriptor ring */ + struct rx_sw_desc *sdesc; /* address of SW Rx descriptor ring */ + dma_addr_t phys_addr; /* physical address of HW ring start */ + unsigned int cntxt_id; /* SGE context id for the free list */ + unsigned long empty;/* # of times queue ran out of buffers */ +}; + +/* + * Bundle size for grouping offload RX packets for delivery to the stack. + * Don't make this too big as we do prefetch on each packet in a bundle. + */ +# define RX_BUNDLE_SIZE 8 + +struct rsp_desc; + +struct sge_rspq { /* state for an SGE response queue */ + unsigned int credits; /* # of pending response credits */ + unsigned int size; /* capacity of response queue */ + unsigned int cidx; /* consumer index */ + unsigned int gen; /* current generation bit */ + unsigned int polling; /* is the queue serviced through NAPI? */ + unsigned int holdoff_tmr; /* interrupt holdoff timer in 100ns */ + unsigned int next_holdoff; /* holdoff time for next interrupt */ + struct rsp_desc *desc; /* address of HW response ring */ + dma_addr_t phys_addr; /* physical address of the ring */ + unsigned int cntxt_id; /* SGE context id for the response q */ + spinlock_t lock;/* guards response processing */ + struct sk_buff *rx_head;/* offload packet receive queue head */ + struct sk_buff *rx_tail;/* offload packet receive queue tail */ + + unsigned long offload_pkts; + unsigned long offload_bundles; + unsigned long eth_pkts; /* # of ethernet packets */ + unsigned long pure_rsps;/* # of pure (non-data) responses */ + unsigned long imm_data; /* responses with immediate data */ + unsigned long rx_drops; /* # of packets dropped due to no mem */ + unsigned long async_notif; /* # of asynchronous notification events */ + unsigned long empty;/* # of times queue ran out of credits */ + unsigned long nomem;/* # of responses deferred due to no mem */ + unsigned long unhandled_irqs; /* # of spurious intrs */ +}; + +struct tx_desc; +struct tx_sw_desc; + +struct sge_txq { /* state for an SGE Tx queue */ + unsigned long flags;/* HW DMA fetch status */ + unsigned int in_use;/* # of in-use Tx descriptors */ + unsigned int size; /* # of descriptors */ + unsigned int processed; /* total # of descs HW has processed */ + unsigned int cleaned; /* total # of
[PATCH 1/10] cxgb3 - main header files
From: Divy Le Ray [EMAIL PROTECTED] This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray [EMAIL PROTECTED] --- drivers/net/cxgb3/adapter.h | 255 drivers/net/cxgb3/common.h | 710 ++ drivers/net/cxgb3/cxgb3_ioctl.h | 165 drivers/net/cxgb3/firmware_exports.h | 144 +++ 4 files changed, 1274 insertions(+), 0 deletions(-) diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h new file mode 100755 index 000..16643f6 --- /dev/null +++ b/drivers/net/cxgb3/adapter.h @@ -0,0 +1,255 @@ +/* + * This file is part of the Chelsio T3 Ethernet driver for Linux. + * + * Copyright (C) 2003-2006 Chelsio Communications. All rights reserved. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file included in this + * release for licensing terms and conditions. + */ + +/* This file should not be included directly. Include common.h instead. */ + +#ifndef __T3_ADAPTER_H__ +#define __T3_ADAPTER_H__ + +#include linux/pci.h +#include linux/spinlock.h +#include linux/interrupt.h +#include linux/timer.h +#include linux/cache.h +#include t3cdev.h +#include asm/semaphore.h +#include asm/bitops.h +#include asm/io.h + +typedef irqreturn_t(*intr_handler_t) (int, void *); + +struct vlan_group; + +struct port_info { + struct vlan_group *vlan_grp; + const struct port_type_info *port_type; + u8 port_id; + u8 rx_csum_offload; + u8 nqsets; + u8 first_qset; + struct cphy phy; + struct cmac mac; + struct link_config link_config; + struct net_device_stats netstats; + int activity; +}; + +enum { /* adapter flags */ + FULL_INIT_DONE = (1 0), + USING_MSI = (1 1), + USING_MSIX = (1 2), +}; + +struct rx_desc; +struct rx_sw_desc; + +struct sge_fl {/* SGE per free-buffer list state */ + unsigned int buf_size; /* size of each Rx buffer */ + unsigned int credits; /* # of available Rx buffers */ + unsigned int size; /* capacity of free list */ + unsigned int cidx; /* consumer index */ + unsigned int pidx; /* producer index */ + unsigned int gen; /* free list generation */ + struct rx_desc *desc; /* address of HW Rx descriptor ring */ + struct rx_sw_desc *sdesc; /* address of SW Rx descriptor ring */ + dma_addr_t phys_addr; /* physical address of HW ring start */ + unsigned int cntxt_id; /* SGE context id for the free list */ + unsigned long empty;/* # of times queue ran out of buffers */ +}; + +/* + * Bundle size for grouping offload RX packets for delivery to the stack. + * Don't make this too big as we do prefetch on each packet in a bundle. + */ +# define RX_BUNDLE_SIZE 8 + +struct rsp_desc; + +struct sge_rspq { /* state for an SGE response queue */ + unsigned int credits; /* # of pending response credits */ + unsigned int size; /* capacity of response queue */ + unsigned int cidx; /* consumer index */ + unsigned int gen; /* current generation bit */ + unsigned int polling; /* is the queue serviced through NAPI? */ + unsigned int holdoff_tmr; /* interrupt holdoff timer in 100ns */ + unsigned int next_holdoff; /* holdoff time for next interrupt */ + struct rsp_desc *desc; /* address of HW response ring */ + dma_addr_t phys_addr; /* physical address of the ring */ + unsigned int cntxt_id; /* SGE context id for the response q */ + spinlock_t lock;/* guards response processing */ + struct sk_buff *rx_head;/* offload packet receive queue head */ + struct sk_buff *rx_tail;/* offload packet receive queue tail */ + + unsigned long offload_pkts; + unsigned long offload_bundles; + unsigned long eth_pkts; /* # of ethernet packets */ + unsigned long pure_rsps;/* # of pure (non-data) responses */ + unsigned long imm_data; /* responses with immediate data */ + unsigned long rx_drops; /* # of packets dropped due to no mem */ + unsigned long async_notif; /* # of asynchronous notification events */ + unsigned long empty;/* # of times queue ran out of credits */ + unsigned long nomem;/* # of responses deferred due to no mem */ + unsigned long unhandled_irqs; /* # of spurious intrs */ +}; + +struct tx_desc; +struct tx_sw_desc; + +struct sge_txq { /* state for an SGE Tx queue */ + unsigned long flags;/* HW DMA fetch status */ + unsigned int in_use;/* # of in-use Tx descriptors */ + unsigned int size; /* # of descriptors */ + unsigned int
[PATCH 1/10] cxgb3 - main header files
From: Divy Le Ray <[EMAIL PROTECTED]> This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> --- drivers/net/cxgb3/adapter.h | 250 drivers/net/cxgb3/common.h | 704 ++ drivers/net/cxgb3/cxgb3_ioctl.h | 165 drivers/net/cxgb3/firmware_exports.h | 144 +++ 4 files changed, 1263 insertions(+), 0 deletions(-) diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h new file mode 100755 index 000..c2eaaf4 --- /dev/null +++ b/drivers/net/cxgb3/adapter.h @@ -0,0 +1,250 @@ +/* + * This file is part of the Chelsio T3 Ethernet driver for Linux. + * + * Copyright (C) 2003-2006 Chelsio Communications. All rights reserved. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file included in this + * release for licensing terms and conditions. + */ + +/* This file should not be included directly. Include common.h instead. */ + +#ifndef __T3_ADAPTER_H__ +#define __T3_ADAPTER_H__ + +#include +#include +#include +#include +#include +#include "t3cdev.h" +#include +#include +#include + +typedef irqreturn_t(*intr_handler_t) (int, void *); + +struct vlan_group; + +struct port_info { + struct net_device *dev; + struct vlan_group *vlan_grp; + const struct port_type_info *port_type; + u8 rx_csum_offload; + u8 nqsets; + u8 first_qset; + struct cphy phy; + struct cmac mac; + struct link_config link_config; + struct net_device_stats netstats; + int activity; +}; + +enum { /* adapter flags */ + FULL_INIT_DONE = (1 << 0), + USING_MSI = (1 << 1), + USING_MSIX = (1 << 2), +}; + +struct rx_desc; +struct rx_sw_desc; + +struct sge_fl {/* SGE per free-buffer list state */ + unsigned int buf_size; /* size of each Rx buffer */ + unsigned int credits; /* # of available Rx buffers */ + unsigned int size; /* capacity of free list */ + unsigned int cidx; /* consumer index */ + unsigned int pidx; /* producer index */ + unsigned int gen; /* free list generation */ + struct rx_desc *desc; /* address of HW Rx descriptor ring */ + struct rx_sw_desc *sdesc; /* address of SW Rx descriptor ring */ + dma_addr_t phys_addr; /* physical address of HW ring start */ + unsigned int cntxt_id; /* SGE context id for the free list */ + unsigned long empty;/* # of times queue ran out of buffers */ +}; + +/* + * Bundle size for grouping offload RX packets for delivery to the stack. + * Don't make this too big as we do prefetch on each packet in a bundle. + */ +# define RX_BUNDLE_SIZE 8 + +struct rsp_desc; + +struct sge_rspq { /* state for an SGE response queue */ + unsigned int credits; /* # of pending response credits */ + unsigned int size; /* capacity of response queue */ + unsigned int cidx; /* consumer index */ + unsigned int gen; /* current generation bit */ + unsigned int polling; /* is the queue serviced through NAPI? */ + unsigned int holdoff_tmr; /* interrupt holdoff timer in 100ns */ + unsigned int next_holdoff; /* holdoff time for next interrupt */ + struct rsp_desc *desc; /* address of HW response ring */ + dma_addr_t phys_addr; /* physical address of the ring */ + unsigned int cntxt_id; /* SGE context id for the response q */ + spinlock_t lock;/* guards response processing */ + struct sk_buff *rx_head;/* offload packet receive queue head */ + struct sk_buff *rx_tail;/* offload packet receive queue tail */ + + unsigned long offload_pkts; + unsigned long offload_bundles; + unsigned long eth_pkts; /* # of ethernet packets */ + unsigned long pure_rsps;/* # of pure (non-data) responses */ + unsigned long imm_data; /* responses with immediate data */ + unsigned long rx_drops; /* # of packets dropped due to no mem */ + unsigned long async_notif; /* # of asynchronous notification events */ + unsigned long empty;/* # of times queue ran out of credits */ + unsigned long nomem;/* # of responses deferred due to no mem */ + unsigned long unhandled_irqs; /* # of spurious intrs */ +}; + +struct tx_desc; +struct tx_sw_desc; + +struct sge_txq { /* state for an SGE Tx queue */ + unsigned long flags;/* HW DMA fetch status */ + unsigned int in_use;/* # of in-use Tx descriptors */ + unsigned int size; /* # of descriptors */ + unsigned int processed; /* total # of descs HW has processed */ + unsigned int
[PATCH 1/10] cxgb3 - main header files
From: Divy Le Ray [EMAIL PROTECTED] This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray [EMAIL PROTECTED] --- drivers/net/cxgb3/adapter.h | 250 drivers/net/cxgb3/common.h | 704 ++ drivers/net/cxgb3/cxgb3_ioctl.h | 165 drivers/net/cxgb3/firmware_exports.h | 144 +++ 4 files changed, 1263 insertions(+), 0 deletions(-) diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h new file mode 100755 index 000..c2eaaf4 --- /dev/null +++ b/drivers/net/cxgb3/adapter.h @@ -0,0 +1,250 @@ +/* + * This file is part of the Chelsio T3 Ethernet driver for Linux. + * + * Copyright (C) 2003-2006 Chelsio Communications. All rights reserved. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file included in this + * release for licensing terms and conditions. + */ + +/* This file should not be included directly. Include common.h instead. */ + +#ifndef __T3_ADAPTER_H__ +#define __T3_ADAPTER_H__ + +#include linux/pci.h +#include linux/spinlock.h +#include linux/interrupt.h +#include linux/timer.h +#include linux/cache.h +#include t3cdev.h +#include asm/semaphore.h +#include asm/bitops.h +#include asm/io.h + +typedef irqreturn_t(*intr_handler_t) (int, void *); + +struct vlan_group; + +struct port_info { + struct net_device *dev; + struct vlan_group *vlan_grp; + const struct port_type_info *port_type; + u8 rx_csum_offload; + u8 nqsets; + u8 first_qset; + struct cphy phy; + struct cmac mac; + struct link_config link_config; + struct net_device_stats netstats; + int activity; +}; + +enum { /* adapter flags */ + FULL_INIT_DONE = (1 0), + USING_MSI = (1 1), + USING_MSIX = (1 2), +}; + +struct rx_desc; +struct rx_sw_desc; + +struct sge_fl {/* SGE per free-buffer list state */ + unsigned int buf_size; /* size of each Rx buffer */ + unsigned int credits; /* # of available Rx buffers */ + unsigned int size; /* capacity of free list */ + unsigned int cidx; /* consumer index */ + unsigned int pidx; /* producer index */ + unsigned int gen; /* free list generation */ + struct rx_desc *desc; /* address of HW Rx descriptor ring */ + struct rx_sw_desc *sdesc; /* address of SW Rx descriptor ring */ + dma_addr_t phys_addr; /* physical address of HW ring start */ + unsigned int cntxt_id; /* SGE context id for the free list */ + unsigned long empty;/* # of times queue ran out of buffers */ +}; + +/* + * Bundle size for grouping offload RX packets for delivery to the stack. + * Don't make this too big as we do prefetch on each packet in a bundle. + */ +# define RX_BUNDLE_SIZE 8 + +struct rsp_desc; + +struct sge_rspq { /* state for an SGE response queue */ + unsigned int credits; /* # of pending response credits */ + unsigned int size; /* capacity of response queue */ + unsigned int cidx; /* consumer index */ + unsigned int gen; /* current generation bit */ + unsigned int polling; /* is the queue serviced through NAPI? */ + unsigned int holdoff_tmr; /* interrupt holdoff timer in 100ns */ + unsigned int next_holdoff; /* holdoff time for next interrupt */ + struct rsp_desc *desc; /* address of HW response ring */ + dma_addr_t phys_addr; /* physical address of the ring */ + unsigned int cntxt_id; /* SGE context id for the response q */ + spinlock_t lock;/* guards response processing */ + struct sk_buff *rx_head;/* offload packet receive queue head */ + struct sk_buff *rx_tail;/* offload packet receive queue tail */ + + unsigned long offload_pkts; + unsigned long offload_bundles; + unsigned long eth_pkts; /* # of ethernet packets */ + unsigned long pure_rsps;/* # of pure (non-data) responses */ + unsigned long imm_data; /* responses with immediate data */ + unsigned long rx_drops; /* # of packets dropped due to no mem */ + unsigned long async_notif; /* # of asynchronous notification events */ + unsigned long empty;/* # of times queue ran out of credits */ + unsigned long nomem;/* # of responses deferred due to no mem */ + unsigned long unhandled_irqs; /* # of spurious intrs */ +}; + +struct tx_desc; +struct tx_sw_desc; + +struct sge_txq { /* state for an SGE Tx queue */ + unsigned long flags;/* HW DMA fetch status */ + unsigned int in_use;/* # of in-use Tx descriptors */ + unsigned int size; /* # of descriptors */ +
Re: [PATCH 1/10] cxgb3 - main header files
On Nov 17 2006 12:23, Divy Le Ray <[EMAIL PROTECTED]> wrote: >Subject: [PATCH 1/10] cxgb3 - main header files (For all files) Some suggestions: * change the typedefs to struct, this includes: adapter_t -> struct adapter * function prototypes and function headers (e.g. t3_get_cong_cntl_tab) are listed as void t3_get_cong_cntl_tab(adapter_t *adap, unsigned short incr[NMTUS][NCCTRL_WIN]); which could be shortened to void t3_get_cong_cntl_tab(adapter_t *adap, unsigned short incr[][]); functions where there is only one level of [], e.g. void t3_load_mtus(adapter_t *adap, unsigned short mtus[NMTUS], unsigned short alpha[NCCTRL_WIN], unsigned short beta[NCCTRL_WIN], unsigned short mtu_cap); could become void t3_load_mtus(adapter_t *adap, unsigned short *mtus, unsigned short *alpha, unsigned short *beta, unsigned short mtu_cap); depending on your taste. * get rid of superfluous from-void/to-void casts, such as: cxgb3_main.c:754: struct adapter *adapter = (struct adapter *)dev->priv; in some places, the 'U' suffix for literal numbers is not required, such as: cxgb3_main.c:292: unsigned int nq1 = max((unsigned int)adap->port[1].nqsets, 1U); sge.c:2359: qs->rspq.holdoff_tmr = max(p->coalesce_usecs * 10, 1U); * const run 1: const'ify structs that do not change or are not changed, such as cxgb3_main.c:924:static char stats_strings[][ETH_GSTRING_LEN] = { t3_hw.c:220:static struct mdio_ops mi1_mdio_ops = { t3_hw.c:271:static struct mdio_ops mi1_mdio_ext_ops = { t3_hw.c:1130: static struct intr_info pcix1_intr_info[] = { t3_hw.c:1166: static struct intr_info pcie_intr_info[] = { (these are just the small picture) * const run 2: const'ify locals that do not change, such as cxgb3_offload.c:63: struct adapter *adapter = tdev2adap(tdev); * const run 3: const'ify function arguments that do not change, e.g. static inline int offload_activated(struct t3cdev *tdev) Note that the listed lines do not cover all source lines - cxgb3 is quite some code. Running it through sparse gives 'context imbalance' (whatever that is - i just tried sparse). -`J' -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
On Nov 17 2006 12:23, Divy Le Ray [EMAIL PROTECTED] wrote: Subject: [PATCH 1/10] cxgb3 - main header files (For all files) Some suggestions: * change the typedefs to struct, this includes: adapter_t - struct adapter * function prototypes and function headers (e.g. t3_get_cong_cntl_tab) are listed as void t3_get_cong_cntl_tab(adapter_t *adap, unsigned short incr[NMTUS][NCCTRL_WIN]); which could be shortened to void t3_get_cong_cntl_tab(adapter_t *adap, unsigned short incr[][]); functions where there is only one level of [], e.g. void t3_load_mtus(adapter_t *adap, unsigned short mtus[NMTUS], unsigned short alpha[NCCTRL_WIN], unsigned short beta[NCCTRL_WIN], unsigned short mtu_cap); could become void t3_load_mtus(adapter_t *adap, unsigned short *mtus, unsigned short *alpha, unsigned short *beta, unsigned short mtu_cap); depending on your taste. * get rid of superfluous from-void/to-void casts, such as: cxgb3_main.c:754: struct adapter *adapter = (struct adapter *)dev-priv; in some places, the 'U' suffix for literal numbers is not required, such as: cxgb3_main.c:292: unsigned int nq1 = max((unsigned int)adap-port[1].nqsets, 1U); sge.c:2359: qs-rspq.holdoff_tmr = max(p-coalesce_usecs * 10, 1U); * const run 1: const'ify structs that do not change or are not changed, such as cxgb3_main.c:924:static char stats_strings[][ETH_GSTRING_LEN] = { t3_hw.c:220:static struct mdio_ops mi1_mdio_ops = { t3_hw.c:271:static struct mdio_ops mi1_mdio_ext_ops = { t3_hw.c:1130: static struct intr_info pcix1_intr_info[] = { t3_hw.c:1166: static struct intr_info pcie_intr_info[] = { (these are just the small picture) * const run 2: const'ify locals that do not change, such as cxgb3_offload.c:63: struct adapter *adapter = tdev2adap(tdev); * const run 3: const'ify function arguments that do not change, e.g. static inline int offload_activated(struct t3cdev *tdev) Note that the listed lines do not cover all source lines - cxgb3 is quite some code. Running it through sparse gives 'context imbalance' (whatever that is - i just tried sparse). -`J' -- - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
> > +#define MDIO_LOCK(adapter) down(&(adapter)->mdio_lock) > > +#define MDIO_UNLOCK(adapter) up(&(adapter)->mdio_lock) > > Please don't wrap locks Plus these should probably be mutexes, not semaphores. > > +int t3_offload_tx(struct t3cdev *tdev, struct sk_buff *skb); > > What kind of offload? You remember TOE was rejected. But we're OK with RDMA over TCP (iWARP) I think... - R. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/10] cxgb3 - main header files
> + > +struct work_struct; > +struct dentry; Why do you need these extra forward declarations? ... > + > +struct sge_rspq { /* state for an SGE response queue */ > + unsigned int credits; /* # of pending response credits */ > + unsigned int size; /* capacity of response queue */ > + unsigned int cidx; /* consumer index */ > + unsigned int gen; /* current generation bit */ > + unsigned int polling; /* is the queue serviced through NAPI? */ > + unsigned int holdoff_tmr; /* interrupt holdoff timer in 100ns */ > + unsigned int next_holdoff; /* holdoff time for next interrupt */ > + struct rsp_desc *desc; /* address of HW response ring */ > + dma_addr_t phys_addr; /* physical address of the ring */ > + unsigned int cntxt_id; /* SGE context id for the response q */ > + spinlock_t lock; /* guards response processing */ > + struct sk_buff *rx_head;/* offload packet receive queue head */ > + struct sk_buff *rx_tail;/* offload packet receive queue tail */ Why not use sk_buff_head? ... > + /* > + * Dummy netdevices are needed when using multiple receive queues with > + * NAPI as each netdevice can service only one queue. > + */ > + struct net_device *dummy_netdev[SGE_QSETS - 1]; > Rather than abusing, NAPI with multiple receive queue's why not do it by either: 1) changing NAPI to have multiple receive contexts 2) or use your own tasklet and processing. > + struct dentry *debugfs_root; > + > + struct semaphore mdio_lock; > + spinlock_t stats_lock; > + spinlock_t work_lock; > +}; > + > +#define MDIO_LOCK(adapter) down(&(adapter)->mdio_lock) > +#define MDIO_UNLOCK(adapter) up(&(adapter)->mdio_lock) Please don't wrap locks > +static inline u32 t3_read_reg(adapter_t *adapter, u32 reg_addr) > +{ > + u32 val = readl(adapter->regs + reg_addr); > + > + CH_DBG(adapter, MMIO, "read register 0x%x value 0x%x\n", reg_addr, > +val); > + return val; > +} > + > +static inline void t3_write_reg(adapter_t *adapter, u32 reg_addr, u32 val) > +{ > + CH_DBG(adapter, MMIO, "setting register 0x%x to 0x%x\n", reg_addr, > +val); > + writel(val, adapter->regs + reg_addr); > +} This kind of wrapper makes sense. > +static inline int t3_os_pci_save_state(adapter_t *adapter) > +{ > + return pci_save_state(adapter->pdev); > +} Please don't add bogus OS independent wrappers. It makes it harder for later maintenance. > +static inline int t3_os_pci_restore_state(adapter_t *adapter) > +{ > + return pci_restore_state(adapter->pdev); > +} > + > +static inline void t3_os_pci_write_config_4(adapter_t *adapter, int reg, > + u32 val) > +{ > + pci_write_config_dword(adapter->pdev, reg, val); > +} > + > +static inline void t3_os_pci_read_config_4(adapter_t *adapter, int reg, > +u32 *val) > +{ > + pci_read_config_dword(adapter->pdev, reg, val); > +} > + > +static inline void t3_os_pci_write_config_2(adapter_t *adapter, int reg, > + u16 val) > +{ > + pci_write_config_word(adapter->pdev, reg, val); > +} > + > +static inline void t3_os_pci_read_config_2(adapter_t *adapter, int reg, > +u16 *val) > +{ > + pci_read_config_word(adapter->pdev, reg, val); > +} > + > +static inline int t3_os_find_pci_capability(adapter_t *adapter, int cap) > +{ > + return pci_find_capability(adapter->pdev, cap); > +} > + > +static inline const char *adapter_name(adapter_t *adapter) > +{ > + return adapter->name; > +} > + > +static inline const char *port_name(adapter_t *adapter, unsigned int > port_idx) > +{ > + return adapter->port[port_idx].dev->name; > +} Why not do this inline. > +static inline void t3_os_set_hw_addr(adapter_t *adapter, int port_idx, > + u8 hw_addr[]) > +{ > + memcpy(adapter->port[port_idx].dev->dev_addr, hw_addr, ETH_ALEN); > +#ifdef ETHTOOL_GPERMADDR > + memcpy(adapter->port[port_idx].dev->perm_addr, hw_addr, ETH_ALEN); > +#endif > +} Another bogus wrapper. > +/* > + * We use the spare atalk_ptr to map a net device to its SGE queue set. > + * This is a macro so it can be used as l-value. > + */ > +#define dev2qset(netdev) ((netdev)->atalk_ptr) That looks a bad idea. > + > +#define OFFLOAD_DEVMAP_BIT 15 > + > +#define tdev2adap(d) container_of(d, struct adapter, tdev) > + > +static inline int offload_running(adapter_t *adapter) > +{ > + return test_bit(OFFLOAD_DEVMAP_BIT, >open_device_map); > +} > + > +int t3_offload_tx(struct t3cdev *tdev, struct sk_buff *skb); What kind of offload? You remember TOE was rejected. > +#define promisc_rx_mode(rm) ((rm)->dev->flags & IFF_PROMISC) > +#define allmulti_rx_mode(rm) ((rm)->dev->flags & IFF_ALLMULTI) Yet another
[PATCH 1/10] cxgb3 - main header files
From: Divy Le Ray <[EMAIL PROTECTED]> This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]> --- drivers/net/cxgb3/adapter.h | 317 +++ drivers/net/cxgb3/common.h | 702 ++ drivers/net/cxgb3/cxgb3_ioctl.h | 165 drivers/net/cxgb3/firmware_exports.h | 145 +++ 4 files changed, 1329 insertions(+), 0 deletions(-) diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h new file mode 100644 index 000..318fe6c --- /dev/null +++ b/drivers/net/cxgb3/adapter.h @@ -0,0 +1,317 @@ +/* + * This file is part of the Chelsio T3 Ethernet driver for Linux. + * + * Copyright (C) 2003-2006 Chelsio Communications. All rights reserved. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file included in this + * release for licensing terms and conditions. + */ + +/* This file should not be included directly. Include common.h instead. */ + +#ifndef __T3_ADAPTER_H__ +#define __T3_ADAPTER_H__ + +#include +#include +#include +#include +#include +#include "t3cdev.h" +#include +#include +#include + +typedef irqreturn_t (*intr_handler_t)(int, void *); + +struct vlan_group; + +struct port_info { + struct net_device *dev; + struct vlan_group *vlan_grp; + const struct port_type_info *port_type; + u8 rx_csum_offload; + u8 nqsets; + u8 first_qset; + struct cphy phy; + struct cmac mac; + struct link_config link_config; + struct net_device_stats netstats; + int activity; +}; + +struct work_struct; +struct dentry; + +enum { /* adapter flags */ + FULL_INIT_DONE = (1 << 0), + USING_MSI = (1 << 1), + USING_MSIX = (1 << 2), +}; + +struct rx_desc; +struct rx_sw_desc; + +struct sge_fl { /* SGE per free-buffer list state */ + unsigned int buf_size; /* size of each Rx buffer */ + unsigned int credits; /* # of available Rx buffers */ + unsigned int size; /* capacity of free list */ + unsigned int cidx; /* consumer index */ + unsigned int pidx; /* producer index */ + unsigned int gen; /* free list generation */ + struct rx_desc *desc; /* address of HW Rx descriptor ring */ + struct rx_sw_desc *sdesc; /* address of SW Rx descriptor ring */ + dma_addr_t phys_addr; /* physical address of HW ring start */ + unsigned int cntxt_id; /* SGE context id for the free list */ + unsigned long empty;/* # of times queue ran out of buffers */ +}; + +/* + * Bundle size for grouping offload RX packets for delivery to the stack. + * Don't make this too big as we do prefetch on each packet in a bundle. + */ +# define RX_BUNDLE_SIZE 8 + +struct rsp_desc; + +struct sge_rspq { /* state for an SGE response queue */ + unsigned int credits; /* # of pending response credits */ + unsigned int size; /* capacity of response queue */ + unsigned int cidx; /* consumer index */ + unsigned int gen; /* current generation bit */ + unsigned int polling; /* is the queue serviced through NAPI? */ + unsigned int holdoff_tmr; /* interrupt holdoff timer in 100ns */ + unsigned int next_holdoff; /* holdoff time for next interrupt */ + struct rsp_desc *desc; /* address of HW response ring */ + dma_addr_t phys_addr; /* physical address of the ring */ + unsigned int cntxt_id; /* SGE context id for the response q */ + spinlock_t lock; /* guards response processing */ + struct sk_buff *rx_head;/* offload packet receive queue head */ + struct sk_buff *rx_tail;/* offload packet receive queue tail */ + + unsigned long offload_pkts; + unsigned long offload_bundles; + unsigned long eth_pkts; /* # of ethernet packets */ + unsigned long pure_rsps;/* # of pure (non-data) responses */ + unsigned long imm_data; /* responses with immediate data */ + unsigned long rx_drops; /* # of packets dropped due to no mem */ + unsigned long async_notif; /* # of asynchronous notification events */ + unsigned long empty;/* # of times queue ran out of credits */ + unsigned long nomem;/* # of responses deferred due to no mem */ + unsigned long unhandled_irqs; /* # of spurious intrs */ +}; + +struct tx_desc; +struct tx_sw_desc; + +struct sge_txq {/* state for an SGE Tx queue */ + unsigned long flags;/* HW DMA fetch status */ + unsigned int in_use; /* # of in-use Tx
[PATCH 1/10] cxgb3 - main header files
From: Divy Le Ray [EMAIL PROTECTED] This patch implements the main header files of the Chelsio T3 network driver. Signed-off-by: Divy Le Ray [EMAIL PROTECTED] --- drivers/net/cxgb3/adapter.h | 317 +++ drivers/net/cxgb3/common.h | 702 ++ drivers/net/cxgb3/cxgb3_ioctl.h | 165 drivers/net/cxgb3/firmware_exports.h | 145 +++ 4 files changed, 1329 insertions(+), 0 deletions(-) diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h new file mode 100644 index 000..318fe6c --- /dev/null +++ b/drivers/net/cxgb3/adapter.h @@ -0,0 +1,317 @@ +/* + * This file is part of the Chelsio T3 Ethernet driver for Linux. + * + * Copyright (C) 2003-2006 Chelsio Communications. All rights reserved. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file included in this + * release for licensing terms and conditions. + */ + +/* This file should not be included directly. Include common.h instead. */ + +#ifndef __T3_ADAPTER_H__ +#define __T3_ADAPTER_H__ + +#include linux/pci.h +#include linux/spinlock.h +#include linux/interrupt.h +#include linux/timer.h +#include linux/cache.h +#include t3cdev.h +#include asm/semaphore.h +#include asm/bitops.h +#include asm/io.h + +typedef irqreturn_t (*intr_handler_t)(int, void *); + +struct vlan_group; + +struct port_info { + struct net_device *dev; + struct vlan_group *vlan_grp; + const struct port_type_info *port_type; + u8 rx_csum_offload; + u8 nqsets; + u8 first_qset; + struct cphy phy; + struct cmac mac; + struct link_config link_config; + struct net_device_stats netstats; + int activity; +}; + +struct work_struct; +struct dentry; + +enum { /* adapter flags */ + FULL_INIT_DONE = (1 0), + USING_MSI = (1 1), + USING_MSIX = (1 2), +}; + +struct rx_desc; +struct rx_sw_desc; + +struct sge_fl { /* SGE per free-buffer list state */ + unsigned int buf_size; /* size of each Rx buffer */ + unsigned int credits; /* # of available Rx buffers */ + unsigned int size; /* capacity of free list */ + unsigned int cidx; /* consumer index */ + unsigned int pidx; /* producer index */ + unsigned int gen; /* free list generation */ + struct rx_desc *desc; /* address of HW Rx descriptor ring */ + struct rx_sw_desc *sdesc; /* address of SW Rx descriptor ring */ + dma_addr_t phys_addr; /* physical address of HW ring start */ + unsigned int cntxt_id; /* SGE context id for the free list */ + unsigned long empty;/* # of times queue ran out of buffers */ +}; + +/* + * Bundle size for grouping offload RX packets for delivery to the stack. + * Don't make this too big as we do prefetch on each packet in a bundle. + */ +# define RX_BUNDLE_SIZE 8 + +struct rsp_desc; + +struct sge_rspq { /* state for an SGE response queue */ + unsigned int credits; /* # of pending response credits */ + unsigned int size; /* capacity of response queue */ + unsigned int cidx; /* consumer index */ + unsigned int gen; /* current generation bit */ + unsigned int polling; /* is the queue serviced through NAPI? */ + unsigned int holdoff_tmr; /* interrupt holdoff timer in 100ns */ + unsigned int next_holdoff; /* holdoff time for next interrupt */ + struct rsp_desc *desc; /* address of HW response ring */ + dma_addr_t phys_addr; /* physical address of the ring */ + unsigned int cntxt_id; /* SGE context id for the response q */ + spinlock_t lock; /* guards response processing */ + struct sk_buff *rx_head;/* offload packet receive queue head */ + struct sk_buff *rx_tail;/* offload packet receive queue tail */ + + unsigned long offload_pkts; + unsigned long offload_bundles; + unsigned long eth_pkts; /* # of ethernet packets */ + unsigned long pure_rsps;/* # of pure (non-data) responses */ + unsigned long imm_data; /* responses with immediate data */ + unsigned long rx_drops; /* # of packets dropped due to no mem */ + unsigned long async_notif; /* # of asynchronous notification events */ + unsigned long empty;/* # of times queue ran out of credits */ + unsigned long nomem;/* # of responses deferred due to no mem */ + unsigned long unhandled_irqs; /* # of spurious intrs */ +}; + +struct tx_desc; +struct tx_sw_desc; + +struct sge_txq {/* state for an SGE Tx queue */ + unsigned long flags;
Re: [PATCH 1/10] cxgb3 - main header files
+ +struct work_struct; +struct dentry; Why do you need these extra forward declarations? ... + +struct sge_rspq { /* state for an SGE response queue */ + unsigned int credits; /* # of pending response credits */ + unsigned int size; /* capacity of response queue */ + unsigned int cidx; /* consumer index */ + unsigned int gen; /* current generation bit */ + unsigned int polling; /* is the queue serviced through NAPI? */ + unsigned int holdoff_tmr; /* interrupt holdoff timer in 100ns */ + unsigned int next_holdoff; /* holdoff time for next interrupt */ + struct rsp_desc *desc; /* address of HW response ring */ + dma_addr_t phys_addr; /* physical address of the ring */ + unsigned int cntxt_id; /* SGE context id for the response q */ + spinlock_t lock; /* guards response processing */ + struct sk_buff *rx_head;/* offload packet receive queue head */ + struct sk_buff *rx_tail;/* offload packet receive queue tail */ Why not use sk_buff_head? ... + /* + * Dummy netdevices are needed when using multiple receive queues with + * NAPI as each netdevice can service only one queue. + */ + struct net_device *dummy_netdev[SGE_QSETS - 1]; Rather than abusing, NAPI with multiple receive queue's why not do it by either: 1) changing NAPI to have multiple receive contexts 2) or use your own tasklet and processing. + struct dentry *debugfs_root; + + struct semaphore mdio_lock; + spinlock_t stats_lock; + spinlock_t work_lock; +}; + +#define MDIO_LOCK(adapter) down((adapter)-mdio_lock) +#define MDIO_UNLOCK(adapter) up((adapter)-mdio_lock) Please don't wrap locks +static inline u32 t3_read_reg(adapter_t *adapter, u32 reg_addr) +{ + u32 val = readl(adapter-regs + reg_addr); + + CH_DBG(adapter, MMIO, read register 0x%x value 0x%x\n, reg_addr, +val); + return val; +} + +static inline void t3_write_reg(adapter_t *adapter, u32 reg_addr, u32 val) +{ + CH_DBG(adapter, MMIO, setting register 0x%x to 0x%x\n, reg_addr, +val); + writel(val, adapter-regs + reg_addr); +} This kind of wrapper makes sense. +static inline int t3_os_pci_save_state(adapter_t *adapter) +{ + return pci_save_state(adapter-pdev); +} Please don't add bogus OS independent wrappers. It makes it harder for later maintenance. +static inline int t3_os_pci_restore_state(adapter_t *adapter) +{ + return pci_restore_state(adapter-pdev); +} + +static inline void t3_os_pci_write_config_4(adapter_t *adapter, int reg, + u32 val) +{ + pci_write_config_dword(adapter-pdev, reg, val); +} + +static inline void t3_os_pci_read_config_4(adapter_t *adapter, int reg, +u32 *val) +{ + pci_read_config_dword(adapter-pdev, reg, val); +} + +static inline void t3_os_pci_write_config_2(adapter_t *adapter, int reg, + u16 val) +{ + pci_write_config_word(adapter-pdev, reg, val); +} + +static inline void t3_os_pci_read_config_2(adapter_t *adapter, int reg, +u16 *val) +{ + pci_read_config_word(adapter-pdev, reg, val); +} + +static inline int t3_os_find_pci_capability(adapter_t *adapter, int cap) +{ + return pci_find_capability(adapter-pdev, cap); +} + +static inline const char *adapter_name(adapter_t *adapter) +{ + return adapter-name; +} + +static inline const char *port_name(adapter_t *adapter, unsigned int port_idx) +{ + return adapter-port[port_idx].dev-name; +} Why not do this inline. +static inline void t3_os_set_hw_addr(adapter_t *adapter, int port_idx, + u8 hw_addr[]) +{ + memcpy(adapter-port[port_idx].dev-dev_addr, hw_addr, ETH_ALEN); +#ifdef ETHTOOL_GPERMADDR + memcpy(adapter-port[port_idx].dev-perm_addr, hw_addr, ETH_ALEN); +#endif +} Another bogus wrapper. +/* + * We use the spare atalk_ptr to map a net device to its SGE queue set. + * This is a macro so it can be used as l-value. + */ +#define dev2qset(netdev) ((netdev)-atalk_ptr) That looks a bad idea. + +#define OFFLOAD_DEVMAP_BIT 15 + +#define tdev2adap(d) container_of(d, struct adapter, tdev) + +static inline int offload_running(adapter_t *adapter) +{ + return test_bit(OFFLOAD_DEVMAP_BIT, adapter-open_device_map); +} + +int t3_offload_tx(struct t3cdev *tdev, struct sk_buff *skb); What kind of offload? You remember TOE was rejected. +#define promisc_rx_mode(rm) ((rm)-dev-flags IFF_PROMISC) +#define allmulti_rx_mode(rm) ((rm)-dev-flags IFF_ALLMULTI) Yet another high maintenance wrapper +struct sg_ent { /* SGE scatter/gather entry */ + u32 len[2]; + u64 addr[2]; +}; Shouldn't
Re: [PATCH 1/10] cxgb3 - main header files
+#define MDIO_LOCK(adapter) down((adapter)-mdio_lock) +#define MDIO_UNLOCK(adapter) up((adapter)-mdio_lock) Please don't wrap locks Plus these should probably be mutexes, not semaphores. +int t3_offload_tx(struct t3cdev *tdev, struct sk_buff *skb); What kind of offload? You remember TOE was rejected. But we're OK with RDMA over TCP (iWARP) I think... - R. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/