Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions homa_plumbing.c
Original file line number Diff line number Diff line change
Expand Up @@ -1677,11 +1677,15 @@ int homa_softirq(struct sk_buff *skb)
* skb_shinfo(skb)->frag_list by the Homa GRO mechanism. Make a
* pass through the list to process all of the short packets,
* leaving the longer packets in the list. Also, perform various
* prep/cleanup/error checking functions.
* prep/cleanup/error checking functions. IP reassembly can also
* leave a frag_list, but in that case the frag_list is part of
* this packet (its length is included in skb->len), so leave it.
*/
tt_record("homa_softirq starting");
skb->next = skb_shinfo(skb)->frag_list;
skb_shinfo(skb)->frag_list = NULL;
if (skb->len == skb_pagelen(skb)) {
skb->next = skb_shinfo(skb)->frag_list;
skb_shinfo(skb)->frag_list = NULL;
}
packets = skb;
prev_link = &packets;
for (skb = packets; skb; skb = next) {
Expand Down
26 changes: 26 additions & 0 deletions test/unit_homa_plumbing.c
Original file line number Diff line number Diff line change
Expand Up @@ -1767,6 +1767,32 @@ TEST_F(homa_plumbing, homa_softirq__per_rpc_batching)
"sk->sk_data_ready invoked",
unit_log_get());
}
TEST_F(homa_plumbing, homa_softirq__frag_list_from_ip_reassembly)
{
struct sk_buff *skb, *skb2;
struct homa_rpc *srpc;

/* skb2 has a Homa header, but it is just payload in the
* reassembled packet, so it must not be processed separately.
*/
self->data.common.sender_id = cpu_to_be64(5000);
skb2 = mock_skb_alloc(self->client_ip, self->server_ip,
&self->data.common, 400, 0);
skb2->dev = NULL;
self->data.common.sender_id = cpu_to_be64(self->client_id);
skb = mock_skb_alloc(self->client_ip, self->server_ip,
&self->data.common, 1000, 0);
skb_shinfo(skb)->frag_list = skb2;
skb->len += skb2->len;
skb->data_len += skb2->len;
homa_softirq(skb);
unit_log_clear();
unit_log_active_ids(&self->hsk);
EXPECT_STREQ("1235", unit_log_get());
srpc = list_first_entry(&self->hsk.active_rpcs, struct homa_rpc,
active_links);
EXPECT_EQ(10000 - 1000 - skb2->len, srpc->msgin.bytes_remaining);
}

TEST_F(homa_plumbing, homa_err_handler_v4__port_unreachable)
{
Expand Down