Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Mar 20, 2013
  1. @minipli @gregkh

    dcbnl: fix various netlink info leaks

    minipli authored gregkh committed
    [ Upstream commit 29cd8ae0e1a39e239a3a7b67da1986add1199fc0 ]
    
    The dcb netlink interface leaks stack memory in various places:
    * perm_addr[] buffer is only filled at max with 12 of the 32 bytes but
      copied completely,
    * no in-kernel driver fills all fields of an IEEE 802.1Qaz subcommand,
      so we're leaking up to 58 bytes for ieee_ets structs, up to 136 bytes
      for ieee_pfc structs, etc.,
    * the same is true for CEE -- no in-kernel driver fills the whole
      struct,
    
    Prevent all of the above stack info leaks by properly initializing the
    buffers/structures involved.
    
    Signed-off-by: Mathias Krause <minipli@googlemail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Commits on Oct 31, 2011
  1. net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modules

    Paul Gortmaker authored
    These files are non modular, but need to export symbols using
    the macros now living in export.h -- call out the include so
    that things won't break when we remove the implicit presence
    of module.h from everywhere.
    
    Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
  2. net: Fix files explicitly needing to include module.h

    Paul Gortmaker authored
    With calls to modular infrastructure, these files really
    needs the full module.h header.  Call it out so some of the
    cleanups of implicit and unrequired includes elsewhere can be
    cleaned up.
    
    Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Commits on Oct 6, 2011
  1. @jrfastab @davem330

    dcb: add DCBX mode to event notifier attributes

    jrfastab authored davem330 committed
    Add DCBX mode to event notifiers so listeners can learn
    currently enabled mode.
    
    Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
  2. @davem330

    dcb: Use ifindex instead of ifname

    Mark Rustad authored davem330 committed
    Use ifindex instead of ifname in the DCB app ring. This makes for a smaller
    data structure and faster comparisons. It also avoids possible issues when
    a net device is renamed.
    
    Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
    Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
Commits on Jul 8, 2011
  1. @error27 @davem330

    dcbnl: unlock on an error path in dcbnl_cee_fill()

    error27 authored davem330 committed
    We need to release "dcb_lock" which we took on the previous line.
    
    Signed-off-by: Dan Carpenter <error27@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
Commits on Jul 6, 2011
  1. @davem330

    dcbnl: Add CEE notification

    Shmulik Ravid authored davem330 committed
    This patch add an unsolicited notification of the DCBX negotiated
    parameters for the CEE flavor of the DCBX protocol. The notification
    message is identical to the aggregated CEE get operation and holds all
    the pertinent local and peer information. The notification routine is
    exported so it can be invoked by drivers supporting an embedded DCBX
    stack.
    
    Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
  2. @davem330

    dcbnl: Aggregated CEE GET operation

    Shmulik Ravid authored davem330 committed
    The following couple of patches add dcbnl an unsolicited notification of
    the the DCB configuration for the CEE flavor of the DCBX protocol. This
    is useful when the user-mode DCB client is not responsible for
    conducting and resolving the DCBX negotiation (either because the DCBX
    stack is embedded in the HW or the negotiation is handled by another
    agent in the host), but still needs to get the negotiated parameters.
    This functionality already exists for the IEEE flavor of the DCBX
    protocol and these patches add it to the older CEE flavor.
    
    The first patch extends the CEE attribute GET operation to include not
    only the peer information, but also all the pertinent local
    configuration (negotiated parameters). The second patch adds and export
    a CEE specific notification routine.
    
    Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
Commits on Jun 23, 2011
  1. @error27 @davem330

    dcb: use nlmsg_free() instead of kfree()

    error27 authored davem330 committed
    These sk_buff structs were allocated with nlmsg_new() so they should
    be freed with nlmsg_free().
    
    Signed-off-by: Dan Carpenter <error27@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
