aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-02-09 17:35:57 -0500
committerDavid S. Miller <davem@davemloft.net>2015-02-09 17:35:57 -0500
commit2573beec56aa28a0e6d4430fb6796d0c76308bcf (patch)
tree15c902551b78a954d5138304b97a16a4d9968202 /net/core
parentfd3137cd33ae5590c45c81e9a46fe53b6ab5f66e (diff)
parent531c94a9681b8c253fd0490a4ca8bbe01a38c78b (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c4
-rw-r--r--net/core/flow.c2
-rw-r--r--net/core/pktgen.c16
-rw-r--r--net/core/rtnetlink.c18
4 files changed, 17 insertions, 23 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 8be38675e1a8..d030575532a2 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -7129,11 +7129,11 @@ static int dev_cpu_callback(struct notifier_block *nfb,
7129 7129
7130 /* Process offline CPU's input_pkt_queue */ 7130 /* Process offline CPU's input_pkt_queue */
7131 while ((skb = __skb_dequeue(&oldsd->process_queue))) { 7131 while ((skb = __skb_dequeue(&oldsd->process_queue))) {
7132 netif_rx_internal(skb); 7132 netif_rx_ni(skb);
7133 input_queue_head_incr(oldsd); 7133 input_queue_head_incr(oldsd);
7134 } 7134 }
7135 while ((skb = skb_dequeue(&oldsd->input_pkt_queue))) { 7135 while ((skb = skb_dequeue(&oldsd->input_pkt_queue))) {
7136 netif_rx_internal(skb); 7136 netif_rx_ni(skb);
7137 input_queue_head_incr(oldsd); 7137 input_queue_head_incr(oldsd);
7138 } 7138 }
7139 7139
diff --git a/net/core/flow.c b/net/core/flow.c
index a0348fde1fdf..1033725be40b 100644
--- a/net/core/flow.c
+++ b/net/core/flow.c
@@ -379,7 +379,7 @@ done:
379static void flow_cache_flush_task(struct work_struct *work) 379static void flow_cache_flush_task(struct work_struct *work)
380{ 380{
381 struct netns_xfrm *xfrm = container_of(work, struct netns_xfrm, 381 struct netns_xfrm *xfrm = container_of(work, struct netns_xfrm,
382 flow_cache_gc_work); 382 flow_cache_flush_work);
383 struct net *net = container_of(xfrm, struct net, xfrm); 383 struct net *net = container_of(xfrm, struct net, xfrm);
384 384
385 flow_cache_flush(net); 385 flow_cache_flush(net);
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index da934fc3faa8..9fa25b0ea145 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2842,25 +2842,25 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
2842 skb->dev = odev; 2842 skb->dev = odev;
2843 skb->pkt_type = PACKET_HOST; 2843 skb->pkt_type = PACKET_HOST;
2844 2844
2845 pktgen_finalize_skb(pkt_dev, skb, datalen);
2846
2845 if (!(pkt_dev->flags & F_UDPCSUM)) { 2847 if (!(pkt_dev->flags & F_UDPCSUM)) {
2846 skb->ip_summed = CHECKSUM_NONE; 2848 skb->ip_summed = CHECKSUM_NONE;
2847 } else if (odev->features & NETIF_F_V4_CSUM) { 2849 } else if (odev->features & NETIF_F_V4_CSUM) {
2848 skb->ip_summed = CHECKSUM_PARTIAL; 2850 skb->ip_summed = CHECKSUM_PARTIAL;
2849 skb->csum = 0; 2851 skb->csum = 0;
2850 udp4_hwcsum(skb, udph->source, udph->dest); 2852 udp4_hwcsum(skb, iph->saddr, iph->daddr);
2851 } else { 2853 } else {
2852 __wsum csum = udp_csum(skb); 2854 __wsum csum = skb_checksum(skb, skb_transport_offset(skb), datalen + 8, 0);
2853 2855
2854 /* add protocol-dependent pseudo-header */ 2856 /* add protocol-dependent pseudo-header */
2855 udph->check = csum_tcpudp_magic(udph->source, udph->dest, 2857 udph->check = csum_tcpudp_magic(iph->saddr, iph->daddr,
2856 datalen + 8, IPPROTO_UDP, csum); 2858 datalen + 8, IPPROTO_UDP, csum);
2857 2859
2858 if (udph->check == 0) 2860 if (udph->check == 0)
2859 udph->check = CSUM_MANGLED_0; 2861 udph->check = CSUM_MANGLED_0;
2860 } 2862 }
2861 2863
2862 pktgen_finalize_skb(pkt_dev, skb, datalen);
2863
2864#ifdef CONFIG_XFRM 2864#ifdef CONFIG_XFRM
2865 if (!process_ipsec(pkt_dev, skb, protocol)) 2865 if (!process_ipsec(pkt_dev, skb, protocol))
2866 return NULL; 2866 return NULL;
@@ -2976,6 +2976,8 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
2976 skb->dev = odev; 2976 skb->dev = odev;
2977 skb->pkt_type = PACKET_HOST; 2977 skb->pkt_type = PACKET_HOST;
2978 2978
2979 pktgen_finalize_skb(pkt_dev, skb, datalen);
2980
2979 if (!(pkt_dev->flags & F_UDPCSUM)) { 2981 if (!(pkt_dev->flags & F_UDPCSUM)) {
2980 skb->ip_summed = CHECKSUM_NONE; 2982 skb->ip_summed = CHECKSUM_NONE;
2981 } else if (odev->features & NETIF_F_V6_CSUM) { 2983 } else if (odev->features & NETIF_F_V6_CSUM) {
@@ -2984,7 +2986,7 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
2984 skb->csum_offset = offsetof(struct udphdr, check); 2986 skb->csum_offset = offsetof(struct udphdr, check);
2985 udph->check = ~csum_ipv6_magic(&iph->saddr, &iph->daddr, udplen, IPPROTO_UDP, 0); 2987 udph->check = ~csum_ipv6_magic(&iph->saddr, &iph->daddr, udplen, IPPROTO_UDP, 0);
2986 } else { 2988 } else {
2987 __wsum csum = udp_csum(skb); 2989 __wsum csum = skb_checksum(skb, skb_transport_offset(skb), udplen, 0);
2988 2990
2989 /* add protocol-dependent pseudo-header */ 2991 /* add protocol-dependent pseudo-header */
2990 udph->check = csum_ipv6_magic(&iph->saddr, &iph->daddr, udplen, IPPROTO_UDP, csum); 2992 udph->check = csum_ipv6_magic(&iph->saddr, &iph->daddr, udplen, IPPROTO_UDP, csum);
@@ -2993,8 +2995,6 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
2993 udph->check = CSUM_MANGLED_0; 2995 udph->check = CSUM_MANGLED_0;
2994 } 2996 }
2995 2997
2996 pktgen_finalize_skb(pkt_dev, skb, datalen);
2997
2998 return skb; 2998 return skb;
2999} 2999}
3000 3000
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 5dad4f782f03..5be499b6a2d2 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1263,18 +1263,12 @@ static const struct nla_policy ifla_vfinfo_policy[IFLA_VF_INFO_MAX+1] = {
1263}; 1263};
1264 1264
1265static const struct nla_policy ifla_vf_policy[IFLA_VF_MAX+1] = { 1265static const struct nla_policy ifla_vf_policy[IFLA_VF_MAX+1] = {
1266 [IFLA_VF_MAC] = { .type = NLA_BINARY, 1266 [IFLA_VF_MAC] = { .len = sizeof(struct ifla_vf_mac) },
1267 .len = sizeof(struct ifla_vf_mac) }, 1267 [IFLA_VF_VLAN] = { .len = sizeof(struct ifla_vf_vlan) },
1268 [IFLA_VF_VLAN] = { .type = NLA_BINARY, 1268 [IFLA_VF_TX_RATE] = { .len = sizeof(struct ifla_vf_tx_rate) },
1269 .len = sizeof(struct ifla_vf_vlan) }, 1269 [IFLA_VF_SPOOFCHK] = { .len = sizeof(struct ifla_vf_spoofchk) },
1270 [IFLA_VF_TX_RATE] = { .type = NLA_BINARY, 1270 [IFLA_VF_RATE] = { .len = sizeof(struct ifla_vf_rate) },
1271 .len = sizeof(struct ifla_vf_tx_rate) }, 1271 [IFLA_VF_LINK_STATE] = { .len = sizeof(struct ifla_vf_link_state) },
1272 [IFLA_VF_SPOOFCHK] = { .type = NLA_BINARY,
1273 .len = sizeof(struct ifla_vf_spoofchk) },
1274 [IFLA_VF_RATE] = { .type = NLA_BINARY,
1275 .len = sizeof(struct ifla_vf_rate) },
1276 [IFLA_VF_LINK_STATE] = { .type = NLA_BINARY,
1277 .len = sizeof(struct ifla_vf_link_state) },
1278}; 1272};
1279 1273
1280static const struct nla_policy ifla_port_policy[IFLA_PORT_MAX+1] = { 1274static const struct nla_policy ifla_port_policy[IFLA_PORT_MAX+1] = {