diff options
author | Willem de Bruijn <willemb@google.com> | 2013-03-21 14:10:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-21 14:31:36 -0400 |
commit | 98e821a2a927b6dc0f7adc4b64ad29bec1b6ff89 (patch) | |
tree | 8844d59f60b08ba86bd60e7395e121d1b7e1385a /tools | |
parent | eaaa31392690c7609f7afeec5ba38a79d009842d (diff) |
net: fix psock_fanout on sparc64
The packetsocket fanout test uses a packet ring. Use TPACKET_V2
instead of TPACKET_V1 to work around a known 32/64 bit issue in
the older ring that manifests on sparc64.
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/net/psock_fanout.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/psock_fanout.c b/tools/testing/selftests/net/psock_fanout.c index 226e5e33105a..59bd6367af71 100644 --- a/tools/testing/selftests/net/psock_fanout.c +++ b/tools/testing/selftests/net/psock_fanout.c | |||
@@ -182,7 +182,13 @@ static char *sock_fanout_open_ring(int fd) | |||
182 | .tp_frame_nr = RING_NUM_FRAMES, | 182 | .tp_frame_nr = RING_NUM_FRAMES, |
183 | }; | 183 | }; |
184 | char *ring; | 184 | char *ring; |
185 | int val = TPACKET_V2; | ||
185 | 186 | ||
187 | if (setsockopt(fd, SOL_PACKET, PACKET_VERSION, (void *) &val, | ||
188 | sizeof(val))) { | ||
189 | perror("packetsock ring setsockopt version"); | ||
190 | exit(1); | ||
191 | } | ||
186 | if (setsockopt(fd, SOL_PACKET, PACKET_RX_RING, (void *) &req, | 192 | if (setsockopt(fd, SOL_PACKET, PACKET_RX_RING, (void *) &req, |
187 | sizeof(req))) { | 193 | sizeof(req))) { |
188 | perror("packetsock ring setsockopt"); | 194 | perror("packetsock ring setsockopt"); |
@@ -201,7 +207,7 @@ static char *sock_fanout_open_ring(int fd) | |||
201 | 207 | ||
202 | static int sock_fanout_read_ring(int fd, void *ring) | 208 | static int sock_fanout_read_ring(int fd, void *ring) |
203 | { | 209 | { |
204 | struct tpacket_hdr *header = ring; | 210 | struct tpacket2_hdr *header = ring; |
205 | int count = 0; | 211 | int count = 0; |
206 | 212 | ||
207 | while (header->tp_status & TP_STATUS_USER && count < RING_NUM_FRAMES) { | 213 | while (header->tp_status & TP_STATUS_USER && count < RING_NUM_FRAMES) { |