20 Sep, 2018

1 commit

  • [ Upstream commit 08193d1a893c802c4b807e4d522865061f4e9f4f ]

    The function dcb_app_lookup walks the list of specified DCB APP entries,
    looking for one that matches a given criteria: ifindex, selector,
    protocol ID and optionally also priority. The "don't care" value for
    priority is set to 0, because that priority has not been allowed under
    CEE regime, which predates the IEEE standardization.

    Under IEEE, 0 is a valid priority number. But because dcb_app_lookup
    considers zero a wild card, attempts to add an APP entry with priority 0
    fail when other entries exist for a given ifindex / selector / PID
    triplet.

    Fix by changing the wild-card value to -1.

    Signed-off-by: Petr Machata
    Signed-off-by: Ido Schimmel
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Petr Machata
     

10 Aug, 2017

1 commit

  • This change allows us to later indicate to rtnetlink core that certain
    doit functions should be called without acquiring rtnl_mutex.

    This change should have no effect, we simply replace the last (now
    unused) calcit argument with the new flag.

    Signed-off-by: Florian Westphal
    Reviewed-by: Hannes Frederic Sowa
    Signed-off-by: David S. Miller

    Florian Westphal
     

22 May, 2017

1 commit

  • Found by reviewing the warning about unused policy table.
    The code implies that it meant to check for size, but since
    it unrolled the loop for attribute validation that is never used.
    Instead do explicit check for attribute.

    Compile tested only. Needs review by original author.

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

    stephen hemminger
     

18 Apr, 2017

1 commit

  • Add netlink_ext_ack arg to rtnl_doit_func. Pass extack arg to nlmsg_parse
    for doit functions that call it directly.

    This is the first step to using extended error reporting in rtnetlink.
    >From here individual subsystems can be updated to set netlink_ext_ack as
    needed.

    Signed-off-by: David Ahern
    Signed-off-by: David S. Miller

    David Ahern
     

14 Apr, 2017

1 commit


04 Dec, 2016

1 commit

  • In function dcbnl_cee_fill(), returns the value of variable err on
    errors. However, on some error paths (e.g. nla put fails), its value may
    be 0. It may be better to explicitly set a negative errno to variable
    err before returning.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188881

    Signed-off-by: Pan Bian
    Signed-off-by: David S. Miller

    Pan Bian
     

09 Oct, 2015

1 commit

  • The Kconfig currently controlling compilation of this code is:

    net/dcb/Kconfig:config DCB
    net/dcb/Kconfig: bool "Data Center Bridging support"

    ...meaning that it currently is not being built as a module by anyone.

    Lets remove the modular code that is essentially orphaned, so that
    when reading the driver there is no doubt it is builtin-only.

    Since module_init translates to device_initcall in the non-modular
    case, the init ordering remains unchanged with this commit. We can
    change to one of the other priority initcalls (subsys?) at any later
    date, if desired.

    We also delete the MODULE_LICENSE tag etc. since all that information
    is (or is now) already contained at the top of the file in the comments.

    Cc: "David S. Miller"
    Cc: Or Gerlitz
    Cc: Anish Bhatt
    Cc: John Fastabend
    Cc: Shani Michaeli
    Cc: netdev@vger.kernel.org
    Signed-off-by: Paul Gortmaker
    Signed-off-by: David S. Miller

    Paul Gortmaker
     

07 Mar, 2015

1 commit

  • As specified in 802.1Qau spec. Add this optional attribute to the
    DCB netlink layer. To allow for application to use the new attribute,
    NIC drivers should implement and register the callbacks ieee_getqcn,
    ieee_setqcn and ieee_getqcnstats.

    The QCN attribute holds a set of parameters for management, and
    a set of statistics to provide informative data on Congestion-Control
    defined by this spec.

    Signed-off-by: Shani Michaeli
    Signed-off-by: Shachar Raindel
    Signed-off-by: Or Gerlitz
    Acked-by: John Fastabend
    Signed-off-by: David S. Miller

    Shani Michaeli
     

17 Nov, 2014

1 commit

  • Solves possible lockup issues that can be seen from firmware DCB agents calling
    into the DCB app api.

    DCB firmware event queues can be tied in with NAPI so that dcb events are
    generated in softIRQ context. This can results in calls to dcb_*app()
    functions which try to take the dcb_lock.

    If the the event triggers while we also have the dcb_lock because lldpad or
    some other agent happened to be issuing a get/set command we could see a cpu
    lockup.

    This code was not originally written with firmware agents in mind, hence
    grabbing dcb_lock from softIRQ context was not considered.

    Signed-off-by: Anish Bhatt
    Signed-off-by: David S. Miller

    Anish Bhatt
     

31 Jul, 2014

1 commit

  • Current explanation of dcb_app->priority is wrong. It says priority is
    expected to be a 3-bit unsigned integer which is only true when working with
    DCBx-IEEE. Use of dcb_app->priority by DCBx-CEE expects it to be 802.1p user
    priority bitmap. Updated accordingly

    This affects the cxgb4 driver, but I will post those changes as part of a
    larger changeset shortly.

    Fixes: 3e29027af4372 ("dcbnl: add support for ieee8021Qaz attributes")
    Signed-off-by: Anish Bhatt
    Acked-by: John Fastabend
    Signed-off-by: David S. Miller

    Anish Bhatt
     

18 Jul, 2014

1 commit


25 Apr, 2014

1 commit

  • It is possible by passing a netlink socket to a more privileged
    executable and then to fool that executable into writing to the socket
    data that happens to be valid netlink message to do something that
    privileged executable did not intend to do.

    To keep this from happening replace bare capable and ns_capable calls
    with netlink_capable, netlink_net_calls and netlink_ns_capable calls.
    Which act the same as the previous calls except they verify that the
    opener of the socket had the desired permissions as well.

    Reported-by: Andy Lutomirski
    Signed-off-by: "Eric W. Biederman"
    Signed-off-by: David S. Miller

    Eric W. Biederman
     

15 Jan, 2014

1 commit

  • The following call chain indicates that dcb_doit() is protected
    under rtnl_lock. So if we use __dev_get_by_name() instead of
    dev_get_by_name() to find interface handlers in it, this would
    help us avoid to change interface reference counter.

    rtnetlink_rcv()
    rtnl_lock()
    netlink_rcv_skb()
    dcb_doit()
    rtnl_unlock()

    Cc: John Fastabend
    Signed-off-by: Ying Xue
    Signed-off-by: David S. Miller

    Ying Xue
     

07 Dec, 2013

1 commit

  • Several files refer to an old address for the Free Software Foundation
    in the file header comment. Resolve by replacing the address with
    the URL so that we do not have to keep
    updating the header comments anytime the address changes.

    CC: John Fastabend
    CC: Alex Duyck
    CC: Marcel Holtmann
    CC: Gustavo Padovan
    CC: Johan Hedberg
    CC: Jamal Hadi Salim
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Jeff Kirsher
     

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