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 tag 'net-6.11-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Pull networking fixes from Paolo Abeni:
"Including fixes from netfilter.

Notably this includes fixes for a s390 build breakage.

Current release - new code bugs:

- eth: fbnic: fix s390 build

- eth: airoha: fix NULL pointer dereference in
airoha_qdma_cleanup_rx_queue()

Previous releases - regressions:

- flow_dissector: use DEBUG_NET_WARN_ON_ONCE

- ipv4: fix incorrect TOS in route get reply

- dsa: fix chip-wide frame size config in some drivers

Previous releases - always broken:

- netfilter: nf_set_pipapo: fix initial map fill

- eth: gve: fix XDP TX completion handling when counters overflow"

* tag 'net-6.11-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net:
eth: fbnic: don't build the driver when skb has more than 21 frags
net: dsa: b53: Limit chip-wide jumbo frame config to CPU ports
net: dsa: mv88e6xxx: Limit chip-wide frame size config to CPU ports
net: airoha: Fix NULL pointer dereference in airoha_qdma_cleanup_rx_queue()
net: wwan: t7xx: add support for Dell DW5933e
ipv4: Fix incorrect TOS in fibmatch route get reply
ipv4: Fix incorrect TOS in route get reply
net: flow_dissector: use DEBUG_NET_WARN_ON_ONCE
driver core: auxiliary bus: Fix documentation of auxiliary_device
net: airoha: fix error branch in airoha_dev_xmit and airoha_set_gdm_ports
gve: Fix XDP TX completion handling when counters overflow
ipvs: properly dereference pe in ip_vs_add_service
selftests: netfilter: add test case for recent mismatch bug
netfilter: nf_set_pipapo: fix initial map fill
netfilter: ctnetlink: use helper function to calculate expect ID
eth: fbnic: fix s390 build.

