1. 17 3月, 2011 9 次提交
  2. 16 3月, 2011 11 次提交
    • I
      xen network backend driver · f942dc25
      Ian Campbell 提交于
      netback is the host side counterpart to the frontend driver in
      drivers/net/xen-netfront.c. The PV protocol is also implemented by
      frontend drivers in other OSes too, such as the BSDs and even Windows.
      
      The patch is based on the driver from the xen.git pvops kernel tree but
      has been put through the checkpatch.pl wringer plus several manual
      cleanup passes and review iterations. The driver has been moved from
      drivers/xen/netback to drivers/net/xen-netback.
      
      One major change from xen.git is that the guest transmit path (i.e. what
      looks like receive to netback) has been significantly reworked to remove
      the dependency on the out of tree PageForeign page flag (a core kernel
      patch which enables a per page destructor callback on the final
      put_page). This page flag was used in order to implement a grant map
      based transmit path (where guest pages are mapped directly into SKB
      frags). Instead this version of netback uses grant copy operations into
      regular memory belonging to the backend domain. Reinstating the grant
      map functionality is something which I would like to revisit in the
      future.
      
      Note that this driver depends on 2e820f58 "xen/irq: implement
      bind_interdomain_evtchn_to_irqhandler for backend drivers" which is in
      linux next via the "xen-two" tree and is intended for the 2.6.39 merge
      window:
              git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/backends
      this branch has only that single commit since 2.6.38-rc2 and is safe for
      cross merging into the net branch.
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      Reviewed-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f942dc25
    • P
      bonding: Improve syslog message at device creation time · 5f86cad1
      Phil Oester 提交于
      When the bonding module is loaded, it creates bond0 by default.
      Then, when attempting to create bond0, the following messages
      are printed to syslog:
      
          kernel: bonding: bond0 is being created...
          kernel: bonding: Bond creation failed.
      
      Which seems to indicate a problem, when in reality there is no
      problem.  Since the actual error code is passed down from bond_create,
      make use of it to print a bit less ominous message:
      
          kernel: bonding: bond0 is being created...
          kernel: bond0 already exists.
      Signed-off-by: NPhil Oester <kernel@linuxace.com>
      Signed-off-by: NAndy Gospodarek <andy@greyhouse.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5f86cad1
    • P
      bonding: Call netif_carrier_off after register_netdevice · e826eafa
      Phil Oester 提交于
      Bringing up a bond interface with all network cables disconnected
      does not properly set the interface as DOWN because the call to
      netif_carrier_off occurs too early in bond_init.  The call needs
      to occur after register_netdevice has set dev->reg_state to
      NETREG_REGISTERED, so that netif_carrier_off will trigger the
      call to linkwatch_fire_event.
      Signed-off-by: NPhil Oester <kernel@linuxace.com>
      Signed-off-by: NAndy Gospodarek <andy@greyhouse.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e826eafa
    • P
      bonding: Incorrect TX queue offset · fd0e435b
      Phil Oester 提交于
      When packets come in from a device with >= 16 receive queues
      headed out a bonding interface, syslog gets filled with this:
      
          kernel: bond0 selects TX queue 16, but real number of TX queues is 16
      
      because queue_mapping is offset by 1.  Adjust return value
      to account for the offset.
      
      This is a revision of my earlier patch (which did not use the
      skb_rx_queue_* helpers - thanks to Ben for the suggestion).
      Andy submitted a similar patch which emits a pr_warning on
      invalid queue selection, but I believe the log spew is
      not useful.  We can revisit that question in the future,
      but in the interim I believe fixing the core problem is
      worthwhile.
      Signed-off-by: NPhil Oester <kernel@linuxace.com>
      Signed-off-by: NAndy Gospodarek <andy@greyhouse.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fd0e435b
    • P
      be2net: Fix UDP packet detected status in RX compl · 9ecb42fd
      Padmanabh Ratnakar 提交于
      Status of UDP packet detection not getting populated in RX completion
      structure. This is required in csum_passed() routine.
      Signed-off-by: NPadmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
      Signed-off-by: NSathya Perla <sathya.perla@emulex.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9ecb42fd
    • S
      netxen: support for GbE port settings · bfd823bd
      Sony Chacko 提交于
      o Enable setting speed and auto negotiation parameters for GbE ports.
      o Hardware do not support half duplex setting currently.
      
      David Miller:
      	Amit please update your patch to silently reject link setting
      	attempts that are unsupported by the device.
      Signed-off-by: NSony Chacko <sony.chacko@qlogic.com>
      Signed-off-by: NAmit Kumar Salecha <amit.salecha@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bfd823bd
    • J
      smsc911x: Fix build error when SMSC_TRACE() used · 84c0c693
      Jeongtae Park 提交于
      This patch fixes build error when SMSC_TRACE() used.
      Signed-off-by: NJeongtae Park <jtp.park@samsung.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      84c0c693
    • S
      RDMA/cma: Replace global lock in rdma_destroy_id() with id-specific one · a396d43a
      Sean Hefty 提交于
      rdma_destroy_id currently uses the global rdma cm 'lock' to test if an
      rdma_cm_id has been bound to a device.  This prevents an active
      address resolution callback handler from assigning a device to the
      rdma_cm_id after rdma_destroy_id checks for one.
      
      Instead, we can replace the use of the global lock around the check to
      the rdma_cm_id device pointer by setting the id state to destroying,
      then flushing all active callbacks.  The latter is accomplished by
      acquiring and releasing the handler_mutex.  Any active handler will
      complete first, and any newly scheduled handlers will find the
      rdma_cm_id in an invalid state.
      
      In addition to optimizing the current locking scheme, the use of the
      rdma_cm_id mutex is a more intuitive synchronization mechanism than
      that of the global lock.  These changes are based on feedback from
      Doug Ledford <dledford@redhat.com> while he was trying to debug a
      crash in the rdma cm destroy path.
      Signed-off-by: NSean Hefty <sean.hefty@intel.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      a396d43a
    • S
      IB/cm: Cancel pending LAP message when exiting IB_CM_ESTABLISH state · 8d8ac865
      Sean Hefty 提交于
      This problem was reported by Moni Shoua <monis@mellanox.com> and Amir
      Vadai <amirv@mellanox.com>:
      
      	When destroying a cm_id from a context of a work queue and if
      	the lap_state of this cm_id is IB_CM_LAP_SENT, we need to
      	release the reference of this id that was taken upon the send
      	of the LAP message.  Otherwise, if the expected APR message
      	gets lost, it is only after a long time that the reference
      	will be released, while during that the work handler thread is
      	not available to process other things.
      
      It turns out that we need to cancel any pending LAP messages whenever
      we transition out of the IB_CM_ESTABLISH state.  This occurs when
      disconnecting - either sending or receiving a DREQ.  It can also
      happen in a corner case where we receive a REJ message after sending
      an RTU, followed by a LAP.  Add checks and cancel any outstanding LAP
      messages in these three cases.
      
      Canceling the LAP when sending a DREQ fixes the destroy problem
      reported by Moni.  When a cm_id is destroyed in the IB_CM_ESTABLISHED
      state, it sends a DREQ to the remote side to notify the peer that the
      connection is going away.
      Signed-off-by: NSean Hefty <sean.hefty@intel.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      8d8ac865
    • S
      IB/cm: Bump reference count on cm_id before invoking callback · 29963437
      Sean Hefty 提交于
      When processing a SIDR REQ, the ib_cm allocates a new cm_id.  The
      refcount of the cm_id is initialized to 1.  However, cm_process_work
      will decrement the refcount after invoking all callbacks.  The result
      is that the cm_id will end up with refcount set to 0 by the end of the
      sidr req handler.
      
      If a user tries to destroy the cm_id, the destruction will proceed,
      under the incorrect assumption that no other threads are referencing
      the cm_id.  This can lead to a crash when the cm callback thread tries
      to access the cm_id.
      
      This problem was noticed as part of a larger investigation with kernel
      crashes in the rdma_cm when running on a real time OS.
      Signed-off-by: NSean Hefty <sean.hefty@intel.com>
      Acked-by: NDoug Ledford <dledford@redhat.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      29963437
    • S
      RDMA/cma: Fix crash in request handlers · 25ae21a1
      Sean Hefty 提交于
      Doug Ledford and Red Hat reported a crash when running the rdma_cm on
      a real-time OS.  The crash has the following call trace:
      
          cm_process_work
             cma_req_handler
                cma_disable_callback
                rdma_create_id
                   kzalloc
                   init_completion
                cma_get_net_info
                cma_save_net_info
                cma_any_addr
                   cma_zero_addr
                rdma_translate_ip
                   rdma_copy_addr
                cma_acquire_dev
                   rdma_addr_get_sgid
                   ib_find_cached_gid
                   cma_attach_to_dev
                ucma_event_handler
                   kzalloc
                   ib_copy_ah_attr_to_user
                cma_comp
      
      [ preempted ]
      
          cma_write
              copy_from_user
              ucma_destroy_id
                 copy_from_user
                 _ucma_find_context
                 ucma_put_ctx
                 ucma_free_ctx
                    rdma_destroy_id
                       cma_exch
                       cma_cancel_operation
                       rdma_node_get_transport
      
              rt_mutex_slowunlock
              bad_area_nosemaphore
              oops_enter
      
      They were able to reproduce the crash multiple times with the
      following details:
      
          Crash seems to always happen on the:
                  mutex_unlock(&conn_id->handler_mutex);
          as conn_id looks to have been freed during this code path.
      
      An examination of the code shows that a race exists in the request
      handlers.  When a new connection request is received, the rdma_cm
      allocates a new connection identifier.  This identifier has a single
      reference count on it.  If a user calls rdma_destroy_id() from another
      thread after receiving a callback, rdma_destroy_id will proceed to
      destroy the id and free the associated memory.  However, the request
      handlers may still be in the process of running.  When control returns
      to the request handlers, they can attempt to access the newly created
      identifiers.
      
      Fix this by holding a reference on the newly created rdma_cm_id until
      the request handler is through accessing it.
      Signed-off-by: NSean Hefty <sean.hefty@intel.com>
      Acked-by: NDoug Ledford <dledford@redhat.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      25ae21a1
  3. 15 3月, 2011 20 次提交