1. 01 Apr, 2014 13 commits
    • Daniel Borkmann's avatar
      net: ptp: move PTP classifier in its own file · 408eccce
      Daniel Borkmann authored
      This commit fixes a build error reported by Fengguang, that is
      triggered when CONFIG_NETWORK_PHY_TIMESTAMPING is not set:
      
        ERROR: "ptp_classify_raw" [drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.ko] undefined!
      
      The fix is to introduce its own file for the PTP BPF classifier,
      so that PTP_1588_CLOCK and/or NETWORK_PHY_TIMESTAMPING can select
      it independently from each other. IXP4xx driver on ARM needs to
      select it as well since it does not seem to select PTP_1588_CLOCK
      or similar that would pull it in automatically.
      
      This also allows for hiding all of the internals of the BPF PTP
      program inside that file, and only exporting relevant API bits
      to drivers.
      
      This patch also adds a kdoc documentation of ptp_classify_raw()
      API to make it clear that it can return PTP_CLASS_* defines. Also,
      the BPF program has been translated into bpf_asm code, so that it
      can be more easily read and altered (extensively documented in [1]).
      
      In the kernel tree under tools/net/ we have bpf_asm and bpf_dbg
      tools, so the commented program can simply be translated via
      `./bpf_asm -c prog` where prog is a file that contains the
      commented code. This makes it easily readable/verifiable and when
      there's a need to change something, jump offsets etc do not need
      to be replaced manually which can be very error prone. Instead,
      a newly translated version via bpf_asm can simply replace the old
      code. I have checked opcode diffs before/after and it's the very
      same filter.
      
        [1] Documentation/networking/filter.txt
      
      Fixes: 164d8c66 ("net: ptp: do not reimplement PTP/BPF classifier")
      Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Jiri Benc <jbenc@redhat.com>
      Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      408eccce
    • Dan Carpenter's avatar
      net: sxgbe: make "core_ops" static · 7baea6ef
      Dan Carpenter authored
      The "core_ops" variable isn't referenced outside this file and Sparse
      complains about it:
      
      	drivers/net/ethernet/samsung/sxgbe/sxgbe_core.c:239:29: warning:
      	symbol 'core_ops' was not declared. Should it be static?
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7baea6ef
    • Dan Carpenter's avatar
      net: sxgbe: fix logical vs bitwise operation · 4f6ed914
      Dan Carpenter authored
      Bitwise '|' was intended here instead of logical '||'.
      
      Fixes: 1edb9ca6 ('net: sxgbe: add basic framework for Samsung 10Gb ethernet driver')
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4f6ed914
    • Dan Carpenter's avatar
      net: sxgbe: sxgbe_mdio_register() frees the bus · ca231f83
      Dan Carpenter authored
      "err" is always zero at this point so we always unregister and free the
      mdio_bus before returning success.  This seems like left over code and
      I have deleted it.
      
      Fixes: 1edb9ca6 ('net: sxgbe: add basic framework for Samsung 10Gb ethernet driver')
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ca231f83
    • Daniel Pieczko's avatar
      Call efx_set_channels() before efx->type->dimension_resources() · 52ad762b
      Daniel Pieczko authored
      When using the "separate_tx_channels=1" module parameter, the TX queues are
      initially numbered starting from the first TX-only channel number (after all the
      RX-only channels).  efx_set_channels() renumbers the queues so that they are
      indexed from zero.
      
      On EF10, the TX queues need to be relabelled in this way before calling the
      dimension_resources NIC type operation, otherwise the TX queue PIO buffers can be
      linked to the wrong VIs when using "separate_tx_channels=1".
      
      Added comments to explain UC/WC mappings for PIO buffers
      Signed-off-by: default avatarShradha Shah <sshah@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      52ad762b
    • Wei Liu's avatar
      xen-netback: disable rogue vif in kthread context · e9d8b2c2
      Wei Liu authored
      When netback discovers frontend is sending malformed packet it will
      disables the interface which serves that frontend.
      
      However disabling a network interface involving taking a mutex which
      cannot be done in softirq context, so we need to defer this process to
      kthread context.
      
      This patch does the following:
      1. introduce a flag to indicate the interface is disabled.
      2. check that flag in TX path, don't do any work if it's true.
      3. check that flag in RX path, turn off that interface if it's true.
      
      The reason to disable it in RX path is because RX uses kthread. After
      this change the behavior of netback is still consistent -- it won't do
      any TX work for a rogue frontend, and the interface will be eventually
      turned off.
      
      Also change a "continue" to "break" after xenvif_fatal_tx_err, as it
      doesn't make sense to continue processing packets if frontend is rogue.
      
      This is a fix for XSA-90.
      Reported-by: default avatarTörök Edwin <edwin@etorok.net>
      Signed-off-by: default avatarWei Liu <wei.liu2@citrix.com>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Reviewed-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Acked-by: default avatarIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9d8b2c2
    • Or Gerlitz's avatar
      net/mlx4: Set proper build dependancy with vxlan · a66132f3
      Or Gerlitz authored
      Make sure that vxlan_get_rx_port() is present in the kernel build in a manner
      consistent with mlx4, else mlx4 can be made built-in where vxlan a module and
      the phase of the build linking fails. Add CONFIG_MLX4_EN_VXLAN for that.
      
      Also, #ifdef the advertizement and implementation of the mlx4 vxlan ndo
      calls and related code under this config directive.
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a66132f3
    • Sathya Perla's avatar
      be2net: fix build dependency on VxLAN · c5abe7c0
      Sathya Perla authored
      Introduce a CONFIG_BE2NET_VXLAN define to control be2net's build
      dependency on the VXLAN driver.
      
      Without this fix, the kernel build fails when VxLAN driver is
      selected to be built as a module while be2net is built-in.
      
      fixes: c9c47142 ("be2net: csum, tso and rss steering offload support for VxLAN")
      Signed-off-by: default avatarSathya Perla <sathya.perla@emulex.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c5abe7c0
    • Phoebe Buckheister's avatar
      mac802154: make csma/cca parameters per-wpan · e462ded6
      Phoebe Buckheister authored
      Commit 9b2777d6 (ieee802154: add TX power control to wpan_phy)
      and following erroneously added CSMA and CCA parameters for 802.15.4
      devices as PHY parameters, while they are actually MAC parameters and
      can differ for any two WPAN instances. Since it is now sensible to have
      multiple WPAN devices with differing CSMA/CCA parameters, make these
      parameters MAC parameters instead.
      Signed-off-by: default avatarPhoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e462ded6
    • Phoebe Buckheister's avatar
      mac802154: allow only one WPAN to be up at any given time · 336908f6
      Phoebe Buckheister authored
      All 802.15.4 PHY devices with drivers in tree can support only one WPAN
      at any given time, yet the stack allows arbitrarily many WPAN devices to
      be created and up at the same time. This cannot work with what the
      hardware provides, and in the current implementation, provides an easy
      DoS vector to any process on the system that may call socket() and
      sendmsg().
      
      Thus, allow only one WPAN per PHY to be up at once, just like mac80211
      does for managed devices.
      Signed-off-by: default avatarPhoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      336908f6
    • Daniel Borkmann's avatar
      net: filter: minor: fix kdoc in __sk_run_filter · 01d32f6e
      Daniel Borkmann authored
      This minor patch fixes the following warning when doing
      a `make htmldocs`:
      
        DOCPROC Documentation/DocBook/networking.xml
      Warning(.../net/core/filter.c:135): No description found for parameter 'insn'
      Warning(.../net/core/filter.c:135): Excess function parameter 'fentry' description in '__sk_run_filter'
        HTML    Documentation/DocBook/networking.html
      Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Cc: Alexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      01d32f6e
    • Pablo Neira's avatar
      netlink: don't compare the nul-termination in nla_strcmp · 8b7b9324
      Pablo Neira authored
      nla_strcmp compares the string length plus one, so it's implicitly
      including the nul-termination in the comparison.
      
       int nla_strcmp(const struct nlattr *nla, const char *str)
       {
              int len = strlen(str) + 1;
              ...
                      d = memcmp(nla_data(nla), str, len);
      
      However, if NLA_STRING is used, userspace can send us a string without
      the nul-termination. This is a problem since the string
      comparison will not match as the last byte may be not the
      nul-termination.
      
      Fix this by skipping the comparison of the nul-termination if the
      attribute data is nul-terminated. Suggested by Thomas Graf.
      
      Cc: Florian Westphal <fw@strlen.de>
      Cc: Thomas Graf <tgraf@suug.ch>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8b7b9324
    • David S. Miller's avatar
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next · ff378ca1
      David S. Miller authored
      Jeff Kirsher says:
      
      ====================
      Intel Wired LAN Driver Updates
      
      This series contains fixes to e1000e, igb, ixgbe, ixgebvf, i40e and
      i40evf.
      
      David provides a fix for e1000e to resolve an issue where the device is
      capable of transmitting packets but is unable to receive packets until
      a previously introduced workaround is called.
      
      Jakub Kicinski provides PTP fixes for ixgbe, which include removing a
      redundant if clause and make sure we are not generating both a software and
      hardware timestamp.  As well as fix a race condition and leaking skbs
      when multiple transmit rings try to claim time stamping.
      
      Jean Sacren fixes a function declaration in ixgbe which was introduced
      in commit c97506ab ("ixgbe: Add check for FW veto bit").  In addition
      fixes a function header comment in i40e and fixes the error checking
      by binding the check to the pertinent DMA bit mask.
      
      Mark provides several fixes for ixgbe and ixgbevf.  Most notably are fixes
      to resolve namespace issues and fix ECU warnings induced by LER for ixgbe
      and ixgbevf.
      
      Joe Perches fixes up unnecessary casts in i40e and i40evf.
      
      Peter Senna Tschudin fixes igb to use pci_iounmap when the virtual mapping
      was done with pci_iomap.
      ====================# Please enter a commit message to explain why this merge is necessary,
      ff378ca1
  2. 31 Mar, 2014 27 commits