1. 15 Aug, 2016 19 commits
    • Wei Yongjun's avatar
      net: phy: Fix return value check in xgmiitorgmii_probe() · 64721094
      Wei Yongjun authored
      In case of error, the function of_parse_phandle() returns NULL
      pointer not ERR_PTR(). The IS_ERR() test in the return value check
      should be replaced with NULL test.
      Signed-off-by: default avatarWei Yongjun <weiyj.lk@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      64721094
    • Colin Ian King's avatar
      net: hns: mdio->irq is an array, so no need to check if it is null · cfaace26
      Colin Ian King authored
      The null check on mdio->irq is redundant since mdio->irq is an array
      of PHY_MAX_ADDR ints and hence can never be null. Remove the redundant
      check.
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cfaace26
    • Or Gerlitz's avatar
      switchdev: Put export declaration in the right place · 2eb03e6c
      Or Gerlitz authored
      Move exporting of switchdev_port_same_parent_id to be right
      below it and not elsewhere.
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Reported-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2eb03e6c
    • David S. Miller's avatar
      Merge branch 'qed-janitorial' · a2956ecd
      David S. Miller authored
      Yuval Mintz says:
      
      ====================
      qed*: Janitorial series [semantic & prints]
      
      Some day 1 slips in coding style exist in the qed* code
      [incorrect alignments, conditions using (== 0), etc.].
      This series comes to address those, and do some additional
      cosmetic changes along the way [such as reducing the number of lines
      for function declerations].
      
      The series is broken to 3 parts - purely semantic changes, cosmetic
      changes that required minor changes in the code, and print-related
      changes. All-in-all, no real change in driver behavior is expected.
      
      [This is a repost; Original was sent when net-next closed].
      
      Please consider applying this to `net-next'.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a2956ecd
    • Yuval Mintz's avatar
      qed*: Add and modify some prints · 525ef5c0
      Yuval Mintz authored
      This patch touches various prints in the driver - it reduces the
      verbosity of some prints [which were previously logged by default]
      while adding several new debug prints and modifying others.
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      525ef5c0
    • Yuval Mintz's avatar
      qed*: Trivial modifications · 83aeb933
      Yuval Mintz authored
      Change qed* code in trivial manner; This isn't necessarily
      semantic-only, but the end result is the same, i.e., no change
      should occur from user perspective. Changes include:
        - Using temporary variables to better fit 80-character restrictions.
        - Removal of unused variables & code with no effect.
      [plus some additional minor modifications].
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      83aeb933
    • Yuval Mintz's avatar
      qed*: Semantic changes · 1a635e48
      Yuval Mintz authored
      Make semantic-only adjustments to qed* drivers, such as:
        - Changes in code indentation.
        - Usage of BIT() macro.
        - re-naming of variables.
        - Re-ordering of variable declerations.
        - Removal of (== 0) and (!= 0) in conditions.
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1a635e48
    • Markus Elfring's avatar
      fjes: Delete owner assignment · 54be3d98
      Markus Elfring authored
      The field "owner" is set by core. Thus delete an extra initialisation.
      
      Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
      Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      54be3d98
    • Gao Feng's avatar
      pptp: Refactor the struct and macros of PPTP codes · 03459345
      Gao Feng authored
      1. Use struct gre_base_hdr directly in pptp_gre_header instead of
      duplicated members;
      2. Use existing macros like GRE_KEY, GRE_SEQ, and so on instead of
      duplicated macros defined by PPTP;
      3. Add new macros like GRE_IS_ACK/SEQ and so on instead of
      PPTP_GRE_IS_A/S and so on;
      Signed-off-by: default avatarGao Feng <fgao@ikuai8.com>
      Reviewed-by: default avatarPhilip Prindeville <philipp@redfish-solutions.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      03459345
    • Wei Yongjun's avatar
      net: dsa: b53: remove .owner and .bus fields for driver · cfad65c7
      Wei Yongjun authored
      Remove .owner and .bus fields since module_spi_driver() is used
      which set them automatically.
      
      Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
      Signed-off-by: default avatarWei Yongjun <weiyj.lk@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cfad65c7
    • Wei Yongjun's avatar
      net: macb: add missing free_netdev() on error in macb_probe() · b22ae0b4
      Wei Yongjun authored
      Add the missing free_netdev() before return from function macb_probe()
      in the platform_get_irq() error handling case.
      
      Fixes: c69618b3 ("net/macb: fix probe sequence to setup clocks earlier")
      Signed-off-by: default avatarWei Yongjun <weiyj.lk@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b22ae0b4
    • Wei Yongjun's avatar
      qed: Fix possible memory leak in qed_dcbnl_get_ieee_pfc() · 02ee9b18
      Wei Yongjun authored
      'dcbx_info is malloced in qed_dcbnl_get_ieee_pfc() and should be freed
      before leaving from the error handling cases, otherwise it will cause
      memory leak.
      
      Fixes: a1d8d8a5 ("qed: Add dcbnl support.")
      Signed-off-by: default avatarWei Yongjun <weiyj.lk@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      02ee9b18
    • David S. Miller's avatar
      Merge branch 'cxgb4-IFLA_VF_MAC' · 2fb876b2
      David S. Miller authored
      Hariprasad Shenai says:
      
      ====================
      cxgb4: Add support for IFLA_VF_MAC
      
      We're struggling to implement the PCI SR-IOV management features for
      administering Virtual Functions which represent networking devices using
      the current Linux APIs. The problem is that these APIs incorporate all
      sorts of assumptions which don't match chelsio networking cards.
      
      For instance, the current APIs assume a 1-to-1 mapping of Network Ports,
      Physical Functions and the SR-IOV Virtual Functions of those Physical
      Functions. This is not the case with our cards where any Virtual Function
      can be hooked up to any Port -- or any number of Ports the current Linux
      APIs also assume only 1 Network Interface/Port can be accessed per Virtuali
      Function.
      
      Another issue is that these APIs assume that the Administrative Driver is
      attached to the Physical Function Associated with a Virtual Function. This
      is not the case with our card where all administration is performed by a
      Driver which is not attached to any of the Physical Functions which have
      SR-IOV PCI Capabilities.
      
      Another consequence of these assumptions is the inability to utilize all
      of the cards SR-IOV resources. For instance, our cards have SR-IOV
      Capabilities on Physical Functions 0..3 and the administrative Driver
      attaches to Physical Function 4. Each of the Physical Functions 0..3 can
      support up to 16 Virtual Functions. With the current Linux APIs, a 2-Port
      card would only be able to use the Virtual Functions on Physical
      Function 0..1 and not allow the Virtual Functions on Physical
      Functions 2..3 to be used since there are no Ports 2..3 on a 2-Port card.
      
      Patch 1/2 adds support to create management interface for each PF to control
      thier corresponding VF's. Patch 2/2 adds support for ndo_set_vf_mac.
      
      This patch series has been created against net-next tree.
      
      We have included all the maintainers of respective drivers. Kindly review
      the change and let us know in case of any review comments.
      
      V5: Fix warning reported by kbuild bot when CONFIG_PCI_IOV isn't defined.
      
      V4: Handle memory allocation failure for adapter->mbox_log in init_one().
          Based on review comment by Yuval Mintz <Yuval.Mintz@qlogic.com>
      
      V3: Based on review comment by Yuval Mintz, removed extra parameter pf
          added to IFLA_VF API's and created a net_device corresponding to
          each PF for controling their VF. Based on review comment by
          Yuval Mintz <Yuval.Mintz@qlogic.com>
      
      V2: Fixed check for MAC address in Patch 2/2, based on review comment by
          Yuval Mintz <Yuval.Mintz@qlogic.com>
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2fb876b2
    • Hariprasad Shenai's avatar
      cxgb4/cxgb4vf: Add set VF mac address support · 858aa65c
      Hariprasad Shenai authored
      Add ndo_set_vf_mac support which allows to set the MAC address
      for cxgb4vf interfaces from the host
      Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      858aa65c
    • Hariprasad Shenai's avatar
      cxgb4: Add control net_device for configuring PCIe VF · 7829451c
      Hariprasad Shenai authored
      Issue:
      For instance, the current APIs assume a 1-to-1 mapping of Network Ports,
      Physical Functions and the SR-IOV Virtual Functions of those Physical
      Functions. This is not the case with our cards where any Virtual
      Function can be hooked up to any Port -- or any number of Ports the
      current Linux APIs also assume only 1 Network Interface/Port can be
      accessed per Virtual Function.
      
      Another issue is that these APIs assume that the Administrative Driver
      is attached to the Physical Function Associated with a Virtual Function.
      This is not the case with our card where all administration is performed
      by a Driver which is not attached to any of the Physical Functions which
      have SR-IOV PCI Capabilities.
      
      Another consequence of these assumptions is the inability to utilize all
      of the cards SR-IOV resources. For instance, our cards have SR-IOV
      Capabilities on Physical Functions 0..3 and the administrative Driver
      attaches to Physical Function 4. Each of the Physical Functions 0..3 can
      support up to 16 Virtual Functions. With the current Linux APIs, a
      2-Port card would only be able to use the Virtual Functions on Physical
      Function 0..1 and not allow the Virtual Functions on Physical Functions
      2..3 to be used since there are no Ports 2..3 on a 2-Port card.
      
      Fix:
      Since the control node is always the netdevice for all VF ACL commands.
      Created a dummy netdevice for each Physical Function from 0 to 3 through
      which one could control their VFs. The device won't be associated with
      any port, since it doesn't need to transmit/receive. Its purely used
      for VF management purpose only. The device will be registered only when
      VF for a particular PF is configured using PCI sysfs interface and
      unregistered while pci_disable_sriov() for the PF is called.
      Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7829451c
    • David S. Miller's avatar
      Merge branch 'proc-per-ns' · a878c020
      David S. Miller authored
      Dmitry Torokhov says:
      
      ====================
      Make /proc per net namespace objects belong to container
      
      Currently [almost] all /proc objects belong to the global root, even if
      data belongs to a given namespace within a container and (at least for
      sysctls) we work around permssions checks to allow container's root to
      access the data.
      
      This series changes ownership of net namespace /proc objects
      (/proc/net/self/* and /proc/sys/net/*) to be container's root and not
      global root when there exists mapping for container's root in user
      namespace.
      
      This helps when running Android CTS in a container, but I think it makes
      sense regardless.
      
      Changes from V1:
      
      - added fix for crash when !CONFIG_NET_NS (new patch #1)
      - addressed Eric'c comments for error handling style in patch #3 and
        added his Ack
      - adjusted patch #2 to use the same style of erro handling
      - sent out as series instead of separate patches
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a878c020
    • Dmitry Torokhov's avatar
      net: make net namespace sysctls belong to container's owner · e79c6a4f
      Dmitry Torokhov authored
      If net namespace is attached to a user namespace let's make container's
      root owner of sysctls affecting said network namespace instead of global
      root.
      
      This also allows us to clean up net_ctl_permissions() because we do not
      need to fudge permissions anymore for the container's owner since it now
      owns the objects in question.
      Acked-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e79c6a4f
    • Dmitry Torokhov's avatar
      proc: make proc entries inherit ownership from parent · c110486f
      Dmitry Torokhov authored
      There are certain parameters that belong to net namespace and that are
      exported in /proc. They should be controllable by the container's owner,
      but are currently owned by global root and thus not available.
      
      Let's change proc code to inherit ownership of parent entry, and when
      create per-ns "net" proc entry set it up as owned by container's owner.
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c110486f
    • Dmitry Torokhov's avatar
      netns: do not call pernet ops for not yet set up init_net namespace · f8c46cb3
      Dmitry Torokhov authored
      When CONFIG_NET_NS is disabled, registering pernet operations causes
      init() to be called immediately with init_net as an argument. Unfortunately
      this leads to some pernet ops, such as proc_net_ns_init() to be called too
      early, when init_net namespace has not been fully initialized. This causes
      issues when we want to change pernet ops to use more data from the net
      namespace in question, for example reference user namespace that owns our
      network namespace.
      
      To fix this we could either play game of musical chairs and rearrange init
      order, or we could do the same as when CONFIG_NET_NS is enabled, and
      postpone calling pernet ops->init() until namespace is set up properly.
      
      Note that we can not simply undo commit ed160e83 ("[NET]: Cleanup
      pernet operation without CONFIG_NET_NS") and use the same implementations
      for __register_pernet_operations() and __unregister_pernet_operations(),
      because many pernet ops are marked as __net_initdata and will be discarded,
      which wreaks havoc on our ops lists. Here we rely on the fact that we only
      use lists until init_net is fully initialized, which happens much earlier
      than discarding __net_initdata sections.
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f8c46cb3
  2. 13 Aug, 2016 21 commits