Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_infiniband.c
Show First 20 Lines • Show All 247 Lines • ▼ Show 20 Lines | if ((m->m_flags & (M_BCAST | M_MCAST)) == 0) { | ||||
ih->ib_protocol = htons(ETHERTYPE_IP); | ih->ib_protocol = htons(ETHERTYPE_IP); | ||||
ih->ib_reserved = 0; | ih->ib_reserved = 0; | ||||
} | } | ||||
break; | break; | ||||
#endif | #endif | ||||
#ifdef INET6 | #ifdef INET6 | ||||
case AF_INET6: | case AF_INET6: | ||||
if ((m->m_flags & M_MCAST) == 0) { | if ((m->m_flags & M_MCAST) == 0) { | ||||
error = nd6_resolve(ifp, LLE_SF(AF_INET6, 0), m, dst, | int af = RO_GET_FAMILY(ro, dst); | ||||
phdr, &lleflags, plle); | error = nd6_resolve(ifp, LLE_SF(af, 0), m, dst, phdr, | ||||
&lleflags, plle); | |||||
} else { | } else { | ||||
infiniband_ipv6_multicast_map( | infiniband_ipv6_multicast_map( | ||||
&((const struct sockaddr_in6 *)dst)->sin6_addr, | &((const struct sockaddr_in6 *)dst)->sin6_addr, | ||||
ifp->if_broadcastaddr, ih->ib_hwaddr); | ifp->if_broadcastaddr, ih->ib_hwaddr); | ||||
ih->ib_protocol = htons(ETHERTYPE_IPV6); | ih->ib_protocol = htons(ETHERTYPE_IPV6); | ||||
ih->ib_reserved = 0; | ih->ib_reserved = 0; | ||||
} | } | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | error = infiniband_resolve_addr(ifp, m, dst, ro, phdr, &pflags, | ||||
addref ? &lle : NULL); | addref ? &lle : NULL); | ||||
if (addref && lle != NULL) | if (addref && lle != NULL) | ||||
ro->ro_lle = lle; | ro->ro_lle = lle; | ||||
if (error != 0) | if (error != 0) | ||||
return (error == EWOULDBLOCK ? 0 : error); | return (error == EWOULDBLOCK ? 0 : error); | ||||
} | } | ||||
if ((pflags & RT_L2_ME) != 0) { | if ((pflags & RT_L2_ME) != 0) { | ||||
update_mbuf_csumflags(m, m); | update_mbuf_csumflags(m, m); | ||||
hselasky: Maybe move the "int af = ..." down here, if this is the only place it is used. | |||||
return (if_simloop(ifp, m, dst->sa_family, 0)); | return (if_simloop(ifp, m, RO_GET_FAMILY(ro, dst), 0)); | ||||
} | } | ||||
/* | /* | ||||
* Add local infiniband header. If no space in first mbuf, | * Add local infiniband header. If no space in first mbuf, | ||||
* allocate another. | * allocate another. | ||||
*/ | */ | ||||
M_PREPEND(m, INFINIBAND_HDR_LEN, M_NOWAIT); | M_PREPEND(m, INFINIBAND_HDR_LEN, M_NOWAIT); | ||||
if (m == NULL) { | if (m == NULL) { | ||||
error = ENOBUFS; | error = ENOBUFS; | ||||
goto bad; | goto bad; | ||||
} | } | ||||
if ((pflags & RT_HAS_HEADER) == 0) { | if ((pflags & RT_HAS_HEADER) == 0) { | ||||
ih = mtod(m, struct infiniband_header *); | ih = mtod(m, struct infiniband_header *); | ||||
memcpy(ih, phdr, hlen); | memcpy(ih, phdr, hlen); | ||||
} | } | ||||
Done Inline ActionsNot needed, we should pass proper family to ‘infiniband_resolve_addr()’ melifaro: Not needed, we should pass proper family to ‘infiniband_resolve_addr()’ | |||||
/* | /* | ||||
* Queue message on interface, update output statistics if | * Queue message on interface, update output statistics if | ||||
* successful, and start output if interface not yet active. | * successful, and start output if interface not yet active. | ||||
*/ | */ | ||||
return (ifp->if_transmit(ifp, m)); | return (ifp->if_transmit(ifp, m)); | ||||
bad: | bad: | ||||
if (m != NULL) | if (m != NULL) | ||||
▲ Show 20 Lines • Show All 254 Lines • Show Last 20 Lines |
Maybe move the "int af = ..." down here, if this is the only place it is used.