* [PATCH 1/7] net: add ETH_P_FCOE for Fibre Channel over Ethernet (FCoE)
[not found] <20090219194734.22270.8445.stgit@zychengdu.jf.intel.com>
@ 2009-02-19 19:49 ` Yi Zou
2009-02-19 19:49 ` [PATCH 2/7] net: add FCoE offload support through net_device Yi Zou
` (5 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Yi Zou @ 2009-02-19 19:49 UTC (permalink / raw)
To: linux-scsi, netdev
This adds eth type ETH_P_FCOE for Fibre Channel over Ethernet (FCoE)
Signed-off-by: Yi Zou <yi.zou@intel.com>
---
include/linux/if_ether.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index 7f3c735..59d197c 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -78,6 +78,7 @@
#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
#define ETH_P_TIPC 0x88CA /* TIPC */
+#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */
#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
/*
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/7] net: add FCoE offload support through net_device
[not found] <20090219194734.22270.8445.stgit@zychengdu.jf.intel.com>
2009-02-19 19:49 ` [PATCH 1/7] net: add ETH_P_FCOE for Fibre Channel over Ethernet (FCoE) Yi Zou
@ 2009-02-19 19:49 ` Yi Zou
2009-02-19 21:24 ` Stephen Hemminger
2009-02-19 19:49 ` [PATCH 3/7] fcoe: check offload features from LLD through netdev Yi Zou
` (4 subsequent siblings)
6 siblings, 1 reply; 13+ messages in thread
From: Yi Zou @ 2009-02-19 19:49 UTC (permalink / raw)
To: linux-scsi, netdev
This adds a "struct net_fcoe_ops *fcoe_ops" to net_device struct so any
network adapter driver can provide Fiber Channle over Ethernet (FCoE) offload
support through net_device. The fcoe_ops is only available when FCoE is
enabled in kernel as built-in or module driver.
Signed-off-by: Yi Zou <yi.zou@intel.com>
---
include/linux/netdevice.h | 8 ++++++++
include/linux/netfcoe.h | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+), 0 deletions(-)
create mode 100644 include/linux/netfcoe.h
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ec54785..faf85be 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -47,6 +47,10 @@
#include <net/dcbnl.h>
#endif
+#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
+#include <linux/netfcoe.h>
+#endif
+
struct vlan_group;
struct ethtool_ops;
struct netpoll_info;
@@ -840,6 +844,10 @@ struct net_device
struct dcbnl_rtnl_ops *dcbnl_ops;
#endif
+#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
+ struct net_fcoe_ops *fcoe_ops;
+#endif
+
#ifdef CONFIG_COMPAT_NET_DEV_OPS
struct {
int (*init)(struct net_device *dev);
diff --git a/include/linux/netfcoe.h b/include/linux/netfcoe.h
new file mode 100644
index 0000000..9d6d64d
--- /dev/null
+++ b/include/linux/netfcoe.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright(c) 2007 - 2009 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Maintained at www.Open-FCoE.org
+ */
+#ifndef __NET_FCOE_H__
+#define __NET_FCOE_H__
+
+#define NET_FCOE_CRC (1 << 0) /* FC CRC32 offload */
+#define NET_FCOE_LSO (1 << 1) /* Large send offload */
+#define NET_FCOE_LRO (1 << 2) /* Large receive offload */
+/*
+ * Ops struct for FCoE enabled drivers to callback through the netdevice struct
+ */
+struct net_fcoe_ops {
+ u16 lro_xid;
+ u32 features;
+ int (*ddp_setup)(struct net_device *netdev, u16 xid,
+ struct scatterlist *sgl, unsigned int nents);
+ int (*ddp_done)(struct net_device *netdev, u16 xid);
+};
+
+#endif /* __NET_FCOE_H__ */
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 3/7] fcoe: check offload features from LLD through netdev
[not found] <20090219194734.22270.8445.stgit@zychengdu.jf.intel.com>
2009-02-19 19:49 ` [PATCH 1/7] net: add ETH_P_FCOE for Fibre Channel over Ethernet (FCoE) Yi Zou
2009-02-19 19:49 ` [PATCH 2/7] net: add FCoE offload support through net_device Yi Zou
@ 2009-02-19 19:49 ` Yi Zou
2009-02-19 19:50 ` [PATCH 4/7] libfc: add support of large receive offload by ddp in fc_fcp Yi Zou
` (3 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Yi Zou @ 2009-02-19 19:49 UTC (permalink / raw)
To: linux-scsi, netdev
This checkes if net_devices supports net_fcoe_ops, if it does, then sets up
the corresponding flags in the associated fc_lport.
Note that large sequence offload is already supported in the current
libfc/fcoe, only thing needed is to tell the corresponding fc_lport that LLD
is capabale of doing so by using fcoe_ops->features.
Signed-off-by: Yi Zou <yi.zou@intel.com>
---
drivers/scsi/fcoe/fcoe_sw.c | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe_sw.c b/drivers/scsi/fcoe/fcoe_sw.c
index fe1bcaa..7632d7e 100644
--- a/drivers/scsi/fcoe/fcoe_sw.c
+++ b/drivers/scsi/fcoe/fcoe_sw.c
@@ -188,6 +188,33 @@ static int fcoe_sw_netdev_config(struct fc_lport *lp, struct net_device *netdev)
if (fc->real_dev->features & NETIF_F_SG)
lp->sg_supp = 1;
+ lp->crc_offload = 0;
+ lp->seq_offload = 0;
+ lp->lro_enabled = 0;
+ if (netdev->fcoe_ops) {
+ struct net_fcoe_ops *fops = netdev->fcoe_ops;
+
+ if (fops->features & NET_FCOE_CRC) {
+ lp->crc_offload = 1;
+ FCOE_DBG("%s supports FCoE FCCRC offload\n",
+ netdev->name);
+ }
+
+ if (fops->features & NET_FCOE_LSO) {
+ lp->seq_offload = 1;
+ FCOE_DBG("%s supports FCoE large send offload\n",
+ netdev->name);
+ }
+
+ if ((fops->features & NET_FCOE_LRO) &&
+ (fops->lro_xid)) {
+ lp->lro_enabled = 1;
+ lp->lro_xid = fops->lro_xid;
+ FCOE_DBG("%s supports FCoE large receive offload "
+ "with max read exchange id for ddp %d\n",
+ netdev->name, lp->lro_xid);
+ }
+ }
skb_queue_head_init(&fc->fcoe_pending_queue);
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 4/7] libfc: add support of large receive offload by ddp in fc_fcp
[not found] <20090219194734.22270.8445.stgit@zychengdu.jf.intel.com>
` (2 preceding siblings ...)
2009-02-19 19:49 ` [PATCH 3/7] fcoe: check offload features from LLD through netdev Yi Zou
@ 2009-02-19 19:50 ` Yi Zou
2009-02-19 19:50 ` [PATCH 5/7] fcoe: add support to net_fcoe_ops in fcoe_sw Yi Zou
` (2 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Yi Zou @ 2009-02-19 19:50 UTC (permalink / raw)
To: linux-scsi, netdev
When LLD supports direct data placement (ddp) for large receive of an scsi
i/o coming into fc_fcp, we call into libfc_function_template's ddp_setup()
to prepare for a ddp of large receive for this read I/O. When I/O is complete,
we call the corresponding ddp_done() to get the length of data ddped as well
as to let LLD do clean up.
Summary of changes:
1. Added ddp_setup()/ddp_done() to libfc_function_template and they are
expected to be impleted by fcoe layer
2. Added exch_send() to seperate exch_alloc() from exch_seq_send in
fc_fcp_cmd_send() since that's where we call ddp_setup() and we have to have
know the exchange xid.
3. Added calling lp->tt.ddp_setup() for read I/O if lro_enabled is set.
When ddp_setup is successful, xfer_ddp stores the corresponding exchange xid.
4. Added calling lp->tt.ddp_done() to fc_fcp_resp() to update the xfer_len
for the case of a normal complete ddp and let the LLD release ddp resource.
5. Added calling lp->tt.ddp_done() to fc_fcp_recv_data() to update the
xfer_len for the case of an incomplete ddp
6. Added calling lp->tt.ddp_done() to fc_io_compl() for an ddped I/O to make
sure ddp resource is released in case of abort
7. Also removed clearing of lro_enabled flag in fc_exch_mgr_alloc() since
that is taken care of by fcoe_sw_netdev_config() now.
Signed-off-by: Yi Zou <yi.zou@intel.com>
---
drivers/scsi/libfc/fc_exch.c | 46 +++++++++++++++++++++++++++---------------
drivers/scsi/libfc/fc_fcp.c | 36 +++++++++++++++++++++++++++++++--
include/scsi/libfc.h | 46 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 110 insertions(+), 18 deletions(-)
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index 2fb2282..8faf5e8 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -1753,9 +1753,6 @@ struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *lp,
mp->max_read = lp->lro_xid;
mp->last_read = min_xid - 1;
mp->last_xid = mp->max_read;
- } else {
- /* disable lro if no xid control over read */
- lp->lro_enabled = 0;
}
INIT_LIST_HEAD(&mp->ex_list);
@@ -1795,24 +1792,19 @@ struct fc_exch *fc_exch_get(struct fc_lport *lp, struct fc_frame *fp)
}
EXPORT_SYMBOL(fc_exch_get);
-struct fc_seq *fc_exch_seq_send(struct fc_lport *lp,
- struct fc_frame *fp,
- void (*resp)(struct fc_seq *,
- struct fc_frame *fp,
- void *arg),
- void (*destructor)(struct fc_seq *, void *),
- void *arg, u32 timer_msec)
+struct fc_seq *fc_exch_send(struct fc_lport *lp,
+ struct fc_exch *ep,
+ struct fc_frame *fp,
+ void (*resp)(struct fc_seq *,
+ struct fc_frame *fp,
+ void *arg),
+ void (*destructor)(struct fc_seq *, void *),
+ void *arg, u32 timer_msec)
{
- struct fc_exch *ep;
struct fc_seq *sp = NULL;
struct fc_frame_header *fh;
int rc = 1;
- ep = lp->tt.exch_get(lp, fp);
- if (!ep) {
- fc_frame_free(fp);
- return NULL;
- }
ep->esb_stat |= ESB_ST_SEQ_INIT;
fh = fc_frame_header_get(fp);
fc_exch_set_addr(ep, ntoh24(fh->fh_s_id), ntoh24(fh->fh_d_id));
@@ -1846,6 +1838,25 @@ err:
fc_exch_mgr_delete_ep(ep);
return NULL;
}
+EXPORT_SYMBOL(fc_exch_send);
+
+struct fc_seq *fc_exch_seq_send(struct fc_lport *lp,
+ struct fc_frame *fp,
+ void (*resp)(struct fc_seq *,
+ struct fc_frame *fp,
+ void *arg),
+ void (*destructor)(struct fc_seq *, void *),
+ void *arg, u32 timer_msec)
+{
+ struct fc_exch *ep;
+
+ ep = lp->tt.exch_get(lp, fp);
+ if (!ep) {
+ fc_frame_free(fp);
+ return NULL;
+ }
+ return fc_exch_send(lp, ep, fp, resp, destructor, arg, timer_msec);
+}
EXPORT_SYMBOL(fc_exch_seq_send);
/*
@@ -1906,6 +1917,9 @@ int fc_exch_init(struct fc_lport *lp)
if (!lp->tt.seq_start_next)
lp->tt.seq_start_next = fc_seq_start_next;
+ if (!lp->tt.exch_send)
+ lp->tt.exch_send = fc_exch_send;
+
if (!lp->tt.exch_seq_send)
lp->tt.exch_seq_send = fc_exch_seq_send;
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index 92a72c7..c6ef7fe 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -285,6 +285,11 @@ static void fc_fcp_recv_data(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
len = fr_len(fp) - sizeof(*fh);
buf = fc_frame_payload_get(fp, 0);
+ /* if this I/O is ddped, update xfer len */
+ if (fsp->xfer_ddp && lp->tt.ddp_done) {
+ fsp->xfer_len = lp->tt.ddp_done(lp, fsp->xfer_ddp);
+ fsp->xfer_ddp = 0;
+ }
if (offset + len > fsp->data_len) {
/* this should never happen */
if ((fr_flags(fp) & FCPHF_CRC_UNCHECKED) &&
@@ -740,6 +745,12 @@ static void fc_fcp_resp(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
fsp->scsi_comp_flags = flags;
expected_len = fsp->data_len;
+ /* if ddp, update xfer len */
+ if (fsp->xfer_ddp && fsp->lp->tt.ddp_done) {
+ fsp->xfer_len = fsp->lp->tt.ddp_done(fsp->lp, fsp->xfer_ddp);
+ fsp->xfer_ddp = 0;
+ }
+
if (unlikely((flags & ~FCP_CONF_REQ) || fc_rp->fr_status)) {
rp_ex = (void *)(fc_rp + 1);
if (flags & (FCP_RSP_LEN_VAL | FCP_SNS_LEN_VAL)) {
@@ -987,6 +998,7 @@ static int fc_fcp_cmd_send(struct fc_lport *lp, struct fc_fcp_pkt *fsp,
{
struct fc_frame *fp;
struct fc_seq *seq;
+ struct fc_exch *ep;
struct fc_rport *rport;
struct fc_rport_libfc_priv *rp;
const size_t len = sizeof(fsp->cdb_cmd);
@@ -1011,7 +1023,21 @@ static int fc_fcp_cmd_send(struct fc_lport *lp, struct fc_fcp_pkt *fsp,
fc_host_port_id(rp->local_port->host), FC_TYPE_FCP,
FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0);
- seq = lp->tt.exch_seq_send(lp, fp, resp, fc_fcp_pkt_destroy, fsp, 0);
+ ep = lp->tt.exch_get(lp, fp);
+ if (!ep) {
+ fc_frame_free(fp);
+ goto unlock;
+ rc = -1;
+ }
+
+ if ((fsp->req_flags & FC_SRB_READ) &&
+ (lp->lro_enabled) && (lp->tt.ddp_setup)) {
+ if (lp->tt.ddp_setup(lp, ep->xid, scsi_sglist(fsp->cmd),
+ scsi_sg_count(fsp->cmd)))
+ fsp->xfer_ddp = ep->xid;
+ }
+
+ seq = lp->tt.exch_send(lp, ep, fp, resp, fc_fcp_pkt_destroy, fsp, 0);
if (!seq) {
fc_frame_free(fp);
rc = -1;
@@ -1736,6 +1762,13 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
struct fc_lport *lp;
unsigned long flags;
+ /* release outstanding ddp context */
+ lp = fsp->lp;
+ if (fsp->xfer_ddp && lp->tt.ddp_done) {
+ lp->tt.ddp_done(lp, fsp->xfer_ddp);
+ fsp->xfer_ddp = 0;
+ }
+
fsp->state |= FC_SRB_COMPL;
if (!(fsp->state & FC_SRB_FCP_PROCESSING_TMO)) {
spin_unlock_bh(&fsp->scsi_pkt_lock);
@@ -1743,7 +1776,6 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
spin_lock_bh(&fsp->scsi_pkt_lock);
}
- lp = fsp->lp;
si = fc_get_scsi_internal(lp);
spin_lock_irqsave(lp->host->host_lock, flags);
if (!fsp->cmd) {
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index a4c6050..c7fc122 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -274,6 +274,7 @@ struct fc_fcp_pkt {
*/
struct fcp_cmnd cdb_cmd;
size_t xfer_len;
+ u16 xfer_ddp; /* this xfer is ddped */
u32 xfer_contig_end; /* offset of end of contiguous xfer */
u16 max_payload; /* max payload size in bytes */
@@ -429,6 +430,37 @@ struct libfc_function_template {
void *arg, unsigned int timer_msec);
/*
+ * This does the same job like exch_seq_send() except that the caller
+ * must allocate the exchange itself and pass it to exch_send()
+ *
+ * STATUS: OPTIONAL
+ */
+ struct fc_seq *(*exch_send)(struct fc_lport *lp,
+ struct fc_exch *ep,
+ struct fc_frame *fp,
+ void (*resp)(struct fc_seq *sp,
+ struct fc_frame *fp,
+ void *arg),
+ void (*destructor)(struct fc_seq *sp,
+ void *arg),
+ void *arg, unsigned int timer_msec);
+
+ /*
+ * Sets up the DDP context for a given exchange id on the given
+ * scatterlist if LLD supports DDP for large receive.
+ *
+ * STATUS: OPTIONAL
+ */
+ int (*ddp_setup)(struct fc_lport *lp, u16 xid,
+ struct scatterlist *sgl, unsigned int sgc);
+ /*
+ * Completes the DDP transfer and returns the length of data DDPed
+ * for the given exchange id.
+ *
+ * STATUS: OPTIONAL
+ */
+ int (*ddp_done)(struct fc_lport *lp, u16 xid);
+ /*
* Send a frame using an existing sequence and exchange.
*
* STATUS: OPTIONAL
@@ -917,6 +949,20 @@ struct fc_seq *fc_exch_seq_send(struct fc_lport *lp,
void (*destructor)(struct fc_seq *sp,
void *arg),
void *arg, u32 timer_msec);
+/*
+ * This function is for exch_send function pointer in
+ * struct libfc_function_template, see comment block on
+ * exch_send for description of this function.
+ */
+struct fc_seq *fc_exch_send(struct fc_lport *lp,
+ struct fc_exch *ep,
+ struct fc_frame *fp,
+ void (*resp)(struct fc_seq *sp,
+ struct fc_frame *fp,
+ void *arg),
+ void (*destructor)(struct fc_seq *sp,
+ void *arg),
+ void *arg, u32 timer_msec);
/*
* send a frame using existing sequence and exchange.
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 5/7] fcoe: add support to net_fcoe_ops in fcoe_sw
[not found] <20090219194734.22270.8445.stgit@zychengdu.jf.intel.com>
` (3 preceding siblings ...)
2009-02-19 19:50 ` [PATCH 4/7] libfc: add support of large receive offload by ddp in fc_fcp Yi Zou
@ 2009-02-19 19:50 ` Yi Zou
2009-02-19 19:50 ` [PATCH 6/7] fcoe: remove ETH_P_FCOE from fc_fcoe.h Yi Zou
2009-02-19 19:50 ` [PATCH 7/7] fcoe: fcoe fc crc offload indication by skb->ip_summed Yi Zou
6 siblings, 0 replies; 13+ messages in thread
From: Yi Zou @ 2009-02-19 19:50 UTC (permalink / raw)
To: linux-scsi, netdev
This adds implementation of ddp_setup()/ddp_done() in fcoe_sw for its
fcoe_sw_libfc_fcn_templ.
Signed-off-by: Yi Zou <yi.zou@intel.com>
---
drivers/scsi/fcoe/fcoe_sw.c | 37 +++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe_sw.c b/drivers/scsi/fcoe/fcoe_sw.c
index 7632d7e..57f7a51 100644
--- a/drivers/scsi/fcoe/fcoe_sw.c
+++ b/drivers/scsi/fcoe/fcoe_sw.c
@@ -373,8 +373,45 @@ static int fcoe_sw_destroy(struct net_device *netdev)
return 0;
}
+/*
+ * fcoe_sw_ddp_setup - calls LLD's ddp_setup through net_device
+ * @lp: the corresponding fc_lport
+ * @xid: the exchange id for this ddp transfer
+ * @sgl: the scatterlist describing this transfer
+ * @sgc: number of sg items
+ *
+ * Returns : 0 no ddp
+ */
+static int fcoe_sw_ddp_setup(struct fc_lport *lp, u16 xid,
+ struct scatterlist *sgl, unsigned int sgc)
+{
+ struct net_device *ndev = fcoe_netdev(lp);
+
+ if (ndev->fcoe_ops && ndev->fcoe_ops->ddp_setup)
+ return ndev->fcoe_ops->ddp_setup(ndev, xid, sgl, sgc);
+ return 0;
+}
+
+/*
+ * fcoe_sw_ddp_done - calls LLD's ddp_done through net_device
+ * @lp: the corresponding fc_lport
+ * @xid: the exchange id for this ddp transfer
+ *
+ * Returns : the length of data that have been completed by ddp
+ */
+static int fcoe_sw_ddp_done(struct fc_lport *lp, u16 xid)
+{
+ struct net_device *ndev = fcoe_netdev(lp);
+
+ if (ndev->fcoe_ops && ndev->fcoe_ops->ddp_done)
+ return ndev->fcoe_ops->ddp_done(ndev, xid);
+ return 0;
+}
+
static struct libfc_function_template fcoe_sw_libfc_fcn_templ = {
.frame_send = fcoe_xmit,
+ .ddp_setup = fcoe_sw_ddp_setup,
+ .ddp_done = fcoe_sw_ddp_done,
};
/**
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 6/7] fcoe: remove ETH_P_FCOE from fc_fcoe.h
[not found] <20090219194734.22270.8445.stgit@zychengdu.jf.intel.com>
` (4 preceding siblings ...)
2009-02-19 19:50 ` [PATCH 5/7] fcoe: add support to net_fcoe_ops in fcoe_sw Yi Zou
@ 2009-02-19 19:50 ` Yi Zou
2009-02-19 21:25 ` Stephen Hemminger
2009-02-19 19:50 ` [PATCH 7/7] fcoe: fcoe fc crc offload indication by skb->ip_summed Yi Zou
6 siblings, 1 reply; 13+ messages in thread
From: Yi Zou @ 2009-02-19 19:50 UTC (permalink / raw)
To: linux-scsi, netdev
No need to have ETH_P_FCOE in fc_fcoe.h as it is now defined in if_ether.h
Signed-off-by: Yi Zou <yi.zou@intel.com>
---
include/scsi/fc/fc_fcoe.h | 7 -------
1 files changed, 0 insertions(+), 7 deletions(-)
diff --git a/include/scsi/fc/fc_fcoe.h b/include/scsi/fc/fc_fcoe.h
index f271d9c..ccb3dbe 100644
--- a/include/scsi/fc/fc_fcoe.h
+++ b/include/scsi/fc/fc_fcoe.h
@@ -25,13 +25,6 @@
*/
/*
- * The FCoE ethertype eventually goes in net/if_ether.h.
- */
-#ifndef ETH_P_FCOE
-#define ETH_P_FCOE 0x8906 /* FCOE ether type */
-#endif
-
-/*
* FC_FCOE_OUI hasn't been standardized yet. XXX TBD.
*/
#ifndef FC_FCOE_OUI
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 7/7] fcoe: fcoe fc crc offload indication by skb->ip_summed
[not found] <20090219194734.22270.8445.stgit@zychengdu.jf.intel.com>
` (5 preceding siblings ...)
2009-02-19 19:50 ` [PATCH 6/7] fcoe: remove ETH_P_FCOE from fc_fcoe.h Yi Zou
@ 2009-02-19 19:50 ` Yi Zou
6 siblings, 0 replies; 13+ messages in thread
From: Yi Zou @ 2009-02-19 19:50 UTC (permalink / raw)
To: linux-scsi, netdev
If LLD supports FCCRC offload, it should set ip_summed to be
CHECKSUM_UNNECESSARY so we don't have to do CRC check again.
Signed-off-by: Yi Zou <yi.zou@intel.com>
---
drivers/scsi/fcoe/libfcoe.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
index 3072428..2a34832 100644
--- a/drivers/scsi/fcoe/libfcoe.c
+++ b/drivers/scsi/fcoe/libfcoe.c
@@ -624,7 +624,7 @@ int fcoe_percpu_receive_thread(void *arg)
* it's solicited data, in which case, the FCP layer would
* check it during the copy.
*/
- if (lp->crc_offload)
+ if (lp->crc_offload && skb->ip_summed == CHECKSUM_UNNECESSARY)
fr_flags(fp) &= ~FCPHF_CRC_UNCHECKED;
else
fr_flags(fp) |= FCPHF_CRC_UNCHECKED;
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 2/7] net: add FCoE offload support through net_device
2009-02-19 19:49 ` [PATCH 2/7] net: add FCoE offload support through net_device Yi Zou
@ 2009-02-19 21:24 ` Stephen Hemminger
2009-02-19 21:32 ` Zou, Yi
0 siblings, 1 reply; 13+ messages in thread
From: Stephen Hemminger @ 2009-02-19 21:24 UTC (permalink / raw)
To: Yi Zou; +Cc: linux-scsi, netdev
On Thu, 19 Feb 2009 12:49:49 -0700
Yi Zou <yi.zou@intel.com> wrote:
> This adds a "struct net_fcoe_ops *fcoe_ops" to net_device struct so any
> network adapter driver can provide Fiber Channle over Ethernet (FCoE) offload
> support through net_device. The fcoe_ops is only available when FCoE is
> enabled in kernel as built-in or module driver.
>
> Signed-off-by: Yi Zou <yi.zou@intel.com>
Rather than adding another _ops structure please add to existing
netdevice_ops. You don't need the flags that way. If netdevice_ops
has fcoe_setup, then device can do it...
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 6/7] fcoe: remove ETH_P_FCOE from fc_fcoe.h
2009-02-19 19:50 ` [PATCH 6/7] fcoe: remove ETH_P_FCOE from fc_fcoe.h Yi Zou
@ 2009-02-19 21:25 ` Stephen Hemminger
2009-02-19 21:49 ` Zou, Yi
0 siblings, 1 reply; 13+ messages in thread
From: Stephen Hemminger @ 2009-02-19 21:25 UTC (permalink / raw)
To: Yi Zou; +Cc: linux-scsi, netdev
On Thu, 19 Feb 2009 12:50:23 -0700
Yi Zou <yi.zou@intel.com> wrote:
> No need to have ETH_P_FCOE in fc_fcoe.h as it is now defined in if_ether.h
>
> Signed-off-by: Yi Zou <yi.zou@intel.com>
> ---
>
> include/scsi/fc/fc_fcoe.h | 7 -------
> 1 files changed, 0 insertions(+), 7 deletions(-)
>
> diff --git a/include/scsi/fc/fc_fcoe.h b/include/scsi/fc/fc_fcoe.h
> index f271d9c..ccb3dbe 100644
> --- a/include/scsi/fc/fc_fcoe.h
> +++ b/include/scsi/fc/fc_fcoe.h
> @@ -25,13 +25,6 @@
> */
>
> /*
> - * The FCoE ethertype eventually goes in net/if_ether.h.
> - */
> -#ifndef ETH_P_FCOE
> -#define ETH_P_FCOE 0x8906 /* FCOE ether type */
> -#endif
> -
>
Just do the move from fc_fcoe.h to if_ether.h in one patch.
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 2/7] net: add FCoE offload support through net_device
2009-02-19 21:24 ` Stephen Hemminger
@ 2009-02-19 21:32 ` Zou, Yi
2009-02-20 23:21 ` Zou, Yi
0 siblings, 1 reply; 13+ messages in thread
From: Zou, Yi @ 2009-02-19 21:32 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: linux-scsi@vger.kernel.org, netdev@vger.kernel.org
>On Thu, 19 Feb 2009 12:49:49 -0700
>Yi Zou <yi.zou@intel.com> wrote:
>
>> This adds a "struct net_fcoe_ops *fcoe_ops" to net_device struct so
>any
>> network adapter driver can provide Fiber Channle over Ethernet (FCoE)
>offload
>> support through net_device. The fcoe_ops is only available when FCoE
>is
>> enabled in kernel as built-in or module driver.
>>
>> Signed-off-by: Yi Zou <yi.zou@intel.com>
>
>Rather than adding another _ops structure please add to existing
>netdevice_ops. You don't need the flags that way. If netdevice_ops
>has fcoe_setup, then device can do it...
The comments in struct net_device_ops says for management hooks, if
that's an ok place for net_fcoe_ops, then, I am all for it.
Thanks.
yi
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 6/7] fcoe: remove ETH_P_FCOE from fc_fcoe.h
2009-02-19 21:25 ` Stephen Hemminger
@ 2009-02-19 21:49 ` Zou, Yi
0 siblings, 0 replies; 13+ messages in thread
From: Zou, Yi @ 2009-02-19 21:49 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: linux-scsi@vger.kernel.org, netdev@vger.kernel.org
>On Thu, 19 Feb 2009 12:50:23 -0700
>Yi Zou <yi.zou@intel.com> wrote:
>
>> No need to have ETH_P_FCOE in fc_fcoe.h as it is now defined in
>if_ether.h
>>
>> Signed-off-by: Yi Zou <yi.zou@intel.com>
>> ---
>>
>> include/scsi/fc/fc_fcoe.h | 7 -------
>> 1 files changed, 0 insertions(+), 7 deletions(-)
>>
>> diff --git a/include/scsi/fc/fc_fcoe.h b/include/scsi/fc/fc_fcoe.h
>> index f271d9c..ccb3dbe 100644
>> --- a/include/scsi/fc/fc_fcoe.h
>> +++ b/include/scsi/fc/fc_fcoe.h
>> @@ -25,13 +25,6 @@
>> */
>>
>> /*
>> - * The FCoE ethertype eventually goes in net/if_ether.h.
>> - */
>> -#ifndef ETH_P_FCOE
>> -#define ETH_P_FCOE 0x8906 /* FCOE ether type */
>> -#endif
>> -
>>
>Just do the move from fc_fcoe.h to if_ether.h in one patch.
Good point, I'll fix that.
Thanks.
yi
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 2/7] net: add FCoE offload support through net_device
2009-02-19 21:32 ` Zou, Yi
@ 2009-02-20 23:21 ` Zou, Yi
2009-02-20 23:27 ` Stephen Hemminger
0 siblings, 1 reply; 13+ messages in thread
From: Zou, Yi @ 2009-02-20 23:21 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: linux-scsi@vger.kernel.org, netdev@vger.kernel.org
>>On Thu, 19 Feb 2009 12:49:49 -0700
>>Yi Zou <yi.zou@intel.com> wrote:
>>
>>> This adds a "struct net_fcoe_ops *fcoe_ops" to net_device struct so
>>any
>>> network adapter driver can provide Fiber Channle over Ethernet (FCoE)
>>offload
>>> support through net_device. The fcoe_ops is only available when FCoE
>>is
>>> enabled in kernel as built-in or module driver.
>>>
>>> Signed-off-by: Yi Zou <yi.zou@intel.com>
>>
>>Rather than adding another _ops structure please add to existing
>>netdevice_ops. You don't need the flags that way. If netdevice_ops
>>has fcoe_setup, then device can do it...
>The comments in struct net_device_ops says for management hooks, if
>that's an ok place for net_fcoe_ops, then, I am all for it.
>
>Thanks.
>
>yi
Hi, Stephen,
Regarding your comment about adding net_fcoe_ops to net_device_ops,
the net_fcoe_ops contains function pointers ad well as data members,
where net_device_ops seems to me is the placeholder only for function
pointers. So I think it is still better to still leave
the net_fcoe_ops to net_device. Let me know what you think.
Thanks,
yi
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/7] net: add FCoE offload support through net_device
2009-02-20 23:21 ` Zou, Yi
@ 2009-02-20 23:27 ` Stephen Hemminger
0 siblings, 0 replies; 13+ messages in thread
From: Stephen Hemminger @ 2009-02-20 23:27 UTC (permalink / raw)
To: Zou, Yi; +Cc: linux-scsi@vger.kernel.org, netdev@vger.kernel.org
On Fri, 20 Feb 2009 15:21:42 -0800
"Zou, Yi" <yi.zou@intel.com> wrote:
> >>On Thu, 19 Feb 2009 12:49:49 -0700
> >>Yi Zou <yi.zou@intel.com> wrote:
> >>
> >>> This adds a "struct net_fcoe_ops *fcoe_ops" to net_device struct so
> >>any
> >>> network adapter driver can provide Fiber Channle over Ethernet (FCoE)
> >>offload
> >>> support through net_device. The fcoe_ops is only available when FCoE
> >>is
> >>> enabled in kernel as built-in or module driver.
> >>>
> >>> Signed-off-by: Yi Zou <yi.zou@intel.com>
> >>
> >>Rather than adding another _ops structure please add to existing
> >>netdevice_ops. You don't need the flags that way. If netdevice_ops
> >>has fcoe_setup, then device can do it...
> >The comments in struct net_device_ops says for management hooks, if
> >that's an ok place for net_fcoe_ops, then, I am all for it.
> >
> >Thanks.
> >
> >yi
>
> Hi, Stephen,
> Regarding your comment about adding net_fcoe_ops to net_device_ops,
> the net_fcoe_ops contains function pointers ad well as data members,
> where net_device_ops seems to me is the placeholder only for function
> pointers. So I think it is still better to still leave
> the net_fcoe_ops to net_device. Let me know what you think.
>
> Thanks,
> yi
Data members go in net_device (because they are per device instance).
Put fcoe stuff in net_device_ops. Ideally, it should look like TSO
and GRO; with standard ethtool type config?
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2009-02-20 23:28 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20090219194734.22270.8445.stgit@zychengdu.jf.intel.com>
2009-02-19 19:49 ` [PATCH 1/7] net: add ETH_P_FCOE for Fibre Channel over Ethernet (FCoE) Yi Zou
2009-02-19 19:49 ` [PATCH 2/7] net: add FCoE offload support through net_device Yi Zou
2009-02-19 21:24 ` Stephen Hemminger
2009-02-19 21:32 ` Zou, Yi
2009-02-20 23:21 ` Zou, Yi
2009-02-20 23:27 ` Stephen Hemminger
2009-02-19 19:49 ` [PATCH 3/7] fcoe: check offload features from LLD through netdev Yi Zou
2009-02-19 19:50 ` [PATCH 4/7] libfc: add support of large receive offload by ddp in fc_fcp Yi Zou
2009-02-19 19:50 ` [PATCH 5/7] fcoe: add support to net_fcoe_ops in fcoe_sw Yi Zou
2009-02-19 19:50 ` [PATCH 6/7] fcoe: remove ETH_P_FCOE from fc_fcoe.h Yi Zou
2009-02-19 21:25 ` Stephen Hemminger
2009-02-19 21:49 ` Zou, Yi
2009-02-19 19:50 ` [PATCH 7/7] fcoe: fcoe fc crc offload indication by skb->ip_summed Yi Zou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).