Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224436
b: refs/heads/master
c: 9e50e3a
h: refs/heads/master
v: v3
  • Loading branch information
John Fastabend authored and David S. Miller committed Nov 18, 2010
1 parent a7ae5c2 commit 840d19c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f72f2f4cdeb67bc262d80a6d474292f00182a4dc
refs/heads/master: 9e50e3ac5a5bbb1fd2949bdd57444ad1b93e5f41
20 changes: 20 additions & 0 deletions trunk/net/core/pktgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ struct pktgen_dev {

u16 queue_map_min;
u16 queue_map_max;
__u32 skb_priority; /* skb priority field */
int node; /* Memory node */

#ifdef CONFIG_XFRM
Expand Down Expand Up @@ -547,6 +548,10 @@ static int pktgen_if_show(struct seq_file *seq, void *v)
pkt_dev->queue_map_min,
pkt_dev->queue_map_max);

if (pkt_dev->skb_priority)
seq_printf(seq, " skb_priority: %u\n",
pkt_dev->skb_priority);

if (pkt_dev->flags & F_IPV6) {
char b1[128], b2[128], b3[128];
fmt_ip6(b1, pkt_dev->in6_saddr.s6_addr);
Expand Down Expand Up @@ -1711,6 +1716,18 @@ static ssize_t pktgen_if_write(struct file *file,
return count;
}

if (!strcmp(name, "skb_priority")) {
len = num_arg(&user_buffer[i], 9, &value);
if (len < 0)
return len;

i += len;
pkt_dev->skb_priority = value;
sprintf(pg_result, "OK: skb_priority=%i",
pkt_dev->skb_priority);
return count;
}

sprintf(pkt_dev->result, "No such parameter \"%s\"", name);
return -EINVAL;
}
Expand Down Expand Up @@ -2671,6 +2688,8 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
skb->transport_header = skb->network_header + sizeof(struct iphdr);
skb_put(skb, sizeof(struct iphdr) + sizeof(struct udphdr));
skb_set_queue_mapping(skb, queue_map);
skb->priority = pkt_dev->skb_priority;

iph = ip_hdr(skb);
udph = udp_hdr(skb);

Expand Down Expand Up @@ -3016,6 +3035,7 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
skb->transport_header = skb->network_header + sizeof(struct ipv6hdr);
skb_put(skb, sizeof(struct ipv6hdr) + sizeof(struct udphdr));
skb_set_queue_mapping(skb, queue_map);
skb->priority = pkt_dev->skb_priority;
iph = ipv6_hdr(skb);
udph = udp_hdr(skb);

Expand Down

0 comments on commit 840d19c

Please sign in to comment.