Skip to content

Commit c312840

Browse files
committed
Revert "pktgen: Allow configuration of IPv6 source address range"
This reverts commit 7786a1a. It causes build failures on 32-bit, for example: net/core/pktgen.o: In function `mod_cur_headers': >> pktgen.c:(.text.mod_cur_headers+0xba0): undefined reference to `__umoddi3' Signed-off-by: David S. Miller <[email protected]>
1 parent 6a7e25c commit c312840

File tree

1 file changed

+0
-98
lines changed

1 file changed

+0
-98
lines changed

net/core/pktgen.c

Lines changed: 0 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,6 @@ struct pktgen_dev {
323323
struct in6_addr max_in6_daddr;
324324
struct in6_addr min_in6_saddr;
325325
struct in6_addr max_in6_saddr;
326-
u64 max_in6_h;
327-
u64 max_in6_l;
328-
u64 min_in6_h;
329-
u64 min_in6_l;
330326

331327
/* If we're doing ranges, random or incremental, then this
332328
* defines the min/max for those ranges.
@@ -1359,59 +1355,6 @@ static ssize_t pktgen_if_write(struct file *file,
13591355
sprintf(pg_result, "OK: dst6_max=%s", buf);
13601356
return count;
13611357
}
1362-
if (!strcmp(name, "src6_min")) {
1363-
len = strn_len(&user_buffer[i], sizeof(buf) - 1);
1364-
if (len < 0)
1365-
return len;
1366-
1367-
pkt_dev->flags |= F_IPV6;
1368-
1369-
if (copy_from_user(buf, &user_buffer[i], len))
1370-
return -EFAULT;
1371-
buf[len] = 0;
1372-
1373-
in6_pton(buf, -1, pkt_dev->min_in6_saddr.s6_addr, -1, NULL);
1374-
snprintf(buf, sizeof(buf), "%pI6c", &pkt_dev->min_in6_saddr);
1375-
1376-
memcpy(&pkt_dev->min_in6_h, pkt_dev->min_in6_saddr.s6_addr, 8);
1377-
memcpy(&pkt_dev->min_in6_l, pkt_dev->min_in6_saddr.s6_addr + 8, 8);
1378-
pkt_dev->min_in6_h = be64_to_cpu(pkt_dev->min_in6_h);
1379-
pkt_dev->min_in6_l = be64_to_cpu(pkt_dev->min_in6_l);
1380-
1381-
pkt_dev->cur_in6_saddr = pkt_dev->min_in6_saddr;
1382-
if (debug)
1383-
pr_debug("src6_min set to: %s\n", buf);
1384-
1385-
i += len;
1386-
sprintf(pg_result, "OK: src6_min=%s", buf);
1387-
return count;
1388-
}
1389-
if (!strcmp(name, "src6_max")) {
1390-
len = strn_len(&user_buffer[i], sizeof(buf) - 1);
1391-
if (len < 0)
1392-
return len;
1393-
1394-
pkt_dev->flags |= F_IPV6;
1395-
1396-
if (copy_from_user(buf, &user_buffer[i], len))
1397-
return -EFAULT;
1398-
buf[len] = 0;
1399-
1400-
in6_pton(buf, -1, pkt_dev->max_in6_saddr.s6_addr, -1, NULL);
1401-
snprintf(buf, sizeof(buf), "%pI6c", &pkt_dev->max_in6_saddr);
1402-
1403-
memcpy(&pkt_dev->max_in6_h, pkt_dev->max_in6_saddr.s6_addr, 8);
1404-
memcpy(&pkt_dev->max_in6_l, pkt_dev->max_in6_saddr.s6_addr + 8, 8);
1405-
pkt_dev->max_in6_h = be64_to_cpu(pkt_dev->max_in6_h);
1406-
pkt_dev->max_in6_l = be64_to_cpu(pkt_dev->max_in6_l);
1407-
1408-
if (debug)
1409-
pr_debug("src6_max set to: %s\n", buf);
1410-
1411-
i += len;
1412-
sprintf(pg_result, "OK: src6_max=%s", buf);
1413-
return count;
1414-
}
14151358
if (!strcmp(name, "src6")) {
14161359
len = strn_len(&user_buffer[i], sizeof(buf) - 1);
14171360
if (len < 0)
@@ -2343,45 +2286,6 @@ static void set_cur_queue_map(struct pktgen_dev *pkt_dev)
23432286
pkt_dev->cur_queue_map = pkt_dev->cur_queue_map % pkt_dev->odev->real_num_tx_queues;
23442287
}
23452288

2346-
/* generate ipv6 source addr */
2347-
static void set_src_in6_addr(struct pktgen_dev *pkt_dev)
2348-
{
2349-
u64 min6, max6, rand, i;
2350-
struct in6_addr addr6;
2351-
__be64 addr_l, *t;
2352-
2353-
min6 = pkt_dev->min_in6_l;
2354-
max6 = pkt_dev->max_in6_l;
2355-
2356-
/* only generate source address in least significant 64 bits range
2357-
* most significant 64 bits must be equal
2358-
*/
2359-
if (pkt_dev->max_in6_h != pkt_dev->min_in6_h || min6 >= max6)
2360-
return;
2361-
2362-
addr6 = pkt_dev->min_in6_saddr;
2363-
t = (__be64 *)addr6.s6_addr + 1;
2364-
2365-
if (pkt_dev->flags & F_IPSRC_RND) {
2366-
do {
2367-
prandom_bytes(&rand, sizeof(rand));
2368-
rand = rand % (max6 - min6) + min6;
2369-
addr_l = cpu_to_be64(rand);
2370-
memcpy(t, &addr_l, 8);
2371-
} while (ipv6_addr_loopback(&addr6) ||
2372-
ipv6_addr_v4mapped(&addr6) ||
2373-
ipv6_addr_is_multicast(&addr6));
2374-
} else {
2375-
addr6 = pkt_dev->cur_in6_saddr;
2376-
i = be64_to_cpu(*t);
2377-
if (++i > max6)
2378-
i = min6;
2379-
addr_l = cpu_to_be64(i);
2380-
memcpy(t, &addr_l, 8);
2381-
}
2382-
pkt_dev->cur_in6_saddr = addr6;
2383-
}
2384-
23852289
/* Increment/randomize headers according to flags and current values
23862290
* for IP src/dest, UDP src/dst port, MAC-Addr src/dst
23872291
*/
@@ -2550,8 +2454,6 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
25502454
}
25512455
} else { /* IPV6 * */
25522456

2553-
set_src_in6_addr(pkt_dev);
2554-
25552457
if (!ipv6_addr_any(&pkt_dev->min_in6_daddr)) {
25562458
int i;
25572459

0 commit comments

Comments
 (0)