Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge patch series "fnic 1.8.0.3 update"

Karan Tilak Kumar <kartilak@cisco.com> says:

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

+127 -89
+2 -2
drivers/scsi/fnic/fdls_disc.c
··· 4613 4613 if (!iport->usefip) { 4614 4614 if (iport->flags & FNIC_FIRST_LINK_UP) { 4615 4615 spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags); 4616 - fnic_scsi_fcpio_reset(iport->fnic); 4616 + fnic_fcpio_reset(iport->fnic); 4617 4617 spin_lock_irqsave(&fnic->fnic_lock, fnic->lock_flags); 4618 4618 4619 4619 iport->flags &= ~FNIC_FIRST_LINK_UP; ··· 5072 5072 iport->fabric.flags = 0; 5073 5073 5074 5074 spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags); 5075 - fnic_scsi_fcpio_reset(iport->fnic); 5075 + fnic_fcpio_reset(iport->fnic); 5076 5076 spin_lock_irqsave(&fnic->fnic_lock, fnic->lock_flags); 5077 5077 list_for_each_entry_safe(tport, next, &iport->tport_list, links) { 5078 5078 FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
+1 -1
drivers/scsi/fnic/fip.c
··· 737 737 if (memcmp(iport->selected_fcf.fcf_mac, zmac, ETH_ALEN) != 0) { 738 738 739 739 if (iport->flags & FNIC_FIRST_LINK_UP) { 740 - fnic_scsi_fcpio_reset(iport->fnic); 740 + fnic_fcpio_reset(iport->fnic); 741 741 iport->flags &= ~FNIC_FIRST_LINK_UP; 742 742 } 743 743
+4 -3
drivers/scsi/fnic/fnic.h
··· 30 30 31 31 #define DRV_NAME "fnic" 32 32 #define DRV_DESCRIPTION "Cisco FCoE HBA Driver" 33 - #define DRV_VERSION "1.8.0.2" 33 + #define DRV_VERSION "1.8.0.3" 34 34 #define PFX DRV_NAME ": " 35 35 #define DFX DRV_NAME "%d: " 36 36 ··· 438 438 struct list_head tx_queue; 439 439 mempool_t *frame_pool; 440 440 mempool_t *frame_elem_pool; 441 + mempool_t *frame_recv_pool; 441 442 struct work_struct tport_work; 442 443 struct list_head tport_event_list; 443 444 ··· 513 512 void fnic_reset(struct Scsi_Host *shost); 514 513 int fnic_issue_fc_host_lip(struct Scsi_Host *shost); 515 514 void fnic_get_host_port_state(struct Scsi_Host *shost); 516 - void fnic_scsi_fcpio_reset(struct fnic *fnic); 517 515 int fnic_wq_copy_cmpl_handler(struct fnic *fnic, int copy_work_to_do, unsigned int cq_index); 518 516 int fnic_wq_cmpl_handler(struct fnic *fnic, int); 519 517 int fnic_flogi_reg_handler(struct fnic *fnic, u32); ··· 541 541 } 542 542 void __fnic_set_state_flags(struct fnic *, unsigned long, unsigned long); 543 543 void fnic_dump_fchost_stats(struct Scsi_Host *, struct fc_host_statistics *); 544 - void fnic_free_txq(struct list_head *head); 544 + void fnic_free_txq(struct fnic *fnic); 545 + void fnic_free_rxq(struct fnic *fnic); 545 546 int fnic_get_desc_by_devid(struct pci_dev *pdev, char **desc, 546 547 char **subsys_desc); 547 548 void fnic_fdls_link_status_change(struct fnic *fnic, int linkup);
+91 -21
drivers/scsi/fnic/fnic_fcs.c
··· 291 291 if (fnic->stop_rx_link_events) { 292 292 list_del(&cur_frame->links); 293 293 spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags); 294 - kfree(cur_frame->fp); 294 + mempool_free(cur_frame->fp, fnic->frame_recv_pool); 295 295 mempool_free(cur_frame, fnic->frame_elem_pool); 296 296 return; 297 297 } ··· 317 317 fnic_fdls_recv_frame(&fnic->iport, cur_frame->fp, 318 318 cur_frame->frame_len, fchdr_offset); 319 319 320 - kfree(cur_frame->fp); 320 + mempool_free(cur_frame->fp, fnic->frame_recv_pool); 321 321 mempool_free(cur_frame, fnic->frame_elem_pool); 322 322 } 323 323 spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags); ··· 337 337 if (fnic->stop_rx_link_events) { 338 338 list_del(&cur_frame->links); 339 339 spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags); 340 - kfree(cur_frame->fp); 341 - kfree(cur_frame); 340 + mempool_free(cur_frame->fp, fnic->frame_recv_pool); 341 + mempool_free(cur_frame, fnic->frame_elem_pool); 342 342 return; 343 343 } 344 344 ··· 355 355 list_del(&cur_frame->links); 356 356 357 357 if (fdls_fip_recv_frame(fnic, cur_frame->fp)) { 358 - kfree(cur_frame->fp); 359 - kfree(cur_frame); 358 + mempool_free(cur_frame->fp, fnic->frame_recv_pool); 359 + mempool_free(cur_frame, fnic->frame_elem_pool); 360 360 } 361 361 } 362 362 spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags); ··· 375 375 376 376 eh = (struct ethhdr *) fp; 377 377 if ((eh->h_proto == cpu_to_be16(ETH_P_FIP)) && (fnic->iport.usefip)) { 378 - fip_fr_elem = (struct fnic_frame_list *) 379 - kzalloc_obj(struct fnic_frame_list, GFP_ATOMIC); 378 + fip_fr_elem = mempool_alloc(fnic->frame_elem_pool, GFP_ATOMIC); 380 379 if (!fip_fr_elem) 381 380 return 0; 381 + memset(fip_fr_elem, 0, sizeof(struct fnic_frame_list)); 382 382 fip_fr_elem->fp = fp; 383 383 spin_lock_irqsave(&fnic->fnic_lock, flags); 384 384 list_add_tail(&fip_fr_elem->links, &fnic->fip_frame_queue); ··· 519 519 520 520 spin_unlock_irqrestore(&fnic->fnic_lock, flags); 521 521 522 - frame_elem = mempool_alloc(fnic->frame_elem_pool, 523 - GFP_ATOMIC | __GFP_ZERO); 522 + frame_elem = mempool_alloc(fnic->frame_elem_pool, GFP_ATOMIC); 524 523 if (!frame_elem) { 525 524 FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 526 525 "Failed to allocate memory for frame elem"); 527 526 goto drop; 528 527 } 528 + memset(frame_elem, 0, sizeof(struct fnic_frame_list)); 529 529 frame_elem->fp = fp; 530 530 frame_elem->rx_ethhdr_stripped = ethhdr_stripped; 531 531 frame_elem->frame_len = bytes_written; ··· 538 538 return; 539 539 540 540 drop: 541 - kfree(fp); 541 + mempool_free(fp, fnic->frame_recv_pool); 542 542 } 543 543 544 544 static int fnic_rq_cmpl_handler_cont(struct vnic_dev *vdev, ··· 591 591 int ret; 592 592 593 593 len = FNIC_FRAME_HT_ROOM; 594 - buf = kmalloc(len, GFP_ATOMIC); 594 + buf = mempool_alloc(fnic->frame_recv_pool, GFP_ATOMIC); 595 595 if (!buf) { 596 596 FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 597 597 "Unable to allocate RQ buffer of size: %d\n", len); ··· 609 609 fnic_queue_rq_desc(rq, buf, pa, len); 610 610 return 0; 611 611 free_buf: 612 - kfree(buf); 612 + mempool_free(buf, fnic->frame_recv_pool); 613 613 return ret; 614 614 } 615 615 ··· 621 621 dma_unmap_single(&fnic->pdev->dev, buf->dma_addr, buf->len, 622 622 DMA_FROM_DEVICE); 623 623 624 - kfree(rq_buf); 624 + mempool_free(rq_buf, fnic->frame_recv_pool); 625 625 buf->os_buf = NULL; 626 626 } 627 627 ··· 704 704 */ 705 705 if ((fnic->state != FNIC_IN_FC_MODE) 706 706 && (fnic->state != FNIC_IN_ETH_MODE)) { 707 - frame_elem = mempool_alloc(fnic->frame_elem_pool, 708 - GFP_ATOMIC | __GFP_ZERO); 707 + frame_elem = mempool_alloc(fnic->frame_elem_pool, GFP_ATOMIC); 709 708 if (!frame_elem) { 710 709 FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 711 710 "Failed to allocate memory for frame elem"); 712 711 return -ENOMEM; 713 712 } 713 + memset(frame_elem, 0, sizeof(struct fnic_frame_list)); 714 714 715 715 FNIC_FCS_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num, 716 716 "Queueing FC frame: sid/did/type/oxid = 0x%x/0x%x/0x%x/0x%x\n", ··· 836 836 return 0; 837 837 } 838 838 839 - void fnic_free_txq(struct list_head *head) 839 + void fnic_free_txq(struct fnic *fnic) 840 840 { 841 841 struct fnic_frame_list *cur_frame, *next; 842 842 843 - list_for_each_entry_safe(cur_frame, next, head, links) { 843 + list_for_each_entry_safe(cur_frame, next, &fnic->tx_queue, links) { 844 844 list_del(&cur_frame->links); 845 - kfree(cur_frame->fp); 846 - kfree(cur_frame); 845 + mempool_free(cur_frame->fp, fnic->frame_pool); 846 + mempool_free(cur_frame, fnic->frame_elem_pool); 847 + } 848 + } 849 + 850 + void fnic_free_rxq(struct fnic *fnic) 851 + { 852 + struct fnic_frame_list *cur_frame, *next; 853 + 854 + list_for_each_entry_safe(cur_frame, next, &fnic->frame_queue, links) { 855 + list_del(&cur_frame->links); 856 + mempool_free(cur_frame->fp, fnic->frame_recv_pool); 857 + mempool_free(cur_frame, fnic->frame_elem_pool); 858 + } 859 + 860 + if (fnic->config.flags & VFCF_FIP_CAPABLE) { 861 + list_for_each_entry_safe(cur_frame, next, 862 + &fnic->fip_frame_queue, links) { 863 + list_del(&cur_frame->links); 864 + mempool_free(cur_frame->fp, fnic->frame_recv_pool); 865 + mempool_free(cur_frame, fnic->frame_elem_pool); 866 + } 847 867 } 848 868 } 849 869 ··· 918 898 dma_unmap_single(&fnic->pdev->dev, buf->dma_addr, buf->len, 919 899 DMA_TO_DEVICE); 920 900 921 - kfree(buf->os_buf); 901 + mempool_free(buf->os_buf, fnic->frame_pool); 922 902 buf->os_buf = NULL; 923 903 } 924 904 ··· 1127 1107 } 1128 1108 spin_unlock_irqrestore(&reset_fnic_list_lock, 1129 1109 reset_fnic_list_lock_flags); 1110 + } 1111 + 1112 + void fnic_fcpio_reset(struct fnic *fnic) 1113 + { 1114 + unsigned long flags; 1115 + enum fnic_state old_state; 1116 + struct fnic_iport_s *iport = &fnic->iport; 1117 + DECLARE_COMPLETION_ONSTACK(fw_reset_done); 1118 + int time_remain; 1119 + 1120 + /* issue fw reset */ 1121 + spin_lock_irqsave(&fnic->fnic_lock, flags); 1122 + if (unlikely(fnic->state == FNIC_IN_FC_TRANS_ETH_MODE)) { 1123 + /* fw reset is in progress, poll for its completion */ 1124 + spin_unlock_irqrestore(&fnic->fnic_lock, flags); 1125 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 1126 + "fnic is in unexpected state: %d for fw_reset\n", 1127 + fnic->state); 1128 + return; 1129 + } 1130 + 1131 + old_state = fnic->state; 1132 + fnic->state = FNIC_IN_FC_TRANS_ETH_MODE; 1133 + 1134 + fnic_update_mac_locked(fnic, iport->hwmac); 1135 + fnic->fw_reset_done = &fw_reset_done; 1136 + spin_unlock_irqrestore(&fnic->fnic_lock, flags); 1137 + 1138 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 1139 + "Issuing fw reset\n"); 1140 + if (fnic_fw_reset_handler(fnic)) { 1141 + spin_lock_irqsave(&fnic->fnic_lock, flags); 1142 + if (fnic->state == FNIC_IN_FC_TRANS_ETH_MODE) 1143 + fnic->state = old_state; 1144 + spin_unlock_irqrestore(&fnic->fnic_lock, flags); 1145 + } else { 1146 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 1147 + "Waiting for fw completion\n"); 1148 + time_remain = wait_for_completion_timeout(&fw_reset_done, 1149 + msecs_to_jiffies(FNIC_FW_RESET_TIMEOUT)); 1150 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 1151 + "Woken up after fw completion timeout\n"); 1152 + if (time_remain == 0) { 1153 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 1154 + "FW reset completion timed out after %d ms\n", 1155 + FNIC_FW_RESET_TIMEOUT); 1156 + } 1157 + atomic64_inc(&fnic->fnic_stats.reset_stats.fw_reset_timeouts); 1158 + } 1159 + fnic->fw_reset_done = NULL; 1130 1160 }
+1 -1
drivers/scsi/fnic/fnic_fdls.h
··· 410 410 void fnic_fdls_remove_tport(struct fnic_iport_s *iport, 411 411 struct fnic_tport_s *tport, 412 412 unsigned long flags); 413 + void fnic_fcpio_reset(struct fnic *fnic); 413 414 414 415 /* fip.c */ 415 416 void fnic_fcoe_send_vlan_req(struct fnic *fnic); ··· 423 422 extern void fdls_fabric_timer_callback(struct timer_list *t); 424 423 425 424 /* fnic_scsi.c */ 426 - void fnic_scsi_fcpio_reset(struct fnic *fnic); 427 425 extern void fdls_fabric_timer_callback(struct timer_list *t); 428 426 void fnic_rport_exch_reset(struct fnic *fnic, u32 fcid); 429 427 int fnic_fdls_register_portid(struct fnic_iport_s *iport, u32 port_id,
+25 -3
drivers/scsi/fnic/fnic_main.c
··· 40 40 static struct kmem_cache *fnic_io_req_cache; 41 41 static struct kmem_cache *fdls_frame_cache; 42 42 static struct kmem_cache *fdls_frame_elem_cache; 43 + static struct kmem_cache *fdls_frame_recv_cache; 43 44 static LIST_HEAD(fnic_list); 44 45 static DEFINE_SPINLOCK(fnic_list_lock); 45 46 static DEFINE_IDA(fnic_ida); ··· 555 554 mempool_destroy(fnic->io_req_pool); 556 555 mempool_destroy(fnic->frame_pool); 557 556 mempool_destroy(fnic->frame_elem_pool); 557 + mempool_destroy(fnic->frame_recv_pool); 558 558 for (i = 0; i < FNIC_SGL_NUM_CACHES; i++) 559 559 mempool_destroy(fnic->io_sgl_pool[i]); 560 560 ··· 930 928 } 931 929 fnic->frame_elem_pool = pool; 932 930 931 + pool = mempool_create_slab_pool(FDLS_MIN_FRAMES, 932 + fdls_frame_recv_cache); 933 + if (!pool) { 934 + err = -ENOMEM; 935 + goto err_out_fdls_frame_recv_pool; 936 + } 937 + fnic->frame_recv_pool = pool; 938 + 933 939 /* setup vlan config, hw inserts vlan header */ 934 940 fnic->vlan_hw_insert = 1; 935 941 fnic->vlan_id = 0; ··· 1095 1085 } 1096 1086 vnic_dev_notify_unset(fnic->vdev); 1097 1087 err_out_fnic_notify_set: 1088 + mempool_destroy(fnic->frame_recv_pool); 1089 + err_out_fdls_frame_recv_pool: 1098 1090 mempool_destroy(fnic->frame_elem_pool); 1099 1091 err_out_fdls_frame_elem_pool: 1100 1092 mempool_destroy(fnic->frame_pool); ··· 1169 1157 timer_delete_sync(&fnic->enode_ka_timer); 1170 1158 timer_delete_sync(&fnic->vn_ka_timer); 1171 1159 1172 - fnic_free_txq(&fnic->fip_frame_queue); 1173 1160 fnic_fcoe_reset_vlans(fnic); 1174 1161 } 1175 1162 ··· 1188 1177 list_del(&fnic->list); 1189 1178 spin_unlock_irqrestore(&fnic_list_lock, flags); 1190 1179 1191 - fnic_free_txq(&fnic->frame_queue); 1192 - fnic_free_txq(&fnic->tx_queue); 1180 + fnic_free_rxq(fnic); 1181 + fnic_free_txq(fnic); 1193 1182 1194 1183 vnic_dev_notify_unset(fnic->vdev); 1195 1184 fnic_free_intr(fnic); ··· 1298 1287 goto err_create_fdls_frame_cache_elem; 1299 1288 } 1300 1289 1290 + fdls_frame_recv_cache = kmem_cache_create("fdls_frame_recv", 1291 + FNIC_FRAME_HT_ROOM, 1292 + 0, SLAB_HWCACHE_ALIGN, NULL); 1293 + if (!fdls_frame_recv_cache) { 1294 + pr_err("fnic fdls frame recv cach create failed\n"); 1295 + err = -ENOMEM; 1296 + goto err_create_fdls_frame_recv_cache; 1297 + } 1298 + 1301 1299 fnic_event_queue = 1302 1300 alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, "fnic_event_wq"); 1303 1301 if (!fnic_event_queue) { ··· 1359 1339 if (pc_rscn_handling_feature_flag == PC_RSCN_HANDLING_FEATURE_ON) 1360 1340 destroy_workqueue(reset_fnic_work_queue); 1361 1341 err_create_reset_fnic_workq: 1342 + kmem_cache_destroy(fdls_frame_recv_cache); 1343 + err_create_fdls_frame_recv_cache: 1362 1344 destroy_workqueue(fnic_event_queue); 1363 1345 err_create_fnic_workq: 1364 1346 kmem_cache_destroy(fdls_frame_elem_cache);
+3 -58
drivers/scsi/fnic/fnic_scsi.c
··· 777 777 */ 778 778 if (ret) { 779 779 spin_unlock_irqrestore(&fnic->fnic_lock, flags); 780 - fnic_free_txq(&fnic->tx_queue); 780 + fnic_free_txq(fnic); 781 781 goto reset_cmpl_handler_end; 782 782 } 783 783 ··· 1972 1972 */ 1973 1973 spin_lock_irqsave(&fnic->fnic_lock, flags); 1974 1974 fnic->iport.state = FNIC_IPORT_STATE_LINK_WAIT; 1975 - spin_unlock_irqrestore(&fnic->fnic_lock, flags); 1976 - 1977 - if (fdls_get_state(&fnic->iport.fabric) != FDLS_STATE_INIT) 1978 - fnic_scsi_fcpio_reset(fnic); 1979 - 1980 - spin_lock_irqsave(&fnic->fnic_lock, flags); 1981 1975 fnic->in_remove = 1; 1982 1976 spin_unlock_irqrestore(&fnic->fnic_lock, flags); 1977 + 1978 + fnic_fcpio_reset(fnic); 1983 1979 1984 1980 fnic_flush_tport_event_list(fnic); 1985 1981 fnic_delete_fcp_tports(fnic); ··· 3035 3039 3036 3040 ret = fnic_host_reset(shost); 3037 3041 return ret; 3038 - } 3039 - 3040 - 3041 - void fnic_scsi_fcpio_reset(struct fnic *fnic) 3042 - { 3043 - unsigned long flags; 3044 - enum fnic_state old_state; 3045 - struct fnic_iport_s *iport = &fnic->iport; 3046 - DECLARE_COMPLETION_ONSTACK(fw_reset_done); 3047 - int time_remain; 3048 - 3049 - /* issue fw reset */ 3050 - spin_lock_irqsave(&fnic->fnic_lock, flags); 3051 - if (unlikely(fnic->state == FNIC_IN_FC_TRANS_ETH_MODE)) { 3052 - /* fw reset is in progress, poll for its completion */ 3053 - spin_unlock_irqrestore(&fnic->fnic_lock, flags); 3054 - FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 3055 - "fnic is in unexpected state: %d for fw_reset\n", 3056 - fnic->state); 3057 - return; 3058 - } 3059 - 3060 - old_state = fnic->state; 3061 - fnic->state = FNIC_IN_FC_TRANS_ETH_MODE; 3062 - 3063 - fnic_update_mac_locked(fnic, iport->hwmac); 3064 - fnic->fw_reset_done = &fw_reset_done; 3065 - spin_unlock_irqrestore(&fnic->fnic_lock, flags); 3066 - 3067 - FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 3068 - "Issuing fw reset\n"); 3069 - if (fnic_fw_reset_handler(fnic)) { 3070 - spin_lock_irqsave(&fnic->fnic_lock, flags); 3071 - if (fnic->state == FNIC_IN_FC_TRANS_ETH_MODE) 3072 - fnic->state = old_state; 3073 - spin_unlock_irqrestore(&fnic->fnic_lock, flags); 3074 - } else { 3075 - FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 3076 - "Waiting for fw completion\n"); 3077 - time_remain = wait_for_completion_timeout(&fw_reset_done, 3078 - msecs_to_jiffies(FNIC_FW_RESET_TIMEOUT)); 3079 - FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 3080 - "Woken up after fw completion timeout\n"); 3081 - if (time_remain == 0) { 3082 - FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 3083 - "FW reset completion timed out after %d ms)\n", 3084 - FNIC_FW_RESET_TIMEOUT); 3085 - } 3086 - atomic64_inc(&fnic->fnic_stats.reset_stats.fw_reset_timeouts); 3087 - } 3088 - fnic->fw_reset_done = NULL; 3089 3042 }