RE: [PATCH 8/9] scsi: bfa: Use zeroing allocator rather than allocator/memset

2018-01-01 Thread Gurumurthy, Anil


-Original Message-
From: Himanshu Jha [mailto:himanshujha199...@gmail.com] 
Sent: 30 December 2017 20:59
To: j...@linux.vnet.ibm.com; martin.peter...@oracle.com; aacr...@adaptec.com
Cc: Gurumurthy, Anil <anil.gurumur...@cavium.com>; Kalluru, Sudarsana 
<sudarsana.kall...@cavium.com>; Dept-Eng QLogic Storage Upstream 
<qlogic-storage-upstr...@cavium.com>; satis...@cisco.com; sebad...@cisco.com; 
karti...@cisco.com; Dept-Eng QLogic Storage Upstream 
<qlogic-storage-upstr...@cavium.com>; Dept-Eng QLA2xxx Upstream 
<qla2xxx-upstr...@cavium.com>; linux-scsi@vger.kernel.org; 
linux-ker...@vger.kernel.org; Himanshu Jha <himanshujha199...@gmail.com>
Subject: [PATCH 8/9] scsi: bfa: Use zeroing allocator rather than 
allocator/memset

Use vzalloc instead of vmalloc followed by memset 0.

Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci

Suggested-by: Luis R. Rodriguez <mcg...@kernel.org>
Signed-off-by: Himanshu Jha <himanshujha199...@gmail.com>
---
 drivers/scsi/bfa/bfad.c | 3 +--
 drivers/scsi/bfa/bfad_debugfs.c | 8 ++--
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 
bac18f6..bd7e6a6f 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -610,13 +610,12 @@ bfad_hal_mem_alloc(struct bfad_s *bfad)
/* Iterate through the KVA meminfo queue */
list_for_each(km_qe, _info->qe) {
kva_elem = (struct bfa_mem_kva_s *) km_qe;
-   kva_elem->kva = vmalloc(kva_elem->mem_len);
+   kva_elem->kva = vzalloc(kva_elem->mem_len);
if (kva_elem->kva == NULL) {
bfad_hal_mem_release(bfad);
rc = BFA_STATUS_ENOMEM;
goto ext;
}
-   memset(kva_elem->kva, 0, kva_elem->mem_len);
}
 
/* Iterate through the DMA meminfo queue */ diff --git 
a/drivers/scsi/bfa/bfad_debugfs.c b/drivers/scsi/bfa/bfad_debugfs.c index 
05f5239..349cfe7 100644
--- a/drivers/scsi/bfa/bfad_debugfs.c
+++ b/drivers/scsi/bfa/bfad_debugfs.c
@@ -81,7 +81,7 @@ bfad_debugfs_open_fwtrc(struct inode *inode, struct file 
*file)
 
fw_debug->buffer_len = sizeof(struct bfa_trc_mod_s);
 
