1. 05 Aug, 2013 12 commits
    • Veaceslav Falico's avatar
      bonding: remove locking from bond_set_rx_mode() · 7864a1ad
      Veaceslav Falico authored
      We're already protected by RTNL lock, so nothing can happen to bond/its
      slaves, and thus the locking is useless here (both bond->lock and
      bond->curr_active_slave).
      
      Also, add ASSERT_RTNL() both to bond_set_rx_mode() and bond_hw_addr_swap()
      to catch possible uses of it without RTNL locking.
      
      This patch also saves us from a lockdep false-positive in
      bond_set_rx_mode() vs bond_hw_addr_swap().
      
      CC: Jay Vosburgh <fubar@us.ibm.com>
      CC: Andy Gospodarek <andy@greyhouse.net>
      CC: Nikolay Aleksandrov <nikolay@redhat.com>
      Signed-off-by: default avatarVeaceslav Falico <vfalico@redhat.com>
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7864a1ad
    • Mugunthan V N's avatar
      drivers: net: cpsw: Add support for new CPSW IP version · c193f365
      Mugunthan V N authored
      The new IP version has a minor changes and the offsets are same as the
      previous version, so adding new IP version support in the driver.
      Signed-off-by: default avatarMugunthan V N <mugunthanvnm@ti.com>
      Reviewed-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c193f365
    • fan.du's avatar
      sctp: Pack dst_cookie into 1st cacheline hole for 64bit host · 5a139296
      fan.du authored
      As dst_cookie is used in fast path sctp_transport_dst_check.
      
      Before:
      struct sctp_transport {
      	struct list_head           transports;           /*     0    16 */
      	atomic_t                   refcnt;               /*    16     4 */
      	__u32                      dead:1;               /*    20:31  4 */
      	__u32                      rto_pending:1;        /*    20:30  4 */
      	__u32                      hb_sent:1;            /*    20:29  4 */
      	__u32                      pmtu_pending:1;       /*    20:28  4 */
      
      	/* XXX 28 bits hole, try to pack */
      
      	__u32                      sack_generation;      /*    24     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	struct flowi               fl;                   /*    32    64 */
      	/* --- cacheline 1 boundary (64 bytes) was 32 bytes ago --- */
      	union sctp_addr            ipaddr;               /*    96    28 */
      
      After:
      struct sctp_transport {
      	struct list_head           transports;           /*     0    16 */
      	atomic_t                   refcnt;               /*    16     4 */
      	__u32                      dead:1;               /*    20:31  4 */
      	__u32                      rto_pending:1;        /*    20:30  4 */
      	__u32                      hb_sent:1;            /*    20:29  4 */
      	__u32                      pmtu_pending:1;       /*    20:28  4 */
      
      	/* XXX 28 bits hole, try to pack */
      
      	__u32                      sack_generation;      /*    24     4 */
      	u32                        dst_cookie;           /*    28     4 */
      	struct flowi               fl;                   /*    32    64 */
      	/* --- cacheline 1 boundary (64 bytes) was 32 bytes ago --- */
      	union sctp_addr            ipaddr;               /*    96    28 */
      Signed-off-by: default avatarFan Du <fan.du@windriver.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5a139296
    • Veaceslav Falico's avatar
      bonding: add bond_time_in_interval() and use it for time comparison · e7f63f1d
      Veaceslav Falico authored
      Currently we use a lot of time comparison math for arp_interval
      comparisons, which are sometimes quite hard to read and understand.
      
      All the time comparisons have one pattern:
      (time - arp_interval_jiffies) <= jiffies <= (time + mod *
      arp_interval_jiffies + arp_interval_jiffies/2)
      
      Introduce a new helper - bond_time_in_interval(), which will do the math in
      one place and, thus, will clean up the logical code. This helper introduces
      a bit of overhead (by always calculating the jiffies from arp_interval),
      however it's really not visible, considering that functions using it
      usually run once in arp_interval milliseconds.
      
      There are several lines slightly over 80 chars, however breaking them would
      result in more hard-to-read code than several character after the 80 mark.
      
      CC: Jay Vosburgh <fubar@us.ibm.com>
      CC: Andy Gospodarek <andy@greyhouse.net>
      Signed-off-by: default avatarVeaceslav Falico <vfalico@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e7f63f1d
    • Veaceslav Falico's avatar
      bonding: call slave_last_rx() only once per slave · def4460c
      Veaceslav Falico authored
      Simple cleanup to not call slave_last_rx() on every time function. It won't
      give any measurable boost - but looks cleaner and easier to understand.
      
      There are no time-consuming functions in between these calls, so it's safe
      to call it in the beginning only once.
      
      CC: Jay Vosburgh <fubar@us.ibm.com>
      CC: Andy Gospodarek <andy@greyhouse.net>
      Signed-off-by: default avatarVeaceslav Falico <vfalico@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      def4460c
    • Wei Yongjun's avatar
      tile: fix missing unlock on error in tile_net_open() · 1155e964
      Wei Yongjun authored
      Add the missing unlock before return from function tile_net_open()
      in the error handling case.
      
      Introduced by commit f3286a3a.
      (tile: support multiple mPIPE shims in tilegx network driver)
      Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
      Acked-by: default avatarChris Metcalf <cmetcalf@tilera.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1155e964
    • Jingoo Han's avatar
      net: mlx4: Staticize local functions · f094668c
      Jingoo Han authored
      These local functions are used only in this file.
      Fix the following sparse warnings:
      
      drivers/net/ethernet/mellanox/mlx4/cmd.c:803:5: warning: symbol 'MLX4_CMD_UPDATE_QP_wrapper' was not declared. Should it be static?
      drivers/net/ethernet/mellanox/mlx4/cmd.c:812:5: warning: symbol 'MLX4_CMD_GET_OP_REQ_wrapper' was not declared. Should it be static?
      drivers/net/ethernet/mellanox/mlx4/cmd.c:1547:5: warning: symbol 'mlx4_master_immediate_activate_vlan_qos' was not declared. Should
      it be static?
      Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
      Acked-By: default avatarAmir Vadai <amirv@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f094668c
    • Jingoo Han's avatar
      net: micrel: Staticize local functions · 51a700db
      Jingoo Han authored
      These local functions are used only in this file.
      Fix the following sparse warnings:
      
      drivers/net/ethernet/micrel/ks8842.c:708:6: warning: symbol 'ks8842_handle_rx' was not declared. Should it be static?
      drivers/net/ethernet/micrel/ks8842.c:718:6: warning: symbol 'ks8842_handle_tx' was not declared. Should it be static?
      drivers/net/ethernet/micrel/ks8842.c:727:6: warning: symbol 'ks8842_handle_rx_overrun' was not declared. Should it be static?
      drivers/net/ethernet/micrel/ks8842.c:735:6: warning: symbol 'ks8842_tasklet' was not declared. Should it be static?
      drivers/net/ethernet/micrel/ks8851_mll.c:691:6: warning: symbol 'ks_enable_qmu' was not declared. Should it be static?
      Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      51a700db
    • Jingoo Han's avatar
      be2net: Staticize local functions · 4188e7df
      Jingoo Han authored
      These local functions are used only in this file.
      Fix the following sparse warnings:
      
      drivers/net/ethernet/emulex/benet/be_main.c:475:6: warning: symbol 'populate_erx_stats' was not declared. Should it be static?
      drivers/net/ethernet/emulex/benet/be_main.c:1485:6: warning: symbol 'be_rx_compl_process_gro' was not declared. Should it be static?
      drivers/net/ethernet/emulex/benet/be_main.c:2262:5: warning: symbol 'be_poll' was not declared. Should it be static?
      drivers/net/ethernet/emulex/benet/be_main.c:3223:6: warning: symbol 'flash_cookie' was not declared. Should it be static?
      drivers/net/ethernet/emulex/benet/be_main.c:3280:27: warning: symbol 'get_fsec_info' was not declared. Should it be static?
      drivers/net/ethernet/emulex/benet/be_cmds.c:1013:5: warning: symbol 'be_cmd_mccq_ext_create' was not declared. Should it be static?
      drivers/net/ethernet/emulex/benet/be_cmds.c:1071:5: warning: symbol 'be_cmd_mccq_org_create' was not declared. Should it be static?
      drivers/net/ethernet/emulex/benet/be_cmds.c:3166:5: warning: symbol 'be_cmd_get_profile_config_mbox' was not declared. Should it be
      static?
      drivers/net/ethernet/emulex/benet/be_cmds.c:3194:5: warning: symbol 'be_cmd_get_profile_config_mccq' was not declared. Should it be
      static?
      drivers/net/ethernet/emulex/benet/be_roce.c:96:6: warning: symbol '_be_roce_dev_remove' was not declared. Should it be static?
      drivers/net/ethernet/emulex/benet/be_roce.c:113:6: warning: symbol '_be_roce_dev_open' was not declared. Should it be static?
      drivers/net/ethernet/emulex/benet/be_roce.c:129:6: warning: symbol '_be_roce_dev_close' was not declared. Should it be static?
      Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4188e7df
    • Jingoo Han's avatar
      bna: Staticize local functions · 7f4341fe
      Jingoo Han authored
      bna_rx_sm_stop_wait_entry(), bna_rx_sm_rxf_stop_wait_entry(),
      bna_rx_sm_started_entry(), bna_rx_sm_cleanup_wait_entry(),
      and bna_rx_sm_cleanup_wait() are used only in this file.
      Fix the following sparse warnings:
      
      drivers/net/ethernet/brocade/bna/bna_tx_rx.c:1423:1: warning: symbol 'bna_rx_sm_stop_wait_entry' was not declared. Should it be
      static?
      drivers/net/ethernet/brocade/bna/bna_tx_rx.c:1476:1: warning: symbol 'bna_rx_sm_rxf_stop_wait_entry' was not declared. Should it be
      static?
      drivers/net/ethernet/brocade/bna/bna_tx_rx.c:1532:1: warning: symbol 'bna_rx_sm_started_entry' was not declared. Should it be
      static?
      drivers/net/ethernet/brocade/bna/bna_tx_rx.c:1597:1: warning: symbol 'bna_rx_sm_cleanup_wait_entry' was not declared. Should it be
      static?
      drivers/net/ethernet/brocade/bna/bna_tx_rx.c:1602:1: warning: symbol 'bna_rx_sm_cleanup_wait' was not declared. Should it be static?
      Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7f4341fe
    • stephen hemminger's avatar
      vxlan: fix rcu related warning · 5ca5461c
      stephen hemminger authored
      Vxlan remote list is protected by RCU and guaranteed to be non-empty.
      Split out the rcu and non-rcu access to the list to fix warning
      Signed-off-by: default avatarStephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5ca5461c
    • stephen hemminger's avatar
      bridge: fix rcu check warning in multicast port group · 762a3d89
      stephen hemminger authored
      Use of RCU here with out marked pointer and function doesn't match prototype
      with sparse.
      Signed-off-by: default avatarStephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      762a3d89
  2. 04 Aug, 2013 2 commits
  3. 03 Aug, 2013 20 commits
  4. 02 Aug, 2013 6 commits
    • Paul Moore's avatar
      netlabel: use domain based selectors when address based selectors are not available · 6a8b7f0c
      Paul Moore authored
      NetLabel has the ability to selectively assign network security labels
      to outbound traffic based on either the LSM's "domain" (different for
      each LSM), the network destination, or a combination of both.  Depending
      on the type of traffic, local or forwarded, and the type of traffic
      selector, domain or address based, different hooks are used to label the
      traffic; the goal being minimal overhead.
      
      Unfortunately, there is a bug such that a system using NetLabel domain
      based traffic selectors does not correctly label outbound local traffic
      that is not assigned to a socket.  The issue is that in these cases
      the associated NetLabel hook only looks at the address based selectors
      and not the domain based selectors.  This patch corrects this by
      checking both the domain and address based selectors so that the correct
      labeling is applied, regardless of the configuration type.
      
      In order to acomplish this fix, this patch also simplifies some of the
      NetLabel domainhash structures to use a more common outbound traffic
      mapping type: struct netlbl_dommap_def.  This simplifies some of the code
      in this patch and paves the way for further simplifications in the
      future.
      Signed-off-by: default avatarPaul Moore <pmoore@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6a8b7f0c
    • Michael Chan's avatar
      cnic, bnx2i: Fix bug on some bnx2x devices that don't support iSCSI · 9e9402eb
      Michael Chan authored
      On some bnx2x devices, iSCSI is determined to be unsupported only after
      firmware is downloaded.  We need to check max_iscsi_conn again after
      NETDEV_UP and block iSCSI init operations.  Without this fix, iscsiadm
      can hang as the firmware will not respond to the iSCSI init message.
      Signed-off-by: default avatarEddie Wai <eddie.wai@broadcom.com>
      Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9e9402eb
    • David S. Miller's avatar
      Merge branch 'bond_neigh_parms' · 4b42df5d
      David S. Miller authored
      Veaceslav Falico says:
      
      ====================
      Recent patches revealed an old bug, which was there for quite awhile. It's
      related to vlan on top of bonding and ndo_neigh_setup(). When vlan device
      is initiated, it calls its real_dev->ndo_neigh_setup(), and in case of
      bonding - it will modify neigh_parms->neigh_setup to point to
      bond_neigh_init, while neigh_parms are of vlan's dev.
      
      This way, when neigh_parms->neigh_setup() of vlan's dev is called, the
      bonding function will be called, which expects the dev to be struct
      bonding, but will receive a vlan dev.
      
      It was hidden before because of bond->first_slave usage. Now, with
      Nikolay's conversion to list/RCU, first_slave is gone and we hit a null
      pointer dereference when working with lists/slave.
      
      First patch moves ndo_neigh_setup() in neigh_parms_alloc() to the bottom,
      so that the ->dev will be available to the caller. It doesn't really change
      anything, however is needed for the second patch.
      
      Second patch makes bond_neigh_setup() (bond->ndo_neigh_setup()) check if
      the neigh_parms are really from a bonding dev, and only modify the
      neigh_setup in this case.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4b42df5d
    • Veaceslav Falico's avatar
      bonding: modify only neigh_parms owned by us · 9918d5bf
      Veaceslav Falico authored
      Otherwise, on neighbour creation, bond_neigh_init() will be called with a
      foreign netdev.
      Signed-off-by: default avatarVeaceslav Falico <vfalico@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9918d5bf
    • Veaceslav Falico's avatar
      neighbour: populate neigh_parms on alloc before calling ndo_neigh_setup · 63134803
      Veaceslav Falico authored
      dev->ndo_neigh_setup() might need some of the values of neigh_parms, so
      populate them before calling it.
      Signed-off-by: default avatarVeaceslav Falico <vfalico@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      63134803
    • Daniel Borkmann's avatar
      net: netlink: minor: remove unused pointer in alloc_pg_vec · 8a849bb7
      Daniel Borkmann authored
      Variable ptr is being assigned, but never used, so just remove it.
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8a849bb7