1. 09 9月, 2019 1 次提交
  2. 25 8月, 2019 1 次提交
    • Z
      net: rds: add service level support in rds-info · e0e6d062
      Zhu Yanjun 提交于
      >From IB specific 7.6.5 SERVICE LEVEL, Service Level (SL)
      is used to identify different flows within an IBA subnet.
      It is carried in the local route header of the packet.
      
      Before this commit, run "rds-info -I". The outputs are as
      below:
      "
      RDS IB Connections:
       LocalAddr  RemoteAddr Tos SL  LocalDev               RemoteDev
      192.2.95.3  192.2.95.1  2   0  fe80::21:28:1a:39  fe80::21:28:10:b9
      192.2.95.3  192.2.95.1  1   0  fe80::21:28:1a:39  fe80::21:28:10:b9
      192.2.95.3  192.2.95.1  0   0  fe80::21:28:1a:39  fe80::21:28:10:b9
      "
      After this commit, the output is as below:
      "
      RDS IB Connections:
       LocalAddr  RemoteAddr Tos SL  LocalDev               RemoteDev
      192.2.95.3  192.2.95.1  2   2  fe80::21:28:1a:39  fe80::21:28:10:b9
      192.2.95.3  192.2.95.1  1   1  fe80::21:28:1a:39  fe80::21:28:10:b9
      192.2.95.3  192.2.95.1  0   0  fe80::21:28:1a:39  fe80::21:28:10:b9
      "
      
      The commit fe3475af ("net: rds: add per rds connection cache
      statistics") adds cache_allocs in struct rds_info_rdma_connection
      as below:
      struct rds_info_rdma_connection {
      ...
              __u32           rdma_mr_max;
              __u32           rdma_mr_size;
              __u8            tos;
              __u32           cache_allocs;
       };
      The peer struct in rds-tools of struct rds_info_rdma_connection is as
      below:
      struct rds_info_rdma_connection {
      ...
              uint32_t        rdma_mr_max;
              uint32_t        rdma_mr_size;
              uint8_t         tos;
              uint8_t         sl;
              uint32_t        cache_allocs;
      };
      The difference between userspace and kernel is the member variable sl.
      In the kernel struct, the member variable sl is missing. This will
      introduce risks. So it is necessary to use this commit to avoid this risk.
      
      Fixes: fe3475af ("net: rds: add per rds connection cache statistics")
      CC: Joe Jin <joe.jin@oracle.com>
      CC: JUNXIAO_BI <junxiao.bi@oracle.com>
      Suggested-by: NGerd Rausch <gerd.rausch@oracle.com>
      Signed-off-by: NZhu Yanjun <yanjun.zhu@oracle.com>
      Acked-by: NSantosh Shilimkar <santosh.shilimkar@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e0e6d062
  3. 22 8月, 2019 1 次提交
  4. 19 8月, 2019 1 次提交
  5. 10 8月, 2019 1 次提交
    • D
      sock: make cookie generation global instead of per netns · cd48bdda
      Daniel Borkmann 提交于
      Generating and retrieving socket cookies are a useful feature that is
      exposed to BPF for various program types through bpf_get_socket_cookie()
      helper.
      
      The fact that the cookie counter is per netns is quite a limitation
      for BPF in practice in particular for programs in host namespace that
      use socket cookies as part of a map lookup key since they will be
      causing socket cookie collisions e.g. when attached to BPF cgroup hooks
      or cls_bpf on tc egress in host namespace handling container traffic
      from veth or ipvlan devices with peer in different netns. Change the
      counter to be global instead.
      
      Socket cookie consumers must assume the value as opqaue in any case.
      Not every socket must have a cookie generated and knowledge of the
      counter value itself does not provide much value either way hence
      conversion to global is fine.
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: Martynas Pumputis <m@lambda.lt>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cd48bdda
  6. 07 8月, 2019 1 次提交
  7. 04 8月, 2019 1 次提交
    • Q
      net/socket: fix GCC8+ Wpacked-not-aligned warnings · 5e5412c3
      Qian Cai 提交于
      There are a lot of those warnings with GCC8+ 64-bit,
      
      In file included from ./include/linux/sctp.h:42,
                       from net/core/skbuff.c:47:
      ./include/uapi/linux/sctp.h:395:1: warning: alignment 4 of 'struct
      sctp_paddr_change' is less than 8 [-Wpacked-not-aligned]
       } __attribute__((packed, aligned(4)));
       ^
      ./include/uapi/linux/sctp.h:728:1: warning: alignment 4 of 'struct
      sctp_setpeerprim' is less than 8 [-Wpacked-not-aligned]
       } __attribute__((packed, aligned(4)));
       ^
      ./include/uapi/linux/sctp.h:727:26: warning: 'sspp_addr' offset 4 in
      'struct sctp_setpeerprim' isn't aligned to 8 [-Wpacked-not-aligned]
        struct sockaddr_storage sspp_addr;
                                ^~~~~~~~~
      ./include/uapi/linux/sctp.h:741:1: warning: alignment 4 of 'struct
      sctp_prim' is less than 8 [-Wpacked-not-aligned]
       } __attribute__((packed, aligned(4)));
       ^
      ./include/uapi/linux/sctp.h:740:26: warning: 'ssp_addr' offset 4 in
      'struct sctp_prim' isn't aligned to 8 [-Wpacked-not-aligned]
        struct sockaddr_storage ssp_addr;
                                ^~~~~~~~
      ./include/uapi/linux/sctp.h:792:1: warning: alignment 4 of 'struct
      sctp_paddrparams' is less than 8 [-Wpacked-not-aligned]
       } __attribute__((packed, aligned(4)));
       ^
      ./include/uapi/linux/sctp.h:784:26: warning: 'spp_address' offset 4 in
      'struct sctp_paddrparams' isn't aligned to 8 [-Wpacked-not-aligned]
        struct sockaddr_storage spp_address;
                                ^~~~~~~~~~~
      ./include/uapi/linux/sctp.h:905:1: warning: alignment 4 of 'struct
      sctp_paddrinfo' is less than 8 [-Wpacked-not-aligned]
       } __attribute__((packed, aligned(4)));
       ^
      ./include/uapi/linux/sctp.h:899:26: warning: 'spinfo_address' offset 4
      in 'struct sctp_paddrinfo' isn't aligned to 8 [-Wpacked-not-aligned]
        struct sockaddr_storage spinfo_address;
                                ^~~~~~~~~~~~~~
      
      This is because the commit 20c9c825 ("[SCTP] Fix SCTP socket options
      to work with 32-bit apps on 64-bit kernels.") added "packed, aligned(4)"
      GCC attributes to some structures but one of the members, i.e, "struct
      sockaddr_storage" in those structures has the attribute,
      "aligned(__alignof__ (struct sockaddr *)" which is 8-byte on 64-bit
      systems, so the commit overwrites the designed alignments for
      "sockaddr_storage".
      
      To fix this, "struct sockaddr_storage" needs to be aligned to 4-byte as
      it is only used in those packed sctp structure which is part of UAPI,
      and "struct __kernel_sockaddr_storage" is used in some other
      places of UAPI that need not to change alignments in order to not
      breaking userspace.
      
      Use an implicit alignment for "struct __kernel_sockaddr_storage" so it
      can keep the same alignments as a member in both packed and un-packed
      structures without breaking UAPI.
      Suggested-by: NDavid Laight <David.Laight@ACULAB.COM>
      Signed-off-by: NQian Cai <cai@lca.pw>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5e5412c3
  8. 29 7月, 2019 1 次提交
  9. 25 7月, 2019 2 次提交
    • L
      tty: serial: netx: Delete driver · 4a2b8560
      Linus Walleij 提交于
      The Netx ARM machine was deleted from the kernel. This driver
      had no users and has to go.
      
      Cc: Robert Schwebel <r.schwebel@pengutronix.de>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Link: https://lore.kernel.org/r/20190722065146.4844-1-linus.walleij@linaro.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4a2b8560
    • M
      treewide: add "WITH Linux-syscall-note" to SPDX tag of uapi headers · d9c52522
      Masahiro Yamada 提交于
      UAPI headers licensed under GPL are supposed to have exception
      "WITH Linux-syscall-note" so that they can be included into non-GPL
      user space application code.
      
      The exception note is missing in some UAPI headers.
      
      Some of them slipped in by the treewide conversion commit b2441318
      ("License cleanup: add SPDX GPL-2.0 license identifier to files with
      no license"). Just run:
      
        $ git show --oneline b2441318 -- arch/x86/include/uapi/asm/
      
      I believe they are not intentional, and should be fixed too.
      
      This patch was generated by the following script:
      
        git grep -l --not -e Linux-syscall-note --and -e SPDX-License-Identifier \
          -- :arch/*/include/uapi/asm/*.h :include/uapi/ :^*/Kbuild |
        while read file
        do
                sed -i -e '/[[:space:]]OR[[:space:]]/s/\(GPL-[^[:space:]]*\)/(\1 WITH Linux-syscall-note)/g' \
                -e '/[[:space:]]or[[:space:]]/s/\(GPL-[^[:space:]]*\)/(\1 WITH Linux-syscall-note)/g' \
                -e '/[[:space:]]OR[[:space:]]/!{/[[:space:]]or[[:space:]]/!s/\(GPL-[^[:space:]]*\)/\1 WITH Linux-syscall-note/g}' $file
        done
      
      After this patch is applied, there are 5 UAPI headers that do not contain
      "WITH Linux-syscall-note". They are kept untouched since this exception
      applies only to GPL variants.
      
        $ git grep --not -e Linux-syscall-note --and -e SPDX-License-Identifier \
          -- :arch/*/include/uapi/asm/*.h :include/uapi/ :^*/Kbuild
        include/uapi/drm/panfrost_drm.h:/* SPDX-License-Identifier: MIT */
        include/uapi/linux/batman_adv.h:/* SPDX-License-Identifier: MIT */
        include/uapi/linux/qemu_fw_cfg.h:/* SPDX-License-Identifier: BSD-3-Clause */
        include/uapi/linux/vbox_err.h:/* SPDX-License-Identifier: MIT */
        include/uapi/linux/virtio_iommu.h:/* SPDX-License-Identifier: BSD-3-Clause */
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d9c52522
  10. 24 7月, 2019 1 次提交
  11. 22 7月, 2019 1 次提交
  12. 21 7月, 2019 1 次提交
  13. 17 7月, 2019 10 次提交
  14. 16 7月, 2019 1 次提交
  15. 15 7月, 2019 1 次提交
  16. 13 7月, 2019 1 次提交
    • M
      nilfs2: do not use unexported cpu_to_le32()/le32_to_cpu() in uapi header · c32cc30c
      Masahiro Yamada 提交于
      cpu_to_le32/le32_to_cpu is defined in include/linux/byteorder/generic.h,
      which is not exported to user-space.
      
      UAPI headers must use the ones prefixed with double-underscore.
      
      Detected by compile-testing exported headers:
      
        include/linux/nilfs2_ondisk.h: In function `nilfs_checkpoint_set_snapshot':
        include/linux/nilfs2_ondisk.h:536:17: error: implicit declaration of function `cpu_to_le32' [-Werror=implicit-function-declaration]
          cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) |  \
                         ^
        include/linux/nilfs2_ondisk.h:552:1: note: in expansion of macro `NILFS_CHECKPOINT_FNS'
         NILFS_CHECKPOINT_FNS(SNAPSHOT, snapshot)
         ^~~~~~~~~~~~~~~~~~~~
        include/linux/nilfs2_ondisk.h:536:29: error: implicit declaration of function `le32_to_cpu' [-Werror=implicit-function-declaration]
          cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) |  \
                                     ^
        include/linux/nilfs2_ondisk.h:552:1: note: in expansion of macro `NILFS_CHECKPOINT_FNS'
         NILFS_CHECKPOINT_FNS(SNAPSHOT, snapshot)
         ^~~~~~~~~~~~~~~~~~~~
        include/linux/nilfs2_ondisk.h: In function `nilfs_segment_usage_set_clean':
        include/linux/nilfs2_ondisk.h:622:19: error: implicit declaration of function `cpu_to_le64' [-Werror=implicit-function-declaration]
          su->su_lastmod = cpu_to_le64(0);
                           ^~~~~~~~~~~
      
      Link: http://lkml.kernel.org/r/20190605053006.14332-1-yamada.masahiro@socionext.com
      Fixes: e63e88bc ("nilfs2: move ioctl interface and disk layout to uapi separately")
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: NRyusuke Konishi <konishi.ryusuke@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Greg KH <gregkh@linuxfoundation.org>
      Cc: Joe Perches <joe@perches.com>
      Cc: <stable@vger.kernel.org>	[4.9+]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c32cc30c
  17. 11 7月, 2019 3 次提交
  18. 10 7月, 2019 8 次提交
    • D
      pkt_sched: Include const.h · fbc69779
      David Ahern 提交于
      Commit 9903c8dc changed TC_ETF defines to use _BITUL instead of BIT
      but did not add the dependecy on linux/const.h. As a consequence,
      importing the uapi headers into iproute2 causes builds to fail. Add
      the dependency.
      
      Fixes: 9903c8dc ("etf: Don't use BIT() in UAPI headers.")
      Cc: Vedang Patel <vedang.patel@intel.com>
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fbc69779
    • P
      netfilter: nf_tables: add hardware offload support · c9626a2c
      Pablo Neira Ayuso 提交于
      This patch adds hardware offload support for nftables through the
      existing netdev_ops->ndo_setup_tc() interface, the TC_SETUP_CLSFLOWER
      classifier and the flow rule API. This hardware offload support is
      available for the NFPROTO_NETDEV family and the ingress hook.
      
      Each nftables expression has a new ->offload interface, that is used to
      populate the flow rule object that is attached to the transaction
      object.
      
      There is a new per-table NFT_TABLE_F_HW flag, that is set on to offload
      an entire table, including all of its chains.
      
      This patch supports for basic metadata (layer 3 and 4 protocol numbers),
      5-tuple payload matching and the accept/drop actions; this also includes
      basechain hardware offload only.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c9626a2c
    • J
      io_uring: add support for recvmsg() · aa1fa28f
      Jens Axboe 提交于
      This is done through IORING_OP_RECVMSG. This opcode uses the same
      sqe->msg_flags that IORING_OP_SENDMSG added, and we pass in the
      msghdr struct in the sqe->addr field as well.
      
      We use MSG_DONTWAIT to force an inline fast path if recvmsg() doesn't
      block, and punt to async execution if it would have.
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      aa1fa28f
    • J
      io_uring: add support for sendmsg() · 0fa03c62
      Jens Axboe 提交于
      This is done through IORING_OP_SENDMSG. There's a new sqe->msg_flags
      for the flags argument, and the msghdr struct is passed in the
      sqe->addr field.
      
      We use MSG_DONTWAIT to force an inline fast path if sendmsg() doesn't
      block, and punt to async execution if it would have.
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      0fa03c62
    • P
      net/sched: cls_flower: Add matching on conntrack info · e0ace68a
      Paul Blakey 提交于
      New matches for conntrack mark, label, zone, and state.
      Signed-off-by: NPaul Blakey <paulb@mellanox.com>
      Signed-off-by: NMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: NYossi Kuperman <yossiku@mellanox.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e0ace68a
    • P
      net/sched: Introduce action ct · b57dc7c1
      Paul Blakey 提交于
      Allow sending a packet to conntrack module for connection tracking.
      
      The packet will be marked with conntrack connection's state, and
      any metadata such as conntrack mark and label. This state metadata
      can later be matched against with tc classifers, for example with the
      flower classifier as below.
      
      In addition to committing new connections the user can optionally
      specific a zone to track within, set a mark/label and configure nat
      with an address range and port range.
      
      Usage is as follows:
      $ tc qdisc add dev ens1f0_0 ingress
      $ tc qdisc add dev ens1f0_1 ingress
      
      $ tc filter add dev ens1f0_0 ingress \
        prio 1 chain 0 proto ip \
        flower ip_proto tcp ct_state -trk \
        action ct zone 2 pipe \
        action goto chain 2
      $ tc filter add dev ens1f0_0 ingress \
        prio 1 chain 2 proto ip \
        flower ct_state +trk+new \
        action ct zone 2 commit mark 0xbb nat src addr 5.5.5.7 pipe \
        action mirred egress redirect dev ens1f0_1
      $ tc filter add dev ens1f0_0 ingress \
        prio 1 chain 2 proto ip \
        flower ct_zone 2 ct_mark 0xbb ct_state +trk+est \
        action ct nat pipe \
        action mirred egress redirect dev ens1f0_1
      
      $ tc filter add dev ens1f0_1 ingress \
        prio 1 chain 0 proto ip \
        flower ip_proto tcp ct_state -trk \
        action ct zone 2 pipe \
        action goto chain 1
      $ tc filter add dev ens1f0_1 ingress \
        prio 1 chain 1 proto ip \
        flower ct_zone 2 ct_mark 0xbb ct_state +trk+est \
        action ct nat pipe \
        action mirred egress redirect dev ens1f0_0
      Signed-off-by: NPaul Blakey <paulb@mellanox.com>
      Signed-off-by: NMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: NYossi Kuperman <yossiku@mellanox.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      
      Changelog:
      V5->V6:
      	Added CONFIG_NF_DEFRAG_IPV6 in handle fragments ipv6 case
      V4->V5:
      	Reordered nf_conntrack_put() in tcf_ct_skb_nfct_cached()
      V3->V4:
      	Added strict_start_type for act_ct policy
      V2->V3:
      	Fixed david's comments: Removed extra newline after rcu in tcf_ct_params , and indent of break in act_ct.c
      V1->V2:
      	Fixed parsing of ranges TCA_CT_NAT_IPV6_MAX as 'else' case overwritten ipv4 max
      	Refactored NAT_PORT_MIN_MAX range handling as well
      	Added ipv4/ipv6 defragmentation
      	Removed extra skb pull push of nw offset in exectute nat
      	Refactored tcf_ct_skb_network_trim after pull
      	Removed TCA_ACT_CT define
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b57dc7c1
    • P
      devlink: Introduce PCI VF port flavour and port attribute · e41b6bf3
      Parav Pandit 提交于
      In an eswitch, PCI VF may have port which is normally represented using
      a representor netdevice.
      To have better visibility of eswitch port, its association with VF,
      and its representor netdevice, introduce a PCI VF port flavour.
      
      When devlink port flavour is PCI VF, fill up PCI VF attributes of
      the port.
      
      Extend port name creation using PCI PF and VF number scheme on best
      effort basis, so that vendor drivers can skip defining their own scheme.
      
      $ devlink port show
      pci/0000:05:00.0/0: type eth netdev eth0 flavour pcipf pfnum 0
      pci/0000:05:00.0/1: type eth netdev eth1 flavour pcivf pfnum 0 vfnum 0
      pci/0000:05:00.0/2: type eth netdev eth2 flavour pcivf pfnum 0 vfnum 1
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NParav Pandit <parav@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e41b6bf3
    • P
      devlink: Introduce PCI PF port flavour and port attribute · 98fd2d65
      Parav Pandit 提交于
      In an eswitch, PCI PF may have port which is normally represented
      using a representor netdevice.
      To have better visibility of eswitch port, its association with
      PF and a representor netdevice, introduce a PCI PF port
      flavour and port attriute.
      
      When devlink port flavour is PCI PF, fill up PCI PF attributes of the
      port.
      
      Extend port name creation using PCI PF number on best effort basis.
      So that vendor drivers can skip defining their own scheme.
      
      $ devlink port show
      pci/0000:05:00.0/0: type eth netdev eth0 flavour pcipf pfnum 0
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NParav Pandit <parav@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      98fd2d65
  19. 09 7月, 2019 1 次提交
  20. 08 7月, 2019 1 次提交
  21. 06 7月, 2019 1 次提交