1. 17 5月, 2016 7 次提交
    • D
      bpf: minor cleanups in ebpf code · 4936e352
      Daniel Borkmann 提交于
      Besides others, remove redundant comments where the code is self
      documenting enough, and properly indent various bpf_verifier_ops
      and bpf_prog_type_list declarations. Moreover, remove two exports
      that actually have no module user.
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4936e352
    • E
      tcp: minor optimizations around tcp_hdr() usage · ea1627c2
      Eric Dumazet 提交于
      tcp_hdr() is slightly more expensive than using skb->data in contexts
      where we know they point to the same byte.
      
      In receive path, tcp_v4_rcv() and tcp_v6_rcv() are in this situation,
      as tcp header has not been pulled yet.
      
      In output path, the same can be said when we just pushed the tcp header
      in the skb, in tcp_transmit_skb() and tcp_make_synack()
      
      Also factorize the two checks for tcb->tcp_flags & TCPHDR_SYN in
      tcp_transmit_skb() and pass tcp header pointer to tcp_ecn_send(),
      so that compiler can further optimize and avoid a reload.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ea1627c2
    • E
      sock: propagate __sock_cmsg_send() error · 2632616b
      Eric Dumazet 提交于
      __sock_cmsg_send() might return different error codes, not only -EINVAL.
      
      Fixes: 24025c46 ("ipv4: process socket-level control messages in IPv4")
      Fixes: ad1e46a8 ("ipv6: process socket-level control messages in IPv6")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Soheil Hassas Yeganeh <soheil@google.com>
      Acked-by: NSoheil Hassas Yeganeh <soheil@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2632616b
    • A
      net: qrtr: fix build problems · a986a05d
      Arnd Bergmann 提交于
      Having multiple loadable modules with the same name cannot work
      with modprobe, and having both net/qrtr/smd.ko and drivers/soc/qcom/smd.ko
      results in a (somewhat cryptic) build error:
      
      ERROR: "qcom_smd_driver_unregister" [net/qrtr/smd.ko] undefined!
      ERROR: "qcom_smd_driver_register" [net/qrtr/smd.ko] undefined!
      ERROR: "qcom_smd_set_drvdata" [net/qrtr/smd.ko] undefined!
      ERROR: "qcom_smd_send" [net/qrtr/smd.ko] undefined!
      ERROR: "qcom_smd_get_drvdata" [net/qrtr/smd.ko] undefined!
      ERROR: "qcom_smd_driver_unregister" [drivers/soc/qcom/wcnss_ctrl.ko] undefined!
      ERROR: "qcom_smd_driver_register" [drivers/soc/qcom/wcnss_ctrl.ko] undefined!
      ERROR: "qcom_smd_set_drvdata" [drivers/soc/qcom/wcnss_ctrl.ko] undefined!
      ERROR: "qcom_smd_send" [drivers/soc/qcom/wcnss_ctrl.ko] undefined!
      ERROR: "qcom_smd_get_drvdata" [drivers/soc/qcom/wcnss_ctrl.ko] undefined!
      
      Also, the qrtr driver uses the SMD interface and has a Kconfig dependency,
      but also allows for compile-testing when SMD is disabled. However, if
      with QCOM_SMD=m and COMPILE_TEST=y we can end up with QRTR_SMD=y and
      that fails with a related link error.
      
      The changes the dependency so we can still compile-test the driver but
      not have it built-in if SMD is a module, to avoid running in the broken
      configuration, and changes the Makefile to provide the driver under
      a different module name.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: bdabad3e ("net: Add Qualcomm IPC router")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a986a05d
    • A
      net/sched: cls_flower: Hardware offloaded filters statistics support · 10cbc684
      Amir Vadai 提交于
      Introduce a new command in ndo_setup_tc() for hardware offloaded
      filters, to call the NIC driver, and make it update the statistics.
      This will be done before dumping the filter and its statistics.
      Signed-off-by: NAmir Vadai <amirva@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      10cbc684
    • A
      net/sched: act_gact: Update statistics when offloaded to hardware · 9fea47d9
      Amir Vadai 提交于
      Implement the stats_update callback that will be called by NIC drivers
      for hardware offloaded filters.
      Signed-off-by: NAmir Vadai <amirva@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9fea47d9
    • S
      net: cls_u32: Add support for skip-sw flag to tc u32 classifier. · d34e3e18
      Samudrala, Sridhar 提交于
      On devices that support TC U32 offloads, this flag enables a filter to be
      added only to HW. skip-sw and skip-hw are mutually exclusive flags. By
      default without any flags, the filter is added to both HW and SW, but no
      error checks are done in case of failure to add to HW. With skip-sw,
      failure to add to HW is treated as an error.
      
      Here is a sample script that adds 2 filters, one with skip-sw and the other
      with skip-hw flag.
      
         # add ingress qdisc
         tc qdisc add dev p4p1 ingress
      
         # enable hw tc offload.
         ethtool -K p4p1 hw-tc-offload on
      
         # add u32 filter with skip-sw flag.
         tc filter add dev p4p1 parent ffff: protocol ip prio 99 \
            handle 800:0:1 u32 ht 800: flowid 800:1 \
            skip-sw \
            match ip src 192.168.1.0/24 \
            action drop
      
         # add u32 filter with skip-hw flag.
         tc filter add dev p4p1 parent ffff: protocol ip prio 99 \
            handle 800:0:2 u32 ht 800: flowid 800:2 \
            skip-hw \
            match ip src 192.168.2.0/24 \
            action drop
      Signed-off-by: NSridhar Samudrala <sridhar.samudrala@intel.com>
      Acked-by: NJohn Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d34e3e18
  2. 15 5月, 2016 3 次提交
  3. 13 5月, 2016 5 次提交
    • A
      udp: Resolve NULL pointer dereference over flow-based vxlan device · ed7cbbce
      Alexander Duyck 提交于
      While testing an OpenStack configuration using VXLANs I saw the following
      call trace:
      
       RIP: 0010:[<ffffffff815fad49>] udp4_lib_lookup_skb+0x49/0x80
       RSP: 0018:ffff88103867bc50  EFLAGS: 00010286
       RAX: ffff88103269bf00 RBX: ffff88103269bf00 RCX: 00000000ffffffff
       RDX: 0000000000004300 RSI: 0000000000000000 RDI: ffff880f2932e780
       RBP: ffff88103867bc60 R08: 0000000000000000 R09: 000000009001a8c0
       R10: 0000000000004400 R11: ffffffff81333a58 R12: ffff880f2932e794
       R13: 0000000000000014 R14: 0000000000000014 R15: ffffe8efbfd89ca0
       FS:  0000000000000000(0000) GS:ffff88103fd80000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 0000000000000488 CR3: 0000000001c06000 CR4: 00000000001426e0
       Stack:
        ffffffff81576515 ffffffff815733c0 ffff88103867bc98 ffffffff815fcc17
        ffff88103269bf00 ffffe8efbfd89ca0 0000000000000014 0000000000000080
        ffffe8efbfd89ca0 ffff88103867bcc8 ffffffff815fcf8b ffff880f2932e794
       Call Trace:
        [<ffffffff81576515>] ? skb_checksum+0x35/0x50
        [<ffffffff815733c0>] ? skb_push+0x40/0x40
        [<ffffffff815fcc17>] udp_gro_receive+0x57/0x130
        [<ffffffff815fcf8b>] udp4_gro_receive+0x10b/0x2c0
        [<ffffffff81605863>] inet_gro_receive+0x1d3/0x270
        [<ffffffff81589e59>] dev_gro_receive+0x269/0x3b0
        [<ffffffff8158a1b8>] napi_gro_receive+0x38/0x120
        [<ffffffffa0871297>] gro_cell_poll+0x57/0x80 [vxlan]
        [<ffffffff815899d0>] net_rx_action+0x160/0x380
        [<ffffffff816965c7>] __do_softirq+0xd7/0x2c5
        [<ffffffff8107d969>] run_ksoftirqd+0x29/0x50
        [<ffffffff8109a50f>] smpboot_thread_fn+0x10f/0x160
        [<ffffffff8109a400>] ? sort_range+0x30/0x30
        [<ffffffff81096da8>] kthread+0xd8/0xf0
        [<ffffffff81693c82>] ret_from_fork+0x22/0x40
        [<ffffffff81096cd0>] ? kthread_park+0x60/0x60
      
      The following trace is seen when receiving a DHCP request over a flow-based
      VXLAN tunnel.  I believe this is caused by the metadata dst having a NULL
      dev value and as a result dev_net(dev) is causing a NULL pointer dereference.
      
      To resolve this I am replacing the check for skb_dst(skb)->dev with just
      skb->dev.  This makes sense as the callers of this function are usually in
      the receive path and as such skb->dev should always be populated.  In
      addition other functions in the area where these are called are already
      using dev_net(skb->dev) to determine the namespace the UDP packet belongs
      in.
      
      Fixes: 63058308 ("udp: Add udp6_lib_lookup_skb and udp4_lib_lookup_skb")
      Signed-off-by: NAlexander Duyck <aduyck@mirantis.com>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ed7cbbce
    • E
      sunrpc: set SOCK_FASYNC · b4411457
      Eric Dumazet 提交于
      sunrpc is using SOCKWQ_ASYNC_NOSPACE without setting SOCK_FASYNC,
      so the recent optimizations done in sk_set_bit() and sk_clear_bit()
      broke it.
      
      There is still the risk that a subsequent sock_fasync() call
      would clear SOCK_FASYNC, but sunrpc does not use this yet.
      
      Fixes: 9317bb69 ("net: SOCKWQ_ASYNC_NOSPACE optimizations")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Reported-by: NJiri Pirko <jiri@resnulli.us>
      Reported-by: NHuang, Ying <ying.huang@intel.com>
      Tested-by: NJiri Pirko <jiri@resnulli.us>
      Tested-by: NHuang, Ying <ying.huang@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b4411457
    • J
      tipc: eliminate risk of double link_up events · e7142c34
      Jon Paul Maloy 提交于
      When an ACTIVATE or data packet is received in a link in state
      ESTABLISHING, the link does not immediately change state to
      ESTABLISHED, but does instead return a LINK_UP event to the caller,
      which will execute the state change in a different lock context.
      
      This non-atomic approach incurs a low risk that we may have two
      LINK_UP events pending simultaneously for the same link, resulting
      in the final part of the setup procedure being executed twice. The
      only potential harm caused by this it that we may see two LINK_UP
      events issued to subsribers of the topology server, something that
      may cause confusion.
      
      This commit eliminates this risk by checking if the link is already
      up before proceeding with the second half of the setup.
      Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e7142c34
    • H
      gre: Fix wrong tpi->proto in WCCP · da73b4e9
      Haishuang Yan 提交于
      When dealing with WCCP in gre6 tunnel, it sets the wrong tpi->protocol,
      that is, ETH_P_IP instead of ETH_P_IPV6 for the encapuslated traffic.
      Signed-off-by: NHaishuang Yan <yanhaishuang@cmss.chinamobile.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      da73b4e9
    • H
      ip6_gre: Fix get_size calculation for gre6 tunnel · 23f72215
      Haishuang Yan 提交于
      Do not include attribute IFLA_GRE_TOS.
      Signed-off-by: NHaishuang Yan <yanhaishuang@cmss.chinamobile.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      23f72215
  4. 12 5月, 2016 15 次提交
  5. 11 5月, 2016 9 次提交
  6. 10 5月, 2016 1 次提交