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
     

28 Nov, 2010

1 commit

  • As David pointed out correctly, updates to af-specific attributes
    are currently not atomic. If multiple changes are requested and
    one of them fails, previous updates may have been applied already
    leaving the link behind in a undefined state.

    This patch splits the function parse_link_af() into two functions
    validate_link_af() and set_link_at(). validate_link_af() is placed
    to validate_linkmsg() check for errors as early as possible before
    any changes to the link have been made. set_link_af() is called to
    commit the changes later.

    This method is not fail proof, while it is currently sufficient
    to make set_link_af() inerrable and thus 100% atomic, the
    validation function method will not be able to detect all error
    scenarios in the future, there will likely always be errors
    depending on states which are f.e. not protected by rtnl_mutex
    and thus may change between validation and setting.

    Also, instead of silently ignoring unknown address families and
    config blocks for address families which did not register a set
    function the errors EAFNOSUPPORT respectively EOPNOSUPPORT are
    returned to avoid comitting 4 out of 5 update requests without
    notifying the user.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     

18 Nov, 2010

1 commit

  • Each net_device contains address family specific data such as
    per device settings and statistics. We already expose this data
    via procfs/sysfs and partially netlink.

    The netlink method requires the requester to send one RTM_GETLINK
    request for each address family it wishes to receive data of
    and then merge this data itself.

    This patch implements a new API which combines all address family
    specific link data in a new netlink attribute IFLA_AF_SPEC.
    IFLA_AF_SPEC contains a sequence of nested attributes, one for each
    address family which in turn defines the structure of its own
    attribute. Example:

    [IFLA_AF_SPEC] = {
    [AF_INET] = {
    [IFLA_INET_CONF] = ...,
    },
    [AF_INET6] = {
    [IFLA_INET6_FLAGS] = ...,
    [IFLA_INET6_CONF] = ...,
    }
    }

    The API also allows for address families to implement a function
    which parses the IFLA_AF_SPEC attribute sent by userspace to
    implement address family specific link options.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     

21 Oct, 2010

1 commit


27 Feb, 2010

1 commit

  • commit e8469ed959c373c2ff9e6f488aa5a14971aebe1f
    Author: Patrick McHardy
    Date: Tue Feb 23 20:41:30 2010 +0100

    Support specifying the initial device flags when creating a device though
    rtnl_link. Devices allocated by rtnl_create_link() are marked as INITIALIZING
    in order to surpress netlink registration notifications. To complete setup,
    rtnl_configure_link() must be called, which performs the device flag changes
    and invokes the deferred notifiers if everything went well.

    Two examples:

    # add macvlan to eth0
    #
    $ ip link add link eth0 up allmulticast on type macvlan

    [LINK]11: macvlan0@eth0: mtu 1500 qdisc noqueue state UNKNOWN
    link/ether 26:f8:84:02:f9:2a brd ff:ff:ff:ff:ff:ff
    [ROUTE]ff00::/8 dev macvlan0 table local metric 256 mtu 1500 advmss 1440 hoplimit 0
    [ROUTE]fe80::/64 dev macvlan0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 0
    [LINK]11: macvlan0@eth0: mtu 1500
    link/ether 26:f8:84:02:f9:2a
    [ADDR]11: macvlan0 inet6 fe80::24f8:84ff:fe02:f92a/64 scope link
    valid_lft forever preferred_lft forever
    [ROUTE]local fe80::24f8:84ff:fe02:f92a via :: dev lo table local proto none metric 0 mtu 16436 advmss 16376 hoplimit 0
    [ROUTE]default via fe80::215:e9ff:fef0:10f8 dev macvlan0 proto kernel metric 1024 mtu 1500 advmss 1440 hoplimit 0
    [NEIGH]fe80::215:e9ff:fef0:10f8 dev macvlan0 lladdr 00:15:e9:f0:10:f8 router STALE
    [ROUTE]2001:6f8:974::/64 dev macvlan0 proto kernel metric 256 expires 0sec mtu 1500 advmss 1440 hoplimit 0
    [PREFIX]prefix 2001:6f8:974::/64 dev macvlan0 onlink autoconf valid 14400 preferred 131084
    [ADDR]11: macvlan0 inet6 2001:6f8:974:0:24f8:84ff:fe02:f92a/64 scope global dynamic
    valid_lft 86399sec preferred_lft 14399sec

    # add VLAN to eth1, eth1 is down
    #
    $ ip link add link eth1 up type vlan id 1000
    RTNETLINK answers: Network is down

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     

