Home | History | Annotate | Download | only in net

Lines Matching full:ipoib

34 #include <gpxe/ipoib.h>
41 /** Number of IPoIB send work queue entries */
44 /** Number of IPoIB receive work queue entries */
47 /** Number of IPoIB completion entries */
50 /** An IPoIB device */
72 /** Broadcast IPoIB address */
89 * IPoIB peer cache
95 * IPoIB peer address
97 * The IPoIB link-layer header is only four bytes long and so does not
98 * have sufficient room to store IPoIB MAC address(es). We therefore
111 /** Number of IPoIB peer cache entries
117 /** IPoIB peer address cache */
120 /** Oldest IPoIB peer cache entry index */
140 DBG ( "IPoIB warning: peer cache lost track of key %x while "
168 DBG ( "IPoIB peer %x evicted from cache\n", peer->key );
173 DBG ( "IPoIB peer %x has MAC %s\n",
180 * IPoIB link layer
186 * Add IPoIB link-layer header
209 /* Build IPoIB header */
218 * Remove IPoIB link-layer header
230 struct ipoib_device *ipoib = netdev->priv;
237 DBG ( "IPoIB packet too short for link-layer header\n" );
242 /* Strip off IPoIB header */
246 * reserved word in IPoIB header
253 *ll_dest = ( dest ? &dest->mac : &ipoib->broadcast );
254 *ll_source = ( source ? &source->mac : &ipoib->broadcast );
261 * Initialise IPoIB link-layer address
275 * Transcribe IPoIB link-layer address
324 /** An IPoIB Ethernet-compatible compressed link-layer address generator */
335 /** IPoIB Ethernet-compatible compressed link-layer address generators */
363 /** IPoIB protocol */
365 .name = "IPoIB",
379 * Allocate IPoIB device
398 * IPoIB network device
404 * Transmit packet via IPoIB network device
412 struct ipoib_device *ipoib = netdev->priv;
413 struct ib_device *ibdev = ipoib->ibdev;
421 DBGC ( ipoib, "IPoIB %p buffer too short\n", ipoib );
448 return ib_post_send ( ibdev, ipoib->qp, &av, iobuf );
452 * Handle IPoIB send completion
462 struct ipoib_device *ipoib = ib_qp_get_ownerdata ( qp );
464 netdev_tx_complete_err ( ipoib->netdev, iobuf, rc );
468 * Handle IPoIB receive completion
480 struct ipoib_device *ipoib = ib_qp_get_ownerdata ( qp );
481 struct net_device *netdev = ipoib->netdev;
493 DBGC ( ipoib, "IPoIB %p received packet too short to "
494 "contain IPoIB header\n", ipoib );
495 DBGC_HD ( ipoib, iobuf->data, iob_len ( iobuf ) );
513 /** IPoIB completion operations */
520 * Poll IPoIB network device
525 struct ipoib_device *ipoib = netdev->priv;
526 struct ib_device *ibdev = ipoib->ibdev;
532 * Enable/disable interrupts on IPoIB network device
555 struct ipoib_device *ipoib = container_of ( membership,
559 netdev_link_err ( ipoib->netdev, rc );
565 * @v ipoib IPoIB device
568 static int ipoib_join_broadcast_group ( struct ipoib_device *ipoib ) {
571 if ( ( rc = ib_mcast_join ( ipoib->ibdev, ipoib->qp,
572 &ipoib->broadcast_membership,
573 &ipoib->broadcast.gid,
575 DBGC ( ipoib, "IPoIB %p could not join broadcast group: %s\n",
576 ipoib, strerror ( rc ) );
579 ipoib->broadcast_joined = 1;
587 * @v ipoib IPoIB device
589 static void ipoib_leave_broadcast_group ( struct ipoib_device *ipoib ) {
591 if ( ipoib->broadcast_joined ) {
592 ib_mcast_leave ( ipoib->ibdev, ipoib->qp,
593 &ipoib->broadcast_membership );
594 ipoib->broadcast_joined = 0;
599 * Open IPoIB network device
605 struct ipoib_device *ipoib = netdev->priv;
606 ipoib->ibdev;
612 DBGC ( ipoib, "IPoIB %p could not open device: %s\n",
613 ipoib, strerror ( rc ) );
618 ipoib->cq = ib_create_cq ( ibdev, IPOIB_NUM_CQES, &ipoib_cq_op );
619 if ( ! ipoib->cq ) {
620 DBGC ( ipoib, "IPoIB %p could not allocate completion queue\n",
621 ipoib );
627 ipoib->qp = ib_create_qp ( ibdev, IB_QPT_UD,
628 IPOIB_NUM_SEND_WQES, ipoib->cq,
629 IPOIB_NUM_RECV_WQES, ipoib->cq );
630 if ( ! ipoib->qp ) {
631 DBGC ( ipoib, "IPoIB %p could not allocate queue pair\n",
632 ipoib );
636 ib_qp_set_ownerdata ( ipoib->qp, ipoib );
639 mac->flags__qpn = htonl ( ipoib->qp->qpn );
642 ib_refill_recv ( ibdev, ipoib->qp );
649 ib_destroy_qp ( ibdev, ipoib->qp );
651 ib_destroy_cq ( ibdev, ipoib->cq );
659 * Close IPoIB network device
664 struct ipoib_device *ipoib = netdev->priv;
665 struct ib_device *ibdev = ipoib->ibdev;
669 ipoib_leave_broadcast_group ( ipoib );
675 ib_destroy_qp ( ibdev, ipoib->qp );
676 ib_destroy_cq ( ibdev, ipoib->cq );
682 /** IPoIB network device operations */
698 struct ipoib_device *ipoib = netdev->priv;
703 ipoib_leave_broadcast_group ( ipoib );
710 ipoib->broadcast.gid.u.words[2] =
719 ( ( rc = ipoib_join_broadcast_group ( ipoib ) ) != 0 ) ) {
720 DBGC ( ipoib, "IPoIB %p could not rejoin broadcast group: "
721 "%s\n", ipoib, strerror ( rc ) );
728 * Probe IPoIB device
735 struct ipoib_device *ipoib;
739 netdev = alloc_ipoibdev ( sizeof ( *ipoib ) );
743 ipoib = netdev->priv;
746 memset ( ipoib, 0, sizeof ( *ipoib ) );
747 ipoib->netdev = netdev;
748 ipoib->ibdev = ibdev;
755 memcpy ( &ipoib->broadcast, &ipoib_broadcast,
756 sizeof ( ipoib->broadcast ) );
757 netdev->ll_broadcast = ( ( uint8_t * ) &ipoib->broadcast );
772 * Remove IPoIB device