Commits on Jun 21, 2011
  1. @jrfastab @davem330

    dcb: Add missing error check in dcb_ieee_set()

    jrfastab authored davem330 committed
    Missing error checking before nla_parse_nested().
    
    Reported-by: Mark Rustad <mark.d.rustad@intel.com>
    Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
  2. @jrfastab @davem330

    dcb: fix return type on dcb_setapp()

    jrfastab authored davem330 committed
    Incorrect return type on dcb_setapp() this routine
    returns negative error codes. All call sites of
    dcb_setapp() assign the return value to an int already
    so no need to update drivers.
    
    Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
  3. @jrfastab @davem330

    dcb: Add dcb_ieee_getapp_mask() for drivers to query APP settings

    jrfastab authored davem330 committed
    With multiple APP entries per selector and protocol drivers
    or stacks may want to pick a specific value or stripe traffic
    across many priorities. Also if an APP entry in use is
    deleted the stack/driver may want to choose from the existing
    APP entries.
    
    To facilitate this and avoid having duplicate code to walk
    the APP ring provide a routine dcb_ieee_getapp_mask() to
    return a u8 bitmask of all priorities set for the specified
    selector and protocol. This routine and bitmask is a helper
    for DCB kernel users.
    
    Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
  4. @jrfastab @davem330

    dcb: Add ieee_dcb_delapp() and dcb op to delete app entry

    jrfastab authored davem330 committed
    Now that we allow multiple IEEE App entries we need a way
    to remove specific entries. To do this add the ieee_dcb_delapp()
    routine.
    
    Additionaly drivers may need to remove the APP entry from
    their firmware tables. Add dcb ops routine to handle this.
    
    Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
  5. @jrfastab @davem330

    dcb: Add ieee_dcb_setapp() to be used for IEEE 802.1Qaz APP data

    jrfastab authored davem330 committed
    This adds a setapp routine for IEEE802.1Qaz encoded APP data types.
    The IEEE 802.1Qaz spec encodes the priority bits differently and
    allows for multiple APP data entries of the same selector and
    protocol. Trying to force these to use the same set routines was
    becoming tedious. Furthermore, userspace could probably enforce
    the correct semantics, but expecting drivers to do this seems
    error prone in the firmware case.
    
    For these reasons add ieee_dcb_setapp() that understands the
    IEEE 802.1Qaz encoded form.
    
    Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
  6. @jrfastab @davem330

    net: dcbnl, add multicast group for DCB

    jrfastab authored davem330 committed
    Now that dcbnl is being used in many cases by more
    than a single agent it is beneficial to be notified
    when some entity either driver or user space has
    changed the DCB attributes.
    
    Today applications either end up polling the interface
    or relying on a user space database to maintain the DCB
    state and post events. Polling is a poor solution for
    obvious reasons. And relying on a user space database
    has its own downside. Namely it has created strange
    boot dependencies requiring the database be populated
    before any applications dependent on DCB attributes
    starts or the application goes into a polling loop.
    Populating the database requires negotiating link
    setting with the peer and can take anywhere from less
    than a second up to a few seconds depending on the switch
    implementation.
    
    Perhaps more importantly if another application or an
    embedded agent sets a DCB link attribute the database
    has no way of knowing other than polling the kernel.
    This prevents applications from responding quickly to
    changes in link events which at least in the FCoE case
    and probably any other protocols expecting a lossless
    link may result in IO errors.
    
    By adding a multicast group for DCB we have clean way
    to disseminate kernel DCB link attributes up to user
    space. Avoiding the need for user space to maintain
    a coherant database and disperse events that potentially
    do not reflect the current link state.
    
    Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
  7. @jrfastab @davem330

    dcb: Add DCBX capabilities bitmask to the get_ieee response

    jrfastab authored davem330 committed
    Adding the capabilities bitmask to the get_ieee response allows
    user space to determine the current DCBX mode. Either CEE or IEEE
    this is useful with devices that support switching between modes
    where knowing the current state is relevant.
    
    Derived from work by Mark Rustad
    
    Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
