lkml.org 
[lkml]   [2020]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectdrivers/scsi/bnx2fc/bnx2fc_hwi.c:638:16: warning: variable 'index' set but not used
Hi zhengbin,

FYI, the error/warning still remains.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b3a9e3b9622ae10064826dccb4f7a52bd88c7407
commit: 84769706dde5881b8da0dc3da666f7443be95a8a scsi: bnx2fc: remove set but not used variables 'task','port','orig_task'
date: 10 months ago
config: ia64-randconfig-r003-20200615 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 84769706dde5881b8da0dc3da666f7443be95a8a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

In file included from arch/ia64/include/asm/pgtable.h:154,
from include/linux/mm.h:99,
from arch/ia64/include/asm/uaccess.h:38,
from include/linux/uaccess.h:11,
from include/linux/crypto.h:21,
from include/crypto/hash.h:11,
from include/linux/uio.h:10,
from include/linux/socket.h:8,
from include/linux/skbuff.h:19,
from drivers/scsi/bnx2fc/bnx2fc.h:21,
from drivers/scsi/bnx2fc/bnx2fc_hwi.c:16:
arch/ia64/include/asm/mmu_context.h: In function 'reload_context':
arch/ia64/include/asm/mmu_context.h:137:41: warning: variable 'old_rr4' set but not used [-Wunused-but-set-variable]
137 | unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
| ^~~~~~~
drivers/scsi/bnx2fc/bnx2fc_hwi.c: In function 'bnx2fc_process_unsol_compl':
<< from drivers/scsi/bnx2fc/bnx2fc_hwi.c:16:
>> drivers/scsi/bnx2fc/bnx2fc_hwi.c:638:16: warning: variable 'index' set but not used [-Wunused-but-set-variable]
638 | int task_idx, index;
| ^~~~~
<< from drivers/scsi/bnx2fc/bnx2fc_hwi.c:16:
>> drivers/scsi/bnx2fc/bnx2fc_hwi.c:638:6: warning: variable 'task_idx' set but not used [-Wunused-but-set-variable]
638 | int task_idx, index;
| ^~~~~~~~
drivers/scsi/bnx2fc/bnx2fc_hwi.c: In function 'bnx2fc_init_seq_cleanup_task':
drivers/scsi/bnx2fc/bnx2fc_hwi.c:1466:21: warning: variable 'index' set but not used [-Wunused-but-set-variable]
1466 | int orig_task_idx, index;
| ^~~~~
<< from drivers/scsi/bnx2fc/bnx2fc_hwi.c:16:
>> drivers/scsi/bnx2fc/bnx2fc_hwi.c:1466:6: warning: variable 'orig_task_idx' set but not used [-Wunused-but-set-variable]
1466 | int orig_task_idx, index;
| ^~~~~~~~~~~~~
drivers/scsi/bnx2fc/bnx2fc_hwi.c: In function 'bnx2fc_allocate_hash_table':
drivers/scsi/bnx2fc/bnx2fc_hwi.c:2046:7: warning: variable 'hi' set but not used [-Wunused-but-set-variable]
2046 | u32 hi;
| ^~
drivers/scsi/bnx2fc/bnx2fc_hwi.c:2045:7: warning: variable 'lo' set but not used [-Wunused-but-set-variable]
2045 | u32 lo;
| ^~

vim +/index +638 drivers/scsi/bnx2fc/bnx2fc_hwi.c

