diff options
author | David S. Miller <davem@davemloft.net> | 2016-07-06 13:35:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-06 13:35:22 -0400 |
commit | 30d0844bdcea9fb8b0b3c8abfa5547bc3bcf8baa (patch) | |
tree | 87302af9e03ee50cf135cc9ce6589f41fe3b3db1 /net | |
parent | ae3e4562e2ce0149a4424c994a282955700711e7 (diff) | |
parent | bc86765181aa26cc9afcb0a6f9f253cbb1186f26 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/usb/r8152.c
All three conflicts were overlapping changes.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/bridge/br_netfilter_hooks.c | 2 | ||||
-rw-r--r-- | net/core/flow_dissector.c | 43 | ||||
-rw-r--r-- | net/core/skbuff.c | 18 | ||||
-rw-r--r-- | net/decnet/dn_fib.c | 21 | ||||
-rw-r--r-- | net/ipv4/ip_output.c | 4 | ||||
-rw-r--r-- | net/ipv6/ip6_fib.c | 1 | ||||
-rw-r--r-- | net/packet/af_packet.c | 2 | ||||
-rw-r--r-- | net/rds/tcp.c | 5 | ||||
-rw-r--r-- | net/sched/act_mirred.c | 2 | ||||
-rw-r--r-- | net/tipc/netlink_compat.c | 2 |
10 files changed, 65 insertions, 35 deletions
diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c index 2d25979273a6..77e7f69bf80d 100644 --- a/net/bridge/br_netfilter_hooks.c +++ b/net/bridge/br_netfilter_hooks.c | |||
@@ -700,7 +700,7 @@ static int | |||
700 | br_nf_ip_fragment(struct net *net, struct sock *sk, struct sk_buff *skb, | 700 | br_nf_ip_fragment(struct net *net, struct sock *sk, struct sk_buff *skb, |
701 | int (*output)(struct net *, struct sock *, struct sk_buff *)) | 701 | int (*output)(struct net *, struct sock *, struct sk_buff *)) |
702 | { | 702 | { |
703 | unsigned int mtu = ip_skb_dst_mtu(skb); | 703 | unsigned int mtu = ip_skb_dst_mtu(sk, skb); |
704 | struct iphdr *iph = ip_hdr(skb); | 704 | struct iphdr *iph = ip_hdr(skb); |
705 | 705 | ||
706 | if (unlikely(((iph->frag_off & htons(IP_DF)) && !skb->ignore_df) || | 706 | if (unlikely(((iph->frag_off & htons(IP_DF)) && !skb->ignore_df) || |
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index a669dea146c6..61ad43f61c5e 100644 --- a/net/core/flow_dissector.c +++ b/net/core/flow_dissector.c | |||
@@ -651,6 +651,23 @@ void make_flow_keys_digest(struct flow_keys_digest *digest, | |||
651 | } | 651 | } |
652 | EXPORT_SYMBOL(make_flow_keys_digest); | 652 | EXPORT_SYMBOL(make_flow_keys_digest); |
653 | 653 | ||
654 | static struct flow_dissector flow_keys_dissector_symmetric __read_mostly; | ||
655 | |||
656 | u32 __skb_get_hash_symmetric(struct sk_buff *skb) | ||
657 | { | ||
658 | struct flow_keys keys; | ||
659 | |||
660 | __flow_hash_secret_init(); | ||
661 | |||
662 | memset(&keys, 0, sizeof(keys)); | ||
663 | __skb_flow_dissect(skb, &flow_keys_dissector_symmetric, &keys, | ||
664 | NULL, 0, 0, 0, | ||
665 | FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL); | ||
666 | |||
667 | return __flow_hash_from_keys(&keys, hashrnd); | ||
668 | } | ||
669 | EXPORT_SYMBOL_GPL(__skb_get_hash_symmetric); | ||
670 | |||
654 | /** | 671 | /** |
655 | * __skb_get_hash: calculate a flow hash | 672 | * __skb_get_hash: calculate a flow hash |
656 | * @skb: sk_buff to calculate flow hash from | 673 | * @skb: sk_buff to calculate flow hash from |
@@ -868,6 +885,29 @@ static const struct flow_dissector_key flow_keys_dissector_keys[] = { | |||
868 | }, | 885 | }, |
869 | }; | 886 | }; |
870 | 887 | ||
888 | static const struct flow_dissector_key flow_keys_dissector_symmetric_keys[] = { | ||
889 | { | ||
890 | .key_id = FLOW_DISSECTOR_KEY_CONTROL, | ||
891 | .offset = offsetof(struct flow_keys, control), | ||
892 | }, | ||
893 | { | ||
894 | .key_id = FLOW_DISSECTOR_KEY_BASIC, | ||
895 | .offset = offsetof(struct flow_keys, basic), | ||
896 | }, | ||
897 | { | ||
898 | .key_id = FLOW_DISSECTOR_KEY_IPV4_ADDRS, | ||
899 | .offset = offsetof(struct flow_keys, addrs.v4addrs), | ||
900 | }, | ||
901 | { | ||
902 | .key_id = FLOW_DISSECTOR_KEY_IPV6_ADDRS, | ||
903 | .offset = offsetof(struct flow_keys, addrs.v6addrs), | ||
904 | }, | ||
905 | { | ||
906 | .key_id = FLOW_DISSECTOR_KEY_PORTS, | ||
907 | .offset = offsetof(struct flow_keys, ports), | ||
908 | }, | ||
909 | }; | ||
910 | |||
871 | static const struct flow_dissector_key flow_keys_buf_dissector_keys[] = { | 911 | static const struct flow_dissector_key flow_keys_buf_dissector_keys[] = { |
872 | { | 912 | { |
873 | .key_id = FLOW_DISSECTOR_KEY_CONTROL, | 913 | .key_id = FLOW_DISSECTOR_KEY_CONTROL, |
@@ -889,6 +929,9 @@ static int __init init_default_flow_dissectors(void) | |||
889 | skb_flow_dissector_init(&flow_keys_dissector, | 929 | skb_flow_dissector_init(&flow_keys_dissector, |
890 | flow_keys_dissector_keys, | 930 | flow_keys_dissector_keys, |
891 | ARRAY_SIZE(flow_keys_dissector_keys)); | 931 | ARRAY_SIZE(flow_keys_dissector_keys)); |
932 | skb_flow_dissector_init(&flow_keys_dissector_symmetric, | ||
933 | flow_keys_dissector_symmetric_keys, | ||
934 | ARRAY_SIZE(flow_keys_dissector_symmetric_keys)); | ||
892 | skb_flow_dissector_init(&flow_keys_buf_dissector, | 935 | skb_flow_dissector_init(&flow_keys_buf_dissector, |
893 | flow_keys_buf_dissector_keys, | 936 | flow_keys_buf_dissector_keys, |
894 | ARRAY_SIZE(flow_keys_buf_dissector_keys)); | 937 | ARRAY_SIZE(flow_keys_buf_dissector_keys)); |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index e7ec6d3ad5f0..3864b4b68fa1 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -3017,24 +3017,6 @@ int skb_append_pagefrags(struct sk_buff *skb, struct page *page, | |||
3017 | EXPORT_SYMBOL_GPL(skb_append_pagefrags); | 3017 | EXPORT_SYMBOL_GPL(skb_append_pagefrags); |
3018 | 3018 | ||
3019 | /** | 3019 | /** |
3020 | * skb_push_rcsum - push skb and update receive checksum | ||
3021 | * @skb: buffer to update | ||
3022 | * @len: length of data pulled | ||
3023 | * | ||
3024 | * This function performs an skb_push on the packet and updates | ||
3025 | * the CHECKSUM_COMPLETE checksum. It should be used on | ||
3026 | * receive path processing instead of skb_push unless you know | ||
3027 | * that the checksum difference is zero (e.g., a valid IP header) | ||
3028 | * or you are setting ip_summed to CHECKSUM_NONE. | ||
3029 | */ | ||
3030 | static unsigned char *skb_push_rcsum(struct sk_buff *skb, unsigned len) | ||
3031 | { | ||
3032 | skb_push(skb, len); | ||
3033 | skb_postpush_rcsum(skb, skb->data, len); | ||
3034 | return skb->data; | ||
3035 | } | ||
3036 | |||
3037 | /** | ||
3038 | * skb_pull_rcsum - pull skb and update receive checksum | 3020 | * skb_pull_rcsum - pull skb and update receive checksum |
3039 | * @skb: buffer to update | 3021 | * @skb: buffer to update |
3040 | * @len: length of data pulled | 3022 | * @len: length of data pulled |
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c index df4803437888..a796fc7cbc35 100644 --- a/net/decnet/dn_fib.c +++ b/net/decnet/dn_fib.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <net/dn_fib.h> | 41 | #include <net/dn_fib.h> |
42 | #include <net/dn_neigh.h> | 42 | #include <net/dn_neigh.h> |
43 | #include <net/dn_dev.h> | 43 | #include <net/dn_dev.h> |
44 | #include <net/nexthop.h> | ||
44 | 45 | ||
45 | #define RT_MIN_TABLE 1 | 46 | #define RT_MIN_TABLE 1 |
46 | 47 | ||
@@ -150,14 +151,13 @@ static int dn_fib_count_nhs(const struct nlattr *attr) | |||
150 | struct rtnexthop *nhp = nla_data(attr); | 151 | struct rtnexthop *nhp = nla_data(attr); |
151 | int nhs = 0, nhlen = nla_len(attr); | 152 | int nhs = 0, nhlen = nla_len(attr); |
152 | 153 | ||
153 | while(nhlen >= (int)sizeof(struct rtnexthop)) { | 154 | while (rtnh_ok(nhp, nhlen)) { |
154 | if ((nhlen -= nhp->rtnh_len) < 0) | ||
155 | return 0; | ||
156 | nhs++; | 155 | nhs++; |
157 | nhp = RTNH_NEXT(nhp); | 156 | nhp = rtnh_next(nhp, &nhlen); |
158 | } | 157 | } |
159 | 158 | ||
160 | return nhs; | 159 | /* leftover implies invalid nexthop configuration, discard it */ |
160 | return nhlen > 0 ? 0 : nhs; | ||
161 | } | 161 | } |
162 | 162 | ||
163 | static int dn_fib_get_nhs(struct dn_fib_info *fi, const struct nlattr *attr, | 163 | static int dn_fib_get_nhs(struct dn_fib_info *fi, const struct nlattr *attr, |
@@ -167,21 +167,24 @@ static int dn_fib_get_nhs(struct dn_fib_info *fi, const struct nlattr *attr, | |||
167 | int nhlen = nla_len(attr); | 167 | int nhlen = nla_len(attr); |
168 | 168 | ||
169 | change_nexthops(fi) { | 169 | change_nexthops(fi) { |
170 | int attrlen = nhlen - sizeof(struct rtnexthop); | 170 | int attrlen; |
171 | if (attrlen < 0 || (nhlen -= nhp->rtnh_len) < 0) | 171 | |
172 | if (!rtnh_ok(nhp, nhlen)) | ||
172 | return -EINVAL; | 173 | return -EINVAL; |
173 | 174 | ||
174 | nh->nh_flags = (r->rtm_flags&~0xFF) | nhp->rtnh_flags; | 175 | nh->nh_flags = (r->rtm_flags&~0xFF) | nhp->rtnh_flags; |
175 | nh->nh_oif = nhp->rtnh_ifindex; | 176 | nh->nh_oif = nhp->rtnh_ifindex; |
176 | nh->nh_weight = nhp->rtnh_hops + 1; | 177 | nh->nh_weight = nhp->rtnh_hops + 1; |
177 | 178 | ||
178 | if (attrlen) { | 179 | attrlen = rtnh_attrlen(nhp); |
180 | if (attrlen > 0) { | ||
179 | struct nlattr *gw_attr; | 181 | struct nlattr *gw_attr; |
180 | 182 | ||
181 | gw_attr = nla_find((struct nlattr *) (nhp + 1), attrlen, RTA_GATEWAY); | 183 | gw_attr = nla_find((struct nlattr *) (nhp + 1), attrlen, RTA_GATEWAY); |
182 | nh->nh_gw = gw_attr ? nla_get_le16(gw_attr) : 0; | 184 | nh->nh_gw = gw_attr ? nla_get_le16(gw_attr) : 0; |
183 | } | 185 | } |
184 | nhp = RTNH_NEXT(nhp); | 186 | |
187 | nhp = rtnh_next(nhp, &nhlen); | ||
185 | } endfor_nexthops(fi); | 188 | } endfor_nexthops(fi); |
186 | 189 | ||
187 | return 0; | 190 | return 0; |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index cbac493c913a..e23f141c9ba5 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -271,7 +271,7 @@ static int ip_finish_output(struct net *net, struct sock *sk, struct sk_buff *sk | |||
271 | return dst_output(net, sk, skb); | 271 | return dst_output(net, sk, skb); |
272 | } | 272 | } |
273 | #endif | 273 | #endif |
274 | mtu = ip_skb_dst_mtu(skb); | 274 | mtu = ip_skb_dst_mtu(sk, skb); |
275 | if (skb_is_gso(skb)) | 275 | if (skb_is_gso(skb)) |
276 | return ip_finish_output_gso(net, sk, skb, mtu); | 276 | return ip_finish_output_gso(net, sk, skb, mtu); |
277 | 277 | ||
@@ -541,7 +541,7 @@ int ip_do_fragment(struct net *net, struct sock *sk, struct sk_buff *skb, | |||
541 | 541 | ||
542 | iph = ip_hdr(skb); | 542 | iph = ip_hdr(skb); |
543 | 543 | ||
544 | mtu = ip_skb_dst_mtu(skb); | 544 | mtu = ip_skb_dst_mtu(sk, skb); |
545 | if (IPCB(skb)->frag_max_size && IPCB(skb)->frag_max_size < mtu) | 545 | if (IPCB(skb)->frag_max_size && IPCB(skb)->frag_max_size < mtu) |
546 | mtu = IPCB(skb)->frag_max_size; | 546 | mtu = IPCB(skb)->frag_max_size; |
547 | 547 | ||
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 1bcef2369d64..771be1fa4176 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c | |||
@@ -177,6 +177,7 @@ static void rt6_free_pcpu(struct rt6_info *non_pcpu_rt) | |||
177 | } | 177 | } |
178 | } | 178 | } |
179 | 179 | ||
180 | free_percpu(non_pcpu_rt->rt6i_pcpu); | ||
180 | non_pcpu_rt->rt6i_pcpu = NULL; | 181 | non_pcpu_rt->rt6i_pcpu = NULL; |
181 | } | 182 | } |
182 | 183 | ||
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 48b58957adf4..9d92c4c46871 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -1341,7 +1341,7 @@ static unsigned int fanout_demux_hash(struct packet_fanout *f, | |||
1341 | struct sk_buff *skb, | 1341 | struct sk_buff *skb, |
1342 | unsigned int num) | 1342 | unsigned int num) |
1343 | { | 1343 | { |
1344 | return reciprocal_scale(skb_get_hash(skb), num); | 1344 | return reciprocal_scale(__skb_get_hash_symmetric(skb), num); |
1345 | } | 1345 | } |
1346 | 1346 | ||
1347 | static unsigned int fanout_demux_lb(struct packet_fanout *f, | 1347 | static unsigned int fanout_demux_lb(struct packet_fanout *f, |
diff --git a/net/rds/tcp.c b/net/rds/tcp.c index d278432f080b..d24f6c142d03 100644 --- a/net/rds/tcp.c +++ b/net/rds/tcp.c | |||
@@ -651,7 +651,7 @@ static int rds_tcp_init(void) | |||
651 | 651 | ||
652 | ret = rds_tcp_recv_init(); | 652 | ret = rds_tcp_recv_init(); |
653 | if (ret) | 653 | if (ret) |
654 | goto out_slab; | 654 | goto out_pernet; |
655 | 655 | ||
656 | ret = rds_trans_register(&rds_tcp_transport); | 656 | ret = rds_trans_register(&rds_tcp_transport); |
657 | if (ret) | 657 | if (ret) |
@@ -663,8 +663,9 @@ static int rds_tcp_init(void) | |||
663 | 663 | ||
664 | out_recv: | 664 | out_recv: |
665 | rds_tcp_recv_exit(); | 665 | rds_tcp_recv_exit(); |
666 | out_slab: | 666 | out_pernet: |
667 | unregister_pernet_subsys(&rds_tcp_net_ops); | 667 | unregister_pernet_subsys(&rds_tcp_net_ops); |
668 | out_slab: | ||
668 | kmem_cache_destroy(rds_tcp_conn_slab); | 669 | kmem_cache_destroy(rds_tcp_conn_slab); |
669 | out: | 670 | out: |
670 | return ret; | 671 | return ret; |
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index 5b135d357e1e..70cfbbf96af2 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c | |||
@@ -181,7 +181,7 @@ static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a, | |||
181 | 181 | ||
182 | if (!(at & AT_EGRESS)) { | 182 | if (!(at & AT_EGRESS)) { |
183 | if (m->tcfm_ok_push) | 183 | if (m->tcfm_ok_push) |
184 | skb_push(skb2, skb->mac_len); | 184 | skb_push_rcsum(skb2, skb->mac_len); |
185 | } | 185 | } |
186 | 186 | ||
187 | /* mirror is always swallowed */ | 187 | /* mirror is always swallowed */ |
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c index 3ad9fab1985f..1fd464764765 100644 --- a/net/tipc/netlink_compat.c +++ b/net/tipc/netlink_compat.c | |||
@@ -604,7 +604,7 @@ static int tipc_nl_compat_link_dump(struct tipc_nl_compat_msg *msg, | |||
604 | 604 | ||
605 | link_info.dest = nla_get_flag(link[TIPC_NLA_LINK_DEST]); | 605 | link_info.dest = nla_get_flag(link[TIPC_NLA_LINK_DEST]); |
606 | link_info.up = htonl(nla_get_flag(link[TIPC_NLA_LINK_UP])); | 606 | link_info.up = htonl(nla_get_flag(link[TIPC_NLA_LINK_UP])); |
607 | nla_strlcpy(link_info.str, nla_data(link[TIPC_NLA_LINK_NAME]), | 607 | nla_strlcpy(link_info.str, link[TIPC_NLA_LINK_NAME], |
608 | TIPC_MAX_LINK_NAME); | 608 | TIPC_MAX_LINK_NAME); |
609 | 609 | ||
610 | return tipc_add_tlv(msg->rep, TIPC_TLV_LINK_INFO, | 610 | return tipc_add_tlv(msg->rep, TIPC_TLV_LINK_INFO, |