Commits on Jun 10, 2011
  1. @Jkirsher

    rtnetlink: Compute and store minimum ifinfo dump size

    Greg Rose authored Jkirsher committed
    The message size allocated for rtnl ifinfo dumps was limited to
    a single page.  This is not enough for additional interface info
    available with devices that support SR-IOV and caused a bug in
    which VF info would not be displayed if more than approximately
    40 VFs were created per interface.
    
    Implement a new function pointer for the rtnl_register service that will
    calculate the amount of data required for the ifinfo dump and allocate
    enough data to satisfy the request.
    
    Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
    Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Commits on Mar 15, 2011
  1. @davem330

    net: dcbnl: Update copyright dates

    Mark Rustad authored davem330 committed
    Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
    Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
Commits on Mar 4, 2011
  1. @davem330

    Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/…

    davem330 authored
    …davem/net-2.6
    
    Conflicts:
    	drivers/net/bnx2x/bnx2x.h
Commits on Mar 3, 2011
  1. @davem330

    dcbnl: add support for retrieving peer configuration - cee

    Shmulik Ravid authored davem330 committed
    This patch adds the support for retrieving the remote or peer DCBX
    configuration via dcbnl for embedded DCBX stacks supporting the CEE DCBX
    standard.
    
    Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
  2. @davem330

    dcbnl: add support for retrieving peer configuration - ieee

    Shmulik Ravid authored davem330 committed
    These 2 patches add the support for retrieving the remote or peer DCBX
    configuration via dcbnl for embedded DCBX stacks. The peer configuration
    is part of the DCBX MIB and is useful for debugging and diagnostics of
    the overall DCB configuration. The first patch add this support for IEEE
    802.1Qaz standard the second patch add the same support for the older
    CEE standard. Diff for v2 - the peer-app-info is CEE specific.
    
    Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
Commits on Mar 2, 2011
  1. @jrfastab @davem330

    net: dcbnl: check correct ops in dcbnl_ieee_set()

    jrfastab authored davem330 committed
    The incorrect ops routine was being tested for in
    DCB_ATTR_IEEE_PFC attributes. This patch corrects
    it.
    
    Currently, every driver implementing ieee_setets also
    implements ieee_setpfc so this bug is not actualized
    yet.
    
    Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
Commits on Feb 13, 2011
  1. @jjuhl @davem330

    Don't potentially dereference NULL in net/dcb/dcbnl.c:dcbnl_getapp()

    jjuhl authored davem330 committed
    nla_nest_start() may return NULL. If it does then we'll blow up in
    nla_nest_end() when we dereference the pointer.
    
    Signed-off-by: Jesper Juhl <jj@chaosbits.net>
    Signed-off-by: David S. Miller <davem@davemloft.net>
  2. @jrfastab @davem330

    net: dcb: application priority is per net_device

    jrfastab authored davem330 committed
    The app_data priority may not be the same for all net devices.
    In order for stacks with application notifiers to identify the
    specific net device dcb_app_type should be passed in the ptr.
    
    This allows handlers to use dev_get_by_name() to pin priority
    to net devices.
    
    Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
Commits on Jan 24, 2011
  1. @jrfastab @davem330

    dcbnl: make get_app handling symmetric for IEEE and CEE DCBx

    jrfastab authored davem330 committed
    The IEEE get/set app handlers use generic routines and do not
    require the net_device to implement the dcbnl_ops routines. This
    patch makes it symmetric so user space and drivers do not have
    to handle the CEE version and IEEE DCBx versions differently.
    
    Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
Commits on Jan 6, 2011
  1. @error27 @davem330

    dcb: use after free in dcb_flushapp()

    error27 authored davem330 committed
    The original code has a use after free bug because it's not using the
    _safe() version of the list_for_each_entry() macro.
    
    Signed-off-by: Dan Carpenter <error27@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
  2. @error27 @davem330

    dcb: unlock on error in dcbnl_ieee_get()

    error27 authored davem330 committed
    There is a "goto nla_put_failure" hidden inside the NLA_PUT() macro, but
    we're holding the dcb_lock so we need to unlock first.
    
    Signed-off-by: Dan Carpenter <error27@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
