1. 18 7月, 2020 1 次提交
    • E
      net: openvswitch: reorder masks array based on usage · eac87c41
      Eelco Chaudron 提交于
      This patch reorders the masks array every 4 seconds based on their
      usage count. This greatly reduces the masks per packet hit, and
      hence the overall performance. Especially in the OVS/OVN case for
      OpenShift.
      
      Here are some results from the OVS/OVN OpenShift test, which use
      8 pods, each pod having 512 uperf connections, each connection
      sends a 64-byte request and gets a 1024-byte response (TCP).
      All uperf clients are on 1 worker node while all uperf servers are
      on the other worker node.
      
      Kernel without this patch     :  7.71 Gbps
      Kernel with this patch applied: 14.52 Gbps
      
      We also run some tests to verify the rebalance activity does not
      lower the flow insertion rate, which does not.
      Signed-off-by: NEelco Chaudron <echaudro@redhat.com>
      Tested-by: NAndrew Theurer <atheurer@redhat.com>
      Reviewed-by: NPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eac87c41
  2. 17 7月, 2020 3 次提交
  3. 16 7月, 2020 1 次提交
  4. 15 7月, 2020 10 次提交
  5. 14 7月, 2020 25 次提交
    • V
      net: dsa: felix: create a template for the DSA tags on xmit · 67c24049
      Vladimir Oltean 提交于
      With this patch we try to kill 2 birds with 1 stone.
      
      First of all, some switches that use tag_ocelot.c don't have the exact
      same bitfield layout for the DSA tags. The destination ports field is
      different for Seville VSC9953 for example. So the choices are to either
      duplicate tag_ocelot.c into a new tag_seville.c (sub-optimal) or somehow
      take into account a supposed ocelot->dest_ports_offset when packing this
      field into the DSA injection header (again not ideal).
      
      Secondly, tag_ocelot.c already needs to memset a 128-bit area to zero
      and call some packing() functions of dubious performance in the
      fastpath. And most of the values it needs to pack are pretty much
      constant (BYPASS=1, SRC_PORT=CPU, DEST=port index). So it would be good
      if we could improve that.
      
      The proposed solution is to allocate a memory area per port at probe
      time, initialize that with the statically defined bits as per chip
      hardware revision, and just perform a simpler memcpy in the fastpath.
      
      Other alternatives have been analyzed, such as:
      - Create a separate tag_seville.c: too much code duplication for just 1
        bit field difference.
      - Create a separate DSA_TAG_PROTO_SEVILLE under tag_ocelot.c, just like
        tag_brcm.c, which would have a separate .xmit function. Again, too
        much code duplication for just 1 bit field difference.
      - Allocate the template from the init function of the tag_ocelot.c
        module, instead of from the driver: couldn't figure out a method of
        accessing the correct port template corresponding to the correct
        tagger in the .xmit function.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      67c24049
    • I
      devlink: Fix use-after-free when destroying health reporters · 5d037b4d
      Ido Schimmel 提交于
      Dereferencing the reporter after it was destroyed in order to unlock the
      reporters lock results in a use-after-free [1].
      
      Fix this by storing a pointer to the lock in a local variable before
      destroying the reporter.
      
      [1]
      ==================================================================
      BUG: KASAN: use-after-free in devlink_health_reporter_destroy+0x15c/0x1b0 net/core/devlink.c:5476
      Read of size 8 at addr ffff8880650fd020 by task syz-executor.1/904
      
      CPU: 0 PID: 904 Comm: syz-executor.1 Not tainted 5.8.0-rc2+ #35
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014
      Call Trace:
       __dump_stack lib/dump_stack.c:77 [inline]
       dump_stack+0xf6/0x16e lib/dump_stack.c:118
       print_address_description.constprop.0+0x1c/0x250 mm/kasan/report.c:383
       __kasan_report mm/kasan/report.c:513 [inline]
       kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530
       devlink_health_reporter_destroy+0x15c/0x1b0 net/core/devlink.c:5476
       nsim_dev_health_exit+0x8b/0xe0 drivers/net/netdevsim/health.c:317
       nsim_dev_reload_destroy+0x7f/0x110 drivers/net/netdevsim/dev.c:1134
       nsim_dev_reload_down+0x6e/0xd0 drivers/net/netdevsim/dev.c:712
       devlink_reload+0xc6/0x3b0 net/core/devlink.c:2952
       devlink_nl_cmd_reload+0x2f1/0x7c0 net/core/devlink.c:2987
       genl_family_rcv_msg_doit net/netlink/genetlink.c:691 [inline]
       genl_family_rcv_msg net/netlink/genetlink.c:736 [inline]
       genl_rcv_msg+0x611/0x9d0 net/netlink/genetlink.c:753
       netlink_rcv_skb+0x152/0x440 net/netlink/af_netlink.c:2469
       genl_rcv+0x24/0x40 net/netlink/genetlink.c:764
       netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
       netlink_unicast+0x53a/0x750 net/netlink/af_netlink.c:1329
       netlink_sendmsg+0x850/0xd90 net/netlink/af_netlink.c:1918
       sock_sendmsg_nosec net/socket.c:652 [inline]
       sock_sendmsg+0x150/0x190 net/socket.c:672
       ____sys_sendmsg+0x6d8/0x840 net/socket.c:2363
       ___sys_sendmsg+0xff/0x170 net/socket.c:2417
       __sys_sendmsg+0xe5/0x1b0 net/socket.c:2450
       do_syscall_64+0x56/0xa0 arch/x86/entry/common.c:359
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      RIP: 0033:0x4748ad
      Code: Bad RIP value.
      RSP: 002b:00007fd0358adc38 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
      RAX: ffffffffffffffda RBX: 000000000056bf00 RCX: 00000000004748ad
      RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000000000003
      RBP: 00000000ffffffff R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
      R13: 00000000004d1a4b R14: 00007fd0358ae6b4 R15: 00007fd0358add80
      
      Allocated by task 539:
       save_stack+0x1b/0x40 mm/kasan/common.c:48
       set_track mm/kasan/common.c:56 [inline]
       __kasan_kmalloc mm/kasan/common.c:494 [inline]
       __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:467
       kmalloc include/linux/slab.h:555 [inline]
       kzalloc include/linux/slab.h:669 [inline]
       __devlink_health_reporter_create+0x91/0x2f0 net/core/devlink.c:5359
       devlink_health_reporter_create+0xa1/0x170 net/core/devlink.c:5431
       nsim_dev_health_init+0x95/0x3a0 drivers/net/netdevsim/health.c:279
       nsim_dev_probe+0xb1e/0xeb0 drivers/net/netdevsim/dev.c:1086
       really_probe+0x287/0x6d0 drivers/base/dd.c:525
       driver_probe_device+0xfe/0x1d0 drivers/base/dd.c:701
       __device_attach_driver+0x21e/0x290 drivers/base/dd.c:807
       bus_for_each_drv+0x161/0x1e0 drivers/base/bus.c:431
       __device_attach+0x21a/0x360 drivers/base/dd.c:873
       bus_probe_device+0x1e6/0x290 drivers/base/bus.c:491
       device_add+0xaf2/0x1b00 drivers/base/core.c:2680
       nsim_bus_dev_new drivers/net/netdevsim/bus.c:336 [inline]
       new_device_store+0x374/0x590 drivers/net/netdevsim/bus.c:215
       bus_attr_store+0x75/0xa0 drivers/base/bus.c:122
       sysfs_kf_write+0x113/0x170 fs/sysfs/file.c:138
       kernfs_fop_write+0x25d/0x480 fs/kernfs/file.c:315
       __vfs_write+0x7c/0x100 fs/read_write.c:495
       vfs_write+0x265/0x5e0 fs/read_write.c:559
       ksys_write+0x12d/0x250 fs/read_write.c:612
       do_syscall_64+0x56/0xa0 arch/x86/entry/common.c:359
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Freed by task 904:
       save_stack+0x1b/0x40 mm/kasan/common.c:48
       set_track mm/kasan/common.c:56 [inline]
       kasan_set_free_info mm/kasan/common.c:316 [inline]
       __kasan_slab_free+0x12c/0x170 mm/kasan/common.c:455
       slab_free_hook mm/slub.c:1474 [inline]
       slab_free_freelist_hook mm/slub.c:1507 [inline]
       slab_free mm/slub.c:3072 [inline]
       kfree+0xe6/0x320 mm/slub.c:4063
       devlink_health_reporter_free net/core/devlink.c:5449 [inline]
       devlink_health_reporter_put+0xb7/0xf0 net/core/devlink.c:5456
       __devlink_health_reporter_destroy net/core/devlink.c:5463 [inline]
       devlink_health_reporter_destroy+0x11b/0x1b0 net/core/devlink.c:5475
       nsim_dev_health_exit+0x8b/0xe0 drivers/net/netdevsim/health.c:317
       nsim_dev_reload_destroy+0x7f/0x110 drivers/net/netdevsim/dev.c:1134
       nsim_dev_reload_down+0x6e/0xd0 drivers/net/netdevsim/dev.c:712
       devlink_reload+0xc6/0x3b0 net/core/devlink.c:2952
       devlink_nl_cmd_reload+0x2f1/0x7c0 net/core/devlink.c:2987
       genl_family_rcv_msg_doit net/netlink/genetlink.c:691 [inline]
       genl_family_rcv_msg net/netlink/genetlink.c:736 [inline]
       genl_rcv_msg+0x611/0x9d0 net/netlink/genetlink.c:753
       netlink_rcv_skb+0x152/0x440 net/netlink/af_netlink.c:2469
       genl_rcv+0x24/0x40 net/netlink/genetlink.c:764
       netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
       netlink_unicast+0x53a/0x750 net/netlink/af_netlink.c:1329
       netlink_sendmsg+0x850/0xd90 net/netlink/af_netlink.c:1918
       sock_sendmsg_nosec net/socket.c:652 [inline]
       sock_sendmsg+0x150/0x190 net/socket.c:672
       ____sys_sendmsg+0x6d8/0x840 net/socket.c:2363
       ___sys_sendmsg+0xff/0x170 net/socket.c:2417
       __sys_sendmsg+0xe5/0x1b0 net/socket.c:2450
       do_syscall_64+0x56/0xa0 arch/x86/entry/common.c:359
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      The buggy address belongs to the object at ffff8880650fd000
       which belongs to the cache kmalloc-512 of size 512
      The buggy address is located 32 bytes inside of
       512-byte region [ffff8880650fd000, ffff8880650fd200)
      The buggy address belongs to the page:
      page:ffffea0001943f00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880650ff800 head:ffffea0001943f00 order:2 compound_mapcount:0 compound_pincount:0
      flags: 0x100000000010200(slab|head)
      raw: 0100000000010200 ffffea0001a06a08 ffffea00010ad308 ffff88806c402500
      raw: ffff8880650ff800 0000000000100009 00000001ffffffff 0000000000000000
      page dumped because: kasan: bad access detected
      
      Memory state around the buggy address:
       ffff8880650fcf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
       ffff8880650fcf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
      >ffff8880650fd000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                     ^
       ffff8880650fd080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
       ffff8880650fd100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      ==================================================================
      
      Fixes: 3c5584bf ("devlink: Rework devlink health reporter destructor")
      Fixes: 15c724b9 ("devlink: Add devlink health port reporters API")
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NMoshe Shemesh <moshe@mellanox.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Reviewed-by: NJakub Kicinski <kuba@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5d037b4d
    • W
      net: make symbol 'flush_works' static · ce1e2a77
      Wei Yongjun 提交于
      The sparse tool complains as follows:
      
      net/core/dev.c:5594:1: warning:
       symbol '__pcpu_scope_flush_works' was not declared. Should it be static?
      
      'flush_works' is not used outside of dev.c, so marks
      it static.
      
      Fixes: 41852497 ("net: batch calls to flush_all_backlogs()")
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ce1e2a77
    • P
      net: sched: Pass qdisc reference in struct flow_block_offload · c40f4e50
      Petr Machata 提交于
      Previously, shared blocks were only relevant for the pseudo-qdiscs ingress
      and clsact. Recently, a qevent facility was introduced, which allows to
      bind blocks to well-defined slots of a qdisc instance. RED in particular
      got two qevents: early_drop and mark. Drivers that wish to offload these
      blocks will be sent the usual notification, and need to know which qdisc it
      is related to.
      
      To that end, extend flow_block_offload with a "sch" pointer, and initialize
      as appropriate. This prompts changes in the indirect block facility, which
      now tracks the scheduler in addition to the netdevice. Update signatures of
      several functions similarly.
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c40f4e50
    • A
      net: x25: kerneldoc fixes · 62c89238
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      
      Cc: Andrew Hendry <andrew.hendry@gmail.com>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      62c89238
    • A
      net: wireless: kerneldoc fixes · 726e6af9
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      726e6af9
    • A
      net: tipc: kerneldoc fixes · d8141208
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      
      Cc: Jon Maloy <jmaloy@redhat.com>
      Cc: Ying Xue <ying.xue@windriver.com>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Acked-by: NJon Maloy <jmaloy@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d8141208
    • A
      net: switchdev: kerneldoc fixes · c8af73f0
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c8af73f0
    • A
      net: socket: Move kerneldoc next to function it documents · 9a8ad9ac
      Andrew Lunn 提交于
      Fix the warning "Function parameter or member 'inode' not described in
      '__sock_release'' due to the kerneldoc being placed before
      __sock_release() not sock_release(), which does not take an inode
      parameter.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9a8ad9ac
    • A
      net: sched: kerneldoc fixes · 90ac5d03
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Cong Wang <xiyou.wangcong@gmail.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      90ac5d03
    • A
      net: rxrpc: kerneldoc fixes · 76f2fe73
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      
      Cc: David Howells <dhowells@redhat.com>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      76f2fe73
    • A
      net: openvswitch: kerneldoc fixes · 96678514
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      
      Cc: Pravin B Shelar <pshelar@ovn.org>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      96678514
    • A
      net: nfc: kerneldoc fixes · ffbab1c9
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ffbab1c9
    • A
      net: netlabel: kerneldoc fixes · 26c3baaa
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      
      Cc: Paul Moore <paul@paul-moore.com>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Acked-by: NPaul Moore <paul@paul-moore.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      26c3baaa
    • A
      net: netfilter: kerneldoc fixes · 3db86c39
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      
      Cc: Pablo Neira Ayuso <pablo@netfilter.org>
      Cc: Jozsef Kadlecsik <kadlec@netfilter.org>
      Cc: Florian Westphal <fw@strlen.de>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3db86c39
    • A
      net: mac80211: kerneldoc fixes · 9fd00b4d
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9fd00b4d
    • A
      net: llc: kerneldoc fixes · 74c950c9
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      74c950c9
    • A
      net: ipv6: kerneldoc fixes · b51cd7c8
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      
      Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b51cd7c8
    • A
      net: ipv4: kerneldoc fixes · 3628e3cb
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      
      Cc: Paul Moore <paul@paul-moore.com>
      Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Cc: Eric Dumazet <edumazet@google.com>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Acked-by: NPaul Moore <paul@paul-moore.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3628e3cb
    • A
      net: decnet: kerneldoc fixes · aff53b23
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aff53b23
    • A
      net: dccp: kerneldoc fixes · d0b1101b
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      
      Cc: Gerrit Renker <gerrit@erg.abdn.ac.uk>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d0b1101b
    • A
      net: core: kerneldoc fixes · 8842500d
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8842500d
    • A
      net: can: kerneldoc fixes · e0a7f1fe
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      
      Cc: Oliver Hartkopp <socketcan@hartkopp.net>
      Cc: Marc Kleine-Budde <mkl@pengutronix.de>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e0a7f1fe
    • A
      net: 9p: kerneldoc fixes · 15e522a7
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      
      Cc: Eric Van Hensbergen <ericvh@gmail.com>
      Cc: Latchesar Ionkov <lucho@ionkov.net>
      Cc: Dominique Martinet <asmadeus@codewreck.org>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      15e522a7
    • C
      xsk: Add xdp statistics to xsk_diag · 0d80cb46
      Ciara Loftus 提交于
      Add xdp statistics to the information dumped through the xsk_diag interface
      Signed-off-by: NCiara Loftus <ciara.loftus@intel.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20200708072835.4427-4-ciara.loftus@intel.com
      0d80cb46