853e2bd2103aaa Bhanu Gollapudi 2011-02-04 625
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 626 static void bnx2fc_process_unsol_compl(struct bnx2fc_rport *tgt, u16 wqe)
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 627 {
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 628 u8 num_rq;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 629 struct fcoe_err_report_entry *err_entry;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 630 unsigned char *rq_data;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 631 unsigned char *buf = NULL, *buf1;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 632 int i;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 633 u16 xid;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 634 u32 frame_len, len;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 635 struct bnx2fc_cmd *io_req = NULL;
aea71a024914e8 Bhanu Prakash Gollapudi 2011-07-26 636 struct bnx2fc_interface *interface = tgt->port->priv;
aea71a024914e8 Bhanu Prakash Gollapudi 2011-07-26 637 struct bnx2fc_hba *hba = interface->hba;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 @638 int task_idx, index;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 639 int rc = 0;
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 640 u64 err_warn_bit_map;
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 641 u8 err_warn = 0xff;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 642
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 643
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 644 BNX2FC_TGT_DBG(tgt, "Entered UNSOL COMPLETION wqe = 0x%x\n", wqe);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 645 switch (wqe & FCOE_UNSOLICITED_CQE_SUBTYPE) {
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 646 case FCOE_UNSOLICITED_FRAME_CQE_TYPE:
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 647 frame_len = (wqe & FCOE_UNSOLICITED_CQE_PKT_LEN) >>
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 648 FCOE_UNSOLICITED_CQE_PKT_LEN_SHIFT;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 649
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 650 num_rq = (frame_len + BNX2FC_RQ_BUF_SZ - 1) / BNX2FC_RQ_BUF_SZ;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 651
686959736a8543 Nithin Sujir 2011-03-17 652 spin_lock_bh(&tgt->tgt_lock);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 653 rq_data = (unsigned char *)bnx2fc_get_next_rqe(tgt, num_rq);
686959736a8543 Nithin Sujir 2011-03-17 654 spin_unlock_bh(&tgt->tgt_lock);
686959736a8543 Nithin Sujir 2011-03-17 655
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 656 if (rq_data) {
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 657 buf = rq_data;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 658 } else {
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 659 buf1 = buf = kmalloc((num_rq * BNX2FC_RQ_BUF_SZ),
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 660 GFP_ATOMIC);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 661
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 662 if (!buf1) {
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 663 BNX2FC_TGT_DBG(tgt, "Memory alloc failure\n");
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 664 break;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 665 }
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 666
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 667 for (i = 0; i < num_rq; i++) {
686959736a8543 Nithin Sujir 2011-03-17 668 spin_lock_bh(&tgt->tgt_lock);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 669 rq_data = (unsigned char *)
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 670 bnx2fc_get_next_rqe(tgt, 1);
686959736a8543 Nithin Sujir 2011-03-17 671 spin_unlock_bh(&tgt->tgt_lock);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 672 len = BNX2FC_RQ_BUF_SZ;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 673 memcpy(buf1, rq_data, len);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 674 buf1 += len;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 675 }
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 676 }
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 677 bnx2fc_process_l2_frame_compl(tgt, buf, frame_len,
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 678 FC_XID_UNKNOWN);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 679
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 680 if (buf != rq_data)
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 681 kfree(buf);
686959736a8543 Nithin Sujir 2011-03-17 682 spin_lock_bh(&tgt->tgt_lock);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 683 bnx2fc_return_rqe(tgt, num_rq);
686959736a8543 Nithin Sujir 2011-03-17 684 spin_unlock_bh(&tgt->tgt_lock);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 685 break;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 686
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 687 case FCOE_ERROR_DETECTION_CQE_TYPE:
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 688 /*
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 689 * In case of error reporting CQE a single RQ entry
686959736a8543 Nithin Sujir 2011-03-17 690 * is consumed.
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 691 */
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 692 spin_lock_bh(&tgt->tgt_lock);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 693 num_rq = 1;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 694 err_entry = (struct fcoe_err_report_entry *)
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 695 bnx2fc_get_next_rqe(tgt, 1);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 696 xid = err_entry->fc_hdr.ox_id;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 697 BNX2FC_TGT_DBG(tgt, "Unsol Error Frame OX_ID = 0x%x\n", xid);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 698 BNX2FC_TGT_DBG(tgt, "err_warn_bitmap = %08x:%08x\n",
619c5cb6885b93 Vlad Zolotarov 2011-06-14 699 err_entry->data.err_warn_bitmap_hi,
619c5cb6885b93 Vlad Zolotarov 2011-06-14 700 err_entry->data.err_warn_bitmap_lo);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 701 BNX2FC_TGT_DBG(tgt, "buf_offsets - tx = 0x%x, rx = 0x%x\n",
619c5cb6885b93 Vlad Zolotarov 2011-06-14 702 err_entry->data.tx_buf_off, err_entry->data.rx_buf_off);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 703
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 704
0eb43b4bb081a1 Bhanu Prakash Gollapudi 2013-04-22 705 if (xid > hba->max_xid) {
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 706 BNX2FC_TGT_DBG(tgt, "xid(0x%x) out of FW range\n",
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 707 xid);
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 708 goto ret_err_rqe;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 709 }
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 710
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 711 task_idx = xid / BNX2FC_TASKS_PER_PAGE;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 712 index = xid % BNX2FC_TASKS_PER_PAGE;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 713
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 714 io_req = (struct bnx2fc_cmd *)hba->cmd_mgr->cmds[xid];
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 715 if (!io_req)
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 716 goto ret_err_rqe;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 717
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 718 if (io_req->cmd_type != BNX2FC_SCSI_CMD) {
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 719 printk(KERN_ERR PFX "err_warn: Not a SCSI cmd\n");
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 720 goto ret_err_rqe;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 721 }
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 722
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 723 if (test_and_clear_bit(BNX2FC_FLAG_IO_CLEANUP,
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 724 &io_req->req_flags)) {
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 725 BNX2FC_IO_DBG(io_req, "unsol_err: cleanup in "
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 726 "progress.. ignore unsol err\n");
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 727 goto ret_err_rqe;
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 728 }
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 729
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 730 err_warn_bit_map = (u64)
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 731 ((u64)err_entry->data.err_warn_bitmap_hi << 32) |
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 732 (u64)err_entry->data.err_warn_bitmap_lo;
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 733 for (i = 0; i < BNX2FC_NUM_ERR_BITS; i++) {
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 734 if (err_warn_bit_map & (u64)((u64)1 << i)) {
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 735 err_warn = i;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 736 break;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 737 }
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 738 }
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 739
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 740 /*
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 741 * If ABTS is already in progress, and FW error is
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 742 * received after that, do not cancel the timeout_work
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 743 * and let the error recovery continue by explicitly
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 744 * logging out the target, when the ABTS eventually
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 745 * times out.
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 746 */
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 747 if (test_bit(BNX2FC_FLAG_ISSUE_ABTS, &io_req->req_flags)) {
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 748 printk(KERN_ERR PFX "err_warn: io_req (0x%x) already "
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 749 "in ABTS processing\n", xid);
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 750 goto ret_err_rqe;
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 751 }
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 752 BNX2FC_TGT_DBG(tgt, "err = 0x%x\n", err_warn);
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 753 if (tgt->dev_type != TYPE_TAPE)
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 754 goto skip_rec;
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 755 switch (err_warn) {
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 756 case FCOE_ERROR_CODE_REC_TOV_TIMER_EXPIRATION:
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 757 case FCOE_ERROR_CODE_DATA_OOO_RO:
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 758 case FCOE_ERROR_CODE_COMMON_INCORRECT_SEQ_CNT:
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 759 case FCOE_ERROR_CODE_DATA_SOFI3_SEQ_ACTIVE_SET:
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 760 case FCOE_ERROR_CODE_FCP_RSP_OPENED_SEQ:
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 761 case FCOE_ERROR_CODE_DATA_SOFN_SEQ_ACTIVE_RESET:
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 762 BNX2FC_TGT_DBG(tgt, "REC TOV popped for xid - 0x%x\n",
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 763 xid);
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 764 memcpy(&io_req->err_entry, err_entry,
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 765 sizeof(struct fcoe_err_report_entry));
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 766 if (!test_bit(BNX2FC_FLAG_SRR_SENT,
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 767 &io_req->req_flags)) {
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 768 spin_unlock_bh(&tgt->tgt_lock);
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 769 rc = bnx2fc_send_rec(io_req);
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 770 spin_lock_bh(&tgt->tgt_lock);
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 771
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 772 if (rc)
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 773 goto skip_rec;
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 774 } else
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 775 printk(KERN_ERR PFX "SRR in progress\n");
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 776 goto ret_err_rqe;
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 777 break;
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 778 default:
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 779 break;
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 780 }
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 781
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 782 skip_rec:
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 783 set_bit(BNX2FC_FLAG_ISSUE_ABTS, &io_req->req_flags);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 784 /*
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 785 * Cancel the timeout_work, as we received IO
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 786 * completion with FW error.
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 787 */
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 788 if (cancel_delayed_work(&io_req->timeout_work))
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 789 kref_put(&io_req->refcount, bnx2fc_cmd_release);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 790
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 791 rc = bnx2fc_initiate_abts(io_req);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 792 if (rc != SUCCESS) {
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 793 printk(KERN_ERR PFX "err_warn: initiate_abts "
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 794 "failed xid = 0x%x. issue cleanup\n",
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 795 io_req->xid);
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 796 bnx2fc_initiate_cleanup(io_req);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 797 }
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 798 ret_err_rqe:
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 799 bnx2fc_return_rqe(tgt, 1);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 800 spin_unlock_bh(&tgt->tgt_lock);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 801 break;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 802
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 803 case FCOE_WARNING_DETECTION_CQE_TYPE:
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 804 /*
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 805 *In case of warning reporting CQE a single RQ entry
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 806 * is consumes.
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 807 */
686959736a8543 Nithin Sujir 2011-03-17 808 spin_lock_bh(&tgt->tgt_lock);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 809 num_rq = 1;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 810 err_entry = (struct fcoe_err_report_entry *)
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 811 bnx2fc_get_next_rqe(tgt, 1);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 812 xid = cpu_to_be16(err_entry->fc_hdr.ox_id);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 813 BNX2FC_TGT_DBG(tgt, "Unsol Warning Frame OX_ID = 0x%x\n", xid);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 814 BNX2FC_TGT_DBG(tgt, "err_warn_bitmap = %08x:%08x",
619c5cb6885b93 Vlad Zolotarov 2011-06-14 815 err_entry->data.err_warn_bitmap_hi,
619c5cb6885b93 Vlad Zolotarov 2011-06-14 816 err_entry->data.err_warn_bitmap_lo);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 817 BNX2FC_TGT_DBG(tgt, "buf_offsets - tx = 0x%x, rx = 0x%x",
619c5cb6885b93 Vlad Zolotarov 2011-06-14 818 err_entry->data.tx_buf_off, err_entry->data.rx_buf_off);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 819
0eb43b4bb081a1 Bhanu Prakash Gollapudi 2013-04-22 820 if (xid > hba->max_xid) {
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 821 BNX2FC_TGT_DBG(tgt, "xid(0x%x) out of FW range\n", xid);
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 822 goto ret_warn_rqe;
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 823 }
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 824
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 825 err_warn_bit_map = (u64)
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 826 ((u64)err_entry->data.err_warn_bitmap_hi << 32) |
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 827 (u64)err_entry->data.err_warn_bitmap_lo;
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 828 for (i = 0; i < BNX2FC_NUM_ERR_BITS; i++) {
d0c0d902339249 Colin Ian King 2019-05-04 829 if (err_warn_bit_map & ((u64)1 << i)) {
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 830 err_warn = i;
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 831 break;
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 832 }
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 833 }
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 834 BNX2FC_TGT_DBG(tgt, "warn = 0x%x\n", err_warn);
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 835
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 836 task_idx = xid / BNX2FC_TASKS_PER_PAGE;
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 837 index = xid % BNX2FC_TASKS_PER_PAGE;
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 838 io_req = (struct bnx2fc_cmd *)hba->cmd_mgr->cmds[xid];
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 839 if (!io_req)
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 840 goto ret_warn_rqe;
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 841
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 842 if (io_req->cmd_type != BNX2FC_SCSI_CMD) {
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 843 printk(KERN_ERR PFX "err_warn: Not a SCSI cmd\n");
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 844 goto ret_warn_rqe;
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 845 }
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 846
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 847 memcpy(&io_req->err_entry, err_entry,
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 848 sizeof(struct fcoe_err_report_entry));
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 849
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 850 if (err_warn == FCOE_ERROR_CODE_REC_TOV_TIMER_EXPIRATION)
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 851 /* REC_TOV is not a warning code */
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 852 BUG_ON(1);
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 853 else
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 854 BNX2FC_TGT_DBG(tgt, "Unsolicited warning\n");
7b594769120b43 Bhanu Prakash Gollapudi 2011-07-27 855 ret_warn_rqe:
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 856 bnx2fc_return_rqe(tgt, 1);
686959736a8543 Nithin Sujir 2011-03-17 857 spin_unlock_bh(&tgt->tgt_lock);
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 858 break;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 859
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 860 default:
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 861 printk(KERN_ERR PFX "Unsol Compl: Invalid CQE Subtype\n");
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 862 break;
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 863 }
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 864 }
853e2bd2103aaa Bhanu Gollapudi 2011-02-04 865

:::::: The code at line 638 was first introduced by commit
:::::: 853e2bd2103aaa91d1ba1c0b57ba17628d836f03 [SCSI] bnx2fc: Broadcom FCoE offload driver

:::::: TO: Bhanu Gollapudi <bprakash@broadcom.com>
:::::: CC: James Bottomley <James.Bottomley@suse.de>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2020-06-15 15:44    [W:0.035 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site