Commits on Jan 3, 2011
  1. @davem330

    dcbnl: more informed return values for new dcbnl routines

    Shmulik Ravid authored davem330 committed
    More accurate return values for the following (new) dcbnl routines:
    dcbnl_getdcbx()
    dcbnl_setdcbx()
    dcbnl_getfeatcfg()
    dcbnl_setfeatcfg()
    
    Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
Commits on Dec 31, 2010
  1. @davem330

    dcbnl: cleanup

    Shmulik Ravid authored davem330 committed
    A couple of small cleanups for patches:
    [net-next-2.6 PATCH 1/3] dcbnl: add support for ieee8021Qaz attributes
    [net-next-2.6 PATCH 2/3] dcbnl: add appliction tlv handlers
    [net-next-2.6 PATCH 3/3] net_dcb: add application notifiers
    
    Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
  2. @davem330

    dcbnl: adding DCBX feature flags get-set

    Shmulik Ravid authored davem330 committed
    Adding a pair of set-get routines to dcbnl for setting the negotiation
    flags of the various DCB features. Conforms to the CEE flavor of DCBX
    The user sets these flags (enable, advertise, willing) for each feature
    to be used by the DCBX engine. The 'get' routine returns which of the
    features is enabled after the negotiation.
    
    This patch is dependent on the following patches:
    [net-next-2.6 PATCH 1/3] dcbnl: add support for ieee8021Qaz attributes
    [net-next-2.6 PATCH 2/3] dcbnl: add appliction tlv handlers
    [net-next-2.6 PATCH 3/3] net_dcb: add application notifiers
    
    Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
  3. @davem330

    dcbnl: adding DCBX engine capability

    Shmulik Ravid authored davem330 committed
    Adding an optional DCBX capability and a pair for get-set routines for
    setting the device DCBX mode. The DCBX capability is a bit field of
    supported attributes. The user is expected to set the DCBX mode with a
    subset of the advertised attributes.
    
    This patch is dependent on the following patches:
    [net-next-2.6 PATCH 1/3] dcbnl: add support for ieee8021Qaz attributes
    [net-next-2.6 PATCH 2/3] dcbnl: add appliction tlv handlers
    [net-next-2.6 PATCH 3/3] net_dcb: add application notifiers
    
    Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
    Acked-by: John Fastabend <john.r.fastabend@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
  4. @jrfastab @davem330

    net_dcb: add application notifiers

    jrfastab authored davem330 committed
    DCBx applications priorities can be changed dynamically. If
    application stacks are expected to keep the skb priority
    consistent with the dcbx priority the stack will need to
    be notified when these changes occur.
    
    This patch adds application notifiers for the stack to register
    with.
    
    Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
  5. @jrfastab @davem330

    dcbnl: add appliction tlv handlers

    jrfastab authored davem330 committed
    This patch adds application tlv handlers. Networking stacks
    may use the application priority to set the skb priority of
    their stack using the negoatiated dcbx priority.
    
    This patch provides the dcb_{get|set}app() routines for the
    stack to query these parameters. Notice lower layer drivers
    can use the dcbnl_ops routines if additional handling is
    needed. Perhaps in the firmware case for example
    
    Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
    Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
  6. @jrfastab @davem330

    dcbnl: add support for ieee8021Qaz attributes

    jrfastab authored davem330 committed
    The IEEE8021Qaz is the IEEE standard version of CEE. The
    standard has had enough significant changes from the CEE
    version that many of the CEE attributes have no meaning
    in the new spec or do not easily map to IEEE standards.
    
    Rather then attempt to create a complicated mapping
    between CEE and IEEE standards this patch adds a nested
    IEEE attribute to the list of DCB attributes. The policy
    is,
    
    	[DCB_ATTR_IFNAME]
    	[DCB_ATTR_STATE]
    	...
    	[DCB_ATTR_IEEE]
    		[DCB_ATTR_IEEE_ETS]
    		[DCB_ATTR_IEEE_PFC]
    		[DCB_ATTR_IEEE_APP_TABLE]
    			[DCB_ATTR_IEEE_APP]
    			...
    
    The following dcbnl_rtnl_ops routines were added to handle
    the IEEE standard,
    
    	int (*ieee_getets) (struct net_device *, struct ieee_ets *);
    	int (*ieee_setets) (struct net_device *, struct ieee_ets *);
    	int (*ieee_getpfc) (struct net_device *, struct ieee_pfc *);
    	int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *);
    	int (*ieee_getapp) (struct net_device *, struct dcb_app *);
    	int (*ieee_setapp) (struct net_device *, struct dcb_app *);
    
    Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
