diff options
Diffstat (limited to 'net/core')
| -rw-r--r-- | net/core/pktgen.c | 30 | ||||
| -rw-r--r-- | net/core/sock.c | 2 |
2 files changed, 19 insertions, 13 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index dd023fd28304..733d86d0a4fb 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
| @@ -2304,6 +2304,12 @@ static void mpls_push(__be32 *mpls, struct pktgen_dev *pkt_dev) | |||
| 2304 | *mpls |= MPLS_STACK_BOTTOM; | 2304 | *mpls |= MPLS_STACK_BOTTOM; |
| 2305 | } | 2305 | } |
| 2306 | 2306 | ||
| 2307 | static inline __be16 build_tci(unsigned int id, unsigned int cfi, | ||
| 2308 | unsigned int prio) | ||
| 2309 | { | ||
| 2310 | return htons(id | (cfi << 12) | (prio << 13)); | ||
| 2311 | } | ||
| 2312 | |||
| 2307 | static struct sk_buff *fill_packet_ipv4(struct net_device *odev, | 2313 | static struct sk_buff *fill_packet_ipv4(struct net_device *odev, |
| 2308 | struct pktgen_dev *pkt_dev) | 2314 | struct pktgen_dev *pkt_dev) |
| 2309 | { | 2315 | { |
| @@ -2353,16 +2359,16 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev, | |||
| 2353 | if (pkt_dev->vlan_id != 0xffff) { | 2359 | if (pkt_dev->vlan_id != 0xffff) { |
| 2354 | if(pkt_dev->svlan_id != 0xffff) { | 2360 | if(pkt_dev->svlan_id != 0xffff) { |
| 2355 | svlan_tci = (__be16 *)skb_put(skb, sizeof(__be16)); | 2361 | svlan_tci = (__be16 *)skb_put(skb, sizeof(__be16)); |
| 2356 | *svlan_tci = htons(pkt_dev->svlan_id); | 2362 | *svlan_tci = build_tci(pkt_dev->svlan_id, |
| 2357 | *svlan_tci |= pkt_dev->svlan_p << 5; | 2363 | pkt_dev->svlan_cfi, |
| 2358 | *svlan_tci |= pkt_dev->svlan_cfi << 4; | 2364 | pkt_dev->svlan_p); |
| 2359 | svlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16)); | 2365 | svlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16)); |
| 2360 | *svlan_encapsulated_proto = __constant_htons(ETH_P_8021Q); | 2366 | *svlan_encapsulated_proto = __constant_htons(ETH_P_8021Q); |
| 2361 | } | 2367 | } |
| 2362 | vlan_tci = (__be16 *)skb_put(skb, sizeof(__be16)); | 2368 | vlan_tci = (__be16 *)skb_put(skb, sizeof(__be16)); |
| 2363 | *vlan_tci = htons(pkt_dev->vlan_id); | 2369 | *vlan_tci = build_tci(pkt_dev->vlan_id, |
| 2364 | *vlan_tci |= pkt_dev->vlan_p << 5; | 2370 | pkt_dev->vlan_cfi, |
| 2365 | *vlan_tci |= pkt_dev->vlan_cfi << 4; | 2371 | pkt_dev->vlan_p); |
| 2366 | vlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16)); | 2372 | vlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16)); |
| 2367 | *vlan_encapsulated_proto = __constant_htons(ETH_P_IP); | 2373 | *vlan_encapsulated_proto = __constant_htons(ETH_P_IP); |
| 2368 | } | 2374 | } |
| @@ -2689,16 +2695,16 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev, | |||
| 2689 | if (pkt_dev->vlan_id != 0xffff) { | 2695 | if (pkt_dev->vlan_id != 0xffff) { |
| 2690 | if(pkt_dev->svlan_id != 0xffff) { | 2696 | if(pkt_dev->svlan_id != 0xffff) { |
| 2691 | svlan_tci = (__be16 *)skb_put(skb, sizeof(__be16)); | 2697 | svlan_tci = (__be16 *)skb_put(skb, sizeof(__be16)); |
| 2692 | *svlan_tci = htons(pkt_dev->svlan_id); | 2698 | *svlan_tci = build_tci(pkt_dev->svlan_id, |
| 2693 | *svlan_tci |= pkt_dev->svlan_p << 5; | 2699 | pkt_dev->svlan_cfi, |
| 2694 | *svlan_tci |= pkt_dev->svlan_cfi << 4; | 2700 | pkt_dev->svlan_p); |
| 2695 | svlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16)); | 2701 | svlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16)); |
| 2696 | *svlan_encapsulated_proto = __constant_htons(ETH_P_8021Q); | 2702 | *svlan_encapsulated_proto = __constant_htons(ETH_P_8021Q); |
| 2697 | } | 2703 | } |
| 2698 | vlan_tci = (__be16 *)skb_put(skb, sizeof(__be16)); | 2704 | vlan_tci = (__be16 *)skb_put(skb, sizeof(__be16)); |
| 2699 | *vlan_tci = htons(pkt_dev->vlan_id); | 2705 | *vlan_tci = build_tci(pkt_dev->vlan_id, |
| 2700 | *vlan_tci |= pkt_dev->vlan_p << 5; | 2706 | pkt_dev->vlan_cfi, |
| 2701 | *vlan_tci |= pkt_dev->vlan_cfi << 4; | 2707 | pkt_dev->vlan_p); |
| 2702 | vlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16)); | 2708 | vlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16)); |
| 2703 | *vlan_encapsulated_proto = __constant_htons(ETH_P_IPV6); | 2709 | *vlan_encapsulated_proto = __constant_htons(ETH_P_IPV6); |
| 2704 | } | 2710 | } |
diff --git a/net/core/sock.c b/net/core/sock.c index d472db4776c3..ee6cd2541d35 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
| @@ -1160,7 +1160,7 @@ static struct sk_buff *sock_alloc_send_pskb(struct sock *sk, | |||
| 1160 | goto failure; | 1160 | goto failure; |
| 1161 | 1161 | ||
| 1162 | if (atomic_read(&sk->sk_wmem_alloc) < sk->sk_sndbuf) { | 1162 | if (atomic_read(&sk->sk_wmem_alloc) < sk->sk_sndbuf) { |
| 1163 | skb = alloc_skb(header_len, sk->sk_allocation); | 1163 | skb = alloc_skb(header_len, gfp_mask); |
| 1164 | if (skb) { | 1164 | if (skb) { |
| 1165 | int npages; | 1165 | int npages; |
| 1166 | int i; | 1166 | int i; |
