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 tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma

Pull rdma fixes from Jason Gunthorpe:
"Nothing special here, though Bob's regression fixes for rxe would have
made it before the rc cycle had there not been such strong winter
weather!

- Fix corner cases in the rxe reference counting cleanup that are
causing regressions in blktests for SRP

- Two kdoc fixes so W=1 is clean

- Missing error return in error unwind for mlx5

- Wrong lock type nesting in IB CM"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
RDMA/rxe: Fix errant WARN_ONCE in rxe_completer()
RDMA/rxe: Fix extra deref in rxe_rcv_mcast_pkt()
RDMA/rxe: Fix missed IB reference counting in loopback
RDMA/uverbs: Fix kernel-doc warning of _uverbs_alloc
RDMA/mlx5: Set correct kernel-doc identifier
IB/mlx5: Add missing error code
RDMA/rxe: Fix missing kconfig dependency on CRYPTO
RDMA/cm: Fix IRQ restore in ib_send_cm_sidr_rep

+76 -62
+3 -2
drivers/infiniband/core/cm.c
··· 3651 struct ib_cm_sidr_rep_param *param) 3652 { 3653 struct ib_mad_send_buf *msg; 3654 int ret; 3655 3656 lockdep_assert_held(&cm_id_priv->lock); ··· 3677 return ret; 3678 } 3679 cm_id_priv->id.state = IB_CM_IDLE; 3680 - spin_lock_irq(&cm.lock); 3681 if (!RB_EMPTY_NODE(&cm_id_priv->sidr_id_node)) { 3682 rb_erase(&cm_id_priv->sidr_id_node, &cm.remote_sidr_table); 3683 RB_CLEAR_NODE(&cm_id_priv->sidr_id_node); 3684 } 3685 - spin_unlock_irq(&cm.lock); 3686 return 0; 3687 } 3688
··· 3651 struct ib_cm_sidr_rep_param *param) 3652 { 3653 struct ib_mad_send_buf *msg; 3654 + unsigned long flags; 3655 int ret; 3656 3657 lockdep_assert_held(&cm_id_priv->lock); ··· 3676 return ret; 3677 } 3678 cm_id_priv->id.state = IB_CM_IDLE; 3679 + spin_lock_irqsave(&cm.lock, flags); 3680 if (!RB_EMPTY_NODE(&cm_id_priv->sidr_id_node)) { 3681 rb_erase(&cm_id_priv->sidr_id_node, &cm.remote_sidr_table); 3682 RB_CLEAR_NODE(&cm_id_priv->sidr_id_node); 3683 } 3684 + spin_unlock_irqrestore(&cm.lock, flags); 3685 return 0; 3686 } 3687
+1 -1
drivers/infiniband/core/uverbs_ioctl.c
··· 91 } 92 93 /** 94 - * uverbs_alloc() - Quickly allocate memory for use with a bundle 95 * @bundle: The bundle 96 * @size: Number of bytes to allocate 97 * @flags: Allocator flags
··· 91 } 92 93 /** 94 + * _uverbs_alloc() - Quickly allocate memory for use with a bundle 95 * @bundle: The bundle 96 * @size: Number of bytes to allocate 97 * @flags: Allocator flags
+3 -1
drivers/infiniband/hw/mlx5/devx.c
··· 2073 2074 num_alloc_xa_entries++; 2075 event_sub = kzalloc(sizeof(*event_sub), GFP_KERNEL); 2076 - if (!event_sub) 2077 goto err; 2078 2079 list_add_tail(&event_sub->event_list, &sub_list); 2080 uverbs_uobject_get(&ev_file->uobj);
··· 2073 2074 num_alloc_xa_entries++; 2075 event_sub = kzalloc(sizeof(*event_sub), GFP_KERNEL); 2076 + if (!event_sub) { 2077 + err = -ENOMEM; 2078 goto err; 2079 + } 2080 2081 list_add_tail(&event_sub->event_list, &sub_list); 2082 uverbs_uobject_get(&ev_file->uobj);
+1 -1
drivers/infiniband/hw/mlx5/odp.c
··· 1082 return ret ? ret : npages; 1083 } 1084 1085 - /** 1086 * Parse a series of data segments for page fault handling. 1087 * 1088 * @dev: Pointer to mlx5 IB device
··· 1082 return ret ? ret : npages; 1083 } 1084 1085 + /* 1086 * Parse a series of data segments for page fault handling. 1087 * 1088 * @dev: Pointer to mlx5 IB device
+1
drivers/infiniband/sw/rxe/Kconfig
··· 4 depends on INET && PCI && INFINIBAND 5 depends on INFINIBAND_VIRT_DMA 6 select NET_UDP_TUNNEL 7 select CRYPTO_CRC32 8 help 9 This driver implements the InfiniBand RDMA transport over
··· 4 depends on INET && PCI && INFINIBAND 5 depends on INFINIBAND_VIRT_DMA 6 select NET_UDP_TUNNEL 7 + select CRYPTO 8 select CRYPTO_CRC32 9 help 10 This driver implements the InfiniBand RDMA transport over
+23 -32
drivers/infiniband/sw/rxe/rxe_comp.c
··· 547 struct sk_buff *skb = NULL; 548 struct rxe_pkt_info *pkt = NULL; 549 enum comp_state state; 550 551 rxe_add_ref(qp); 552 ··· 555 qp->req.state == QP_STATE_RESET) { 556 rxe_drain_resp_pkts(qp, qp->valid && 557 qp->req.state == QP_STATE_ERROR); 558 - goto exit; 559 } 560 561 if (qp->comp.timeout) { ··· 566 qp->comp.timeout_retry = 0; 567 } 568 569 - if (qp->req.need_retry) 570 - goto exit; 571 572 state = COMPST_GET_ACK; 573 ··· 640 break; 641 642 case COMPST_DONE: 643 - if (pkt) 644 - free_pkt(pkt); 645 goto done; 646 647 case COMPST_EXIT: ··· 662 qp->qp_timeout_jiffies) 663 mod_timer(&qp->retrans_timer, 664 jiffies + qp->qp_timeout_jiffies); 665 - goto exit; 666 667 case COMPST_ERROR_RETRY: 668 /* we come here if the retry timer fired and we did ··· 675 */ 676 677 /* there is nothing to retry in this case */ 678 - if (!wqe || (wqe->state == wqe_state_posted)) 679 - goto exit; 680 681 /* if we've started a retry, don't start another 682 * retry sequence, unless this is a timeout. 683 */ 684 if (qp->comp.started_retry && 685 - !qp->comp.timeout_retry) { 686 - if (pkt) 687 - free_pkt(pkt); 688 goto done; 689 - } 690 691 if (qp->comp.retry_cnt > 0) { 692 if (qp->comp.retry_cnt != 7) ··· 707 qp->comp.started_retry = 1; 708 rxe_run_task(&qp->req.task, 0); 709 } 710 - if (pkt) 711 - free_pkt(pkt); 712 goto done; 713 714 } else { ··· 727 mod_timer(&qp->rnr_nak_timer, 728 jiffies + rnrnak_jiffies(aeth_syn(pkt) 729 & ~AETH_TYPE_MASK)); 730 - free_pkt(pkt); 731 - goto exit; 732 } else { 733 rxe_counter_inc(rxe, 734 RXE_CNT_RNR_RETRY_EXCEEDED); ··· 741 WARN_ON_ONCE(wqe->status == IB_WC_SUCCESS); 742 do_complete(qp, wqe); 743 rxe_qp_error(qp); 744 - if (pkt) 745 - free_pkt(pkt); 746 - goto exit; 747 } 748 } 749 750 - exit: 751 - /* we come here if we are done with processing and want the task to 752 - * exit from the loop calling us 753 - */ 754 - WARN_ON_ONCE(skb); 755 - rxe_drop_ref(qp); 756 - return -EAGAIN; 757 - 758 done: 759 - /* we come here if we have processed a packet we want the task to call 760 - * us again to see if there is anything else to do 761 - */ 762 - WARN_ON_ONCE(skb); 763 rxe_drop_ref(qp); 764 - return 0; 765 }
··· 547 struct sk_buff *skb = NULL; 548 struct rxe_pkt_info *pkt = NULL; 549 enum comp_state state; 550 + int ret = 0; 551 552 rxe_add_ref(qp); 553 ··· 554 qp->req.state == QP_STATE_RESET) { 555 rxe_drain_resp_pkts(qp, qp->valid && 556 qp->req.state == QP_STATE_ERROR); 557 + ret = -EAGAIN; 558 + goto done; 559 } 560 561 if (qp->comp.timeout) { ··· 564 qp->comp.timeout_retry = 0; 565 } 566 567 + if (qp->req.need_retry) { 568 + ret = -EAGAIN; 569 + goto done; 570 + } 571 572 state = COMPST_GET_ACK; 573 ··· 636 break; 637 638 case COMPST_DONE: 639 goto done; 640 641 case COMPST_EXIT: ··· 660 qp->qp_timeout_jiffies) 661 mod_timer(&qp->retrans_timer, 662 jiffies + qp->qp_timeout_jiffies); 663 + ret = -EAGAIN; 664 + goto done; 665 666 case COMPST_ERROR_RETRY: 667 /* we come here if the retry timer fired and we did ··· 672 */ 673 674 /* there is nothing to retry in this case */ 675 + if (!wqe || (wqe->state == wqe_state_posted)) { 676 + pr_warn("Retry attempted without a valid wqe\n"); 677 + ret = -EAGAIN; 678 + goto done; 679 + } 680 681 /* if we've started a retry, don't start another 682 * retry sequence, unless this is a timeout. 683 */ 684 if (qp->comp.started_retry && 685 + !qp->comp.timeout_retry) 686 goto done; 687 688 if (qp->comp.retry_cnt > 0) { 689 if (qp->comp.retry_cnt != 7) ··· 704 qp->comp.started_retry = 1; 705 rxe_run_task(&qp->req.task, 0); 706 } 707 goto done; 708 709 } else { ··· 726 mod_timer(&qp->rnr_nak_timer, 727 jiffies + rnrnak_jiffies(aeth_syn(pkt) 728 & ~AETH_TYPE_MASK)); 729 + ret = -EAGAIN; 730 + goto done; 731 } else { 732 rxe_counter_inc(rxe, 733 RXE_CNT_RNR_RETRY_EXCEEDED); ··· 740 WARN_ON_ONCE(wqe->status == IB_WC_SUCCESS); 741 do_complete(qp, wqe); 742 rxe_qp_error(qp); 743 + ret = -EAGAIN; 744 + goto done; 745 } 746 } 747 748 done: 749 + if (pkt) 750 + free_pkt(pkt); 751 rxe_drop_ref(qp); 752 + 753 + return ret; 754 }
+9 -1
drivers/infiniband/sw/rxe/rxe_net.c
··· 407 return 0; 408 } 409 410 void rxe_loopback(struct sk_buff *skb) 411 { 412 if (skb->protocol == htons(ETH_P_IP)) 413 skb_pull(skb, sizeof(struct iphdr)); 414 else 415 skb_pull(skb, sizeof(struct ipv6hdr)); 416 417 - rxe_rcv(skb); 418 } 419 420 struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
··· 407 return 0; 408 } 409 410 + /* fix up a send packet to match the packets 411 + * received from UDP before looping them back 412 + */ 413 void rxe_loopback(struct sk_buff *skb) 414 { 415 + struct rxe_pkt_info *pkt = SKB_TO_PKT(skb); 416 + 417 if (skb->protocol == htons(ETH_P_IP)) 418 skb_pull(skb, sizeof(struct iphdr)); 419 else 420 skb_pull(skb, sizeof(struct ipv6hdr)); 421 422 + if (WARN_ON(!ib_device_try_get(&pkt->rxe->ib_dev))) 423 + kfree_skb(skb); 424 + else 425 + rxe_rcv(skb); 426 } 427 428 struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
+35 -24
drivers/infiniband/sw/rxe/rxe_recv.c
··· 237 struct rxe_mc_elem *mce; 238 struct rxe_qp *qp; 239 union ib_gid dgid; 240 - struct sk_buff *per_qp_skb; 241 - struct rxe_pkt_info *per_qp_pkt; 242 int err; 243 244 if (skb->protocol == htons(ETH_P_IP)) ··· 248 /* lookup mcast group corresponding to mgid, takes a ref */ 249 mcg = rxe_pool_get_key(&rxe->mc_grp_pool, &dgid); 250 if (!mcg) 251 - goto err1; /* mcast group not registered */ 252 253 spin_lock_bh(&mcg->mcg_lock); 254 255 list_for_each_entry(mce, &mcg->qp_list, qp_list) { 256 qp = mce->qp; 257 ··· 269 if (err) 270 continue; 271 272 - /* for all but the last qp create a new clone of the 273 - * skb and pass to the qp. If an error occurs in the 274 - * checks for the last qp in the list we need to 275 - * free the skb since it hasn't been passed on to 276 - * rxe_rcv_pkt() which would free it later. 277 */ 278 if (mce->qp_list.next != &mcg->qp_list) { 279 - per_qp_skb = skb_clone(skb, GFP_ATOMIC); 280 - if (WARN_ON(!ib_device_try_get(&rxe->ib_dev))) { 281 - kfree_skb(per_qp_skb); 282 continue; 283 } 284 } else { 285 - per_qp_skb = skb; 286 - /* show we have consumed the skb */ 287 - skb = NULL; 288 } 289 - 290 - if (unlikely(!per_qp_skb)) 291 - continue; 292 - 293 - per_qp_pkt = SKB_TO_PKT(per_qp_skb); 294 - per_qp_pkt->qp = qp; 295 - rxe_add_ref(qp); 296 - rxe_rcv_pkt(per_qp_pkt, per_qp_skb); 297 } 298 299 spin_unlock_bh(&mcg->mcg_lock); 300 301 rxe_drop_ref(mcg); /* drop ref from rxe_pool_get_key. */ 302 303 - err1: 304 - /* free skb if not consumed */ 305 kfree_skb(skb); 306 ib_device_put(&rxe->ib_dev); 307 }
··· 237 struct rxe_mc_elem *mce; 238 struct rxe_qp *qp; 239 union ib_gid dgid; 240 int err; 241 242 if (skb->protocol == htons(ETH_P_IP)) ··· 250 /* lookup mcast group corresponding to mgid, takes a ref */ 251 mcg = rxe_pool_get_key(&rxe->mc_grp_pool, &dgid); 252 if (!mcg) 253 + goto drop; /* mcast group not registered */ 254 255 spin_lock_bh(&mcg->mcg_lock); 256 257 + /* this is unreliable datagram service so we let 258 + * failures to deliver a multicast packet to a 259 + * single QP happen and just move on and try 260 + * the rest of them on the list 261 + */ 262 list_for_each_entry(mce, &mcg->qp_list, qp_list) { 263 qp = mce->qp; 264 ··· 266 if (err) 267 continue; 268 269 + /* for all but the last QP create a new clone of the 270 + * skb and pass to the QP. Pass the original skb to 271 + * the last QP in the list. 272 */ 273 if (mce->qp_list.next != &mcg->qp_list) { 274 + struct sk_buff *cskb; 275 + struct rxe_pkt_info *cpkt; 276 + 277 + cskb = skb_clone(skb, GFP_ATOMIC); 278 + if (unlikely(!cskb)) 279 continue; 280 + 281 + if (WARN_ON(!ib_device_try_get(&rxe->ib_dev))) { 282 + kfree_skb(cskb); 283 + break; 284 } 285 + 286 + cpkt = SKB_TO_PKT(cskb); 287 + cpkt->qp = qp; 288 + rxe_add_ref(qp); 289 + rxe_rcv_pkt(cpkt, cskb); 290 } else { 291 + pkt->qp = qp; 292 + rxe_add_ref(qp); 293 + rxe_rcv_pkt(pkt, skb); 294 + skb = NULL; /* mark consumed */ 295 } 296 } 297 298 spin_unlock_bh(&mcg->mcg_lock); 299 300 rxe_drop_ref(mcg); /* drop ref from rxe_pool_get_key. */ 301 302 + if (likely(!skb)) 303 + return; 304 + 305 + /* This only occurs if one of the checks fails on the last 306 + * QP in the list above 307 + */ 308 + 309 + drop: 310 kfree_skb(skb); 311 ib_device_put(&rxe->ib_dev); 312 }