08 Nov, 2009

1 commit

  • There is no good reason to not support userspace specifying the
    network namespace during device creation, and it makes it easier
    to create a network device and pass it to a child network namespace
    with a well known name.

    We have to be careful to ensure that the target network namespace
    for the new device exists through the life of the call. To keep
    that logic clear I have factored out the network namespace grabbing
    logic into rtnl_link_get_net.

    In addtion we need to continue to pass the source network namespace
    to the rtnl_link_ops.newlink method so that we can find the base
    device source network namespace.

    Signed-off-by: Eric W. Biederman
    Acked-by: Eric Dumazet

    Eric W. Biederman
     

28 Oct, 2009

1 commit


11 Sep, 2009

1 commit


03 Sep, 2009

1 commit

  • vlan devices are currently not multi-queue capable.

    We can do that with a new rtnl_link_ops method,
    get_tx_queues(), called from rtnl_create_link()

    This new method gets num_tx_queues/real_num_tx_queues
    from real device.

    register_vlan_device() is also handled.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

25 Aug, 2009

1 commit


16 Apr, 2008

1 commit


11 Oct, 2007

2 commits

  • This patch makes most of the generic device layer network
    namespace safe. This patch makes dev_base_head a
    network namespace variable, and then it picks up
    a few associated variables. The functions:
    dev_getbyhwaddr
    dev_getfirsthwbytype
    dev_get_by_flags
    dev_get_by_name
    __dev_get_by_name
    dev_get_by_index
    __dev_get_by_index
    dev_ioctl
    dev_ethtool
    dev_load
    wireless_process_ioctl

    were modified to take a network namespace argument, and
    deal with it.

    vlan_ioctl_set and brioctl_set were modified so their
    hooks will receive a network namespace argument.

    So basically anthing in the core of the network stack that was
    affected to by the change of dev_base was modified to handle
    multiple network namespaces. The rest of the network stack was
    simply modified to explicitly use &init_net the initial network
    namespace. This can be fixed when those components of the network
    stack are modified to handle multiple network namespaces.

    For now the ifindex generator is left global.

    Fundametally ifindex numbers are per namespace, or else
    we will have corner case problems with migration when
    we get that far.

    At the same time there are assumptions in the network stack
    that the ifindex of a network device won't change. Making
    the ifindex number global seems a good compromise until
    the network stack can cope with ifindex changes when
    you change namespaces, and the like.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     
  • This routine gets the parsed rtnl attributes and creates a new
    link with generic info (IFLA_LINKINFO policy). Its intention
    is to help the drivers, that need to create several links at
    once (like VETH).

    This is nothing but a copy-paste-ed part of rtnl_newlink() function
    that is responsible for creation of new device.

    Signed-off-by: Pavel Emelianov
    Acked-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Pavel Emelianov
     

11 Jul, 2007

1 commit


26 Apr, 2007

3 commits

  • - make the following needlessly global variables static:
    - core/rtnetlink.c: struct rtnl_msg_handlers[]
    - netfilter/nf_conntrack_proto.c: struct nf_ct_protos[]
    - make the following needlessly global functions static:
    - core/rtnetlink.c: rtnl_dump_all()
    - netlink/af_netlink.c: netlink_queue_skip()

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: David S. Miller

    Adrian Bunk
     
  • Implements a unified, protocol independant rules dumping function
    which is capable of both, dumping a specific protocol family or
    all of them. This speeds up dumping as less lookups are required.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • This patch adds a new interface to register rtnetlink message
    handlers replacing the exported rtnl_links[] array which
    required many message handlers to be exported unnecessarly.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf