diff --git a/homa_offload.c b/homa_offload.c index b04175aa..05b79cfc 100644 --- a/homa_offload.c +++ b/homa_offload.c @@ -118,7 +118,7 @@ struct sk_buff *homa_gro_receive(struct list_head *held_list, int priority; __u32 saddr; if (skb_is_ipv6(skb)) { - priority = ((struct ipv6hdr *) skb_network_header(skb))->priority; + priority = ipv6_hdr(skb)->priority; saddr = ntohl(ipv6_hdr(skb)->saddr.in6_u.u6_addr32[3]); } else { priority = ((struct iphdr *) skb_network_header(skb))->tos >> 5; diff --git a/homa_outgoing.c b/homa_outgoing.c index 1775c2a2..40760930 100644 --- a/homa_outgoing.c +++ b/homa_outgoing.c @@ -304,13 +304,14 @@ int __homa_xmit_control(void *contents, size_t length, struct homa_peer *peer, extra_bytes); } priority = hsk->homa->num_priorities-1; - set_priority(skb, hsk, priority); skb->ooo_okay = 1; skb_get(skb); if (hsk->inet.sk.sk_family == AF_INET6) { result = ip6_xmit(&hsk->inet.sk, skb, &peer->flow.u.ip6, 0, - NULL, 0, priority); + NULL, hsk->homa->priority_map[priority] << 4, 0); } else { + /* This will find its way to the DSCP field in the IPv4 hdr. */ + hsk->inet.tos = hsk->homa->priority_map[priority]<<5; result = ip_queue_xmit(&hsk->inet.sk, skb, &peer->flow); } if (unlikely(result != 0)) { @@ -446,8 +447,6 @@ void __homa_xmit_data(struct sk_buff *skb, struct homa_rpc *rpc, int priority) skb_transport_header(skb); struct dst_entry *dst; - set_priority(skb, rpc->hsk, priority); - /* Update info that may have changed since the message was initially * created. */ @@ -466,15 +465,16 @@ void __homa_xmit_data(struct sk_buff *skb, struct homa_rpc *rpc, int priority) "offset %d", skb->len, tt_addr(rpc->peer->addr), rpc->id, ntohl(h->seg.offset)); - err = ip6_xmit(&rpc->hsk->inet.sk, skb, &rpc->peer->flow.u.ip6, - 0, NULL, 0, priority); + 0, NULL, + rpc->hsk->homa->priority_map[priority] << 4, 0); } else { tt_record4("calling ip_queue_xmit: skb->len %d, peer 0x%x, " "id %d, offset %d", skb->len, tt_addr(rpc->peer->addr), rpc->id, htonl(h->seg.offset)); + rpc->hsk->inet.tos = rpc->hsk->homa->priority_map[priority]<<5; err = ip_queue_xmit(&rpc->hsk->inet.sk, skb, &rpc->peer->flow); } tt_record4("Finished queueing packet: rpc id %llu, offset %d, len %d, " diff --git a/test/mock.c b/test/mock.c index 4ec2819a..f4cf06d2 100644 --- a/test/mock.c +++ b/test/mock.c @@ -569,7 +569,7 @@ int ip6_xmit(const struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6, mock_xmit_prios_offset += snprintf( mock_xmit_prios + mock_xmit_prios_offset, sizeof(mock_xmit_prios) - mock_xmit_prios_offset, - "%s%d", prefix, ((struct inet_sock *) sk)->tos>>5); + "%s%d", prefix, tclass >> 4); if (mock_xmit_log_verbose) homa_print_packet(skb, buffer, sizeof(buffer)); else