1. 12 12月, 2013 15 次提交
    • D
      filter: bpf_asm: add minimal bpf asm tool · 3f356385
      Daniel Borkmann 提交于
      There are a couple of valid use cases for a minimal low-level bpf asm
      like tool, for example, using/linking to libpcap is not an option, the
      required BPF filters use Linux extensions that are not supported by
      libpcap's compiler, a filter might be more complex and not cleanly
      implementable with libpcap's compiler, particular filter codes should
      be optimized differently than libpcap's internal BPF compiler does,
      or for security audits of emitted BPF JIT code for prepared set of BPF
      instructions resp. BPF JIT compiler development in general.
      
      Then, in such cases writing such a filter in low-level syntax can be
      an good alternative, for example, xt_bpf and cls_bpf users might have
      requirements that could result in more complex filter code, or one that
      cannot be expressed with libpcap (e.g. different return codes in
      cls_bpf for flowids on various BPF code paths).
      
      Moreover, BPF JIT implementors may wish to manually write test cases
      in order to verify the resulting JIT image, and thus need low-level
      access to BPF code generation as well. Therefore, complete the available
      toolchain for BPF with this small bpf_asm helper tool for the tools/net/
      directory. These 3 complementary minimal helper tools round up and
      facilitate BPF development.
      Signed-off-by: NDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3f356385
    • D
      filter: bpf_dbg: add minimal bpf debugger · fd981e3c
      Daniel Borkmann 提交于
      This patch adds a minimal BPF debugger that "emulates" the kernel's
      BPF engine (w/o extensions) and allows for single stepping (forwards
      and backwards through BPF code) or running with >=1 breakpoints through
      selected or all packets from a pcap file with a provided user filter
      in order to facilitate verification of a BPF program. When a breakpoint
      is being hit, it dumps all register contents, decoded instructions and
      in case of branches both decoded branch targets as well as other useful
      information.
      
      Having this facility is in particular useful to verify BPF programs
      against given test traffic *before* attaching to a live system.
      
      With the general availability of cls_bpf, xt_bpf, socket filters,
      team driver and e.g. PTP code, all BPF users, quite often a single
      more complex BPF program is being used. Reasons for a more complex
      BPF program are primarily to optimize execution time for making a
      verdict when multiple simple BPF programs are combined into one in
      order to prevent parsing same headers multiple times. In particular,
      for cls_bpf that can have various return paths for encoding flowids,
      and xt_bpf to come to a fw verdict this can be the case.
      
      Therefore, as this can result in more complex and harder to debug
      code, it would be very useful to have this minimal tool for testing
      purposes. It can also be of help for BPF JIT developers as filters
      are "test attached" to the kernel on a temporary socket thus
      triggering a JIT image dump when enabled. The tool uses an interactive
      libreadline shell with auto-completion and history support.
      Signed-off-by: NDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fd981e3c
    • O
      net: eth: cpsw: 64-bit phys_addr_t and sparse cleanup · 1a3b5056
      Olof Johansson 提交于
      Minor fix for printk format of a phys_addr_t, and the switch of two local
      functions to static since they're not used outside of the file.
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1a3b5056
    • O
      net: eth: davinci_cpdma: Mark a local variable static · df784160
      Olof Johansson 提交于
      Only used locally. Found by sparse.
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      df784160
    • O
      net: eth: davinci_cpdma: 64-bit phys/dma_addr_t cleanup · c767db51
      Olof Johansson 提交于
      Silences the below warnings when building with ARM_LPAE enabled, which
      gives longer dma_addr_t by default:
      
      drivers/net/ethernet/ti/davinci_cpdma.c: In function 'cpdma_desc_pool_create':
      drivers/net/ethernet/ti/davinci_cpdma.c:182:3: warning: passing argument 3 of 'dma_alloc_attrs' from incompatible pointer type [enabled by default]
      drivers/net/ethernet/ti/davinci_cpdma.c: In function 'desc_phys':
      drivers/net/ethernet/ti/davinci_cpdma.c:222:25: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      drivers/net/ethernet/ti/davinci_cpdma.c:223:8: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c767db51
    • M
      8390 : Replace ei_debug with msg_enable/NETIF_MSG_* feature · c45f812f
      Matthew Whitehead 提交于
      Removed the shared ei_debug variable. Replaced it by adding u32 msg_enable to
      the private struct ei_device. Now each 8390 ethernet instance has a per-device
      logging variable.
      
      Changed older style printk() calls to more canonical forms.
      
      Tested on: ne, ne2k-pci, smc-ultra, and wd hardware.
      
      V4.0
      - Substituted pr_info() and pr_debug() for printk() KERN_INFO and KERN_DEBUG
      
      V3.0
      - Checked for cases where pr_cont() was most appropriate choice.
      - Changed module parameter from 'debug' to 'msg_enable' because debug was
      no longer the best description.
      
      V2.0
      - Changed netif_msg_(drv|probe|ifdown|rx_err|tx_err|tx_queued|intr|rx_status|hw)
      to netif_(dbg|info|warn|err) where possible.
      Signed-off-by: NMatthew Whitehead <tedheadster@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c45f812f
    • J
      ipv6: router reachability probing · 7e980569
      Jiri Benc 提交于
      RFC 4191 states in 3.5:
      
         When a host avoids using any non-reachable router X and instead sends
         a data packet to another router Y, and the host would have used
         router X if router X were reachable, then the host SHOULD probe each
         such router X's reachability by sending a single Neighbor
         Solicitation to that router's address.  A host MUST NOT probe a
         router's reachability in the absence of useful traffic that the host
         would have sent to the router if it were reachable.  In any case,
         these probes MUST be rate-limited to no more than one per minute per
         router.
      
      Currently, when the neighbour corresponding to a router falls into
      NUD_FAILED, it's never considered again. Introduce a new rt6_nud_state
      value, RT6_NUD_FAIL_PROBE, which suggests the route should not be used but
      should be probed with a single NS. The probe is ratelimited by the existing
      code. To better distinguish meanings of the failure values, rename
      RT6_NUD_FAIL_SOFT to RT6_NUD_FAIL_DO_RR.
      Signed-off-by: NJiri Benc <jbenc@redhat.com>
      Acked-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7e980569
    • W
      sctp: remove redundant null check on asoc · e4772668
      wangweidong 提交于
      In sctp_err_lookup, goto out while the asoc is not NULL, so remove the
      check NULL. Also, in sctp_err_finish which called by sctp_v4_err and
      sctp_v6_err, they pass asoc to sctp_err_finish while the asoc is not
      NULL, so remove the check.
      Signed-off-by: NWang Weidong <wangweidong1@huawei.com>
      Acked-by: NNeil Horman <nhorman@tuxdriver.com>
      Acked-by: NVlad Yasevich <vyasevich@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e4772668
    • Y
      sch_htb: remove unnecessary NULL pointer judgment · 6b1dd856
      Yang Yingliang 提交于
      It already has a NULL pointer judgment of rtab in qdisc_put_rtab().
      Remove the judgment outside of qdisc_put_rtab().
      Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6b1dd856
    • N
      ipv4: fix wildcard search with inet_confirm_addr() · b601fa19
      Nicolas Dichtel 提交于
      Help of this function says: "in_dev: only on this interface, 0=any interface",
      but since commit 39a6d063 ("[NETNS]: Process inet_confirm_addr in the
      correct namespace."), the code supposes that it will never be NULL. This
      function is never called with in_dev == NULL, but it's exported and may be used
      by an external module.
      
      Because this patch restore the ability to call inet_confirm_addr() with in_dev
      == NULL, I partially revert the above commit, as suggested by Julian.
      
      CC: Julian Anastasov <ja@ssi.bg>
      Signed-off-by: NNicolas Dichtel <nicolas.dichtel@6wind.com>
      Reviewed-by: NJulian Anastasov <ja@ssi.bg>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b601fa19
    • G
      vxlan: leave multicast group when vxlan device down · 95ab0991
      Gao feng 提交于
      vxlan_group_used only allows device to leave multicast group
      when the remote_ip of this vxlan device is difference from
      other vxlan devices' remote_ip. this will cause device not
      leave multicast group untile the vn_sock of this vxlan deivce
      being released.
      
      The check in vxlan_group_used is not quite precise. since even
      the remote_ip is same, but these vxlan devices may use different
      lower devices, and they may use different vn_socks.
      
      Only when some vxlan devices use the same vn_sock,same lower
      device and same remote_ip, the mc_list of the vn_sock should
      not be changed.
      Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      95ab0991
    • G
      vxlan: remove vxlan_group_used in vxlan_open · 79d4a94f
      Gao feng 提交于
      In vxlan_open, vxlan_group_used always returns true,
      because the state of the vxlan deivces which we want
      to open has alreay been running. and it has already
      in vxlan_list.
      
      Since ip_mc_join_group takes care of the reference
      of struct ip_mc_list. removing vxlan_group_used here
      is safe.
      Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      79d4a94f
    • R
      1a0ab767
    • R
      bgmac: reset cached MAC state during chip reset · d469962f
      Rafał Miłecki 提交于
      Without this bgmac_adjust_link didn't know it should re-initialize MAC
      state. This led to the MAC not working after if down & up routine.
      Signed-off-by: NRafał Miłecki <zajec5@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d469962f
    • Y
      net_sched: expand control flow of macro SKIP_NONLOCAL · 4f8f61eb
      Yang Yingliang 提交于
      SKIP_NONLOCAL hides the control flow. The control flow should be
      inlined and expanded explicitly in code so that someone who reads
      it can tell the control flow can be changed by the statement.
      Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4f8f61eb
  2. 11 12月, 2013 25 次提交