Commits on Mar 30, 2010
  1. include cleanup: Update gfp.h and slab.h includes to prepare for brea…

    Tejun Heo authored
    …king implicit slab.h inclusion from percpu.h
    
    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files.  percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.
    
    percpu.h -> slab.h dependency is about to be removed.  Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability.  As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.
    
      http://userweb.kernel.org/~tj/misc/slabh-sweep.py
    
    The script does the followings.
    
    * Scan files for gfp and slab usages and update includes such that
      only the necessary includes are there.  ie. if only gfp is used,
      gfp.h, if slab is used, slab.h.
    
    * When the script inserts a new include, it looks at the include
      blocks and try to put the new include such that its order conforms
      to its surrounding.  It's put in the include block which contains
      core kernel includes, in the same order that the rest are ordered -
      alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
      doesn't seem to be any matching order.
    
    * If the script can't find a place to put a new include (mostly
      because the file doesn't have fitting include block), it prints out
      an error message indicating which .h file needs to be added to the
      file.
    
    The conversion was done in the following steps.
    
    1. The initial automatic conversion of all .c files updated slightly
       over 4000 files, deleting around 700 includes and adding ~480 gfp.h
       and ~3000 slab.h inclusions.  The script emitted errors for ~400
       files.
    
    2. Each error was manually checked.  Some didn't need the inclusion,
       some needed manual addition while adding it to implementation .h or
       embedding .c file was more appropriate for others.  This step added
       inclusions to around 150 files.
    
    3. The script was run again and the output was compared to the edits
       from #2 to make sure no file was left behind.
    
    4. Several build tests were done and a couple of problems were fixed.
       e.g. lib/decompress_*.c used malloc/free() wrappers around slab
       APIs requiring slab.h to be added manually.
    
    5. The script was run on all .h files but without automatically
       editing them as sprinkling gfp.h and slab.h inclusions around .h
       files could easily lead to inclusion dependency hell.  Most gfp.h
       inclusion directives were ignored as stuff from gfp.h was usually
       wildly available and often used in preprocessor macros.  Each
       slab.h inclusion directive was examined and added manually as
       necessary.
    
    6. percpu.h was updated not to include slab.h.
    
    7. Build test were done on the following configurations and failures
       were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
       distributed build env didn't work with gcov compiles) and a few
       more options had to be turned off depending on archs to make things
       build (like ipr on powerpc/64 which failed due to missing writeq).
    
       * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
       * powerpc and powerpc64 SMP allmodconfig
       * sparc and sparc64 SMP allmodconfig
       * ia64 SMP allmodconfig
       * s390 SMP allmodconfig
       * alpha SMP allmodconfig
       * um on x86_64 SMP allmodconfig
    
    8. percpu.h modifications were reverted so that it could be applied as
       a separate patch and serve as bisection point.
    
    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.
    
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
Something went wrong with that request. Please try again.