+156 -46
+3
drivers/net/dsa/b53/b53_common.c
··· 2256 2256 if (is5325(dev) || is5365(dev)) 2257 2257 return -EOPNOTSUPP; 2258 2258 2259 + if (!dsa_is_cpu_port(ds, port)) 2260 + return 0; 2261 + 2259 2262 enable_jumbo = (mtu >= JMS_MIN_SIZE); 2260 2263 allow_10_100 = (dev->chip_id == BCM583XX_DEVICE_ID); 2261 2264
+2 -1
drivers/net/dsa/mv88e6xxx/chip.c
··· 3626 3626 mv88e6xxx_reg_lock(chip); 3627 3627 if (chip->info->ops->port_set_jumbo_size) 3628 3628 ret = chip->info->ops->port_set_jumbo_size(chip, port, new_mtu); 3629 - else if (chip->info->ops->set_max_frame_size) 3629 + else if (chip->info->ops->set_max_frame_size && 3630 + dsa_is_cpu_port(ds, port)) 3630 3631 ret = chip->info->ops->set_max_frame_size(chip, new_mtu); 3631 3632 mv88e6xxx_reg_unlock(chip); 3632 3633
+3 -2
drivers/net/ethernet/google/gve/gve_tx.c
··· 158 158 u32 to_do) 159 159 { 160 160 struct gve_tx_buffer_state *info; 161 - u32 clean_end = tx->done + to_do; 162 161 u64 pkts = 0, bytes = 0; 163 162 size_t space_freed = 0; 164 163 u32 xsk_complete = 0; 165 164 u32 idx; 165 + int i; 166 166 167 - for (; tx->done < clean_end; tx->done++) { 167 + for (i = 0; i < to_do; i++) { 168 168 idx = tx->done & tx->mask; 169 169 info = &tx->info[idx]; 170 + tx->done++; 170 171 171 172 if (unlikely(!info->xdp.size)) 172 173 continue;
+7 -6
drivers/net/ethernet/mediatek/airoha_eth.c
··· 977 977 return 0; 978 978 979 979 error: 980 - for (i--; i >= 0; i++) 980 + for (i--; i >= 0; i--) 981 981 airoha_set_gdm_port(eth, port_list[i], false); 982 982 983 983 return err; ··· 1585 1585 1586 1586 static void airoha_qdma_cleanup_rx_queue(struct airoha_queue *q) 1587 1587 { 1588 - enum dma_data_direction dir = page_pool_get_dma_dir(q->page_pool); 1589 1588 struct airoha_eth *eth = q->eth; 1590 1589 1591 1590 while (q->queued) { ··· 1592 1593 struct page *page = virt_to_head_page(e->buf); 1593 1594 1594 1595 dma_sync_single_for_cpu(eth->dev, e->dma_addr, e->dma_len, 1595 - dir); 1596 + page_pool_get_dma_dir(q->page_pool)); 1596 1597 page_pool_put_full_page(q->page_pool, page, false); 1597 1598 q->tail = (q->tail + 1) % q->ndesc; 1598 1599 q->queued--; ··· 2430 2431 return NETDEV_TX_OK; 2431 2432 2432 2433 error_unmap: 2433 - for (i--; i >= 0; i++) 2434 - dma_unmap_single(dev->dev.parent, q->entry[i].dma_addr, 2435 - q->entry[i].dma_len, DMA_TO_DEVICE); 2434 + for (i--; i >= 0; i--) { 2435 + index = (q->head + i) % q->ndesc; 2436 + dma_unmap_single(dev->dev.parent, q->entry[index].dma_addr, 2437 + q->entry[index].dma_len, DMA_TO_DEVICE); 2438 + } 2436 2439 2437 2440 spin_unlock_bh(&q->lock); 2438 2441 error:
+2
drivers/net/ethernet/meta/Kconfig
··· 20 20 config FBNIC 21 21 tristate "Meta Platforms Host Network Interface" 22 22 depends on X86_64 || COMPILE_TEST 23 + depends on S390=n 24 + depends on MAX_SKB_FRAGS < 22 23 25 depends on PCI_MSI 24 26 select PHYLINK 25 27 help
+1
drivers/net/wwan/t7xx/t7xx_pci.c
··· 852 852 853 853 static const struct pci_device_id t7xx_pci_table[] = { 854 854 { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x4d75) }, 855 + { PCI_DEVICE(0x14c0, 0x4d75) }, // Dell DW5933e 855 856 { } 856 857 }; 857 858 MODULE_DEVICE_TABLE(pci, t7xx_pci_table);
+4 -3
include/linux/auxiliary_bus.h
··· 58 58 * in 59 59 * @name: Match name found by the auxiliary device driver, 60 60 * @id: unique identitier if multiple devices of the same name are exported, 61 - * @irqs: irqs xarray contains irq indices which are used by the device, 62 - * @lock: Synchronize irq sysfs creation, 63 - * @irq_dir_exists: whether "irqs" directory exists, 61 + * @sysfs: embedded struct which hold all sysfs related fields, 62 + * @sysfs.irqs: irqs xarray contains irq indices which are used by the device, 63 + * @sysfs.lock: Synchronize irq sysfs creation, 64 + * @sysfs.irq_dir_exists: whether "irqs" directory exists, 64 65 * 65 66 * An auxiliary_device represents a part of its parent device's functionality. 66 67 * It is given a name that, combined with the registering drivers
+1
include/net/ip_fib.h
··· 173 173 unsigned char type; 174 174 unsigned char scope; 175 175 u32 tclassid; 176 + dscp_t dscp; 176 177 struct fib_nh_common *nhc; 177 178 struct fib_info *fi; 178 179 struct fib_table *table;
+1 -1
net/core/flow_dissector.c
··· 1117 1117 } 1118 1118 } 1119 1119 1120 - WARN_ON_ONCE(!net); 1120 + DEBUG_NET_WARN_ON_ONCE(!net); 1121 1121 if (net) { 1122 1122 enum netns_bpf_attach_type type = NETNS_BPF_FLOW_DISSECTOR; 1123 1123 struct bpf_prog_array *run_array;
+1
net/ipv4/fib_trie.c
··· 1629 1629 res->nhc = nhc; 1630 1630 res->type = fa->fa_type; 1631 1631 res->scope = fi->fib_scope; 1632 + res->dscp = fa->fa_dscp; 1632 1633 res->fi = fi; 1633 1634 res->table = tb; 1634 1635 res->fa_head = &n->leaf;
+8 -8
net/ipv4/route.c
··· 2867 2867 2868 2868 /* called with rcu_read_lock held */ 2869 2869 static int rt_fill_info(struct net *net, __be32 dst, __be32 src, 2870 - struct rtable *rt, u32 table_id, struct flowi4 *fl4, 2871 - struct sk_buff *skb, u32 portid, u32 seq, 2872 - unsigned int flags) 2870 + struct rtable *rt, u32 table_id, dscp_t dscp, 2871 + struct flowi4 *fl4, struct sk_buff *skb, u32 portid, 2872 + u32 seq, unsigned int flags) 2873 2873 { 2874 2874 struct rtmsg *r; 2875 2875 struct nlmsghdr *nlh; ··· 2885 2885 r->rtm_family = AF_INET; 2886 2886 r->rtm_dst_len = 32; 2887 2887 r->rtm_src_len = 0; 2888 - r->rtm_tos = fl4 ? fl4->flowi4_tos : 0; 2888 + r->rtm_tos = inet_dscp_to_dsfield(dscp); 2889 2889 r->rtm_table = table_id < 256 ? table_id : RT_TABLE_COMPAT; 2890 2890 if (nla_put_u32(skb, RTA_TABLE, table_id)) 2891 2891 goto nla_put_failure; ··· 3035 3035 goto next; 3036 3036 3037 3037 err = rt_fill_info(net, fnhe->fnhe_daddr, 0, rt, 3038 - table_id, NULL, skb, 3038 + table_id, 0, NULL, skb, 3039 3039 NETLINK_CB(cb->skb).portid, 3040 3040 cb->nlh->nlmsg_seq, flags); 3041 3041 if (err) ··· 3331 3331 fri.tb_id = table_id; 3332 3332 fri.dst = res.prefix; 3333 3333 fri.dst_len = res.prefixlen; 3334 - fri.dscp = inet_dsfield_to_dscp(fl4.flowi4_tos); 3334 + fri.dscp = res.dscp; 3335 3335 fri.type = rt->rt_type; 3336 3336 fri.offload = 0; 3337 3337 fri.trap = 0; ··· 3358 3358 err = fib_dump_info(skb, NETLINK_CB(in_skb).portid, 3359 3359 nlh->nlmsg_seq, RTM_NEWROUTE, &fri, 0); 3360 3360 } else { 3361 - err = rt_fill_info(net, dst, src, rt, table_id, &fl4, skb, 3362 - NETLINK_CB(in_skb).portid, 3361 + err = rt_fill_info(net, dst, src, rt, table_id, res.dscp, &fl4, 3362 + skb, NETLINK_CB(in_skb).portid, 3363 3363 nlh->nlmsg_seq, 0); 3364 3364 } 3365 3365 if (err < 0)
+5 -5
net/netfilter/ipvs/ip_vs_ctl.c
··· 1459 1459 if (ret < 0) 1460 1460 goto out_err; 1461 1461 1462 - /* Bind the ct retriever */ 1463 - RCU_INIT_POINTER(svc->pe, pe); 1464 - pe = NULL; 1465 - 1466 1462 /* Update the virtual service counters */ 1467 1463 if (svc->port == FTPPORT) 1468 1464 atomic_inc(&ipvs->ftpsvc_counter); 1469 1465 else if (svc->port == 0) 1470 1466 atomic_inc(&ipvs->nullsvc_counter); 1471 - if (svc->pe && svc->pe->conn_out) 1467 + if (pe && pe->conn_out) 1472 1468 atomic_inc(&ipvs->conn_out_counter); 1469 + 1470 + /* Bind the ct retriever */ 1471 + RCU_INIT_POINTER(svc->pe, pe); 1472 + pe = NULL; 1473 1473 1474 1474 /* Count only IPv4 services for old get/setsockopt interface */ 1475 1475 if (svc->af == AF_INET)
+2 -1
net/netfilter/nf_conntrack_netlink.c
··· 3420 3420 3421 3421 if (cda[CTA_EXPECT_ID]) { 3422 3422 __be32 id = nla_get_be32(cda[CTA_EXPECT_ID]); 3423 - if (ntohl(id) != (u32)(unsigned long)exp) { 3423 + 3424 + if (id != nf_expect_get_id(exp)) { 3424 3425 nf_ct_expect_put(exp); 3425 3426 return -ENOENT; 3426 3427 }
+2 -2
net/netfilter/nft_set_pipapo.c
··· 434 434 res_map = scratch->map + (map_index ? m->bsize_max : 0); 435 435 fill_map = scratch->map + (map_index ? 0 : m->bsize_max); 436 436 437 - memset(res_map, 0xff, m->bsize_max * sizeof(*res_map)); 437 + pipapo_resmap_init(m, res_map); 438 438 439 439 nft_pipapo_for_each_field(f, i, m) { 440 440 bool last = i == m->field_count - 1; ··· 542 542 goto out; 543 543 } 544 544 545 - memset(res_map, 0xff, m->bsize_max * sizeof(*res_map)); 545 + pipapo_resmap_init(m, res_map); 546 546 547 547 nft_pipapo_for_each_field(f, i, m) { 548 548 bool last = i == m->field_count - 1;
+21
net/netfilter/nft_set_pipapo.h
··· 278 278 return size; 279 279 } 280 280 281 + /** 282 + * pipapo_resmap_init() - Initialise result map before first use 283 + * @m: Matching data, including mapping table 284 + * @res_map: Result map 285 + * 286 + * Initialize all bits covered by the first field to one, so that after 287 + * the first step, only the matching bits of the first bit group remain. 288 + * 289 + * If other fields have a large bitmap, set remainder of res_map to 0. 290 + */ 291 + static inline void pipapo_resmap_init(const struct nft_pipapo_match *m, unsigned long *res_map) 292 + { 293 + const struct nft_pipapo_field *f = m->f; 294 + int i; 295 + 296 + for (i = 0; i < f->bsize; i++) 297 + res_map[i] = ULONG_MAX; 298 + 299 + for (i = f->bsize; i < m->bsize_max; i++) 300 + res_map[i] = 0ul; 301 + } 281 302 #endif /* _NFT_SET_PIPAPO_H */
+6 -4
net/netfilter/nft_set_pipapo_avx2.c
··· 1036 1036 1037 1037 /** 1038 1038 * nft_pipapo_avx2_lookup_slow() - Fallback function for uncommon field sizes 1039 + * @mdata: Matching data, including mapping table 1039 1040 * @map: Previous match result, used as initial bitmap 1040 1041 * @fill: Destination bitmap to be filled with current match result 1041 1042 * @f: Field, containing lookup and mapping tables ··· 1052 1051 * Return: -1 on no match, rule index of match if @last, otherwise first long 1053 1052 * word index to be checked next (i.e. first filled word). 1054 1053 */ 1055 - static int nft_pipapo_avx2_lookup_slow(unsigned long *map, unsigned long *fill, 1054 + static int nft_pipapo_avx2_lookup_slow(const struct nft_pipapo_match *mdata, 1055 + unsigned long *map, unsigned long *fill, 1056 1056 const struct nft_pipapo_field *f, 1057 1057 int offset, const u8 *pkt, 1058 1058 bool first, bool last) ··· 1062 1060 int i, ret = -1, b; 1063 1061 1064 1062 if (first) 1065 - memset(map, 0xff, bsize * sizeof(*map)); 1063 + pipapo_resmap_init(mdata, map); 1066 1064 1067 1065 for (i = offset; i < bsize; i++) { 1068 1066 if (f->bb == 8) ··· 1188 1186 } else if (f->groups == 16) { 1189 1187 NFT_SET_PIPAPO_AVX2_LOOKUP(8, 16); 1190 1188 } else { 1191 - ret = nft_pipapo_avx2_lookup_slow(res, fill, f, 1189 + ret = nft_pipapo_avx2_lookup_slow(m, res, fill, f, 1192 1190 ret, rp, 1193 1191 first, last); 1194 1192 } ··· 1204 1202 } else if (f->groups == 32) { 1205 1203 NFT_SET_PIPAPO_AVX2_LOOKUP(4, 32); 1206 1204 } else { 1207 - ret = nft_pipapo_avx2_lookup_slow(res, fill, f, 1205 + ret = nft_pipapo_avx2_lookup_slow(m, res, fill, f, 1208 1206 ret, rp, 1209 1207 first, last); 1210 1208 }
+12 -12
tools/testing/selftests/net/fib_tests.sh
··· 1737 1737 1738 1738 # DSCP 0x10 should match the specific route, no matter the ECN bits 1739 1739 $IP route get fibmatch 172.16.102.1 dsfield 0x10 | \ 1740 - grep -q "via 172.16.103.2" 1740 + grep -q "172.16.102.0/24 tos 0x10 via 172.16.103.2" 1741 1741 log_test $? 0 "IPv4 route with DSCP and ECN:Not-ECT" 1742 1742 1743 1743 $IP route get fibmatch 172.16.102.1 dsfield 0x11 | \ 1744 - grep -q "via 172.16.103.2" 1744 + grep -q "172.16.102.0/24 tos 0x10 via 172.16.103.2" 1745 1745 log_test $? 0 "IPv4 route with DSCP and ECN:ECT(1)" 1746 1746 1747 1747 $IP route get fibmatch 172.16.102.1 dsfield 0x12 | \ 1748 - grep -q "via 172.16.103.2" 1748 + grep -q "172.16.102.0/24 tos 0x10 via 172.16.103.2" 1749 1749 log_test $? 0 "IPv4 route with DSCP and ECN:ECT(0)" 1750 1750 1751 1751 $IP route get fibmatch 172.16.102.1 dsfield 0x13 | \ 1752 - grep -q "via 172.16.103.2" 1752 + grep -q "172.16.102.0/24 tos 0x10 via 172.16.103.2" 1753 1753 log_test $? 0 "IPv4 route with DSCP and ECN:CE" 1754 1754 1755 1755 # Unknown DSCP should match the generic route, no matter the ECN bits 1756 1756 $IP route get fibmatch 172.16.102.1 dsfield 0x14 | \ 1757 - grep -q "via 172.16.101.2" 1757 + grep -q "172.16.102.0/24 via 172.16.101.2" 1758 1758 log_test $? 0 "IPv4 route with unknown DSCP and ECN:Not-ECT" 1759 1759 1760 1760 $IP route get fibmatch 172.16.102.1 dsfield 0x15 | \ 1761 - grep -q "via 172.16.101.2" 1761 + grep -q "172.16.102.0/24 via 172.16.101.2" 1762 1762 log_test $? 0 "IPv4 route with unknown DSCP and ECN:ECT(1)" 1763 1763 1764 1764 $IP route get fibmatch 172.16.102.1 dsfield 0x16 | \ 1765 - grep -q "via 172.16.101.2" 1765 + grep -q "172.16.102.0/24 via 172.16.101.2" 1766 1766 log_test $? 0 "IPv4 route with unknown DSCP and ECN:ECT(0)" 1767 1767 1768 1768 $IP route get fibmatch 172.16.102.1 dsfield 0x17 | \ 1769 - grep -q "via 172.16.101.2" 1769 + grep -q "172.16.102.0/24 via 172.16.101.2" 1770 1770 log_test $? 0 "IPv4 route with unknown DSCP and ECN:CE" 1771 1771 1772 1772 # Null DSCP should match the generic route, no matter the ECN bits 1773 1773 $IP route get fibmatch 172.16.102.1 dsfield 0x00 | \ 1774 - grep -q "via 172.16.101.2" 1774 + grep -q "172.16.102.0/24 via 172.16.101.2" 1775 1775 log_test $? 0 "IPv4 route with no DSCP and ECN:Not-ECT" 1776 1776 1777 1777 $IP route get fibmatch 172.16.102.1 dsfield 0x01 | \ 1778 - grep -q "via 172.16.101.2" 1778 + grep -q "172.16.102.0/24 via 172.16.101.2" 1779 1779 log_test $? 0 "IPv4 route with no DSCP and ECN:ECT(1)" 1780 1780 1781 1781 $IP route get fibmatch 172.16.102.1 dsfield 0x02 | \ 1782 - grep -q "via 172.16.101.2" 1782 + grep -q "172.16.102.0/24 via 172.16.101.2" 1783 1783 log_test $? 0 "IPv4 route with no DSCP and ECN:ECT(0)" 1784 1784 1785 1785 $IP route get fibmatch 172.16.102.1 dsfield 0x03 | \ 1786 - grep -q "via 172.16.101.2" 1786 + grep -q "172.16.102.0/24 via 172.16.101.2" 1787 1787 log_test $? 0 "IPv4 route with no DSCP and ECN:CE" 1788 1788 } 1789 1789
+75 -1
tools/testing/selftests/net/netfilter/nft_concat_range.sh
··· 27 27 net6_port_net6_port net_port_mac_proto_net" 28 28 29 29 # Reported bugs, also described by TYPE_ variables below 30 - BUGS="flush_remove_add reload" 30 + BUGS="flush_remove_add reload net_port_proto_match" 31 31 32 32 # List of possible paths to pktgen script from kernel tree for performance tests 33 33 PKTGEN_SCRIPT_PATHS=" ··· 371 371 perf_duration 0 372 372 " 373 373 374 + TYPE_net_port_proto_match=" 375 + display net,port,proto 376 + type_spec ipv4_addr . inet_service . inet_proto 377 + chain_spec ip daddr . udp dport . meta l4proto 378 + dst addr4 port proto 379 + src 380 + start 1 381 + count 9 382 + src_delta 9 383 + tools sendip bash 384 + proto udp 385 + 386 + race_repeat 0 387 + 388 + perf_duration 0 389 + " 374 390 # Set template for all tests, types and rules are filled in depending on test 375 391 set_template=' 376 392 flush ruleset ··· 1566 1550 1567 1551 range_size=$((range_size + 1)) 1568 1552 start=$((end + range_size)) 1553 + done 1554 + 1555 + nft flush ruleset 1556 + } 1557 + 1558 + # - add ranged element, check that packets match it 1559 + # - delete element again, check it is gone 1560 + test_bug_net_port_proto_match() { 1561 + setup veth send_"${proto}" set || return ${ksft_skip} 1562 + rstart=${start} 1563 + 1564 + range_size=1 1565 + for i in $(seq 1 10); do 1566 + for j in $(seq 1 20) ; do 1567 + elem=$(printf "10.%d.%d.0/24 . %d1-%d0 . 6-17 " ${i} ${j} ${i} "$((i+1))") 1568 + 1569 + nft "add element inet filter test { $elem }" || return 1 1570 + nft "get element inet filter test { $elem }" | grep -q "$elem" 1571 + if [ $? -ne 0 ];then 1572 + local got=$(nft "get element inet filter test { $elem }") 1573 + err "post-add: should have returned $elem but got $got" 1574 + return 1 1575 + fi 1576 + done 1577 + done 1578 + 1579 + # recheck after set was filled 1580 + for i in $(seq 1 10); do 1581 + for j in $(seq 1 20) ; do 1582 + elem=$(printf "10.%d.%d.0/24 . %d1-%d0 . 6-17 " ${i} ${j} ${i} "$((i+1))") 1583 + 1584 + nft "get element inet filter test { $elem }" | grep -q "$elem" 1585 + if [ $? -ne 0 ];then 1586 + local got=$(nft "get element inet filter test { $elem }") 1587 + err "post-fill: should have returned $elem but got $got" 1588 + return 1 1589 + fi 1590 + done 1591 + done 1592 + 1593 + # random del and re-fetch 1594 + for i in $(seq 1 10); do 1595 + for j in $(seq 1 20) ; do 1596 + local rnd=$((RANDOM%10)) 1597 + local got="" 1598 + 1599 + elem=$(printf "10.%d.%d.0/24 . %d1-%d0 . 6-17 " ${i} ${j} ${i} "$((i+1))") 1600 + if [ $rnd -gt 0 ];then 1601 + continue 1602 + fi 1603 + 1604 + nft "delete element inet filter test { $elem }" 1605 + got=$(nft "get element inet filter test { $elem }" 2>/dev/null) 1606 + if [ $? -eq 0 ];then 1607 + err "post-delete: query for $elem returned $got instead of error." 1608 + return 1 1609 + fi 1610 + done 1569 1611 done 1570 1612 1571 1613 nft flush ruleset