Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes from David Miller:

1) Handle frames in error situations properly in AF_XDP, from Jakub
Kicinski.

2) tcp_mmap test case only tests ipv6 due to a thinko, fix from
Maninder Singh.

3) Session refcnt fix in l2tp_ppp, from Guillaume Nault.

4) Fix regression in netlink bind handling of multicast gruops, from
Dmitry Safonov.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
netlink: Don't shift on 64 for ngroups
net/smc: no cursor update send in state SMC_INIT
l2tp: fix missing refcount drop in pppol2tp_tunnel_ioctl()
mlxsw: core_acl_flex_actions: Remove redundant mirror resource destruction
mlxsw: core_acl_flex_actions: Remove redundant counter destruction
mlxsw: core_acl_flex_actions: Remove redundant resource destruction
mlxsw: core_acl_flex_actions: Return error for conflicting actions
selftests/bpf: update test_lwt_seg6local.sh according to iproute2
drivers: net: lmc: fix case value for target abort error
selftest/net: fix protocol family to work for IPv4.
net: xsk: don't return frames via the allocator on error
tools/bpftool: fix a percpu_array map dump problem

+58 -43
+29 -22
drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c
··· 327 327 list_add(&resource->list, &block->resource_list); 328 328 } 329 329 330 + static void mlxsw_afa_resource_del(struct mlxsw_afa_resource *resource) 331 + { 332 + list_del(&resource->list); 333 + } 334 + 330 335 static void mlxsw_afa_resources_destroy(struct mlxsw_afa_block *block) 331 336 { 332 337 struct mlxsw_afa_resource *resource, *tmp; 333 338 334 339 list_for_each_entry_safe(resource, tmp, &block->resource_list, list) { 335 - list_del(&resource->list); 336 340 resource->destructor(block, resource); 337 341 } 338 342 } ··· 534 530 mlxsw_afa_fwd_entry_ref_destroy(struct mlxsw_afa_block *block, 535 531 struct mlxsw_afa_fwd_entry_ref *fwd_entry_ref) 536 532 { 533 + mlxsw_afa_resource_del(&fwd_entry_ref->resource); 537 534 mlxsw_afa_fwd_entry_put(block->afa, fwd_entry_ref->fwd_entry); 538 535 kfree(fwd_entry_ref); 539 536 } ··· 584 579 mlxsw_afa_counter_destroy(struct mlxsw_afa_block *block, 585 580 struct mlxsw_afa_counter *counter) 586 581 { 582 + mlxsw_afa_resource_del(&counter->resource); 587 583 block->afa->ops->counter_index_put(block->afa->ops_priv, 588 584 counter->counter_index); 589 585 kfree(counter); ··· 632 626 char *oneact; 633 627 char *actions; 634 628 635 - if (WARN_ON(block->finished)) 636 - return NULL; 629 + if (block->finished) 630 + return ERR_PTR(-EINVAL); 637 631 if (block->cur_act_index + action_size > 638 632 block->afa->max_acts_per_set) { 639 633 struct mlxsw_afa_set *set; ··· 643 637 */ 644 638 set = mlxsw_afa_set_create(false); 645 639 if (!set) 646 - return NULL; 640 + return ERR_PTR(-ENOBUFS); 647 641 set->prev = block->cur_set; 648 642 block->cur_act_index = 0; 649 643 block->cur_set->next = set; ··· 730 724 MLXSW_AFA_VLAN_CODE, 731 725 MLXSW_AFA_VLAN_SIZE); 732 726 733 - if (!act) 734 - return -ENOBUFS; 727 + if (IS_ERR(act)) 728 + return PTR_ERR(act); 735 729 mlxsw_afa_vlan_pack(act, MLXSW_AFA_VLAN_VLAN_TAG_CMD_NOP, 736 730 MLXSW_AFA_VLAN_CMD_SET_OUTER, vid, 737 731 MLXSW_AFA_VLAN_CMD_SET_OUTER, pcp, ··· 812 806 MLXSW_AFA_TRAPDISC_CODE, 813 807 MLXSW_AFA_TRAPDISC_SIZE); 814 808 815 - if (!act) 816 - return -ENOBUFS; 809 + if (IS_ERR(act)) 810 + return PTR_ERR(act); 817 811 mlxsw_afa_trapdisc_pack(act, MLXSW_AFA_TRAPDISC_TRAP_ACTION_NOP, 818 812 MLXSW_AFA_TRAPDISC_FORWARD_ACTION_DISCARD, 0); 819 813 return 0; ··· 826 820 MLXSW_AFA_TRAPDISC_CODE, 827 821 MLXSW_AFA_TRAPDISC_SIZE); 828 822 829 - if (!act) 830 - return -ENOBUFS; 823 + if (IS_ERR(act)) 824 + return PTR_ERR(act); 831 825 mlxsw_afa_trapdisc_pack(act, MLXSW_AFA_TRAPDISC_TRAP_ACTION_TRAP, 832 826 MLXSW_AFA_TRAPDISC_FORWARD_ACTION_DISCARD, 833 827 trap_id); ··· 842 836 MLXSW_AFA_TRAPDISC_CODE, 843 837 MLXSW_AFA_TRAPDISC_SIZE); 844 838 845 - if (!act) 846 - return -ENOBUFS; 839 + if (IS_ERR(act)) 840 + return PTR_ERR(act); 847 841 mlxsw_afa_trapdisc_pack(act, MLXSW_AFA_TRAPDISC_TRAP_ACTION_TRAP, 848 842 MLXSW_AFA_TRAPDISC_FORWARD_ACTION_FORWARD, 849 843 trap_id); ··· 862 856 mlxsw_afa_mirror_destroy(struct mlxsw_afa_block *block, 863 857 struct mlxsw_afa_mirror *mirror) 864 858 { 859 + mlxsw_afa_resource_del(&mirror->resource); 865 860 block->afa->ops->mirror_del(block->afa->ops_priv, 866 861 mirror->local_in_port, 867 862 mirror->span_id, ··· 915 908 char *act = mlxsw_afa_block_append_action(block, 916 909 MLXSW_AFA_TRAPDISC_CODE, 917 910 MLXSW_AFA_TRAPDISC_SIZE); 918 - if (!act) 919 - return -ENOBUFS; 911 + if (IS_ERR(act)) 912 + return PTR_ERR(act); 920 913 mlxsw_afa_trapdisc_pack(act, MLXSW_AFA_TRAPDISC_TRAP_ACTION_NOP, 921 914 MLXSW_AFA_TRAPDISC_FORWARD_ACTION_FORWARD, 0); 922 915 mlxsw_afa_trapdisc_mirror_pack(act, true, mirror_agent); ··· 1003 996 1004 997 act = mlxsw_afa_block_append_action(block, MLXSW_AFA_FORWARD_CODE, 1005 998 MLXSW_AFA_FORWARD_SIZE); 1006 - if (!act) { 1007 - err = -ENOBUFS; 999 + if (IS_ERR(act)) { 1000 + err = PTR_ERR(act); 1008 1001 goto err_append_action; 1009 1002 } 1010 1003 mlxsw_afa_forward_pack(act, MLXSW_AFA_FORWARD_TYPE_PBS, ··· 1059 1052 { 1060 1053 char *act = mlxsw_afa_block_append_action(block, MLXSW_AFA_POLCNT_CODE, 1061 1054 MLXSW_AFA_POLCNT_SIZE); 1062 - if (!act) 1063 - return -ENOBUFS; 1055 + if (IS_ERR(act)) 1056 + return PTR_ERR(act); 1064 1057 mlxsw_afa_polcnt_pack(act, MLXSW_AFA_POLCNT_COUNTER_SET_TYPE_PACKETS_BYTES, 1065 1058 counter_index); 1066 1059 return 0; ··· 1130 1123 char *act = mlxsw_afa_block_append_action(block, 1131 1124 MLXSW_AFA_VIRFWD_CODE, 1132 1125 MLXSW_AFA_VIRFWD_SIZE); 1133 - if (!act) 1134 - return -ENOBUFS; 1126 + if (IS_ERR(act)) 1127 + return PTR_ERR(act); 1135 1128 mlxsw_afa_virfwd_pack(act, MLXSW_AFA_VIRFWD_FID_CMD_SET, fid); 1136 1129 return 0; 1137 1130 } ··· 1200 1193 char *act = mlxsw_afa_block_append_action(block, 1201 1194 MLXSW_AFA_MCROUTER_CODE, 1202 1195 MLXSW_AFA_MCROUTER_SIZE); 1203 - if (!act) 1204 - return -ENOBUFS; 1196 + if (IS_ERR(act)) 1197 + return PTR_ERR(act); 1205 1198 mlxsw_afa_mcrouter_pack(act, MLXSW_AFA_MCROUTER_RPF_ACTION_TRAP, 1206 1199 expected_irif, min_mtu, rmid_valid, kvdl_index); 1207 1200 return 0;
+1 -1
drivers/net/wan/lmc/lmc_main.c
··· 1362 1362 case 0x001: 1363 1363 printk(KERN_WARNING "%s: Master Abort (naughty)\n", dev->name); 1364 1364 break; 1365 - case 0x010: 1365 + case 0x002: 1366 1366 printk(KERN_WARNING "%s: Target Abort (not so naughty)\n", dev->name); 1367 1367 break; 1368 1368 default:
+10 -5
net/l2tp/l2tp_ppp.c
··· 1201 1201 l2tp_session_get(sock_net(sk), tunnel, 1202 1202 stats.session_id); 1203 1203 1204 - if (session && session->pwtype == L2TP_PWTYPE_PPP) { 1205 - err = pppol2tp_session_ioctl(session, cmd, 1206 - arg); 1207 - l2tp_session_dec_refcount(session); 1208 - } else { 1204 + if (!session) { 1209 1205 err = -EBADR; 1206 + break; 1210 1207 } 1208 + if (session->pwtype != L2TP_PWTYPE_PPP) { 1209 + l2tp_session_dec_refcount(session); 1210 + err = -EBADR; 1211 + break; 1212 + } 1213 + 1214 + err = pppol2tp_session_ioctl(session, cmd, arg); 1215 + l2tp_session_dec_refcount(session); 1211 1216 break; 1212 1217 } 1213 1218 #ifdef CONFIG_XFRM
+2 -2
net/netlink/af_netlink.c
··· 1013 1013 1014 1014 if (nlk->ngroups == 0) 1015 1015 groups = 0; 1016 - else 1017 - groups &= (1ULL << nlk->ngroups) - 1; 1016 + else if (nlk->ngroups < 8*sizeof(groups)) 1017 + groups &= (1UL << nlk->ngroups) - 1; 1018 1018 1019 1019 bound = nlk->bound; 1020 1020 if (bound) {
+2 -1
net/smc/smc_cdc.c
··· 233 233 /* force immediate tx of current consumer cursor, but 234 234 * under send_lock to guarantee arrival in seqno-order 235 235 */ 236 - smc_tx_sndbuf_nonempty(conn); 236 + if (smc->sk.sk_state != SMC_INIT) 237 + smc_tx_sndbuf_nonempty(conn); 237 238 } 238 239 } 239 240
+1 -3
net/xdp/xsk.c
··· 84 84 { 85 85 int err = xskq_produce_batch_desc(xs->rx, (u64)xdp->handle, len); 86 86 87 - if (err) { 88 - xdp_return_buff(xdp); 87 + if (err) 89 88 xs->rx_dropped++; 90 - } 91 89 92 90 return err; 93 91 }
+9 -5
tools/bpf/bpftool/map.c
··· 36 36 #include <assert.h> 37 37 #include <errno.h> 38 38 #include <fcntl.h> 39 + #include <linux/kernel.h> 39 40 #include <stdbool.h> 40 41 #include <stdio.h> 41 42 #include <stdlib.h> ··· 91 90 static void *alloc_value(struct bpf_map_info *info) 92 91 { 93 92 if (map_is_per_cpu(info->type)) 94 - return malloc(info->value_size * get_possible_cpus()); 93 + return malloc(round_up(info->value_size, 8) * 94 + get_possible_cpus()); 95 95 else 96 96 return malloc(info->value_size); 97 97 } ··· 163 161 jsonw_name(json_wtr, "value"); 164 162 print_hex_data_json(value, info->value_size); 165 163 } else { 166 - unsigned int i, n; 164 + unsigned int i, n, step; 167 165 168 166 n = get_possible_cpus(); 167 + step = round_up(info->value_size, 8); 169 168 170 169 jsonw_name(json_wtr, "key"); 171 170 print_hex_data_json(key, info->key_size); ··· 179 176 jsonw_int_field(json_wtr, "cpu", i); 180 177 181 178 jsonw_name(json_wtr, "value"); 182 - print_hex_data_json(value + i * info->value_size, 179 + print_hex_data_json(value + i * step, 183 180 info->value_size); 184 181 185 182 jsonw_end_object(json_wtr); ··· 210 207 211 208 printf("\n"); 212 209 } else { 213 - unsigned int i, n; 210 + unsigned int i, n, step; 214 211 215 212 n = get_possible_cpus(); 213 + step = round_up(info->value_size, 8); 216 214 217 215 printf("key:\n"); 218 216 fprint_hex(stdout, key, info->key_size, " "); ··· 221 217 for (i = 0; i < n; i++) { 222 218 printf("value (CPU %02d):%c", 223 219 i, info->value_size > 16 ? '\n' : ' '); 224 - fprint_hex(stdout, value + i * info->value_size, 220 + fprint_hex(stdout, value + i * step, 225 221 info->value_size, " "); 226 222 printf("\n"); 227 223 }
+3 -3
tools/testing/selftests/bpf/test_lwt_seg6local.sh
··· 115 115 ip netns exec ns2 ip -6 route add fd00::1 dev veth3 via fb00::43 scope link 116 116 117 117 ip netns exec ns3 ip -6 route add fc42::1 dev veth5 via fb00::65 118 - ip netns exec ns3 ip -6 route add fd00::1 encap seg6local action End.BPF obj test_lwt_seg6local.o sec add_egr_x dev veth4 118 + ip netns exec ns3 ip -6 route add fd00::1 encap seg6local action End.BPF endpoint obj test_lwt_seg6local.o sec add_egr_x dev veth4 119 119 120 - ip netns exec ns4 ip -6 route add fd00::2 encap seg6local action End.BPF obj test_lwt_seg6local.o sec pop_egr dev veth6 120 + ip netns exec ns4 ip -6 route add fd00::2 encap seg6local action End.BPF endpoint obj test_lwt_seg6local.o sec pop_egr dev veth6 121 121 ip netns exec ns4 ip -6 addr add fc42::1 dev lo 122 122 ip netns exec ns4 ip -6 route add fd00::3 dev veth7 via fb00::87 123 123 124 124 ip netns exec ns5 ip -6 route add fd00::4 table 117 dev veth9 via fb00::109 125 - ip netns exec ns5 ip -6 route add fd00::3 encap seg6local action End.BPF obj test_lwt_seg6local.o sec inspect_t dev veth8 125 + ip netns exec ns5 ip -6 route add fd00::3 encap seg6local action End.BPF endpoint obj test_lwt_seg6local.o sec inspect_t dev veth8 126 126 127 127 ip netns exec ns6 ip -6 addr add fb00::6/16 dev lo 128 128 ip netns exec ns6 ip -6 addr add fd00::4/16 dev lo
+1 -1
tools/testing/selftests/net/tcp_mmap.c
··· 402 402 exit(1); 403 403 } 404 404 405 - fd = socket(AF_INET6, SOCK_STREAM, 0); 405 + fd = socket(cfg_family, SOCK_STREAM, 0); 406 406 if (fd == -1) { 407 407 perror("socket"); 408 408 exit(1);