22 Mar, 2013

1 commit


12 Mar, 2013

1 commit


10 Mar, 2013

2 commits

  • 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
    Signed-off-by: David S. Miller

    Mathias Krause
     
  • Add header with function definitions to quiet warnings and avoid future errors.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     

11 Dec, 2012

1 commit

  • Allow DCB and net namespace to work together. This is useful if you
    have containers that are bound to 'phys' interfaces that want to
    also manage their DCB attributes.

    The net namespace is taken from sock_net(skb->sk) of the netlink skb.

    CC: "Eric W. Biederman"
    Signed-off-by: John Fastabend
    Signed-off-by: David S. Miller

    John Fastabend
     

19 Nov, 2012

1 commit

  • - In rtnetlink_rcv_msg convert the capable(CAP_NET_ADMIN) check
    to ns_capable(net->user-ns, CAP_NET_ADMIN). Allowing unprivileged
    users to make netlink calls to modify their local network
    namespace.

    - In the rtnetlink doit methods add capable(CAP_NET_ADMIN) so
    that calls that are not safe for unprivileged users are still
    protected.

    Later patches will remove the extra capable calls from methods
    that are safe for unprivilged users.

    Acked-by: Serge Hallyn
    Signed-off-by: "Eric W. Biederman"
    Signed-off-by: David S. Miller

    Eric W. Biederman
     

11 Sep, 2012

1 commit

  • It is a frequent mistake to confuse the netlink port identifier with a
    process identifier. Try to reduce this confusion by renaming fields
    that hold port identifiers portid instead of pid.

    I have carefully avoided changing the structures exported to
    userspace to avoid changing the userspace API.

    I have successfully built an allyesconfig kernel with this change.

    Signed-off-by: "Eric W. Biederman"
    Acked-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Eric W. Biederman
     

11 Jul, 2012

1 commit


22 Jun, 2012

1 commit

  • A small regression was introduced in the reply command of
    dcbnl_pg_setcfg(). User space apps may be expecting the
    DCB_ATTR_PG_CFG attribute to be returned with the patch
    below TX or RX variants are returned.

    commit 7be994138b188387691322921c08e19bddf6d3c5
    Author: Thomas Graf
    Date: Wed Jun 13 02:54:55 2012 +0000

    dcbnl: Shorten all command handling functions

    This patch reverts this behavior and returns DCB_ATTR_PG_CFG

    Signed-off-by: John Fastabend
    Acked-by: Thomas Graf
    Signed-off-by: David S. Miller

    John Fastabend
     

14 Jun, 2012

10 commits


26 Apr, 2012

1 commit

  • This adds code to trigger CEE events when an APP change or setall
    command is made from user space. This simplifies user space code
    significantly by creating a single interface to listen on that
    works with both firmware and userland agents.

    And if we end up with multiple agents this keeps every thing in
    sync userland agents, firmware agents, and kernel notifier consumers.

    For an example agent that listens for these events see:

    https://github.com/jrfastab/cgdcbxd

    cgdcbxd is a daemon used to monitor DCB netlink events and manage
    the net_prio control group sub-system.

    Signed-off-by: John Fastabend
    Acked-by: Shmulik Ravid
    Signed-off-by: David S. Miller

    John Fastabend
     

05 Apr, 2012

1 commit

  • Although not specified in 8021Qaz spec, it could be useful to enable drivers
    whose HW supports setting a rate limit for an ETS TC. This patch adds this
    optional attribute to DCB netlink. To use it, drivers should implement and
    register the callbacks ieee_setmaxrate and ieee_getmaxrate. The units are 64
    bits long and specified in Kbps to enable usage over both slow and very fast
    networks.

    Signed-off-by: Amir Vadai
    Signed-off-by: David S. Miller

    Amir Vadai
     

02 Apr, 2012

1 commit


01 Nov, 2011

2 commits


07 Oct, 2011

2 commits


09 Jul, 2011

1 commit


06 Jul, 2011

2 commits

  • 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
    Signed-off-by: David S. Miller

    Shmulik Ravid
     
  • 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
    Signed-off-by: David S. Miller

    Shmulik Ravid
     

23 Jun, 2011

1 commit


22 Jun, 2011

7 commits

  • Missing error checking before nla_parse_nested().

    Reported-by: Mark Rustad
    Signed-off-by: John Fastabend
    Signed-off-by: David S. Miller

    John Fastabend
     
  • 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
    Signed-off-by: David S. Miller

    John Fastabend
     
  • 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
    Signed-off-by: David S. Miller

    John Fastabend
     
  • 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
    Signed-off-by: David S. Miller

    John Fastabend
     
  • 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
    Signed-off-by: David S. Miller

    John Fastabend
     
  • 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
    Signed-off-by: David S. Miller

    John Fastabend
     
  • 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
    Signed-off-by: David S. Miller

    John Fastabend
     

10 Jun, 2011

1 commit

  • 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
    Signed-off-by: Jeff Kirsher

    Greg Rose
     

15 Mar, 2011

1 commit


04 Mar, 2011

1 commit