-   fw_debug->debug_buffer = vmalloc(fw_debug->buffer_len);
+   fw_debug->debug_buffer = vzalloc(fw_debug->buffer_len);
if (!fw_debug->debug_buffer) {
kfree(fw_debug);
printk(KERN_INFO "bfad[%d]: Failed to allocate fwtrc buffer\n", 
@@ -89,8 +89,6 @@ bfad_debugfs_open_fwtrc(struct inode *inode, struct file 
*file)
return -ENOMEM;
}
 
-   memset(fw_debug->debug_buffer, 0, fw_debug->buffer_len);
-
spin_lock_irqsave(>bfad_lock, flags);
rc = bfa_ioc_debug_fwtrc(>bfa.ioc,
fw_debug->debug_buffer,
@@ -125,7 +123,7 @@ bfad_debugfs_open_fwsave(struct inode *inode, struct file 
*file)
 
fw_debug->buffer_len = sizeof(struct bfa_trc_mod_s);
 
-   fw_debug->debug_buffer = vmalloc(fw_debug->buffer_len);
+   fw_debug->debug_buffer = vzalloc(fw_debug->buffer_len);
if (!fw_debug->debug_buffer) {
kfree(fw_debug);
printk(KERN_INFO "bfad[%d]: Failed to allocate fwsave 
buffer\n", @@ -133,8 +131,6 @@ bfad_debugfs_open_fwsave(struct inode *inode, 
struct file *file)
return -ENOMEM;
}
 
-   memset(fw_debug->debug_buffer, 0, fw_debug->buffer_len);
-
spin_lock_irqsave(>bfad_lock, flags);
rc = bfa_ioc_debug_fwsave(>bfa.ioc,
fw_debug->debug_buffer,
--
2.7.4

Acked by: Anil Gurumurthy <anil.gurumur...@cavium.com>



RE: [PATCH] scsi: bfa: use setup_timer instead of init_timer

2017-11-26 Thread Gurumurthy, Anil

-Original Message-
From: Colin King [mailto:colin.k...@canonical.com] 
Sent: 24 November 2017 19:14
To: Gurumurthy, Anil <anil.gurumur...@cavium.com>; Kalluru, Sudarsana 
<sudarsana.kall...@cavium.com>; James E . J . Bottomley 
<j...@linux.vnet.ibm.com>; Martin K . Petersen <martin.peter...@oracle.com>; 
linux-scsi@vger.kernel.org
Cc: kernel-janit...@vger.kernel.org; linux-ker...@vger.kernel.org
Subject: [PATCH] scsi: bfa: use setup_timer instead of init_timer

From: Colin Ian King <colin.k...@canonical.com>

Use setup_timer function instead of initializing timer with the function and 
data fields.

Signed-off-by: Colin Ian King <colin.k...@canonical.com>
---
 drivers/scsi/bfa/bfad.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 
5caf5f3ff642..c910b238bc9e 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -719,10 +719,7 @@ bfad_bfa_tmo(unsigned long data)  void  
bfad_init_timer(struct bfad_s *bfad)  {
-   init_timer(>hal_tmo);
-   bfad->hal_tmo.function = bfad_bfa_tmo;
-   bfad->hal_tmo.data = (unsigned long)bfad;
-
+   setup_timer(>hal_tmo, bfad_bfa_tmo, (unsigned long)bfad);
mod_timer(>hal_tmo,
  jiffies + msecs_to_jiffies(BFA_TIMER_FREQ));
 }
--
2.14.1
 
Acked-by: Anil Gurumurthy <anil.gurumur...@cavium.com>



RE: [PATCH 0/7] scsi: bfa: do_gettimeofday removal

2017-11-10 Thread Gurumurthy, Anil
The bfa drivers are in deep maintenance mode for some time now. We have not had 
issues reported on them for a while, but it would be good to continue to have 
them.

The series looks ok to me too.

Thanks,
Anil

-Original Message-
From: Christoph Hellwig [mailto:h...@lst.de] 
Sent: 10 November 2017 22:55
To: Arnd Bergmann <a...@arndb.de>
Cc: Gurumurthy, Anil <anil.gurumur...@cavium.com>; Kalluru, Sudarsana 
<sudarsana.kall...@cavium.com>; James E . J . Bottomley 
<j...@linux.vnet.ibm.com>; Martin K . Petersen <martin.peter...@oracle.com>; 
linux-scsi@vger.kernel.org; linux-ker...@vger.kernel.org; 
y2...@lists.linaro.org; h...@lst.de; h...@suse.com; jthumsh...@suse.de
Subject: Re: [PATCH 0/7] scsi: bfa: do_gettimeofday removal

This stuff look ok - but I have a bigger question and that is if bfa is still 
alive at all.  Everytime I look at it I have doubts if it works at all, so I 
wonder if we need to keep it on life support.


RE: [PATCH] bfa: turn bfa_mem_{kva,dma}_setup into inline functions

2016-11-20 Thread Gurumurthy, Anil
Patch looks good.
Acked by: Anil Gurumurthy <anil.gurumur...@cavium.com>


-Original Message-
From: Johannes Thumshirn [mailto:jthumsh...@suse.de] 
Sent: 18 November 2016 18:52
To: Arnd Bergmann <a...@arndb.de>
Cc: James E.J. Bottomley <j...@linux.vnet.ibm.com>; Martin K. Petersen 
<martin.peter...@oracle.com>; Anil Gurumurthy <anil.gurumur...@qlogic.com>; 
Sudarsana Kalluru <sudarsana.kall...@qlogic.com>; linux-scsi@vger.kernel.org; 
linux-ker...@vger.kernel.org
Subject: Re: [PATCH] bfa: turn bfa_mem_{kva,dma}_setup into inline functions

On Wed, Nov 16, 2016 at 04:14:27PM +0100, Arnd Bergmann wrote:
> These two macros cause lots of warnings with gcc-7:
> 
> drivers/scsi/bfa/bfa_svc.c: In function 'bfa_fcxp_meminfo':
> drivers/scsi/bfa/bfa_svc.c:521:103: error: '*' in boolean context, 
> suggest '&&' instead [-Werror=int-in-bool-context]
> 
> Using inline functions makes them much more readable and avoids the 
> warnings.
> 
> Signed-off-by: Arnd Bergmann <a...@arndb.de>
> ---

Looks good,
Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de>

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key 
fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: Crash in TCM-LIO

2016-10-26 Thread Gurumurthy, Anil
Hello Nicholas,

-Original Message-
From: Nicholas A. Bellinger [mailto:n...@linux-iscsi.org] 
Sent: 26 October 2016 11:49
To: Gurumurthy, Anil <anil.gurumur...@cavium.com>
Cc: Anil Gurumurthy <anil.gurumur...@qlogic.com>; linux-scsi 
<linux-scsi@vger.kernel.org>; Malavali, Giridhar 
<giridhar.malav...@cavium.com>; Tran, Quinn <quinn.t...@cavium.com>; TomK 
<t...@mdevsys.com>
Subject: Re: Crash in TCM-LIO

Hello Anil & Co,

On Tue, 2016-10-25 at 05:33 +, Gurumurthy, Anil wrote:
> On Mon, 2016-10-24 at 06:36 +, Anil Gurumurthy wrote:



> > 
> > [71884.588748] BUG: unable to handle kernel NULL pointer dereference 
> > at 00e0
> > 
> > [71884.51] IP: [] kmem_cache_free+0x11a/0x200
> > 
> > [71884.588981] PGD 0
> > 
> > [71884.589017] Oops:  [#1] SMP
> > 
> > [71884.589041] [ cut here ]
> > 
> > [71884.589048] WARNING: CPU: 2 PID: 20783 at lib/list_debug.c:62
> > __list_del_entry+0x86/0xd0
> > 
> > [71884.589049] list_del corruption. next->prev should be 
> > 8806f8daeb68, but was 8806f8db79e8
> > 
> > [71884.589075] Modules linked in: target_core_pscsi tcm_qla2xxx(OE)
> > qla2xxx(OE) iscsi_target_mod target_core_file target_core_iblock 
> > target_core_mod netconsole ebtable_nat ebtables ipt_MASQUERADE
> > nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat xt_CHECKSUM 
> > iptable_mangle bridge 8021q mrp garp stp llc ipt_REJECT 
> > nf_reject_ipv4
> > nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables 
> > ip6t_REJECT
> > nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6 xt_state 
> > nf_conntrack ip6table_filter ip6_tables binfmt_misc vhost_net 
> > macvtap macvlan vhost tun uinput sg serio_raw iTCO_wdt 
> > iTCO_vendor_support ipmi_ssif ipmi_si ipmi_msghandler hpilo hpwdt 
> > bnx2 intel_powerclamp coretemp kvm_intel kvm irqbypass 
> > crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel 
> > pcspkr acpi_power_meter lpc_ich mfd_core i7core_edac edac_core 
> > shpchp ext4(E) mbcache(E) jbd2(E) sd_mod(E)
> > sr_mod(E) cdrom(E) scsi_transport_fc(E) hpsa(E) 
> > scsi_transport_sas(E)
> > aesni_intel(E) ablk_helper(E) cryptd(E) lrw(E) gf128mul(E)
> > glue_helper(E) pata_acpi(E) ata_generic(E) ata_piix(E) libata(E)
> > radeon(E) ttm(E) drm_kms_helper(E) drm(E) fb_sys_fops(E) 
> > sysimgblt(E)
> > sysfillrect(E) syscopyarea(E) i2c_algo_bit(E) i2c_core(E) 
> > dm_mirror(E)
> > dm_region_hash(E) dm_log(E) dm_mod(E) [last unloaded: qla2xxx]
> > 
> > [71884.589091] CPU: 2 PID: 20783 Comm: kworker/2:0 Tainted: GW
> > IOE   4.7.0-rc1+ #2
> > 
> > [71884.589092] Hardware name: HP ProLiant DL380 G7, BIOS P67
> > 05/05/2011
> > 
> > [71884.589107] Workqueue: target_completion target_complete_ok_work 
> > [target_core_mod]
> > 
> > [71884.589109]   880408d1fae8 81352197
> > 81370ef6
> > 
> > [71884.589110]  880408d1fb48 880408d1fb48 
> > 880408d1fb38
> > 
> > [71884.589111]  8108a12d 07c3 003e0246
> > 0246
> > 
> > [71884.589112] Call Trace:
> > 
> > [71884.589115]  [] dump_stack+0x67/0x90
> > 
> > [71884.589117]  [] ? __list_del_entry+0x86/0xd0
> > 
> > [71884.589119]  [] __warn+0xfd/0x120
> > 
> > [71884.589120]  [] warn_slowpath_fmt+0x49/0x50
> > 
> > [71884.589122]  [] __list_del_entry+0x86/0xd0
> > 
> > [71884.589123]  [] list_del+0x11/0x40
> > 
> > [71884.589132]  [] target_remove_from_state_list
> > +0x6e/0x80 [target_core_mod]
> > 
> > [71884.589140]  [] transport_cmd_check_stop
> > +0xe4/0x120 [target_core_mod]
> > 
> > [71884.589151]  []
> > transport_cmd_check_stop_to_fabric+0x15/0x20 [target_core_mod]
> > 
> > [71884.589160]  [] target_complete_ok_work
> > +0x14e/0x280 [target_core_mod]
> > 
> > [71884.589162]  [] ? 
> > pwq_dec_nr_in_flight+0x50/0xa0
> > 
> > [71884.589164]  [] process_one_work+0x183/0x4d0
> > 
> > [71884.589166]  [] ? __schedule+0x1ff/0x5c0
> > 
> > [71884.589167]  [] ? schedule+0x40/0xb0
> > 
> > [71884.589169]  [] worker_thread+0x16d/0x530
> > 
> > [71884.589171]  [] ? __switch_to+0x1cd/0x5e0
> > 
> > [71884.589173]  [] ? __schedule+0x1ff/0x5c0
> > 
> > [71884.589175]  [] ? __wake_up_common+0x56/0x90
> > 
> > [71884.589177]  [] ? 
> > maybe_create_worker+0x120/0x120
> > 
> > [71884.589178]  [] ? schedule+0x4

RE: Crash in TCM-LIO

2016-10-25 Thread Gurumurthy, Anil
Hello Nicholas,

-Original Message-
From: Gurumurthy, Anil 
Sent: 24 October 2016 14:50
To: 'Nicholas A. Bellinger' <n...@linux-iscsi.org>; Anil Gurumurthy 
<anil.gurumur...@qlogic.com>
Cc: linux-scsi <linux-scsi@vger.kernel.org>; Malavali, Giridhar 
<giridhar.malav...@cavium.com>; Tran, Quinn <quinn.t...@cavium.com>; TomK 
<t...@mdevsys.com>
Subject: RE: Crash in TCM-LIO



-Original Message-
From: Nicholas A. Bellinger [mailto:n...@linux-iscsi.org]
Sent: 24 October 2016 12:30
To: Anil Gurumurthy <anil.gurumur...@qlogic.com>
Cc: linux-scsi <linux-scsi@vger.kernel.org>; Malavali, Giridhar 
<giridhar.malav...@cavium.com>; Tran, Quinn <quinn.t...@cavium.com>; TomK 
<t...@mdevsys.com>
Subject: Re: Crash in TCM-LIO

Hello Anil & Co,

On Mon, 2016-10-24 at 06:36 +, Anil Gurumurthy wrote:
> Hello Nicholas,
> 
>   I was trying to get DIF working on TCM-LIO with a QLogic FC adapter 
> on kernel version 4.7. I noticed a crash when there was an abort 
> received by the target with the following stack trace:
> 
>  

Thanks for reporting.

> 
> [71884.588748] BUG: unable to handle kernel NULL pointer dereference 
> at 00e0
> 
> [71884.51] IP: [] kmem_cache_free+0x11a/0x200
> 
> [71884.588981] PGD 0
> 
> [71884.589017] Oops:  [#1] SMP
> 
> [71884.589041] [ cut here ]
> 
> [71884.589048] WARNING: CPU: 2 PID: 20783 at lib/list_debug.c:62
> __list_del_entry+0x86/0xd0
> 
> [71884.589049] list_del corruption. next->prev should be 
> 8806f8daeb68, but was 8806f8db79e8
> 
> [71884.589075] Modules linked in: target_core_pscsi tcm_qla2xxx(OE)
> qla2xxx(OE) iscsi_target_mod target_core_file target_core_iblock 
> target_core_mod netconsole ebtable_nat ebtables ipt_MASQUERADE
> nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat xt_CHECKSUM 
> iptable_mangle bridge 8021q mrp garp stp llc ipt_REJECT nf_reject_ipv4
> nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT
> nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack 
> ip6table_filter ip6_tables binfmt_misc vhost_net macvtap macvlan vhost 
> tun uinput sg serio_raw iTCO_wdt iTCO_vendor_support ipmi_ssif ipmi_si 
> ipmi_msghandler hpilo hpwdt bnx2 intel_powerclamp coretemp kvm_intel 
> kvm irqbypass crct10dif_pclmul crc32_pclmul crc32c_intel 
> ghash_clmulni_intel pcspkr acpi_power_meter lpc_ich mfd_core 
> i7core_edac edac_core shpchp ext4(E) mbcache(E) jbd2(E) sd_mod(E)
> sr_mod(E) cdrom(E) scsi_transport_fc(E) hpsa(E) scsi_transport_sas(E)
> aesni_intel(E) ablk_helper(E) cryptd(E) lrw(E) gf128mul(E)
> glue_helper(E) pata_acpi(E) ata_generic(E) ata_piix(E) libata(E)
> radeon(E) ttm(E) drm_kms_helper(E) drm(E) fb_sys_fops(E) sysimgblt(E)
> sysfillrect(E) syscopyarea(E) i2c_algo_bit(E) i2c_core(E) dm_mirror(E)
> dm_region_hash(E) dm_log(E) dm_mod(E) [last unloaded: qla2xxx]
> 
> [71884.589091] CPU: 2 PID: 20783 Comm: kworker/2:0 Tainted: GW
> IOE   4.7.0-rc1+ #2
> 
> [71884.589092] Hardware name: HP ProLiant DL380 G7, BIOS P67
> 05/05/2011
> 
> [71884.589107] Workqueue: target_completion target_complete_ok_work 
> [target_core_mod]
> 
> [71884.589109]   880408d1fae8 81352197
> 81370ef6
> 
> [71884.589110]  880408d1fb48 880408d1fb48 
> 880408d1fb38
> 
> [71884.589111]  8108a12d 07c3 003e0246
> 0246
> 
> [71884.589112] Call Trace:
> 
> [71884.589115]  [] dump_stack+0x67/0x90
> 
> [71884.589117]  [] ? __list_del_entry+0x86/0xd0
> 
> [71884.589119]  [] __warn+0xfd/0x120
> 
> [71884.589120]  [] warn_slowpath_fmt+0x49/0x50
> 
> [71884.589122]  [] __list_del_entry+0x86/0xd0
> 
> [71884.589123]  [] list_del+0x11/0x40
> 
> [71884.589132]  [] target_remove_from_state_list
> +0x6e/0x80 [target_core_mod]
> 
> [71884.589140]  [] transport_cmd_check_stop
> +0xe4/0x120 [target_core_mod]
> 
> [71884.589151]  []
> transport_cmd_check_stop_to_fabric+0x15/0x20 [target_core_mod]
> 
> [71884.589160]  [] target_complete_ok_work
> +0x14e/0x280 [target_core_mod]
> 
> [71884.589162]  [] ? pwq_dec_nr_in_flight+0x50/0xa0
> 
> [71884.589164]  [] process_one_work+0x183/0x4d0
> 
> [71884.589166]  [] ? __schedule+0x1ff/0x5c0
> 
> [71884.589167]  [] ? schedule+0x40/0xb0
> 
> [71884.589169]  [] worker_thread+0x16d/0x530
> 
> [71884.589171]  [] ? __switch_to+0x1cd/0x5e0
> 
> [71884.589173]  [] ? __schedule+0x1ff/0x5c0
> 
> [71884.589175]  [] ? __wake_up_common+0x56/0x90
> 
> [71884.589177]  [] ? maybe_create_worker+0x120/0x120
> 
> [71884.589178]  [] ? schedule+0x40/0xb0
> 
> [71884.58

RE: Crash in TCM-LIO

2016-10-24 Thread Gurumurthy, Anil


-Original Message-
From: Nicholas A. Bellinger [mailto:n...@linux-iscsi.org] 
Sent: 24 October 2016 12:30
To: Anil Gurumurthy <anil.gurumur...@qlogic.com>
Cc: linux-scsi <linux-scsi@vger.kernel.org>; Malavali, Giridhar 
<giridhar.malav...@cavium.com>; Tran, Quinn <quinn.t...@cavium.com>; TomK 
<t...@mdevsys.com>
Subject: Re: Crash in TCM-LIO

Hello Anil & Co,

On Mon, 2016-10-24 at 06:36 +, Anil Gurumurthy wrote:
> Hello Nicholas,
> 
>   I was trying to get DIF working on TCM-LIO with a QLogic FC adapter 
> on kernel version 4.7. I noticed a crash when there was an abort 
> received by the target with the following stack trace:
> 
>  

Thanks for reporting.

> 
> [71884.588748] BUG: unable to handle kernel NULL pointer dereference 
> at 00e0
> 
> [71884.51] IP: [] kmem_cache_free+0x11a/0x200
> 
> [71884.588981] PGD 0
> 
> [71884.589017] Oops:  [#1] SMP
> 
> [71884.589041] [ cut here ]
> 
> [71884.589048] WARNING: CPU: 2 PID: 20783 at lib/list_debug.c:62
> __list_del_entry+0x86/0xd0
> 
> [71884.589049] list_del corruption. next->prev should be 
> 8806f8daeb68, but was 8806f8db79e8
> 
> [71884.589075] Modules linked in: target_core_pscsi tcm_qla2xxx(OE)
> qla2xxx(OE) iscsi_target_mod target_core_file target_core_iblock 
> target_core_mod netconsole ebtable_nat ebtables ipt_MASQUERADE
> nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat xt_CHECKSUM 
> iptable_mangle bridge 8021q mrp garp stp llc ipt_REJECT nf_reject_ipv4
> nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT
> nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack 
> ip6table_filter ip6_tables binfmt_misc vhost_net macvtap macvlan vhost 
> tun uinput sg serio_raw iTCO_wdt iTCO_vendor_support ipmi_ssif ipmi_si 
> ipmi_msghandler hpilo hpwdt bnx2 intel_powerclamp coretemp kvm_intel 
> kvm irqbypass crct10dif_pclmul crc32_pclmul crc32c_intel 
> ghash_clmulni_intel pcspkr acpi_power_meter lpc_ich mfd_core 
> i7core_edac edac_core shpchp ext4(E) mbcache(E) jbd2(E) sd_mod(E)
> sr_mod(E) cdrom(E) scsi_transport_fc(E) hpsa(E) scsi_transport_sas(E)
> aesni_intel(E) ablk_helper(E) cryptd(E) lrw(E) gf128mul(E)
> glue_helper(E) pata_acpi(E) ata_generic(E) ata_piix(E) libata(E)
> radeon(E) ttm(E) drm_kms_helper(E) drm(E) fb_sys_fops(E) sysimgblt(E)
> sysfillrect(E) syscopyarea(E) i2c_algo_bit(E) i2c_core(E) dm_mirror(E)
> dm_region_hash(E) dm_log(E) dm_mod(E) [last unloaded: qla2xxx]
> 
> [71884.589091] CPU: 2 PID: 20783 Comm: kworker/2:0 Tainted: GW
> IOE   4.7.0-rc1+ #2
> 
> [71884.589092] Hardware name: HP ProLiant DL380 G7, BIOS P67
> 05/05/2011
> 
> [71884.589107] Workqueue: target_completion target_complete_ok_work 
> [target_core_mod]
> 
> [71884.589109]   880408d1fae8 81352197
> 81370ef6
> 
> [71884.589110]  880408d1fb48 880408d1fb48 
> 880408d1fb38
> 
> [71884.589111]  8108a12d 07c3 003e0246
> 0246
> 
> [71884.589112] Call Trace:
> 
> [71884.589115]  [] dump_stack+0x67/0x90
> 
> [71884.589117]  [] ? __list_del_entry+0x86/0xd0
> 
> [71884.589119]  [] __warn+0xfd/0x120
> 
> [71884.589120]  [] warn_slowpath_fmt+0x49/0x50
> 
> [71884.589122]  [] __list_del_entry+0x86/0xd0
> 
> [71884.589123]  [] list_del+0x11/0x40
> 
> [71884.589132]  [] target_remove_from_state_list
> +0x6e/0x80 [target_core_mod]
> 
> [71884.589140]  [] transport_cmd_check_stop
> +0xe4/0x120 [target_core_mod]
> 
> [71884.589151]  []
> transport_cmd_check_stop_to_fabric+0x15/0x20 [target_core_mod]
> 
> [71884.589160]  [] target_complete_ok_work
> +0x14e/0x280 [target_core_mod]
> 
> [71884.589162]  [] ? pwq_dec_nr_in_flight+0x50/0xa0
> 
> [71884.589164]  [] process_one_work+0x183/0x4d0
> 
> [71884.589166]  [] ? __schedule+0x1ff/0x5c0
> 
> [71884.589167]  [] ? schedule+0x40/0xb0
> 
> [71884.589169]  [] worker_thread+0x16d/0x530
> 
> [71884.589171]  [] ? __switch_to+0x1cd/0x5e0
> 
> [71884.589173]  [] ? __schedule+0x1ff/0x5c0
> 
> [71884.589175]  [] ? __wake_up_common+0x56/0x90
> 
> [71884.589177]  [] ? maybe_create_worker+0x120/0x120
> 
> [71884.589178]  [] ? schedule+0x40/0xb0
> 
> [71884.589179]  [] ? maybe_create_worker+0x120/0x120
> 
> [71884.589180]  [] kthread+0xcc/0xf0
> 
> [71884.589183]  [] ? do_syscall_64+0x78/0x1d0
> 
> [71884.589185]  [] ? schedule_tail+0x1e/0xc0
> 
> [71884.589188]  [] ret_from_fork+0x1f/0x40
> 
> [71884.589189]  [] ? kthread_freezable_should_stop
> +0x70/0x70
> 
> [71884.589190] ---[ end trace 7f24d6c863b6e35b ]---
> 
> [71884.589204] ---

RE: Crash in TCM-LIO

2016-10-24 Thread Gurumurthy, Anil


-Original Message-
From: Nicholas A. Bellinger [mailto:n...@linux-iscsi.org] 
Sent: 24 October 2016 12:30
To: Anil Gurumurthy <anil.gurumur...@qlogic.com>
Cc: linux-scsi <linux-scsi@vger.kernel.org>; Malavali, Giridhar 
<giridhar.malav...@cavium.com>; Tran, Quinn <quinn.t...@cavium.com>; TomK 
<t...@mdevsys.com>
Subject: Re: Crash in TCM-LIO

Hello Anil & Co,

On Mon, 2016-10-24 at 06:36 +, Anil Gurumurthy wrote:
> Hello Nicholas,
> 
>   I was trying to get DIF working on TCM-LIO with a QLogic FC adapter 
> on kernel version 4.7. I noticed a crash when there was an abort 
> received by the target with the following stack trace:
> 
>  

Thanks for reporting.

> 
> [71884.588748] BUG: unable to handle kernel NULL pointer dereference 
> at 00e0
> 
> [71884.51] IP: [] kmem_cache_free+0x11a/0x200
> 
> [71884.588981] PGD 0
> 
> [71884.589017] Oops:  [#1] SMP
> 
> [71884.589041] [ cut here ]
> 
> [71884.589048] WARNING: CPU: 2 PID: 20783 at lib/list_debug.c:62
> __list_del_entry+0x86/0xd0
> 
> [71884.589049] list_del corruption. next->prev should be 
> 8806f8daeb68, but was 8806f8db79e8
> 
> [71884.589075] Modules linked in: target_core_pscsi tcm_qla2xxx(OE)
> qla2xxx(OE) iscsi_target_mod target_core_file target_core_iblock 
> target_core_mod netconsole ebtable_nat ebtables ipt_MASQUERADE
> nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat xt_CHECKSUM 
> iptable_mangle bridge 8021q mrp garp stp llc ipt_REJECT nf_reject_ipv4
> nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT
> nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack 
> ip6table_filter ip6_tables binfmt_misc vhost_net macvtap macvlan vhost 
> tun uinput sg serio_raw iTCO_wdt iTCO_vendor_support ipmi_ssif ipmi_si 
> ipmi_msghandler hpilo hpwdt bnx2 intel_powerclamp coretemp kvm_intel 
> kvm irqbypass crct10dif_pclmul crc32_pclmul crc32c_intel 
> ghash_clmulni_intel pcspkr acpi_power_meter lpc_ich mfd_core 
> i7core_edac edac_core shpchp ext4(E) mbcache(E) jbd2(E) sd_mod(E)
> sr_mod(E) cdrom(E) scsi_transport_fc(E) hpsa(E) scsi_transport_sas(E)
> aesni_intel(E) ablk_helper(E) cryptd(E) lrw(E) gf128mul(E)
> glue_helper(E) pata_acpi(E) ata_generic(E) ata_piix(E) libata(E)
> radeon(E) ttm(E) drm_kms_helper(E) drm(E) fb_sys_fops(E) sysimgblt(E)
> sysfillrect(E) syscopyarea(E) i2c_algo_bit(E) i2c_core(E) dm_mirror(E)
> dm_region_hash(E) dm_log(E) dm_mod(E) [last unloaded: qla2xxx]
> 
> [71884.589091] CPU: 2 PID: 20783 Comm: kworker/2:0 Tainted: GW
> IOE   4.7.0-rc1+ #2
> 
> [71884.589092] Hardware name: HP ProLiant DL380 G7, BIOS P67
> 05/05/2011
> 
> [71884.589107] Workqueue: target_completion target_complete_ok_work 
> [target_core_mod]
> 
> [71884.589109]   880408d1fae8 81352197
> 81370ef6
> 
> [71884.589110]  880408d1fb48 880408d1fb48 
> 880408d1fb38
> 
> [71884.589111]  8108a12d 07c3 003e0246
> 0246
> 
> [71884.589112] Call Trace:
> 
> [71884.589115]  [] dump_stack+0x67/0x90
> 
> [71884.589117]  [] ? __list_del_entry+0x86/0xd0
> 
> [71884.589119]  [] __warn+0xfd/0x120
> 
> [71884.589120]  [] warn_slowpath_fmt+0x49/0x50
> 
> [71884.589122]  [] __list_del_entry+0x86/0xd0
> 
> [71884.589123]  [] list_del+0x11/0x40
> 
> [71884.589132]  [] target_remove_from_state_list
> +0x6e/0x80 [target_core_mod]
> 
> [71884.589140]  [] transport_cmd_check_stop
> +0xe4/0x120 [target_core_mod]
> 
> [71884.589151]  []
> transport_cmd_check_stop_to_fabric+0x15/0x20 [target_core_mod]
> 
> [71884.589160]  [] target_complete_ok_work
> +0x14e/0x280 [target_core_mod]
> 
> [71884.589162]  [] ? pwq_dec_nr_in_flight+0x50/0xa0
> 
> [71884.589164]  [] process_one_work+0x183/0x4d0
> 
> [71884.589166]  [] ? __schedule+0x1ff/0x5c0
> 
> [71884.589167]  [] ? schedule+0x40/0xb0
> 
> [71884.589169]  [] worker_thread+0x16d/0x530
> 
> [71884.589171]  [] ? __switch_to+0x1cd/0x5e0
> 
> [71884.589173]  [] ? __schedule+0x1ff/0x5c0
> 
> [71884.589175]  [] ? __wake_up_common+0x56/0x90
> 
> [71884.589177]  [] ? maybe_create_worker+0x120/0x120
> 
> [71884.589178]  [] ? schedule+0x40/0xb0
> 
> [71884.589179]  [] ? maybe_create_worker+0x120/0x120
> 
> [71884.589180]  [] kthread+0xcc/0xf0
> 
> [71884.589183]  [] ? do_syscall_64+0x78/0x1d0
> 
> [71884.589185]  [] ? schedule_tail+0x1e/0xc0
> 
> [71884.589188]  [] ret_from_fork+0x1f/0x40
> 
> [71884.589189]  [] ? kthread_freezable_should_stop
> +0x70/0x70
> 
> [71884.589190] ---[ end trace 7f24d6c863b6e35b ]---
> 
> [71884.589204] --

RE: [PATCH resend v2] [SCSI] bfa: fix bfa_fcb_itnim_alloc() error handling

2016-05-06 Thread Anil Gurumurthy
Apologies for the delay. Patch looks good.

Acked by: Anil Gurumurthy <anil.gurumur...@qlogic.com>


-Original Message-
From: Martin K. Petersen [mailto:martin.peter...@oracle.com] 
Sent: 06 May 2016 06:54
To: Dan Carpenter <dan.carpen...@oracle.com>
Cc: Anil Gurumurthy <anil.gurumur...@qlogic.com>; Sudarsana Kalluru 
<sudarsana.kall...@qlogic.com>; James E.J. Bottomley <j...@linux.vnet.ibm.com>; 
Martin K. Petersen <martin.peter...@oracle.com>; linux-scsi 
<linux-scsi@vger.kernel.org>; kernel-janit...@vger.kernel.org
Subject: Re: [PATCH resend v2] [SCSI] bfa: fix bfa_fcb_itnim_alloc() error 
handling

>>>>> "Dan" == Dan Carpenter <dan.carpen...@oracle.com> writes:

Dan> The caller assumes that "itnim" is NULL on error and non-NULL on 
Dan> success but really "itnim" is uninitialized on error.  This 
Dan> function should just use normal error handling where it returns 
Dan> zero on success and negative on failure.

Anil, please review:

https://patchwork.kernel.org/patch/8820751/

-- 
Martin K. Petersen  Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH RESEND] bfa: deinline __bfa_trc() and __bfa_trc32()

2016-02-11 Thread Anil Gurumurthy
You could remove the __bfa_trc32() routine

Thanks,
Acked-by: Anil Gurumurthy <anil.gurumur...@qlogic.com>

-Original Message-
From: Martin K. Petersen [mailto:martin.peter...@oracle.com] 
Sent: 10 February 2016 22:59
To: Denys Vlasenko <dvlas...@redhat.com>
Cc: James Bottomley <jbottom...@parallels.com>; Fabian Frederick 
<f...@skynet.be>; Anil Gurumurthy <anil.gurumur...@qlogic.com>; Christoph 
Hellwig <h...@lst.de>; Guenter Roeck <li...@roeck-us.net>; Ben Hutchings 
<b...@decadent.org.uk>; linux-kernel <linux-ker...@vger.kernel.org>; linux-scsi 
<linux-scsi@vger.kernel.org>
Subject: Re: [PATCH RESEND] bfa: deinline __bfa_trc() and __bfa_trc32()

>>>>> "Denys" == Denys Vlasenko <dvlas...@redhat.com> writes:

Denys> __bfa_trc32() is very similar, so it is uninlined too.  However, 
Denys> it appears to be unused, therefore this patch ifdefs it out.

Why don't we just drop it?

-- 
Martin K. Petersen  Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [patch] bfa: use strncpy() instead of memcpy()

2016-02-02 Thread Anil Gurumurthy
Acked-by: Anil Gurumurthy <anil.gurumur...@qlogic.com>

-Original Message-
From: Dan Carpenter [mailto:dan.carpen...@oracle.com] 
Sent: 30 January 2016 20:06
To: Anil Gurumurthy <anil.gurumur...@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kall...@qlogic.com>; James E.J. Bottomley 
<jbottom...@odin.com>; Martin K. Petersen <martin.peter...@oracle.com>; 
linux-scsi <linux-scsi@vger.kernel.org>; linux-kernel 
<linux-ker...@vger.kernel.org>; kernel-janit...@vger.kernel.org
Subject: [patch] bfa: use strncpy() instead of memcpy()

BFA_MFG_NAME is "QLogic" which is only 7 bytes, but we are copying 8 bytes.  
It's harmless because the badding byte is likely zero but it makes static 
checkers complain.

Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com>
---
Technically the memset() is not needed because strncpy() will pad the rest of 
the buffer with zeros but I was worried that people would be paranoid.

diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c index 
251e2ff..a1ada4a 100644
--- a/drivers/scsi/bfa/bfa_ioc.c
+++ b/drivers/scsi/bfa/bfa_ioc.c
@@ -2803,7 +2803,7 @@ void
 bfa_ioc_get_adapter_manufacturer(struct bfa_ioc_s *ioc, char *manufacturer)  {
memset((void *)manufacturer, 0, BFA_ADAPTER_MFG_NAME_LEN);
-   memcpy(manufacturer, BFA_MFG_NAME, BFA_ADAPTER_MFG_NAME_LEN);
+   strncpy(manufacturer, BFA_MFG_NAME, BFA_ADAPTER_MFG_NAME_LEN);
 }
 
 void
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 2/4] bfa:Fix for crash when bfa_itnim is NULL

2015-11-26 Thread Anil Gurumurthy
Thanks Johannes, will repost the patch set.

-Original Message-
From: Johannes Thumshirn [mailto:jthumsh...@suse.de] 
Sent: 26 November 2015 14:06
To: Anil Gurumurthy <anil.gurumur...@qlogic.com>; martin.peter...@oracle.com; 
james.bottom...@hansenpartnership.com
Cc: linux-scsi <linux-scsi@vger.kernel.org>; Sudarsana Kalluru 
<sudarsana.kall...@qlogic.com>
Subject: Re: [PATCH 2/4] bfa:Fix for crash when bfa_itnim is NULL

On Thu, 2015-11-26 at 02:43 -0500, anil.gurumur...@qlogic.com wrote:
> From: Anil Gurumurthy <anil.gurumur...@qlogic.com>


Can you please explain a bit more why it is crashing in the commit message, 
i.e. copy the comment you added to the source here as well.

And as I spot the words fix and crash in the subject, you might consider adding 
a Cc: sta...@vger.kernel.org

Thanks,
Johannes

> 
> Signed-off-by: Sudarsana Kalluru <sudarsana.kall...@qlogic.com>
> Signed-off-by: Anil Gurumurthy <anil.gurumur...@qlogic.com>
> ---
>  drivers/scsi/bfa/bfad_im.c |   26 ++
>  1 files changed, 26 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c 
> index efcb247..2c0cf8a 100644
> --- a/drivers/scsi/bfa/bfad_im.c
> +++ b/drivers/scsi/bfa/bfad_im.c
> @@ -272,6 +272,19 @@ bfad_im_target_reset_send(struct bfad_s *bfad, 
> struct scsi_cmnd *cmnd,
>   cmnd->host_scribble = NULL;
>   cmnd->SCp.Status = 0;
>   bfa_itnim = bfa_fcs_itnim_get_halitn(>fcs_itnim);
> + /*
> +  * bfa_itnim can be NULL if the port gets disconnected and the bfa
> +  * and fcs layers have cleaned up their nexus with the targets and
> +  * the same has not been cleaned up by the shim
> +  */
> + if (bfa_itnim == NULL) {
> + bfa_tskim_free(tskim);
> + BFA_LOG(KERN_ERR, bfad, bfa_log_level,
> + "target reset, bfa_itnim is NULL\n");
> + rc = BFA_STATUS_FAILED;
> + goto out;
> + }
> +
>   memset(, 0, sizeof(scsilun));
>   bfa_tskim_start(tskim, bfa_itnim, scsilun,
>   FCP_TM_TARGET_RESET, BFAD_TARGET_RESET_TMO); @@ 
> -327,6 +340,19 
> @@ bfad_im_reset_lun_handler(struct scsi_cmnd *cmnd)
>   cmnd->SCp.ptr = (char *)
>   cmnd->SCp.Status = 0;
>   bfa_itnim = bfa_fcs_itnim_get_halitn(>fcs_itnim);
> + /*
> +  * bfa_itnim can be NULL if the port gets disconnected and the bfa
> +  * and fcs layers have cleaned up their nexus with the targets and
> +  * the same has not been cleaned up by the shim
> +  */
> + if (bfa_itnim == NULL) {
> + bfa_tskim_free(tskim);
> + BFA_LOG(KERN_ERR, bfad, bfa_log_level,
> + "lun reset, bfa_itnim is NULL\n");
> + spin_unlock_irqrestore(>bfad_lock, flags);
> + rc = FAILED;
> + goto out;
> + }
>   int_to_scsilun(cmnd->device->lun, );
>   bfa_tskim_start(tskim, bfa_itnim, scsilun,
>   FCP_TM_LUN_RESET, BFAD_LUN_RESET_TMO);

<>

RE: [PATCH] [SCSI] bfa: fix missing { } braces

2015-08-04 Thread Anil Gurumurthy
Hi Colin,
  We will fix the indentation in the next set of patches that we submit 
upstream.

Thanks,
Anil

-Original Message-
From: Colin King [mailto:colin.k...@canonical.com] 
Sent: 03 August 2015 20:05
To: Anil Gurumurthy; Sudarsana Kalluru; James E.J. Bottomley; linux-scsi
Cc: linux-kernel
Subject: [PATCH] [SCSI] bfa: fix missing { } braces

From: Colin Ian King colin.k...@canonical.com

Static analysis by smatch indicated that there was a curly braces issue:

drivers/scsi/bfa/bfa_ioc.c:3668 bfa_cb_sfp_state_query()
warn: curly braces intended?
drivers/scsi/bfa/bfa_ioc.c:3671 bfa_cb_sfp_state_query()
warn: inconsistent indenting
drivers/scsi/bfa/bfa_ioc.c:3676 bfa_cb_sfp_state_query()
warn: curly braces intended?

The fix matches the intended logic based on the original indentation layout of 
the code.

Signed-off-by: Colin Ian King colin.k...@canonical.com
---
 drivers/scsi/bfa/bfa_ioc.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c index 
315d6d6..59c3492 100644
--- a/drivers/scsi/bfa/bfa_ioc.c
+++ b/drivers/scsi/bfa/bfa_ioc.c
@@ -3662,7 +3662,7 @@ bfa_cb_sfp_state_query(struct bfa_sfp_s *sfp)
bfa_trc(sfp, sfp-portspeed);
if (sfp-media) {
bfa_sfp_media_get(sfp);
-   if (sfp-state_query_cbfn)
+   if (sfp-state_query_cbfn) {
sfp-state_query_cbfn(sfp-state_query_cbarg,
sfp-status);
sfp-media = NULL;
@@ -3670,14 +3670,16 @@ bfa_cb_sfp_state_query(struct bfa_sfp_s *sfp)
 
if (sfp-portspeed) {
sfp-status = bfa_sfp_speed_valid(sfp, sfp-portspeed);
-   if (sfp-state_query_cbfn)
+   if (sfp-state_query_cbfn) {
sfp-state_query_cbfn(sfp-state_query_cbarg,
sfp-status);
sfp-portspeed = BFA_PORT_SPEED_UNKNOWN;
+   }
}
 
sfp-state_query_lock = 0;
sfp-state_query_cbfn = NULL;
+   }
 }
 
 /*
--
2.5.0

attachment: winmail.dat

RE: [PATCH 1/1] SCSI/bfa: Use port pointer after NULL check

2015-06-30 Thread Anil Gurumurthy
Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com

-Original Message-
From: Maninder Singh [mailto:maninder...@samsung.com] 
Sent: 29 June 2015 10:51
To: Anil Gurumurthy; Sudarsana Kalluru; jbottom...@odin.com; linux-scsi
Cc: panka...@samsung.com; Maninder Singh
Subject: [PATCH 1/1] SCSI/bfa: Use port pointer after NULL check

Currently port pointer is derefrenced before NULL check.
So NULL check is misleading, Thus it is better to use port pointer after NULL 
Check.

Signed-off-by: Maninder Singh maninder...@samsung.com
Reviewed-by: Akhilesh Kumar akhiles...@samsung.com
---
 drivers/scsi/bfa/bfa_fcs_lport.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
index ff75ef8..542d5c6 100644
--- a/drivers/scsi/bfa/bfa_fcs_lport.c
+++ b/drivers/scsi/bfa/bfa_fcs_lport.c
@@ -5826,12 +5826,13 @@ bfa_fcs_lport_get_rport_max_speed(bfa_fcs_lport_t *port)
bfa_port_speed_t max_speed = 0;
struct bfa_port_attr_s port_attr;
bfa_port_speed_t port_speed, rport_speed;
-   bfa_boolean_t trl_enabled = bfa_fcport_is_ratelim(port-fcs-bfa);
+   bfa_boolean_t trl_enabled;
 
 
if (port == NULL)
return 0;
 
+   trl_enabled = bfa_fcport_is_ratelim(port-fcs-bfa);
fcs = port-fcs;
 
/* Get Physical port's current speed */
--
1.7.9.5

attachment: winmail.dat

RE: [PATCH RESEND 0/4] bfa: Patches for scsi misc branch

2015-04-23 Thread Anil Gurumurthy
Could I get a review for this patch series?

Thanks,
Anil

-Original Message-
From: linux-scsi-ow...@vger.kernel.org 
[mailto:linux-scsi-ow...@vger.kernel.org] On Behalf Of 
anil.gurumur...@qlogic.com
Sent: 03 February 2015 14:15
To: james.bottom...@hansenpartnership.com; h...@infradead.org
Cc: linux-scsi
Subject: [PATCH RESEND 0/4] bfa: Patches for scsi misc branch

Hi James, Christoph,

Re-sending the patches to move user visible strings to a separate patch.
Please apply the following patches to the scsi tree, misc branch  at your 
earliest convenience.

Thanks,
Anil

Anil Gurumurthy (4):
  bfa:Updating copyright messages
  bfa:Fix for crash when bfa_itnim is NULL
  bfa:File header and user visible string changes
  bfa:Update driver version to 3.2.25.0

 drivers/scsi/bfa/bfa.h   |7 ++--
 drivers/scsi/bfa/bfa_core.c  |7 ++--
 drivers/scsi/bfa/bfa_cs.h|7 ++--
 drivers/scsi/bfa/bfa_defs.h  |7 ++--
 drivers/scsi/bfa/bfa_defs_fcs.h  |7 ++--
 drivers/scsi/bfa/bfa_defs_svc.h  |7 ++--
 drivers/scsi/bfa/bfa_fc.h|7 ++--
 drivers/scsi/bfa/bfa_fcbuild.c   |7 ++--
 drivers/scsi/bfa/bfa_fcbuild.h   |7 ++--
 drivers/scsi/bfa/bfa_fcpim.c |7 ++--
 drivers/scsi/bfa/bfa_fcpim.h |7 ++--
 drivers/scsi/bfa/bfa_fcs.c   |7 ++--
 drivers/scsi/bfa/bfa_fcs.h   |9 +++--
 drivers/scsi/bfa/bfa_fcs_fcpim.c |7 ++--
 drivers/scsi/bfa/bfa_fcs_lport.c |9 +++--
 drivers/scsi/bfa/bfa_fcs_rport.c |7 ++--
 drivers/scsi/bfa/bfa_hw_cb.c |7 ++--
 drivers/scsi/bfa/bfa_hw_ct.c |7 ++--
 drivers/scsi/bfa/bfa_ioc.c   |9 +++--
 drivers/scsi/bfa/bfa_ioc.h   |7 ++--
 drivers/scsi/bfa/bfa_ioc_cb.c|7 ++--
 drivers/scsi/bfa/bfa_ioc_ct.c|7 ++--
 drivers/scsi/bfa/bfa_modules.h   |7 ++--
 drivers/scsi/bfa/bfa_plog.h  |7 ++--
 drivers/scsi/bfa/bfa_port.c  |7 ++--
 drivers/scsi/bfa/bfa_port.h  |7 ++--
 drivers/scsi/bfa/bfa_svc.c   |7 ++--
 drivers/scsi/bfa/bfa_svc.h   |7 ++--
 drivers/scsi/bfa/bfad.c  |   24 +---
 drivers/scsi/bfa/bfad_attr.c |   75 +++---
 drivers/scsi/bfa/bfad_bsg.c  |7 ++--
 drivers/scsi/bfa/bfad_bsg.h  |7 ++--
 drivers/scsi/bfa/bfad_debugfs.c  |7 ++--
 drivers/scsi/bfa/bfad_drv.h  |9 +++--
 drivers/scsi/bfa/bfad_im.c   |   35 --
 drivers/scsi/bfa/bfad_im.h   |7 ++--
 drivers/scsi/bfa/bfi.h   |7 ++--
 drivers/scsi/bfa/bfi_ms.h|7 ++--
 drivers/scsi/bfa/bfi_reg.h   |9 +++--
 39 files changed, 228 insertions(+), 168 deletions(-)

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in the 
body of a message to majord...@vger.kernel.org More majordomo info at  
http://vger.kernel.org/majordomo-info.html
attachment: winmail.dat

RE: [PATCH 2/4] Fix for crash when bfa_itnim is NULL

2015-02-02 Thread Anil Gurumurthy
Hi Julian,
   You are right. It makes sense to move it to the next patch. I will re-send 
the patch series.

Thanks,
Anil

-Original Message-
From: Julian Calaby [mailto:julian.cal...@gmail.com] 
Sent: 30 January 2015 06:45
To: Anil Gurumurthy
Cc: Jej B; Christoph Hellwig; linux-scsi
Subject: Re: [PATCH 2/4] Fix for crash when bfa_itnim is NULL

Hi Anil,

On Thu, Jan 29, 2015 at 7:55 PM,  anil.gurumur...@qlogic.com wrote:
 From: Anil Gurumurthy anil.gurumur...@qlogic.com

 Signed-off-by: Sudarsana Kalluru sudarsana.kall...@qlogic.com
 Signed-off-by: Anil Gurumurthy anil.gurumur...@qlogic.com
 ---
  drivers/scsi/bfa/bfa_fcs_lport.c |2 +-
  drivers/scsi/bfa/bfad_im.c   |   26 ++
  2 files changed, 27 insertions(+), 1 deletions(-)

 diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c 
 b/drivers/scsi/bfa/bfa_fcs_lport.c
 index d823792..4631630 100644
 --- a/drivers/scsi/bfa/bfa_fcs_lport.c
 +++ b/drivers/scsi/bfa/bfa_fcs_lport.c
 @@ -2654,7 +2654,7 @@ bfa_fcs_fdmi_get_hbaattr(struct bfa_fcs_lport_fdmi_s 
 *fdmi,

 strncpy(hba_attr-node_sym_name.symname,
 port-port_cfg.node_sym_name.symname, BFA_SYMNAME_MAXLEN);
 -   strcpy(hba_attr-vendor_info, BROCADE);
 +   strcpy(hba_attr-vendor_info, QLogic);

Shouldn't this be in the next patch?

Thanks,

-- 
Julian Calaby

Email: julian.cal...@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
attachment: winmail.dat

[PATCH 1/1] IOMMU Fault occurs when IO and abort IO is out of order

2014-12-23 Thread Anil Chintalapati (achintal)
When I/O is aborted by mid-layer, fnic FW will complete the I/O before 
completing the abort task. In some cases abort request is completed before the 
I/O, which could lead to inconsistent driver and firmware states. In this case 
firmware reset would clear the inconsistent state


Signed-off-by: Anil Chintalapati achin...@cisco.com
Signed-off-by: Sesidhar Baddela sebad...@cisco.com
Signed-off-by: Hiral Shah his...@cisco.com

---
 drivers/scsi/fnic/fnic.h  |  2 +-
 drivers/scsi/fnic/fnic_scsi.c | 15 +++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/fnic/fnic.h b/drivers/scsi/fnic/fnic.h index 
bf8d34c..26270c3 100644
--- a/drivers/scsi/fnic/fnic.h
+++ b/drivers/scsi/fnic/fnic.h
@@ -39,7 +39,7 @@
 
 #define DRV_NAME   fnic
 #define DRV_DESCRIPTIONCisco FCoE HBA Driver
-#define DRV_VERSION1.6.0.11
+#define DRV_VERSION1.6.0.17
 #define PFXDRV_NAME : 
 #define DFX DRV_NAME %d: 
 
diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c 
index 961bdf5..9ebc933 100644
--- a/drivers/scsi/fnic/fnic_scsi.c
+++ b/drivers/scsi/fnic/fnic_scsi.c
@@ -1873,6 +1873,21 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
goto fnic_abort_cmd_end;
}
 
+   /* IO out of order */
+
+   if (!(CMD_FLAGS(sc)  (FNIC_IO_ABORTED | FNIC_IO_DONE))) {
+   spin_unlock_irqrestore(io_lock, flags);
+   FNIC_SCSI_DBG(KERN_DEBUG, fnic-lport-host,
+   Issuing Host reset due to out of order IO\n);
+
+   if (fnic_host_reset(sc) == FAILED) {
+   FNIC_SCSI_DBG(KERN_DEBUG, fnic-lport-host,
+   fnic_host_reset failed.\n);
+   }
+   ret = FAILED;
+   goto fnic_abort_cmd_end;
+   }
+
CMD_STATE(sc) = FNIC_IOREQ_ABTS_COMPLETE;
 
/*
--
1.8.5.4


--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] bfa: switch to mid layer queue full tracking

2014-11-26 Thread Anil Gurumurthy
Patch looks good. 
Thanks!
Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com

-Original Message-
From: Christoph Hellwig [mailto:h...@lst.de] 
Sent: 24 November 2014 19:49
To: Anil Gurumurthy; Sudarsana Kalluru
Cc: linux-scsi
Subject: [PATCH] bfa: switch to mid layer queue full tracking

As far as I can tell the queue tracking in the bfa driver is a copypaste copy 
of the midlayer version, just without support to configure it through sysfs.

Remove the bfa copy and rely on the mid layer version.

Signed-off-by: Christoph Hellwig h...@lst.de
---
 drivers/scsi/bfa/bfad_im.c | 66 ++
 drivers/scsi/bfa/bfad_im.h |  6 -
 2 files changed, 2 insertions(+), 70 deletions(-)

diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c index 
7223b00..ac55fd9 100644
--- a/drivers/scsi/bfa/bfad_im.c
+++ b/drivers/scsi/bfa/bfad_im.c
@@ -43,8 +43,6 @@ bfa_cb_ioim_done(void *drv, struct bfad_ioim_s *dio,  {
struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio;
struct bfad_s *bfad = drv;
-   struct bfad_itnim_data_s *itnim_data;
-   struct bfad_itnim_s *itnim;
u8 host_status = DID_OK;
 
switch (io_status) {
@@ -93,19 +91,6 @@ bfa_cb_ioim_done(void *drv, struct bfad_ioim_s *dio,
cmnd-host_scribble = NULL;
bfa_trc(bfad, cmnd-result);
 
-   itnim_data = cmnd-device-hostdata;
-   if (itnim_data) {
-   itnim = itnim_data-itnim;
-   if (!cmnd-result  itnim 
-(bfa_lun_queue_depth  cmnd-device-queue_depth)) {
-   /* Queue depth adjustment for good status completion */
-   bfad_ramp_up_qdepth(itnim, cmnd-device);
-   } else if (cmnd-result == SAM_STAT_TASK_SET_FULL  itnim) {
-   /* qfull handling */
-   bfad_handle_qfull(itnim, cmnd-device);
-   }
-   }
-
cmnd-scsi_done(cmnd);
 }
 
@@ -113,8 +98,6 @@ void
 bfa_cb_ioim_good_comp(void *drv, struct bfad_ioim_s *dio)  {
struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio;
-   struct bfad_itnim_data_s *itnim_data;
-   struct bfad_itnim_s *itnim;
 
cmnd-result = ScsiResult(DID_OK, SCSI_STATUS_GOOD);
 
@@ -123,17 +106,6 @@ bfa_cb_ioim_good_comp(void *drv, struct bfad_ioim_s *dio)
scsi_dma_unmap(cmnd);
 
cmnd-host_scribble = NULL;
-
-   /* Queue depth adjustment */
-   if (bfa_lun_queue_depth  cmnd-device-queue_depth) {
-   itnim_data = cmnd-device-hostdata;
-   if (itnim_data) {
-   itnim = itnim_data-itnim;
-   if (itnim)
-   bfad_ramp_up_qdepth(itnim, cmnd-device);
-   }
-   }
-
cmnd-scsi_done(cmnd);
 }
 
@@ -801,6 +773,7 @@ struct scsi_host_template bfad_im_scsi_host_template = {
.max_sectors = BFAD_MAX_SECTORS,
.vendor_id = BFA_PCI_VENDOR_ID_BROCADE,
.use_blk_tags = 1,
+   .track_queue_depth = 1,
 };
 
 struct scsi_host_template bfad_im_vport_template = { @@ -823,6 +796,7 @@ 
struct scsi_host_template bfad_im_vport_template = {
.shost_attrs = bfad_im_vport_attrs,
.max_sectors = BFAD_MAX_SECTORS,
.use_blk_tags = 1,
+   .track_queue_depth = 1,
 };
 
 bfa_status_t
@@ -853,42 +827,6 @@ bfad_im_module_exit(void)
fc_release_transport(bfad_im_scsi_vport_transport_template);
 }
 
-void
-bfad_ramp_up_qdepth(struct bfad_itnim_s *itnim, struct scsi_device *sdev) -{
-   struct scsi_device *tmp_sdev;
-
-   if (((jiffies - itnim-last_ramp_up_time) 
-   BFA_QUEUE_FULL_RAMP_UP_TIME * HZ) 
-   ((jiffies - itnim-last_queue_full_time) 
-   BFA_QUEUE_FULL_RAMP_UP_TIME * HZ)) {
-   shost_for_each_device(tmp_sdev, sdev-host) {
-   if (bfa_lun_queue_depth  tmp_sdev-queue_depth) {
-   if (tmp_sdev-id != sdev-id)
-   continue;
-   scsi_change_queue_depth(tmp_sdev,
-   tmp_sdev-queue_depth + 1);
-
-   itnim-last_ramp_up_time = jiffies;
-   }
-   }
-   }
-}
-
-void
-bfad_handle_qfull(struct bfad_itnim_s *itnim, struct scsi_device *sdev) -{
-   struct scsi_device *tmp_sdev;
-
-   itnim-last_queue_full_time = jiffies;
-
-   shost_for_each_device(tmp_sdev, sdev-host) {
-   if (tmp_sdev-id != sdev-id)
-   continue;
-   scsi_track_queue_full(tmp_sdev, tmp_sdev-queue_depth - 1);
-   }
-}
-
 struct bfad_itnim_s *
 bfad_get_itnim(struct bfad_im_port_s *im_port, int id)  { diff --git 
a/drivers/scsi/bfa/bfad_im.h b/drivers/scsi/bfa/bfad_im.h index 
f6c1023..7db2b75 100644
--- a/drivers/scsi/bfa/bfad_im.h
+++ b/drivers/scsi/bfa/bfad_im.h
@@ -44,7 +44,6 @@ u32

RE: [PATCH 1/1] SCSI-bfa: Deletion of an unnecessary check before the function call vfree

2014-11-20 Thread Anil Gurumurthy
Patch looks good. 
Thanks!
Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com

-Original Message-
From: SF Markus Elfring [mailto:elfr...@users.sourceforge.net] 
Sent: 21 November 2014 04:17
To: Anil Gurumurthy; James E. J. Bottomley; Sudarsana Kalluru; linux-scsi
Cc: linux-kernel; kernel-janit...@vger.kernel.org; Julia Lawall
Subject: [PATCH 1/1] SCSI-bfa: Deletion of an unnecessary check before the 
function call vfree

From: Markus Elfring elfr...@users.sourceforge.net
Date: Thu, 20 Nov 2014 23:43:17 +0100

The vfree() function performs also input parameter validation. Thus the test 
around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring elfr...@users.sourceforge.net
---
 drivers/scsi/bfa/bfad_debugfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/bfa/bfad_debugfs.c b/drivers/scsi/bfa/bfad_debugfs.c 
index 8e83d04..a72170f 100644
--- a/drivers/scsi/bfa/bfad_debugfs.c
+++ b/drivers/scsi/bfa/bfad_debugfs.c
@@ -399,8 +399,7 @@ bfad_debugfs_release_fwtrc(struct inode *inode, struct file 
*file)
if (!fw_debug)
return 0;
 
-   if (fw_debug-debug_buffer)
-   vfree(fw_debug-debug_buffer);
+   vfree(fw_debug-debug_buffer);
 
file-private_data = NULL;
kfree(fw_debug);
--
2.1.3

attachment: winmail.dat

[PATCH 1/1] IOMMU Fault occurs when IO and abort IO is out of order

2014-11-17 Thread Anil Chintalapati
When I/O is aborted by mid-layer, fnic FW will complete the I/O before 
completing the abort task. In some cases abort request is completed before the 
I/O,
which could lead to inconsistent driver and firmware states. In this case 
firmware reset would clear the inconsistent state

Signed-off-by: Anil Chintalapati achin...@cisco.com
---
 drivers/scsi/fnic/fnic.h  |  2 +-
 drivers/scsi/fnic/fnic_scsi.c | 15 +++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/fnic/fnic.h b/drivers/scsi/fnic/fnic.h
index bf8d34c..26270c3 100644
--- a/drivers/scsi/fnic/fnic.h
+++ b/drivers/scsi/fnic/fnic.h
@@ -39,7 +39,7 @@
 
 #define DRV_NAME   fnic
 #define DRV_DESCRIPTIONCisco FCoE HBA Driver
-#define DRV_VERSION1.6.0.11
+#define DRV_VERSION1.6.0.17
 #define PFXDRV_NAME : 
 #define DFX DRV_NAME %d: 
 
diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
index 961bdf5..9ebc933 100644
--- a/drivers/scsi/fnic/fnic_scsi.c
+++ b/drivers/scsi/fnic/fnic_scsi.c
@@ -1873,6 +1873,21 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
goto fnic_abort_cmd_end;
}
 
+   /* IO out of order */
+
+   if (!(CMD_FLAGS(sc)  (FNIC_IO_ABORTED | FNIC_IO_DONE))) {
+   spin_unlock_irqrestore(io_lock, flags);
+   FNIC_SCSI_DBG(KERN_DEBUG, fnic-lport-host,
+   Issuing Host reset due to out of order IO\n);
+
+   if (fnic_host_reset(sc) == FAILED) {
+   FNIC_SCSI_DBG(KERN_DEBUG, fnic-lport-host,
+   fnic_host_reset failed.\n);
+   }
+   ret = FAILED;
+   goto fnic_abort_cmd_end;
+   }
+
CMD_STATE(sc) = FNIC_IOREQ_ABTS_COMPLETE;
 
/*
-- 
1.8.5.4

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH V4 linux-next RESEND 2] bfa: replace 2 kzalloc/copy_from_user by memdup_user

2014-11-16 Thread Anil Gurumurthy
Patch looks good. 
Thanks!
Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com

-Original Message-
From: Fabian Frederick [mailto:f...@skynet.be] 
Sent: 15 November 2014 00:20
To: linux-kernel
Cc: Joe Perches; Greg Kroah-Hartman; One Thousand Gnomes; Fabian Frederick; 
Anil Gurumurthy; Sudarsana Kalluru; James E.J. Bottomley; linux-scsi
Subject: [PATCH V4 linux-next RESEND 2] bfa: replace 2 kzalloc/copy_from_user 
by memdup_user

This patch also removes unnecessary printk(KERN_INFO

Signed-off-by: Fabian Frederick f...@skynet.be
---
V4: remove blank line after memdup_user
V3: memdup_user first argument is already void __user * (thanks to Joe Perches)
typo in title
V2: Remove printk(KERN_INFO (suggested by Alan)

 drivers/scsi/bfa/bfad_debugfs.c | 30 ++
 1 file changed, 6 insertions(+), 24 deletions(-)

diff --git a/drivers/scsi/bfa/bfad_debugfs.c b/drivers/scsi/bfa/bfad_debugfs.c 
index 8e83d04..74a307c 100644
--- a/drivers/scsi/bfa/bfad_debugfs.c
+++ b/drivers/scsi/bfa/bfad_debugfs.c
@@ -260,18 +260,9 @@ bfad_debugfs_write_regrd(struct file *file, const char 
__user *buf,
unsigned long flags;
void *kern_buf;
 
-   kern_buf = kzalloc(nbytes, GFP_KERNEL);
-
-   if (!kern_buf) {
-   printk(KERN_INFO bfad[%d]: Failed to allocate buffer\n,
-   bfad-inst_no);
-   return -ENOMEM;
-   }
-
-   if (copy_from_user(kern_buf, (void  __user *)buf, nbytes)) {
-   kfree(kern_buf);
-   return -ENOMEM;
-   }
+   kern_buf = memdup_user(buf, nbytes);
+   if (IS_ERR(kern_buf))
+   return PTR_ERR(kern_buf);
 
rc = sscanf(kern_buf, %x:%x, addr, len);
if (rc  2) {
@@ -336,18 +327,9 @@ bfad_debugfs_write_regwr(struct file *file, const char 
__user *buf,
unsigned long flags;
void *kern_buf;
 
-   kern_buf = kzalloc(nbytes, GFP_KERNEL);
-
-   if (!kern_buf) {
-   printk(KERN_INFO bfad[%d]: Failed to allocate buffer\n,
-   bfad-inst_no);
-   return -ENOMEM;
-   }
-
-   if (copy_from_user(kern_buf, (void  __user *)buf, nbytes)) {
-   kfree(kern_buf);
-   return -ENOMEM;
-   }
+   kern_buf = memdup_user(buf, nbytes);
+   if (IS_ERR(kern_buf))
+   return PTR_ERR(kern_buf);
 
rc = sscanf(kern_buf, %x:%x, addr, val);
if (rc  2) {
--
1.9.3

attachment: winmail.dat

RE: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()

2014-08-13 Thread Anil Gurumurthy
Hi Alexander,
  I believe I acked the series already, if not, I am acking all the bfa patches 
in this series.

Thanks,
Anil

-Original Message-
From: Alexander Gordeev [mailto:agord...@redhat.com] 
Sent: 12 August 2014 16:20
To: Anil Gurumurthy
Cc: linux-kernel; Anil Gurumurthy; Vijaya Mohan Guvva; linux-scsi; linux-pci; 
Sudarsana Kalluru
Subject: Re: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead 
of pci_enable_msix()

On Mon, Aug 11, 2014 at 11:02:56AM +, Anil Gurumurthy wrote:
 Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com

Many thanks, Anil!

If your Ack apply to this patch only or to all three 'bfa' patches in this 
series?

Thanks!

 -Original Message-
 From: Alexander Gordeev [mailto:agord...@redhat.com]
 Sent: 11 August 2014 13:09
 To: linux-kernel
 Cc: Anil Gurumurthy; Vijaya Mohan Guvva; linux-scsi; linux-pci; Anil 
 Gurumurthy; Sudarsana Kalluru
 Subject: Re: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() 
 instead of pci_enable_msix()
 
 On Wed, Jul 16, 2014 at 08:05:08PM +0200, Alexander Gordeev wrote:
  As result of deprecation of MSI-X/MSI enablement functions
  pci_enable_msix() and pci_enable_msi_block() all drivers using these 
  two interfaces need to be updated to use the new
  pci_enable_msi_range()  or pci_enable_msi_exact() and
  pci_enable_msix_range() or pci_enable_msix_exact() interfaces.
 
 Anil, Sudarsana,
 
 Could you please review bfa patches in this series?
 
 Thanks!
 
  Signed-off-by: Alexander Gordeev agord...@redhat.com
  Cc: Anil Gurumurthy aguru...@brocade.com
  Cc: Vijaya Mohan Guvva vmo...@brocade.com
  Cc: linux-scsi@vger.kernel.org
  Cc: linux-...@vger.kernel.org
  Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com
  ---
   drivers/scsi/bfa/bfad.c |   20 ++--
   1 files changed, 6 insertions(+), 14 deletions(-)
  
  diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index
  c18279f..e90a374 100644
  --- a/drivers/scsi/bfa/bfad.c
  +++ b/drivers/scsi/bfa/bfad.c
  @@ -1234,29 +1234,21 @@ bfad_setup_intr(struct bfad_s *bfad)
  if ((bfa_asic_id_ctc(pdev-device)  !msix_disable_ct) ||
 (bfa_asic_id_cb(pdev-device)  !msix_disable_cb)) {
   
  -   error = pci_enable_msix(bfad-pcidev, msix_entries, bfad-nvec);
  +   error = pci_enable_msix_exact(bfad-pcidev,
  + msix_entries, bfad-nvec);
  /* In CT1  CT2, try to allocate just one vector */
  -   if (error  0  bfa_asic_id_ctc(pdev-device)) {
  +   if (error == -ENOSPC  bfa_asic_id_ctc(pdev-device)) {
  printk(KERN_WARNING bfa %s: trying one msix 
 vector failed to allocate %d[%d]\n,
 bfad-pci_name, bfad-nvec, error);
  bfad-nvec = 1;
  -   error = pci_enable_msix(bfad-pcidev,
  -   msix_entries, bfad-nvec);
  +   error = pci_enable_msix_exact(bfad-pcidev,
  + msix_entries, 1);
  }
   
  -   /*
  -* Only error number of vector is available.
  -* We don't have a mechanism to map multiple
  -* interrupts into one vector, so even if we
  -* can try to request less vectors, we don't
  -* know how to associate interrupt events to
  -*  vectors. Linux doesn't duplicate vectors
  -* in the MSIX table for this case.
  -*/
  if (error) {
  printk(KERN_WARNING bfad%d: 
  -  pci_enable_msix failed (%d), 
  +  pci_enable_msix_exact failed (%d), 
 use line based.\n,
  bfad-inst_no, error);
  goto line_based;
  --
  1.7.7.6
  

--
Regards,
Alexander Gordeev
agord...@redhat.com
attachment: winmail.dat

RE: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()

2014-08-11 Thread Anil Gurumurthy
Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com


-Original Message-
From: Alexander Gordeev [mailto:agord...@redhat.com] 
Sent: 11 August 2014 13:09
To: linux-kernel
Cc: Anil Gurumurthy; Vijaya Mohan Guvva; linux-scsi; linux-pci; Anil 
Gurumurthy; Sudarsana Kalluru
Subject: Re: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead 
of pci_enable_msix()

On Wed, Jul 16, 2014 at 08:05:08PM +0200, Alexander Gordeev wrote:
 As result of deprecation of MSI-X/MSI enablement functions
 pci_enable_msix() and pci_enable_msi_block() all drivers using these 
 two interfaces need to be updated to use the new 
 pci_enable_msi_range()  or pci_enable_msi_exact() and 
 pci_enable_msix_range() or pci_enable_msix_exact() interfaces.

Anil, Sudarsana,

Could you please review bfa patches in this series?

Thanks!

 Signed-off-by: Alexander Gordeev agord...@redhat.com
 Cc: Anil Gurumurthy aguru...@brocade.com
 Cc: Vijaya Mohan Guvva vmo...@brocade.com
 Cc: linux-scsi@vger.kernel.org
 Cc: linux-...@vger.kernel.org
 Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com
 ---
  drivers/scsi/bfa/bfad.c |   20 ++--
  1 files changed, 6 insertions(+), 14 deletions(-)
 
 diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 
 c18279f..e90a374 100644
 --- a/drivers/scsi/bfa/bfad.c
 +++ b/drivers/scsi/bfa/bfad.c
 @@ -1234,29 +1234,21 @@ bfad_setup_intr(struct bfad_s *bfad)
   if ((bfa_asic_id_ctc(pdev-device)  !msix_disable_ct) ||
  (bfa_asic_id_cb(pdev-device)  !msix_disable_cb)) {
  
 - error = pci_enable_msix(bfad-pcidev, msix_entries, bfad-nvec);
 + error = pci_enable_msix_exact(bfad-pcidev,
 +   msix_entries, bfad-nvec);
   /* In CT1  CT2, try to allocate just one vector */
 - if (error  0  bfa_asic_id_ctc(pdev-device)) {
 + if (error == -ENOSPC  bfa_asic_id_ctc(pdev-device)) {
   printk(KERN_WARNING bfa %s: trying one msix 
  vector failed to allocate %d[%d]\n,
  bfad-pci_name, bfad-nvec, error);
   bfad-nvec = 1;
 - error = pci_enable_msix(bfad-pcidev,
 - msix_entries, bfad-nvec);
 + error = pci_enable_msix_exact(bfad-pcidev,
 +   msix_entries, 1);
   }
  
 - /*
 -  * Only error number of vector is available.
 -  * We don't have a mechanism to map multiple
 -  * interrupts into one vector, so even if we
 -  * can try to request less vectors, we don't
 -  * know how to associate interrupt events to
 -  *  vectors. Linux doesn't duplicate vectors
 -  * in the MSIX table for this case.
 -  */
   if (error) {
   printk(KERN_WARNING bfad%d: 
 -pci_enable_msix failed (%d), 
 +pci_enable_msix_exact failed (%d), 
  use line based.\n,
   bfad-inst_no, error);
   goto line_based;
 --
 1.7.7.6
 
attachment: winmail.dat

RE: [PATCH 1/1] [SCSI] bfa: use ARRAY_SIZE instead of sizeof/sizeof[0]

2014-07-01 Thread Anil Gurumurthy
Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com


-Original Message-
From: Fabian Frederick [mailto:f...@skynet.be]
Sent: 30 June 2014 23:13
To: linux-kernel
Cc: Fabian Frederick; Anil Gurumurthy; Sudarsana Kalluru; James E.J. Bottomley; 
linux-scsi
Subject: [PATCH 1/1] [SCSI] bfa: use ARRAY_SIZE instead of sizeof/sizeof[0]

Use macro definition

Cc: Anil Gurumurthy anil.gurumur...@qlogic.com
Cc: Sudarsana Kalluru sudarsana.kall...@qlogic.com
Cc: James E.J. Bottomley jbottom...@parallels.com
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Fabian Frederick f...@skynet.be
---
 drivers/scsi/bfa/bfa_fcs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c index 
a3ab5cc..0f19455 100644
--- a/drivers/scsi/bfa/bfa_fcs.c
+++ b/drivers/scsi/bfa/bfa_fcs.c
@@ -81,7 +81,7 @@ bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, 
struct bfad_s *bfad,
bfa-fcs = BFA_TRUE;
fcbuild_init();

-   for (i = 0; i  sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) {
+   for (i = 0; i  ARRAY_SIZE(fcs_modules); i++) {
mod = fcs_modules[i];
if (mod-attach)
mod-attach(fcs);
@@ -97,7 +97,7 @@ bfa_fcs_init(struct bfa_fcs_s *fcs)
int i;
struct bfa_fcs_mod_s  *mod;

-   for (i = 0; i  sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) {
+   for (i = 0; i  ARRAY_SIZE(fcs_modules); i++) {
mod = fcs_modules[i];
if (mod-modinit)
mod-modinit(fcs);
@@ -184,7 +184,7 @@ bfa_fcs_exit(struct bfa_fcs_s *fcs)

bfa_wc_init(fcs-wc, bfa_fcs_exit_comp, fcs);

-   nmods = sizeof(fcs_modules) / sizeof(fcs_modules[0]);
+   nmods = ARRAY_SIZE(fcs_modules);

for (i = 0; i  nmods; i++) {

--
1.8.4.5




This message and any attached documents contain information from QLogic 
Corporation or its wholly-owned subsidiaries that may be confidential. If you 
are not the intended recipient, you may not read, copy, distribute, or use this 
information. If you have received this transmission in error, please notify the 
sender immediately by reply e-mail and then delete this message.
attachment: winmail.dat

RE: [PATCH RESEND] [SCSI] bfa: Fix undefined bit shift on big-endian architectures with 32-bit DMA address

2014-06-25 Thread Anil Gurumurthy
Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com


-Original Message-
From: linux-scsi-ow...@vger.kernel.org 
[mailto:linux-scsi-ow...@vger.kernel.org] On Behalf Of Martin K. Petersen
Sent: 26 June 2014 07:52
To: Christoph Hellwig
Cc: Ben Hutchings; James E.J. Bottomley; Anil Gurumurthy; Vijaya Mohan Guvva; 
linux-scsi; stable
Subject: Re: [PATCH RESEND] [SCSI] bfa: Fix undefined bit shift on big-endian 
architectures with 32-bit DMA address

 Christoph == Christoph Hellwig h...@infradead.org writes:

Christoph Looks good, Reviewed-by: Christoph Hellwig h...@lst.de

Christoph Can I get another review, too please?

Reviewed-by: Martin K. Petersen martin.peter...@oracle.com

--
Martin K. Petersen  Oracle Linux Engineering
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in the 
body of a message to majord...@vger.kernel.org More majordomo info at  
http://vger.kernel.org/majordomo-info.html



This message and any attached documents contain information from QLogic 
Corporation or its wholly-owned subsidiaries that may be confidential. If you 
are not the intended recipient, you may not read, copy, distribute, or use this 
information. If you have received this transmission in error, please notify the 
sender immediately by reply e-mail and then delete this message.
attachment: winmail.dat

RE: [PATCH -next 15/26] bfa: Use dma_zalloc_coherent

2014-06-16 Thread Anil Gurumurthy
Thanks for the patch.
Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com

-Original Message-
From: Joe Perches [mailto:j...@perches.com]
Sent: 16 June 2014 02:08
To: linux-kernel
Cc: Anil Gurumurthy; Sudarsana Kalluru; James E.J. Bottomley; linux-scsi
Subject: [PATCH -next 15/26] bfa: Use dma_zalloc_coherent

Use the zeroing function instead of dma_alloc_coherent  memset(,0,)

Signed-off-by: Joe Perches j...@perches.com
---
 drivers/scsi/bfa/bfad_bsg.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c index 
8994fb8..65f3e74 100644
--- a/drivers/scsi/bfa/bfad_bsg.c
+++ b/drivers/scsi/bfa/bfad_bsg.c
@@ -3270,13 +3270,13 @@ bfad_fcxp_map_sg(struct bfad_s *bfad, void 
*payload_kbuf,
/* Allocate dma coherent memory */
buf_info = buf_base;
buf_info-size = payload_len;
-   buf_info-virt = dma_alloc_coherent(bfad-pcidev-dev, buf_info-size,
-   buf_info-phys, GFP_KERNEL);
+   buf_info-virt = dma_zalloc_coherent(bfad-pcidev-dev,
+buf_info-size, buf_info-phys,
+GFP_KERNEL);
if (!buf_info-virt)
goto out_free_mem;

/* copy the linear bsg buffer to buf_info */
-   memset(buf_info-virt, 0, buf_info-size);
memcpy(buf_info-virt, payload_kbuf, buf_info-size);

/*
--
1.8.1.2.459.gbcd45b4.dirty




This message and any attached documents contain information from QLogic 
Corporation or its wholly-owned subsidiaries that may be confidential. If you 
are not the intended recipient, you may not read, copy, distribute, or use this 
information. If you have received this transmission in error, please notify the 
sender immediately by reply e-mail and then delete this message.
attachment: winmail.dat

RE: [PATCH] scsi: bfa: bfa_fcs_lport.c: Fix for possible null pointer dereference

2014-05-21 Thread Anil Gurumurthy
Thanks for the patch.
Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com

-Original Message-
From: Rickard Strandqvist [mailto:rickard_strandqv...@spectrumdigital.se]
Sent: 18 May 2014 21:36
To: Anil Gurumurthy; Sudarsana Kalluru
Cc: Rickard Strandqvist; James E.J. Bottomley; linux-scsi; linux-kernel
Subject: [PATCH] scsi: bfa: bfa_fcs_lport.c: Fix for possible null pointer 
dereference

There is otherwise a risk of a possible null pointer dereference.

Was largely found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
 drivers/scsi/bfa/bfa_fcs_lport.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
index ff75ef8..542d5c6 100644
--- a/drivers/scsi/bfa/bfa_fcs_lport.c
+++ b/drivers/scsi/bfa/bfa_fcs_lport.c
@@ -5826,12 +5826,13 @@ bfa_fcs_lport_get_rport_max_speed(bfa_fcs_lport_t *port)
bfa_port_speed_t max_speed = 0;
struct bfa_port_attr_s port_attr;
bfa_port_speed_t port_speed, rport_speed;
-   bfa_boolean_t trl_enabled = bfa_fcport_is_ratelim(port-fcs-bfa);
+   bfa_boolean_t trl_enabled;


if (port == NULL)
return 0;

+   trl_enabled = bfa_fcport_is_ratelim(port-fcs-bfa);
fcs = port-fcs;

/* Get Physical port's current speed */
--
1.7.10.4




This message and any attached documents contain information from QLogic 
Corporation or its wholly-owned subsidiaries that may be confidential. If you 
are not the intended recipient, you may not read, copy, distribute, or use this 
information. If you have received this transmission in error, please notify the 
sender immediately by reply e-mail and then delete this message.
attachment: winmail.dat

RE: [SCSI] bfa: Added support to obtain SFP info.

2014-04-30 Thread Anil Gurumurthy
Hi Dan,
  The indentation of the code is an issue here. We will fix it in the next 
patch submission.

The code should be
static void
bfa_cb_sfp_state_query(struct bfa_sfp_s *sfp)
{
bfa_trc(sfp, sfp-portspeed);
if (sfp-media) {
bfa_sfp_media_get(sfp);
if (sfp-state_query_cbfn)
sfp-state_query_cbfn(sfp-state_query_cbarg,
  sfp-status);
sfp-media = NULL;
}

if (sfp-portspeed) {
sfp-status = bfa_sfp_speed_valid(sfp, sfp-portspeed);
if (sfp-state_query_cbfn)
sfp-state_query_cbfn(sfp-state_query_cbarg,
  sfp-status);
sfp-portspeed = BFA_PORT_SPEED_UNKNOWN;
}

sfp-state_query_lock = 0;
sfp-state_query_cbfn = NULL;
}

Thanks,
Anil

-Original Message-
From: Dan Carpenter [mailto:dan.carpen...@oracle.com]
Sent: 29 April 2014 18:21
To: linux-scsi
Cc: Vijaya Mohan Guvva; Anil Gurumurthy; Sudarsana Kalluru
Subject: Re: [SCSI] bfa: Added support to obtain SFP info.

Krishna isn't around any more.  Does anyone else know what's going on in this 
code?  It looks buggy to me.

regards,
dan carpenter

On Fri, Mar 28, 2014 at 02:07:37AM +0300, Dan Carpenter wrote:
 On Fri, Mar 28, 2014 at 02:05:14AM +0300, Dan Carpenter wrote:
  Hello Krishna Gudipati,
 
  The patch 51e569aa1f0c: [SCSI] bfa: Added support to obtain SFP
  info. from Jun 24, 2011, leads to the following static checker
  warning:
 
  drivers/scsi/bfa/bfa_ioc.c:3668 bfa_cb_sfp_state_query()
  warn: add curly braces?
 
  drivers/scsi/bfa/bfa_ioc.c
3659  static void
3660  bfa_cb_sfp_state_query(struct bfa_sfp_s *sfp)
3661  {
3662  bfa_trc(sfp, sfp-portspeed);
3663  if (sfp-media) {
3664  bfa_sfp_media_get(sfp);
3665  if (sfp-state_query_cbfn)
 ^ Add a curly
  brace here?
 
3666  
  sfp-state_query_cbfn(sfp-state_query_cbarg,
3667  sfp-status);
3668  sfp-media = NULL;
3669  }
3670
3671  if (sfp-portspeed) {
3672  sfp-status = bfa_sfp_speed_valid(sfp, 
  sfp-portspeed);
3673  if (sfp-state_query_cbfn)
3674  
  sfp-state_query_cbfn(sfp-state_query_cbarg,
3675  sfp-status);
3676  sfp-portspeed = 
  BFA_PORT_SPEED_UNKNOWN;

 It looks like this if statement needs curly braces as well.

 regards,
 dan carpenter

3677  }
3678
3679  sfp-state_query_lock = 0;
3680  sfp-state_query_cbfn = NULL;
 
  ^
  And another close curly brace here?
 
3681  }
 
  regards,
  dan carpenter



This message and any attached documents contain information from QLogic 
Corporation or its wholly-owned subsidiaries that may be confidential. If you 
are not the intended recipient, you may not read, copy, distribute, or use this 
information. If you have received this transmission in error, please notify the 
sender immediately by reply e-mail and then delete this message.
attachment: winmail.dat

RE: [PATCH v2] [SCSI] bfa: allocate memory with GFP_ATOMIC in spinlock context

2014-04-30 Thread Anil Gurumurthy
Thanks for the patch.
Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com

-Original Message-
From: Alexey Khoroshilov [mailto:khoroshi...@ispras.ru]
Sent: 18 April 2014 13:29
To: Anil Gurumurthy; Sudarsana Kalluru
Cc: Alexey Khoroshilov; James E.J. Bottomley; linux-scsi; linux-kernel; 
ldv-proj...@linuxtesting.org
Subject: [PATCH v2] [SCSI] bfa: allocate memory with GFP_ATOMIC in spinlock 
context

bfa_fcb_pbc_vport_create() is called only from bfa_fcs_pbc_vport_init(), that 
is called only from bfad_drv_start() with bfad_lock spinlock held.
So the patch replaces GFP_KERNEL with GFP_ATOMIC to avoid sleeping in atomic 
spinlock context.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru
---
 drivers/scsi/bfa/bfad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 
cc0fbcdc5192..7593b7c1d336 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -507,7 +507,7 @@ bfa_fcb_pbc_vport_create(struct bfad_s *bfad, struct 
bfi_pbc_vport_s pbc_vport)
struct bfad_vport_s   *vport;
int rc;

-   vport = kzalloc(sizeof(struct bfad_vport_s), GFP_KERNEL);
+   vport = kzalloc(sizeof(struct bfad_vport_s), GFP_ATOMIC);
if (!vport) {
bfa_trc(bfad, 0);
return;
--
1.8.3.2




This message and any attached documents contain information from QLogic 
Corporation or its wholly-owned subsidiaries that may be confidential. If you 
are not the intended recipient, you may not read, copy, distribute, or use this 
information. If you have received this transmission in error, please notify the 
sender immediately by reply e-mail and then delete this message.
attachment: winmail.dat

RE: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()

2014-04-16 Thread Anil Gurumurthy
Patch look good.
Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com

-Original Message-
From: linux-scsi-ow...@vger.kernel.org 
[mailto:linux-scsi-ow...@vger.kernel.org] On Behalf Of Alexander Gordeev
Sent: 14 April 2014 13:35
To: linux-kernel
Cc: Alexander Gordeev; Anil Gurumurthy; Vijaya Mohan Guvva; linux-scsi; 
linux-pci
Subject: [PATCH v2 RESEND 04/23] bfa: Use pci_enable_msix_exact() instead of 
pci_enable_msix()

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers using these two 
interfaces need to be updated to use the new pci_enable_msi_range()  or 
pci_enable_msi_exact() and pci_enable_msix_range() or pci_enable_msix_exact() 
interfaces.

Signed-off-by: Alexander Gordeev agord...@redhat.com
Cc: Anil Gurumurthy aguru...@brocade.com
Cc: Vijaya Mohan Guvva vmo...@brocade.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-...@vger.kernel.org
---
 drivers/scsi/bfa/bfad.c |   20 ++--
 1 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 
e7e4774..839c81c 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1234,29 +1234,21 @@ bfad_setup_intr(struct bfad_s *bfad)
if ((bfa_asic_id_ctc(pdev-device)  !msix_disable_ct) ||
   (bfa_asic_id_cb(pdev-device)  !msix_disable_cb)) {

-   error = pci_enable_msix(bfad-pcidev, msix_entries, bfad-nvec);
+   error = pci_enable_msix_exact(bfad-pcidev,
+ msix_entries, bfad-nvec);
/* In CT1  CT2, try to allocate just one vector */
-   if (error  0  bfa_asic_id_ctc(pdev-device)) {
+   if (error == -ENOSPC  bfa_asic_id_ctc(pdev-device)) {
printk(KERN_WARNING bfa %s: trying one msix 
   vector failed to allocate %d[%d]\n,
   bfad-pci_name, bfad-nvec, error);
bfad-nvec = 1;
-   error = pci_enable_msix(bfad-pcidev,
-   msix_entries, bfad-nvec);
+   error = pci_enable_msix_exact(bfad-pcidev,
+ msix_entries, 1);
}

-   /*
-* Only error number of vector is available.
-* We don't have a mechanism to map multiple
-* interrupts into one vector, so even if we
-* can try to request less vectors, we don't
-* know how to associate interrupt events to
-*  vectors. Linux doesn't duplicate vectors
-* in the MSIX table for this case.
-*/
if (error) {
printk(KERN_WARNING bfad%d: 
-  pci_enable_msix failed (%d), 
+  pci_enable_msix_exact failed (%d), 
   use line based.\n,
bfad-inst_no, error);
goto line_based;
--
1.7.7.6

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in the 
body of a message to majord...@vger.kernel.org More majordomo info at  
http://vger.kernel.org/majordomo-info.html



This message and any attached documents contain information from QLogic 
Corporation or its wholly-owned subsidiaries that may be confidential. If you 
are not the intended recipient, you may not read, copy, distribute, or use this 
information. If you have received this transmission in error, please notify the 
sender immediately by reply e-mail and then delete this message.
attachment: winmail.dat

RE: [PATCH v2 RESEND 03/23] bfa: Cleanup bfad_setup_intr() function

2014-04-16 Thread Anil Gurumurthy
Patch look good.
Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com

-Original Message-
From: linux-scsi-ow...@vger.kernel.org 
[mailto:linux-scsi-ow...@vger.kernel.org] On Behalf Of Alexander Gordeev
Sent: 14 April 2014 13:35
To: linux-kernel
Cc: Alexander Gordeev; Anil Gurumurthy; Vijaya Mohan Guvva; linux-scsi; 
linux-pci
Subject: [PATCH v2 RESEND 03/23] bfa: Cleanup bfad_setup_intr() function

Signed-off-by: Alexander Gordeev agord...@redhat.com
Cc: Anil Gurumurthy aguru...@brocade.com
Cc: Vijaya Mohan Guvva vmo...@brocade.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-...@vger.kernel.org
Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com
---
 drivers/scsi/bfa/bfad.c |   18 --
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 
972ff8d..e7e4774 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1219,7 +1219,7 @@ bfad_install_msix_handler(struct bfad_s *bfad)  int  
bfad_setup_intr(struct bfad_s *bfad)  {
-   int error = 0;
+   int error;
u32 mask = 0, i, num_bit = 0, max_bit = 0;
struct msix_entry msix_entries[MAX_MSIX_ENTRY];
struct pci_dev *pdev = bfad-pcidev;
@@ -1279,20 +1279,18 @@ bfad_setup_intr(struct bfad_s *bfad)

bfad-bfad_flags |= BFAD_MSIX_ON;

-   return error;
+   return 0;
}

 line_based:
-   error = 0;
-   if (request_irq
-   (bfad-pcidev-irq, (irq_handler_t) bfad_intx, BFAD_IRQ_FLAGS,
-BFAD_DRIVER_NAME, bfad) != 0) {
-   /* Enable interrupt handler failed */
-   return 1;
-   }
+   error = request_irq(bfad-pcidev-irq, (irq_handler_t)bfad_intx,
+   BFAD_IRQ_FLAGS, BFAD_DRIVER_NAME, bfad);
+   if (error)
+   return error;
+
bfad-bfad_flags |= BFAD_INTX_ON;

-   return error;
+   return 0;
 }

 void
--
1.7.7.6

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in the 
body of a message to majord...@vger.kernel.org More majordomo info at  
http://vger.kernel.org/majordomo-info.html



This message and any attached documents contain information from QLogic 
Corporation or its wholly-owned subsidiaries that may be confidential. If you 
are not the intended recipient, you may not read, copy, distribute, or use this 
information. If you have received this transmission in error, please notify the 
sender immediately by reply e-mail and then delete this message.
attachment: winmail.dat

RE: [PATCH v2 RESEND 03/23] bfa: Cleanup bfad_setup_intr() function

2014-04-16 Thread Anil Gurumurthy
Patch look good.
Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com

-Original Message-
From: linux-scsi-ow...@vger.kernel.org 
[mailto:linux-scsi-ow...@vger.kernel.org] On Behalf Of Alexander Gordeev
Sent: 14 April 2014 13:35
To: linux-kernel
Cc: Alexander Gordeev; Anil Gurumurthy; Vijaya Mohan Guvva; linux-scsi; 
linux-pci
Subject: [PATCH v2 RESEND 03/23] bfa: Cleanup bfad_setup_intr() function

Signed-off-by: Alexander Gordeev agord...@redhat.com
Cc: Anil Gurumurthy aguru...@brocade.com
Cc: Vijaya Mohan Guvva vmo...@brocade.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-...@vger.kernel.org
Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com
---
 drivers/scsi/bfa/bfad.c |   18 --
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 
972ff8d..e7e4774 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1219,7 +1219,7 @@ bfad_install_msix_handler(struct bfad_s *bfad)  int  
bfad_setup_intr(struct bfad_s *bfad)  {
-   int error = 0;
+   int error;
u32 mask = 0, i, num_bit = 0, max_bit = 0;
struct msix_entry msix_entries[MAX_MSIX_ENTRY];
struct pci_dev *pdev = bfad-pcidev;
@@ -1279,20 +1279,18 @@ bfad_setup_intr(struct bfad_s *bfad)

bfad-bfad_flags |= BFAD_MSIX_ON;

-   return error;
+   return 0;
}

 line_based:
-   error = 0;
-   if (request_irq
-   (bfad-pcidev-irq, (irq_handler_t) bfad_intx, BFAD_IRQ_FLAGS,
-BFAD_DRIVER_NAME, bfad) != 0) {
-   /* Enable interrupt handler failed */
-   return 1;
-   }
+   error = request_irq(bfad-pcidev-irq, (irq_handler_t)bfad_intx,
+   BFAD_IRQ_FLAGS, BFAD_DRIVER_NAME, bfad);
+   if (error)
+   return error;
+
bfad-bfad_flags |= BFAD_INTX_ON;

-   return error;
+   return 0;
 }

 void
--
1.7.7.6

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in the 
body of a message to majord...@vger.kernel.org More majordomo info at  
http://vger.kernel.org/majordomo-info.html



This message and any attached documents contain information from QLogic 
Corporation or its wholly-owned subsidiaries that may be confidential. If you 
are not the intended recipient, you may not read, copy, distribute, or use this 
information. If you have received this transmission in error, please notify the 
sender immediately by reply e-mail and then delete this message.
attachment: winmail.dat

RE: [PATCH v2 RESEND 02/23] bfa: Do not call pci_enable_msix() after it failed once

2014-04-16 Thread Anil Gurumurthy
Patch look good.
Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com

-Original Message-
From: linux-scsi-ow...@vger.kernel.org 
[mailto:linux-scsi-ow...@vger.kernel.org] On Behalf Of Alexander Gordeev
Sent: 14 April 2014 13:35
To: linux-kernel
Cc: Alexander Gordeev; Anil Gurumurthy; Vijaya Mohan Guvva; linux-scsi; 
linux-pci
Subject: [PATCH v2 RESEND 02/23] bfa: Do not call pci_enable_msix() after it 
failed once

Function pci_enable_msix() should not be called in case it threw a negative 
errno from a previous call.

Signed-off-by: Alexander Gordeev agord...@redhat.com
Cc: Anil Gurumurthy aguru...@brocade.com
Cc: Vijaya Mohan Guvva vmo...@brocade.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-...@vger.kernel.org
Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com
---
 drivers/scsi/bfa/bfad.c |   48 ++
 1 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 
cc0fbcd..972ff8d 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1235,33 +1235,31 @@ bfad_setup_intr(struct bfad_s *bfad)
   (bfa_asic_id_cb(pdev-device)  !msix_disable_cb)) {

error = pci_enable_msix(bfad-pcidev, msix_entries, bfad-nvec);
-   if (error) {
-   /* In CT1  CT2, try to allocate just one vector */
-   if (bfa_asic_id_ctc(pdev-device)) {
-   printk(KERN_WARNING bfa %s: trying one msix 
-  vector failed to allocate %d[%d]\n,
-  bfad-pci_name, bfad-nvec, error);
-   bfad-nvec = 1;
-   error = pci_enable_msix(bfad-pcidev,
+   /* In CT1  CT2, try to allocate just one vector */
+   if (error  0  bfa_asic_id_ctc(pdev-device)) {
+   printk(KERN_WARNING bfa %s: trying one msix 
+  vector failed to allocate %d[%d]\n,
+  bfad-pci_name, bfad-nvec, error);
+   bfad-nvec = 1;
+   error = pci_enable_msix(bfad-pcidev,
msix_entries, bfad-nvec);
-   }
+   }

-   /*
-* Only error number of vector is available.
-* We don't have a mechanism to map multiple
-* interrupts into one vector, so even if we
-* can try to request less vectors, we don't
-* know how to associate interrupt events to
-*  vectors. Linux doesn't duplicate vectors
-* in the MSIX table for this case.
-*/
-   if (error) {
-   printk(KERN_WARNING bfad%d: 
-  pci_enable_msix failed (%d), 
-  use line based.\n,
-   bfad-inst_no, error);
-   goto line_based;
-   }
+   /*
+* Only error number of vector is available.
+* We don't have a mechanism to map multiple
+* interrupts into one vector, so even if we
+* can try to request less vectors, we don't
+* know how to associate interrupt events to
+*  vectors. Linux doesn't duplicate vectors
+* in the MSIX table for this case.
+*/
+   if (error) {
+   printk(KERN_WARNING bfad%d: 
+  pci_enable_msix failed (%d), 
+  use line based.\n,
+   bfad-inst_no, error);
+   goto line_based;
}

/* Disable INTX in MSI-X mode */
--
1.7.7.6

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in the 
body of a message to majord...@vger.kernel.org More majordomo info at  
http://vger.kernel.org/majordomo-info.html



This message and any attached documents contain information from QLogic 
Corporation or its wholly-owned subsidiaries that may be confidential. If you 
are not the intended recipient, you may not read, copy, distribute, or use this 
information. If you have received this transmission in error, please notify the 
sender immediately by reply e-mail and then delete this message.
attachment: winmail.dat

RE: [PATCH v2 02/23] bfa: Do not call pci_enable_msix() after it failed once

2014-03-02 Thread Anil Gurumurthy
Patch look good.
Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com

-Original Message-
From: linux-scsi-ow...@vger.kernel.org 
[mailto:linux-scsi-ow...@vger.kernel.org] On Behalf Of Alexander Gordeev
Sent: 24 February 2014 13:32
To: linux-kernel
Cc: Alexander Gordeev; Anil Gurumurthy; Vijaya Mohan Guvva; linux-scsi; 
linux-pci
Subject: [PATCH v2 02/23] bfa: Do not call pci_enable_msix() after it failed 
once

Function pci_enable_msix() should not be called in case it threw a negative 
errno from a previous call.

Signed-off-by: Alexander Gordeev agord...@redhat.com
Cc: Anil Gurumurthy aguru...@brocade.com
Cc: Vijaya Mohan Guvva vmo...@brocade.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-...@vger.kernel.org
---
 drivers/scsi/bfa/bfad.c |   48 ++
 1 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 
cc0fbcd..972ff8d 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1235,33 +1235,31 @@ bfad_setup_intr(struct bfad_s *bfad)
   (bfa_asic_id_cb(pdev-device)  !msix_disable_cb)) {

error = pci_enable_msix(bfad-pcidev, msix_entries, bfad-nvec);
-   if (error) {
-   /* In CT1  CT2, try to allocate just one vector */
-   if (bfa_asic_id_ctc(pdev-device)) {
-   printk(KERN_WARNING bfa %s: trying one msix 
-  vector failed to allocate %d[%d]\n,
-  bfad-pci_name, bfad-nvec, error);
-   bfad-nvec = 1;
-   error = pci_enable_msix(bfad-pcidev,
+   /* In CT1  CT2, try to allocate just one vector */
+   if (error  0  bfa_asic_id_ctc(pdev-device)) {
+   printk(KERN_WARNING bfa %s: trying one msix 
+  vector failed to allocate %d[%d]\n,
+  bfad-pci_name, bfad-nvec, error);
+   bfad-nvec = 1;
+   error = pci_enable_msix(bfad-pcidev,
msix_entries, bfad-nvec);
-   }
+   }

-   /*
-* Only error number of vector is available.
-* We don't have a mechanism to map multiple
-* interrupts into one vector, so even if we
-* can try to request less vectors, we don't
-* know how to associate interrupt events to
-*  vectors. Linux doesn't duplicate vectors
-* in the MSIX table for this case.
-*/
-   if (error) {
-   printk(KERN_WARNING bfad%d: 
-  pci_enable_msix failed (%d), 
-  use line based.\n,
-   bfad-inst_no, error);
-   goto line_based;
-   }
+   /*
+* Only error number of vector is available.
+* We don't have a mechanism to map multiple
+* interrupts into one vector, so even if we
+* can try to request less vectors, we don't
+* know how to associate interrupt events to
+*  vectors. Linux doesn't duplicate vectors
+* in the MSIX table for this case.
+*/
+   if (error) {
+   printk(KERN_WARNING bfad%d: 
+  pci_enable_msix failed (%d), 
+  use line based.\n,
+   bfad-inst_no, error);
+   goto line_based;
}

/* Disable INTX in MSI-X mode */
--
1.7.7.6

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in the 
body of a message to majord...@vger.kernel.org More majordomo info at  
http://vger.kernel.org/majordomo-info.html



This message and any attached documents contain information from QLogic 
Corporation or its wholly-owned subsidiaries that may be confidential. If you 
are not the intended recipient, you may not read, copy, distribute, or use this 
information. If you have received this transmission in error, please notify the 
sender immediately by reply e-mail and then delete this message.
attachment: winmail.dat

RE: [PATCH v2 03/23] bfa: Cleanup bfad_setup_intr() function

2014-03-02 Thread Anil Gurumurthy
Patch look good.
Acked-by: Anil Gurumurthy anil.gurumur...@qlogic.com

-Original Message-
From: linux-scsi-ow...@vger.kernel.org 
[mailto:linux-scsi-ow...@vger.kernel.org] On Behalf Of Alexander Gordeev
Sent: 24 February 2014 13:32
To: linux-kernel
Cc: Alexander Gordeev; Anil Gurumurthy; Vijaya Mohan Guvva; linux-scsi; 
linux-pci
Subject: [PATCH v2 03/23] bfa: Cleanup bfad_setup_intr() function

Signed-off-by: Alexander Gordeev agord...@redhat.com
Cc: Anil Gurumurthy aguru...@brocade.com
Cc: Vijaya Mohan Guvva vmo...@brocade.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-...@vger.kernel.org
---
 drivers/scsi/bfa/bfad.c |   18 --
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 
972ff8d..e7e4774 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1219,7 +1219,7 @@ bfad_install_msix_handler(struct bfad_s *bfad)  int  
bfad_setup_intr(struct bfad_s *bfad)  {
-   int error = 0;
+   int error;
u32 mask = 0, i, num_bit = 0, max_bit = 0;
struct msix_entry msix_entries[MAX_MSIX_ENTRY];
struct pci_dev *pdev = bfad-pcidev;
@@ -1279,20 +1279,18 @@ bfad_setup_intr(struct bfad_s *bfad)

bfad-bfad_flags |= BFAD_MSIX_ON;

-   return error;
+   return 0;
}

 line_based:
-   error = 0;
-   if (request_irq
-   (bfad-pcidev-irq, (irq_handler_t) bfad_intx, BFAD_IRQ_FLAGS,
-BFAD_DRIVER_NAME, bfad) != 0) {
-   /* Enable interrupt handler failed */
-   return 1;
-   }
+   error = request_irq(bfad-pcidev-irq, (irq_handler_t)bfad_intx,
+   BFAD_IRQ_FLAGS, BFAD_DRIVER_NAME, bfad);
+   if (error)
+   return error;
+
bfad-bfad_flags |= BFAD_INTX_ON;

-   return error;
+   return 0;
 }

 void
--
1.7.7.6

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in the 
body of a message to majord...@vger.kernel.org More majordomo info at  
http://vger.kernel.org/majordomo-info.html



This message and any attached documents contain information from QLogic 
Corporation or its wholly-owned subsidiaries that may be confidential. If you 
are not the intended recipient, you may not read, copy, distribute, or use this 
information. If you have received this transmission in error, please notify the 
sender immediately by reply e-mail and then delete this message.
attachment: winmail.dat

[PATCH] bfa: Updating Maintainers email ids

2014-02-26 Thread Anil
From: Anil Gurumurthy anil.gurumur...@qlogic.com

Signed-off-by: Anil Gurumurthy anil.gurumur...@qlogic.com
---
 MAINTAINERS | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 0dba50b..0dff580 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1917,8 +1917,8 @@ F:drivers/bcma/
 F: include/linux/bcma/
 
 BROCADE BFA FC SCSI DRIVER
-M: Anil Gurumurthy aguru...@brocade.com
-M: Vijaya Mohan Guvva vmo...@brocade.com
+M: Anil Gurumurthy anil.gurumur...@qlogic.com
+M: Sudarsana Kalluru sudarsana.kall...@qlogic.com
 L: linux-scsi@vger.kernel.org
 S: Supported
 F: drivers/scsi/bfa/
-- 
1.9.0

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [patch] [SCSI] bfa: fix strncpy() limiter in bfad_start_ops()

2013-01-11 Thread Anil Gurumurthy


-Original Message-
From: linux-scsi-ow...@vger.kernel.org 
[mailto:linux-scsi-ow...@vger.kernel.org] On Behalf Of Dan Carpenter
Sent: Thursday, January 10, 2013 2:36 PM
To: Anil Gurumurthy
Cc: Vijay Mohan Guvva; James E.J. Bottomley; linux-scsi@vger.kernel.org; 
linux-ker...@vger.kernel.org; kernel-janit...@vger.kernel.org
Subject: [patch] [SCSI] bfa: fix strncpy() limiter in bfad_start_ops()

The closing parenthesis is in the wrong place so it takes the sizeof a pointer 
instead of the sizeof the buffer minus one.

Signed-off-by: Dan Carpenter dan.carpen...@oracle.com

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 
e6bf126..a5f7690 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1034,7 +1034,7 @@ bfad_start_ops(struct bfad_s *bfad) {
sizeof(driver_info.host_os_patch) - 1);
 
strncpy(driver_info.os_device_name, bfad-pci_name,
-   sizeof(driver_info.os_device_name - 1));
+   sizeof(driver_info.os_device_name) - 1);
 
/* FCS driver info init */
spin_lock_irqsave(bfad-bfad_lock, flags);
--


Looks good. Thanks for the patch, Dan.

Acked-by: Anil Gurumurthyaguru...@brocade.com


To unsubscribe from this list: send the line unsubscribe linux-scsi in the 
body of a message to majord...@vger.kernel.org More majordomo info at  
http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 2/2][BNX2]: Add iSCSI support to BNX2 devices.

2007-11-28 Thread Anil Veerabhadrappa
On Wed, 2007-11-28 at 14:06 -0600, Mike Christie wrote:
 Anil Veerabhadrappa wrote:
  
  Which ones were they exactly? I think JamesB wanted only common 
  transport values in the transport class. If it is driver specific then 
  it should go on the host or target or device with the scsi_host_template 
  attrs.
 
  It's a chicken  egg issue to put port mapper sysfs entry in scsi host
  attributes. Application won't see sysfs unless initiator creates an
  Sorry for the late response. I was on vacation.
 
  That is only with how you coded it today. I asked you to do something 
  like qla4xxx where the session and host are not so closely bound.
  
  bnx2i is still using scsi host per iscsi session model, we plan to
  migrate to scsi host per device model pretty soon. Previously you
  indicated that you are working on this port, can you please share the
  code? We will build on your work and bring this to closure.
 
 Send me a link to your code so I can rebuild my stuff against it.


ftp://[EMAIL PROTECTED]/bnx2iscsi-2.6.25.diff



  
  You are right, software is flexible enough to allow creation of
  session/connection and endpoint independently but so far user daemon
  creates TCP endpoint before iSCSI session and bind them all together.
  Any changes to this scheme will not be compatible with existing
  distributions
  
 
 So what do you need to do exactly? You want userspace to be able to set 
 some session or connection value, then have it used for that session, 
 right? We have been using the netlink interface for that. You would 
 basically pass iscsiadm some value (on cmdline or in some file/db), then 
 when the session and connection is being created we will pass those 
 values in. Values that are used after we are in FFP, like abort 
 timeouts, are passed in the set_param command. If a value is needed for 
 the session/connection setup then we were passing that in with the 
 command (like create_session has the queue depth sent with it). To add 
 new values (driver specific and common ones) and have the interface 
 compatible with older versions should not be too difficult.

wondering how netlink interface can be expanded to assist hardware
vendor's in configuring and debugging offload devices. In addition to
the current issue we might use this interface for other device
configuration (e.g. administrator will have to shrink per connection
shared queue size if a large number of iSCSI connections is required)
and debugging purpose(e.g. get iSCSI connection context dump when an
error is detected on a connection). Former is a synchronous call while
later in most cases will complete asynchronously. This is how I image
the flow - 
vendor_config_apps -- iscsid -- netlink -- iscsi_transport -- driver

Also passing configuration info via cmd line or file/db will only work
for parameter types which are more like user preferences. I don't think
we will be able to specify a dynamic value using this mechanism, e.g.
port number could be different for 2 consecutive iscsi login to same
target. This will also break -L all interface, right?



 
 --~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
 open-iscsi group.
 To post to this group, send email to [EMAIL PROTECTED]
 To unsubscribe from this group, send email to [EMAIL PROTECTED]
 For more options, visit this group at 
 http://groups.google.com/group/open-iscsi
 -~--~~~~--~~--~--~---
 
 

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 2/2][BNX2]: Add iSCSI support to BNX2 devices.

2007-11-27 Thread Anil Veerabhadrappa

  Which ones were they exactly? I think JamesB wanted only common 
  transport values in the transport class. If it is driver specific then 
  it should go on the host or target or device with the scsi_host_template 
  attrs.
 
  
  It's a chicken  egg issue to put port mapper sysfs entry in scsi host
  attributes. Application won't see sysfs unless initiator creates an
 
 Sorry for the late response. I was on vacation.
 
 That is only with how you coded it today. I asked you to do something 
 like qla4xxx where the session and host are not so closely bound.

bnx2i is still using scsi host per iscsi session model, we plan to
migrate to scsi host per device model pretty soon. Previously you
indicated that you are working on this port, can you please share the
code? We will build on your work and bring this to closure.


 
  iSCSI session and driver can't create an iSCSI session without a tcp
 
 That is not right with how things are today even. The iscsi_session 
 struct can be created before the tcp connection. This was done because 
 we thought we were going to have to use only sysfs for all setup and 
 management (we ended up netlink and sysfs though).

You are right, software is flexible enough to allow creation of
session/connection and endpoint independently but so far user daemon
creates TCP endpoint before iSCSI session and bind them all together.
Any changes to this scheme will not be compatible with existing
distributions



-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 2/2][BNX2]: Add iSCSI support to BNX2 devices.

2007-11-21 Thread Anil Veerabhadrappa

  The sysfs bits related to the hba should be use one of the scsi sysfs 
  facilities or if they are related to iscsi bits and are generic then 
  through the iscsi hba
  
  bnx2i needs 2 sysfs entries -
  1. QP size info - this is used to size per connection shared data
  structures to issue work requests to chip (login, scsi cmd, tmf, nopin)
  and get completions from the chip (scsi completions, async messages,
  etc'). This is a iSCSI HBA attribute
  2. port mapper - we can be more flexible on classifying this as either
  iSCSI HBA attribute or bnx2i driver global attribute
  Can hooks be added to iSCSI transport class to include these?
  
 
 Which ones were they exactly? I think JamesB wanted only common 
 transport values in the transport class. If it is driver specific then 
 it should go on the host or target or device with the scsi_host_template 
 attrs.
 

It's a chicken  egg issue to put port mapper sysfs entry in scsi host
attributes. Application won't see sysfs unless initiator creates an
iSCSI session and driver can't create an iSCSI session without a tcp
port. I was wondering if there is a better way than using IOCTL in this
situation?

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] aic7xxx driver. Restrict DMA to 32bit for 29320LPE Adaptec SCSI controller

2007-09-20 Thread Anil K. Ravindranath
Hi,

We have not heard any comments or inputs on this patch. 

With regards,
  Anil

On Sat, 2007-06-30 at 05:45 -0700, Anil K. Ravindranath wrote:
 Subject: [PATCH] aic7xxx driver. Restrict DMA to 32bit for 29320LPE
 Adaptec SCSI controller
 
 Contribution:
 
 Anil Ravindranath [EMAIL PROTECTED]
 
 Issue:
 
 Data Bursts that cross from 32- to 64-Bit address space have incorrect
 address for 29320LPE. This leads to potential data corruption.
 
 Fix:
 
 Restrict DMA to 32bit so that it does not cross 4GB boundary.
 
 Change Log:
 
 Restrict DMA to 32bit for 29320LPE so that it does not cross 4GB
 boundary
 
 Patch: apply to scsi-misc-2.6.git development tree
 
 Signed off By:  Anil Ravindranath [EMAIL PROTECTED]
 
 diff -urN a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
 b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
 --- a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c2007-06-30
 05:24:08.0 -0700
 +++ b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c2007-06-30
 05:25:40.0 -0700
 @@ -161,7 +161,10 @@
 }
 pci_set_master(pdev);
 
 -   if (sizeof(dma_addr_t)  4) {
 +   /*
 +* Restrict DMA to 32bit for 29320LPE
 +*/
 +   if ((sizeof(dma_addr_t)  4)  (entry-full_id !=
 ID_AHA_29320LPE)) {
 const u64 required_mask = dma_get_required_mask(dev);
 
 if (required_mask  DMA_39BIT_MASK 
 
 
 
 diffstat output:
 
 aic79xx_osm_pci.c |5 -
  1 files changed, 4 insertions(+), 1 deletion(-)
 
 With regards,
   Anil
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 2/2][BNX2]: Add iSCSI support to BNX2 devices.

2007-09-08 Thread Anil Veerabhadrappa
On Sat, 2007-09-08 at 07:49 -0700, Michael Chan wrote:
 Christoph Hellwig wrote:
 
  Most of it should just go away, and the other bits shouldn't 
  change over
  the lifetime of the driver except for additions.  So there 
  really isn't
  any point in auto-generating it.
  
 
 Yes, I agree with Mike Christie on this.  These values in
 question are defined in iSCSI RFC and therefore should be defined
 in a common file. 

Sure, we will remove these duplicate defines from bnx2i header file and
work of iscsi_proto.h macro definitions

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 2/2][BNX2]: Add iSCSI support to BNX2 devices.

2007-09-05 Thread Anil Veerabhadrappa
On Wed, 2007-09-05 at 13:34 -0500, Mike Christie wrote:
 Michael Chan wrote:
  +* This file defines HSI constants for the iSCSI flows
  +*/
  +
  +/* iSCSI request op codes */
  +#define ISCSI_OPCODE_NOP_OUT   (0 | 0x40)
  +#define ISCSI_OPCODE_SCSI_CMD  (1)
  +#define ISCSI_OPCODE_TMF_REQUEST   (2 | 0x40)
  +#define ISCSI_OPCODE_LOGIN_REQUEST (3 | 0x40)
  +#define ISCSI_OPCODE_TEXT_REQUEST  (4 | 0x40)
  +#define ISCSI_OPCODE_DATA_OUT  (5)
  +#define ISCSI_OPCODE_LOGOUT_REQUEST(6 | 0x00)
  +#define ISCSI_OPCODE_CLEANUP_REQUEST   (7)
 
 
 What is ISCSI_OPCODE_CLEANUP_REQUEST?

This is a local message between iSCSI driver and the firmware to cleanup
iSCSI task resources held by chip. This operation is required to reclaim
SCSI command related resources after the TMF response is received for a
task and before it is completed to SCSI-ML


 
 
  +
  +/* iSCSI response/messages op codes */
  +#define ISCSI_OPCODE_NOP_IN(0x20)
  +#define ISCSI_OPCODE_SCSI_RESPONSE (0x21)
  +#define ISCSI_OPCODE_TMF_RESPONSE  (0x22)
  +#define ISCSI_OPCODE_LOGIN_RESPONSE(0x23)
  +#define ISCSI_OPCODE_TEXT_RESPONSE (0x24)
  +#define ISCSI_OPCODE_DATA_IN   (0x25)
  +#define ISCSI_OPCODE_LOGOUT_RESPONSE   (0x26)
  +#define ISCSI_OPCODE_CLEANUP_RESPONSE  (0x27)
  +#define ISCSI_OPCODE_R2T   (0x31)
  +#define ISCSI_OPCODE_ASYNC_MSG (0x32)
  +#define ISCSI_OPCODE_REJECT(0x3f)
  +#define ISCSI_OPCODE_NOPOUT_LOCAL_COMPLETION   (0)
 
 
 What does the LOCAL_COMPLETION on the nopout mean?

This is the completion notification for NOPOUT pdus which does not
involve response from the target. Following two NOPOUTs are classified
under this -
1. Initiator's proactive nopout with ITT=0x
2. Initiator's response to target nopin with TTT != 0x


 
 
  +
  +/* iSCSI stages */
  +#define ISCSI_STAGE_SECURITY_NEGOTIATION (0)
  +#define ISCSI_STAGE_LOGIN_OPERATIONAL_NEGOTIATION (1)
  +#define ISCSI_STAGE_FULL_FEATURE_PHASE (3)
  +/* Logout response codes */
  +#define ISCSI_LOGOUT_RESPONSE_CONNECTION_CLOSED (0)
  +#define ISCSI_LOGOUT_RESPONSE_CID_NOT_FOUND (1)
  +#define ISCSI_LOGOUT_RESPONSE_CLEANUP_FAILED (3)
  +
  +/* iSCSI task types */
  +#define ISCSI_TASK_TYPE_READ(0)
  +#define ISCSI_TASK_TYPE_WRITE   (1)
  +#define ISCSI_TASK_TYPE_MPATH   (2)
 
 
 
 
 All of these iscsi code shoulds be in iscsi_proto.h or should be added 
 there.
This is a very tricky proposal as this header file is automatically
generated by a well defined process and is shared between various driver
supporting multiple platform/OS and the firmware. If it is not of a big
issue I would like to keep it the way it is.


 
 
  +
  +#endif
  diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c
  new file mode 100644
  index 000..b74a93c
  --- /dev/null
  +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c
  @@ -0,0 +1,1977 @@
  +
  +   if (tmf_cqe-response == ISCSI_TMF_RSP_COMPLETE) {
  +   if (aborted_cmd-scsi_cmd) {
  +   aborted_cmd-scsi_cmd-result = DID_ABORT  16;
  +   aborted_cmd-scsi_cmd-resid =
 
 should use resid wrappers throughout driver.
 
  +   aborted_cmd-scsi_cmd-request_bufflen;
 
 Should use bufflen wrappers throught driver.

Will look into this.


  +   cmd-cmd_state = ISCSI_CMD_STATE_INITIATED;
  +   sc-SCp.ptr = (char *) cmd;
  +
  +   if (cmd-req.itt != ITT_INVALID_SIGNATURE) {
  +   bnx2i_send_iscsi_scsicmd(conn, cmd);
  +   list_add_tail(cmd-link, sess-active_cmds);
  +   sess-num_active_cmds++;
  +   }
  +   return 0;
  +
  +iscsi_win_closed:
  +cmd_not_accepted:
  +   return SCSI_MLQUEUE_HOST_BUSY;
  +
  +dev_not_found:
  +   sc-sense_buffer[0] = 0x70;
  +   sc-sense_buffer[2] = NOT_READY;
  +   sc-sense_buffer[7] = 0x6;
  +   sc-sense_buffer[12] = 0x08;
  +   sc-sense_buffer[13] = 0x00;
 
 
 do not fake sense and do not face sense and set a host byte of 
 DID_NO_CONNECT. DID_NO_CONNECT is fine.

ok, thanks.

 
 
  +   sc-result = (DID_NO_CONNECT  16);
  +   sc-resid = sc-request_bufflen;
  +   sc-scsi_done(sc);
  +   return 0;
  +}
  +
  +
  +
  +/*
  + * TMF request timeout handler
  + */
  +static void bnx2i_iscsi_tmf_timer(unsigned long data)
  +{
  +   struct bnx2i_cmd *cmd = (struct bnx2i_cmd *) data;
  +
  +   printk(KERN_ALERT TMF timer: abort failed, cmd 0x%p\n, cmd);
  +   cmd-cmd_state = ISCSI_CMD_STATE_TMF_TIMEOUT;
  +   cmd-conn-sess-recovery_state = ISCSI_SESS_RECOVERY_OPEN_ISCSI;
  +   iscsi_conn_error(cmd-conn-cls_conn, ISCSI_ERR_CONN_FAILED);
  +}
  +
  +
  +/*
  + * initiate command abort process by requesting CNIC to send
  + * an iSCSI TMF request to target
  + */
  +static int bnx2i_initiate_abort_cmd(struct 

module insert question

2005-02-23 Thread Anil Kumar
Hi,

Can you please let me know, what all files does the OS look into to
load modules?
I see the following messages during boot rather installation:
==
Finished bus probing
modules to insert tg3 aic79xx
==

which files does the OS look into to load tg3 and aic79xx after
finishing bus probing. I guess modprobe.conf, modules.alias,
modules.pcimap.

with regards,
Anil
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html