* [PATCH 0/6] Open-FCoE.org libfc and fcoe updates for scsi-misc
@ 2011-09-28 4:37 Yi Zou
2011-09-28 4:37 ` [PATCH 1/6] fcoe: use kthread_create_on_node Yi Zou
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Yi Zou @ 2011-09-28 4:37 UTC (permalink / raw)
To: linux-scsi
This series consists of updates for the libfc and fcoe modules. There are no
features in this series and most patches are performance improvement related
bug fixes.
Thanks,
yi
---
Eric Dumazet (1):
fcoe: use kthread_create_on_node
Vasu Dev (5):
fcoe: setup default initial value for DDP threshold
fcoe: use real dev in case of HW vlan acceleration
libfc: cache align fc_exch_pool
libfc: cache align struct fc_exch fields
libfc: cache align struct fc_fcp_pkt fields
drivers/scsi/fcoe/fcoe.c | 16 +++++++--
drivers/scsi/fcoe/fcoe.h | 1 +
drivers/scsi/libfc/fc_exch.c | 11 +++---
drivers/scsi/libfc/fc_fcp.c | 2 -
include/scsi/libfc.h | 76 ++++++++++++++++++------------------------
5 files changed, 51 insertions(+), 55 deletions(-)
--
Signature: Yi Zou <yi.zou@intel.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/6] fcoe: use kthread_create_on_node
2011-09-28 4:37 [PATCH 0/6] Open-FCoE.org libfc and fcoe updates for scsi-misc Yi Zou
@ 2011-09-28 4:37 ` Yi Zou
2011-09-28 4:37 ` [PATCH 2/6] libfc: cache align struct fc_fcp_pkt fields Yi Zou
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Yi Zou @ 2011-09-28 4:37 UTC (permalink / raw)
To: linux-scsi
Cc: Eric Dumazet, Neerav Parikh, Kiran Patil, James E.J. Bottomley,
Yi Zou
From: Eric Dumazet <eric.dumazet@gmail.com>
Since fcoe_percpu_thread_create() creates percpu kthread, it makes sense
to use kthread_create_on_node() to get proper NUMA affinity for kthread
stack.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Neerav Parikh <Neerav.Parikh@intel.com>
CC: Kiran Patil <kiran.patil@intel.com>
CC: "James E.J. Bottomley" <JBottomley@parallels.com>
Signed-off-by: Yi Zou <yi.zou@intel.com>
---
drivers/scsi/fcoe/fcoe.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 5d0e9a2..5a28940 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -1135,8 +1135,9 @@ static void fcoe_percpu_thread_create(unsigned int cpu)
p = &per_cpu(fcoe_percpu, cpu);
- thread = kthread_create(fcoe_percpu_receive_thread,
- (void *)p, "fcoethread/%d", cpu);
+ thread = kthread_create_on_node(fcoe_percpu_receive_thread,
+ (void *)p, cpu_to_node(cpu),
+ "fcoethread/%d", cpu);
if (likely(!IS_ERR(thread))) {
kthread_bind(thread, cpu);
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/6] libfc: cache align struct fc_fcp_pkt fields
2011-09-28 4:37 [PATCH 0/6] Open-FCoE.org libfc and fcoe updates for scsi-misc Yi Zou
2011-09-28 4:37 ` [PATCH 1/6] fcoe: use kthread_create_on_node Yi Zou
@ 2011-09-28 4:37 ` Yi Zou
2011-09-28 4:38 ` [PATCH 3/6] libfc: cache align struct fc_exch fields Yi Zou
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Yi Zou @ 2011-09-28 4:37 UTC (permalink / raw)
To: linux-scsi; +Cc: Vasu Dev, Yi Zou
From: Vasu Dev <vasu.dev@intel.com>
Re-arrange its fields to avoid padding and have better
cacheline alignments.
Removed not used start_time, end_time and last_pkt_time
fields.
This all reduced this struct size to 448 from 480 and
that also reduced one cacheline on x86_64 beside
eliminating 8 pads. However kept logical fields together.
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Yi Zou <yi.zou@intel.com>
---
drivers/scsi/libfc/fc_fcp.c | 2 --
include/scsi/libfc.h | 49 ++++++++++++++++++-------------------------
2 files changed, 21 insertions(+), 30 deletions(-)
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index 4c41ee8..221875e 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -759,7 +759,6 @@ static void fc_fcp_recv(struct fc_seq *seq, struct fc_frame *fp, void *arg)
goto out;
if (fc_fcp_lock_pkt(fsp))
goto out;
- fsp->last_pkt_time = jiffies;
if (fh->fh_type == FC_TYPE_BLS) {
fc_fcp_abts_resp(fsp, fp);
@@ -1148,7 +1147,6 @@ static int fc_fcp_cmd_send(struct fc_lport *lport, struct fc_fcp_pkt *fsp,
rc = -1;
goto unlock;
}
- fsp->last_pkt_time = jiffies;
fsp->seq_ptr = seq;
fc_fcp_pkt_hold(fsp); /* hold for fc_fcp_pkt_destroy */
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 7d96829..05e2583 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -281,9 +281,6 @@ struct fc_seq_els_data {
* @timer: The command timer
* @tm_done: Completion indicator
* @wait_for_comp: Indicator to wait for completion of the I/O (in jiffies)
- * @start_time: Timestamp indicating the start of the I/O (in jiffies)
- * @end_time: Timestamp indicating the end of the I/O (in jiffies)
- * @last_pkt_time: Timestamp of the last frame received (in jiffies)
* @data_len: The length of the data
* @cdb_cmd: The CDB command
* @xfer_len: The transfer length
@@ -304,50 +301,46 @@ struct fc_seq_els_data {
* @recov_seq: The sequence for REC or SRR
*/
struct fc_fcp_pkt {
- /* Housekeeping information */
- struct fc_lport *lp;
- u16 state;
- atomic_t ref_cnt;
spinlock_t scsi_pkt_lock;
+ atomic_t ref_cnt;
+
+ /* SCSI command and data transfer information */
+ u32 data_len;
/* SCSI I/O related information */
struct scsi_cmnd *cmd;
struct list_head list;
- /* Timeout related information */
- struct timer_list timer;
- struct completion tm_done;
- int wait_for_comp;
- unsigned long start_time;
- unsigned long end_time;
- unsigned long last_pkt_time;
-
- /* SCSI command and data transfer information */
- u32 data_len;
-
- /* Transport related veriables */
- struct fcp_cmnd cdb_cmd;
- size_t xfer_len;
- u16 xfer_ddp;
- u32 xfer_contig_end;
- u16 max_payload;
+ /* Housekeeping information */
+ struct fc_lport *lp;
+ u8 state;
/* SCSI/FCP return status */
- u32 io_status;
u8 cdb_status;
u8 status_code;
u8 scsi_comp_flags;
+ u32 io_status;
u32 req_flags;
u32 scsi_resid;
+ /* Transport related veriables */
+ size_t xfer_len;
+ struct fcp_cmnd cdb_cmd;
+ u32 xfer_contig_end;
+ u16 max_payload;
+ u16 xfer_ddp;
+
/* Associated structures */
struct fc_rport *rport;
struct fc_seq *seq_ptr;
- /* Error Processing information */
- u8 recov_retry;
+ /* Timeout/error related information */
+ struct timer_list timer;
+ int wait_for_comp;
+ u32 recov_retry;
struct fc_seq *recov_seq;
-};
+ struct completion tm_done;
+} ____cacheline_aligned_in_smp;
/*
* Structure and function definitions for managing Fibre Channel Exchanges
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/6] libfc: cache align struct fc_exch fields
2011-09-28 4:37 [PATCH 0/6] Open-FCoE.org libfc and fcoe updates for scsi-misc Yi Zou
2011-09-28 4:37 ` [PATCH 1/6] fcoe: use kthread_create_on_node Yi Zou
2011-09-28 4:37 ` [PATCH 2/6] libfc: cache align struct fc_fcp_pkt fields Yi Zou
@ 2011-09-28 4:38 ` Yi Zou
2011-09-28 4:38 ` [PATCH 4/6] libfc: cache align fc_exch_pool Yi Zou
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Yi Zou @ 2011-09-28 4:38 UTC (permalink / raw)
To: linux-scsi; +Cc: Vasu Dev, Yi Zou
From: Vasu Dev <vasu.dev@intel.com>
cache aligned xid and ex_lock beside
removing holes.
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Yi Zou <yi.zou@intel.com>
---
include/scsi/libfc.h | 27 ++++++++++++---------------
1 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 05e2583..5d1a758 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -406,35 +406,32 @@ struct fc_seq {
* sequence allocation
*/
struct fc_exch {
+ spinlock_t ex_lock;
+ atomic_t ex_refcnt;
+ enum fc_class class;
struct fc_exch_mgr *em;
struct fc_exch_pool *pool;
- u32 state;
- u16 xid;
struct list_head ex_list;
- spinlock_t ex_lock;
- atomic_t ex_refcnt;
- struct delayed_work timeout_work;
struct fc_lport *lp;
+ u32 esb_stat;
+ u8 state;
+ u8 fh_type;
+ u8 seq_id;
+ u8 encaps;
+ u16 xid;
u16 oxid;
u16 rxid;
u32 oid;
u32 sid;
u32 did;
- u32 esb_stat;
u32 r_a_tov;
- u8 seq_id;
- u8 encaps;
u32 f_ctl;
- u8 fh_type;
- enum fc_class class;
- struct fc_seq seq;
-
+ struct fc_seq seq;
void (*resp)(struct fc_seq *, struct fc_frame *, void *);
void *arg;
-
void (*destructor)(struct fc_seq *, void *);
-
-};
+ struct delayed_work timeout_work;
+} ____cacheline_aligned_in_smp;
#define fc_seq_exch(sp) container_of(sp, struct fc_exch, seq)
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/6] libfc: cache align fc_exch_pool
2011-09-28 4:37 [PATCH 0/6] Open-FCoE.org libfc and fcoe updates for scsi-misc Yi Zou
` (2 preceding siblings ...)
2011-09-28 4:38 ` [PATCH 3/6] libfc: cache align struct fc_exch fields Yi Zou
@ 2011-09-28 4:38 ` Yi Zou
2011-09-28 4:38 ` [PATCH 5/6] fcoe: use real dev in case of HW vlan acceleration Yi Zou
2011-09-28 4:38 ` [PATCH 6/6] fcoe: setup default initial value for DDP threshold Yi Zou
5 siblings, 0 replies; 7+ messages in thread
From: Yi Zou @ 2011-09-28 4:38 UTC (permalink / raw)
To: linux-scsi; +Cc: Vasu Dev, Yi Zou
From: Vasu Dev <vasu.dev@intel.com>
fix holes and better cache aligned fields.
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Yi Zou <yi.zou@intel.com>
---
drivers/scsi/libfc/fc_exch.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index d261e98..7c055fd 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -65,16 +65,15 @@ static struct workqueue_struct *fc_exch_workqueue;
* assigned range of exchanges to per cpu pool.
*/
struct fc_exch_pool {
+ spinlock_t lock;
+ struct list_head ex_list;
u16 next_index;
u16 total_exches;
/* two cache of free slot in exch array */
u16 left;
u16 right;
-
- spinlock_t lock;
- struct list_head ex_list;
-};
+} ____cacheline_aligned_in_smp;
/**
* struct fc_exch_mgr - The Exchange Manager (EM).
@@ -91,13 +90,13 @@ struct fc_exch_pool {
* It manages the allocation of exchange IDs.
*/
struct fc_exch_mgr {
+ struct fc_exch_pool *pool;
+ mempool_t *ep_pool;
enum fc_class class;
struct kref kref;
u16 min_xid;
u16 max_xid;
- mempool_t *ep_pool;
u16 pool_max_index;
- struct fc_exch_pool *pool;
/*
* currently exchange mgr stats are updated but not used.
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 5/6] fcoe: use real dev in case of HW vlan acceleration
2011-09-28 4:37 [PATCH 0/6] Open-FCoE.org libfc and fcoe updates for scsi-misc Yi Zou
` (3 preceding siblings ...)
2011-09-28 4:38 ` [PATCH 4/6] libfc: cache align fc_exch_pool Yi Zou
@ 2011-09-28 4:38 ` Yi Zou
2011-09-28 4:38 ` [PATCH 6/6] fcoe: setup default initial value for DDP threshold Yi Zou
5 siblings, 0 replies; 7+ messages in thread
From: Yi Zou @ 2011-09-28 4:38 UTC (permalink / raw)
To: linux-scsi; +Cc: Vasu Dev, Yi Zou
From: Vasu Dev <vasu.dev@intel.com>
Use real dev in case it has HW vlan acceleration
support since in this case the real dev would
do needed vlan processing, this way unnecessary
vlan layer processing avoided and it gives
slightly better IOPS with 512B size IOs.
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Yi Zou <yi.zou@intel.com>
---
drivers/scsi/fcoe/fcoe.c | 9 ++++++++-
drivers/scsi/fcoe/fcoe.h | 1 +
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 5a28940..cd203d7 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -281,6 +281,7 @@ static int fcoe_interface_setup(struct fcoe_interface *fcoe,
* use the first one for SPMA */
real_dev = (netdev->priv_flags & IFF_802_1Q_VLAN) ?
vlan_dev_real_dev(netdev) : netdev;
+ fcoe->realdev = real_dev;
rcu_read_lock();
for_each_dev_addr(real_dev, ha) {
if ((ha->type == NETDEV_HW_ADDR_T_SAN) &&
@@ -1540,7 +1541,13 @@ int fcoe_xmit(struct fc_lport *lport, struct fc_frame *fp)
skb_reset_network_header(skb);
skb->mac_len = elen;
skb->protocol = htons(ETH_P_FCOE);
- skb->dev = fcoe->netdev;
+ if (fcoe->netdev->priv_flags & IFF_802_1Q_VLAN &&
+ fcoe->realdev->features & NETIF_F_HW_VLAN_TX) {
+ skb->vlan_tci = VLAN_TAG_PRESENT |
+ vlan_dev_vlan_id(fcoe->netdev);
+ skb->dev = fcoe->realdev;
+ } else
+ skb->dev = fcoe->netdev;
/* fill up mac and fcoe headers */
eh = eth_hdr(skb);
diff --git a/drivers/scsi/fcoe/fcoe.h b/drivers/scsi/fcoe/fcoe.h
index c4a9399..e4c9afe 100644
--- a/drivers/scsi/fcoe/fcoe.h
+++ b/drivers/scsi/fcoe/fcoe.h
@@ -80,6 +80,7 @@ do { \
struct fcoe_interface {
struct list_head list;
struct net_device *netdev;
+ struct net_device *realdev;
struct packet_type fcoe_packet_type;
struct packet_type fip_packet_type;
struct fcoe_ctlr ctlr;
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 6/6] fcoe: setup default initial value for DDP threshold
2011-09-28 4:37 [PATCH 0/6] Open-FCoE.org libfc and fcoe updates for scsi-misc Yi Zou
` (4 preceding siblings ...)
2011-09-28 4:38 ` [PATCH 5/6] fcoe: use real dev in case of HW vlan acceleration Yi Zou
@ 2011-09-28 4:38 ` Yi Zou
5 siblings, 0 replies; 7+ messages in thread
From: Yi Zou @ 2011-09-28 4:38 UTC (permalink / raw)
To: linux-scsi; +Cc: Vasu Dev, Yi Zou
From: Vasu Dev <vasu.dev@intel.com>
Currently fcoe_ddp_min doesn't have default value
so by default not used, so setting up default value
as 4k as this works better by avoiding overhead
of programing DDP for small IOs.
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Yi Zou <yi.zou@intel.com>
---
drivers/scsi/fcoe/fcoe.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index cd203d7..430b2cd 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -52,7 +52,7 @@ MODULE_DESCRIPTION("FCoE");
MODULE_LICENSE("GPL v2");
/* Performance tuning parameters for fcoe */
-static unsigned int fcoe_ddp_min;
+static unsigned int fcoe_ddp_min = 4096;
module_param_named(ddp_min, fcoe_ddp_min, uint, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(ddp_min, "Minimum I/O size in bytes for " \
"Direct Data Placement (DDP).");
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-09-28 4:47 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-28 4:37 [PATCH 0/6] Open-FCoE.org libfc and fcoe updates for scsi-misc Yi Zou
2011-09-28 4:37 ` [PATCH 1/6] fcoe: use kthread_create_on_node Yi Zou
2011-09-28 4:37 ` [PATCH 2/6] libfc: cache align struct fc_fcp_pkt fields Yi Zou
2011-09-28 4:38 ` [PATCH 3/6] libfc: cache align struct fc_exch fields Yi Zou
2011-09-28 4:38 ` [PATCH 4/6] libfc: cache align fc_exch_pool Yi Zou
2011-09-28 4:38 ` [PATCH 5/6] fcoe: use real dev in case of HW vlan acceleration Yi Zou
2011-09-28 4:38 ` [PATCH 6/6] fcoe: setup default initial value for DDP threshold Yi Zou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox