Skip to content

Commit

Permalink
Convert packet types to hex to match tcpdump.
Browse files Browse the repository at this point in the history
  • Loading branch information
danmanj authored and johnousterhout committed Sep 9, 2022
1 parent acac477 commit fb552e3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
20 changes: 10 additions & 10 deletions homa_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,16 @@ extern void homa_throttle_lock_slow(struct homa *homa);
* See the xxx_header structs below for more information about each type.
*/
enum homa_packet_type {
DATA = 20,
GRANT = 21,
RESEND = 22,
UNKNOWN = 23,
BUSY = 24,
CUTOFFS = 25,
FREEZE = 26,
NEED_ACK = 27,
ACK = 28,
BOGUS = 29, /* Used only in unit tests. */
DATA = 0x10,
GRANT = 0x11,
RESEND = 0x12,
UNKNOWN = 0x13,
BUSY = 0x14,
CUTOFFS = 0x15,
FREEZE = 0x16,
NEED_ACK = 0x17,
ACK = 0x18,
BOGUS = 0x19, /* Used only in unit tests. */
/* If you add a new type here, you must also do the following:
* 1. Change BOGUS so it is the highest opcode
* 2. Add support for the new opcode in homa_print_packet,
Expand Down
2 changes: 1 addition & 1 deletion homa_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ struct sk_buff *homa_gro_receive(struct list_head *held_list,
iph->tos >> 5);
else
tt_record4("homa_gro_receive got packet from 0x%x "
"id %llu, type %d, priority %d",
"id %llu, type 0x%x, priority %d",
ntohl(ip_hdr(skb)->saddr),
homa_local_id(h_new->common.sender_id),
h_new->common.type, iph->tos >> 5);
Expand Down
2 changes: 1 addition & 1 deletion homa_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ char *homa_print_packet_short(struct sk_buff *skb, char *buffer, int buf_len)
snprintf(buffer, buf_len, "ACK");
break;
default:
snprintf(buffer, buf_len, "unknown packet type %d",
snprintf(buffer, buf_len, "unknown packet type 0x%x",
common->type);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit_homa_outgoing.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ TEST_F(homa_outgoing, __homa_xmit_control__pad_packet)
unit_log_clear();
EXPECT_EQ(0, homa_xmit_control(BUSY, &h, 10, srpc));
EXPECT_STREQ("padded control packet with 16 bytes; "
"xmit unknown packet type 0",
"xmit unknown packet type 0x0",
unit_log_get());
}
TEST_F(homa_outgoing, __homa_xmit_control__ip_queue_xmit_error)
Expand Down

0 comments on commit fb552e3

Please sign in to comment.