#
3033fced |
| 20-Jul-2018 |
Tyler Hicks <tyhicks@canonical.com> |
net-sysfs: require net admin in the init ns for setting tx_maxrate
An upcoming change will allow container root to open some /sys/class/net files for writing. The tx_maxrate attribute can result in
net-sysfs: require net admin in the init ns for setting tx_maxrate
An upcoming change will allow container root to open some /sys/class/net files for writing. The tx_maxrate attribute can result in changes to actual hardware devices so err on the side of caution by requiring CAP_NET_ADMIN in the init namespace in the corresponding attribute store operation.
Signed-off-by: Tyler Hicks <tyhicks@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
ffcfe25b |
| 09-Jul-2018 |
Alexander Duyck <alexander.h.duyck@intel.com> |
net: Add support for subordinate device traffic classes
This patch is meant to provide the basic tools needed to allow us to create subordinate device traffic classes. The general idea here is to al
net: Add support for subordinate device traffic classes
This patch is meant to provide the basic tools needed to allow us to create subordinate device traffic classes. The general idea here is to allow subdividing the queues of a device into queue groups accessible through an upper device such as a macvlan.
The idea here is to enforce the idea that an upper device has to be a single queue device, ideally with IFF_NO_QUQUE set. With that being the case we can pretty much guarantee that the tc_to_txq mappings and XPS maps for the upper device are unused. As such we could reuse those in order to support subdividing the lower device and distributing those queues between the subordinate devices.
In order to distinguish between a regular set of traffic classes and if a device is carrying subordinate traffic classes I changed num_tc from a u8 to a s16 value and use the negative values to represent the subordinate pool values. So starting at -1 and running to -32768 we can encode those as pool values, and the existing values of 0 to 15 can be maintained.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
show more ...
|
#
d7be9775 |
| 09-Jul-2018 |
Alexander Duyck <alexander.h.duyck@intel.com> |
net-sysfs: Drop support for XPS and traffic_class on single queue device
This patch makes it so that we do not report the traffic class or allow XPS configuration on single queue devices. This is mo
net-sysfs: Drop support for XPS and traffic_class on single queue device
This patch makes it so that we do not report the traffic class or allow XPS configuration on single queue devices. This is mostly to avoid unnecessary complexity with changes I have planned that will allow us to reuse the unused tc_to_txq and XPS configuration on a single queue device to allow it to make use of a subset of queues on an underlying device.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
show more ...
|
#
8af2c06f |
| 29-Jun-2018 |
Amritha Nambiar <amritha.nambiar@intel.com> |
net-sysfs: Add interface for Rx queue(s) map per Tx queue
Extend transmit queue sysfs attribute to configure Rx queue(s) map per Tx queue. By default no receive queues are configured for the Tx queu
net-sysfs: Add interface for Rx queue(s) map per Tx queue
Extend transmit queue sysfs attribute to configure Rx queue(s) map per Tx queue. By default no receive queues are configured for the Tx queue.
- /sys/class/net/eth0/queues/tx-*/xps_rxqs
Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
80d19669 |
| 29-Jun-2018 |
Amritha Nambiar <amritha.nambiar@intel.com> |
net: Refactor XPS for CPUs and Rx queues
Refactor XPS code to support Tx queue selection based on CPU(s) map or Rx queue(s) map.
Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com> Signed-of
net: Refactor XPS for CPUs and Rx queues
Refactor XPS code to support Tx queue selection based on CPU(s) map or Rx queue(s) map.
Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
664088f8 |
| 31-May-2018 |
Alexander Duyck <alexander.h.duyck@intel.com> |
net-sysfs: Fix memory leak in XPS configuration
This patch reorders the error cases in showing the XPS configuration so that we hold off on memory allocation until after we have verified that we can
net-sysfs: Fix memory leak in XPS configuration
This patch reorders the error cases in showing the XPS configuration so that we hold off on memory allocation until after we have verified that we can support XPS on a given ring.
Fixes: 184c449f91fe ("net: Add support for XPS with QoS via traffic classes") Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
d6444062 |
| 23-Mar-2018 |
Joe Perches <joe@perches.com> |
net: Use octal not symbolic permissions
Prefer the direct use of octal for permissions.
Done with checkpatch -f --types=SYMBOLIC_PERMS --fix-inplace and some typing.
Miscellanea:
o Whitespace nea
net: Use octal not symbolic permissions
Prefer the direct use of octal for permissions.
Done with checkpatch -f --types=SYMBOLIC_PERMS --fix-inplace and some typing.
Miscellanea:
o Whitespace neatening around these conversions.
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
6a643ddb |
| 25-Jan-2018 |
Cong Wang <xiyou.wangcong@gmail.com> |
net: introduce helper dev_change_tx_queue_len()
This patch promotes the local change_tx_queue_len() to a core helper function, dev_change_tx_queue_len(), so that rtnetlink and net-sysfs could share
net: introduce helper dev_change_tx_queue_len()
This patch promotes the local change_tx_queue_len() to a core helper function, dev_change_tx_queue_len(), so that rtnetlink and net-sysfs could share the code. This also prepares for the following patch.
Note, the -EFAULT in the original code doesn't make sense, we should propagate the errno from notifiers.
Cc: John Fastabend <john.fastabend@gmail.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
b2d3bcfa |
| 18-Jan-2018 |
David Decotigny <decot@googlers.com> |
net: core: Expose number of link up/down transitions
Expose the number of times the link has been going UP or DOWN, and update the "carrier_changes" counter to be the sum of these two events. While
net: core: Expose number of link up/down transitions
Expose the number of times the link has been going UP or DOWN, and update the "carrier_changes" counter to be the sum of these two events. While at it, also update the sysfs-class-net documentation to cover: carrier_changes (3.15), carrier_up_count (4.16) and carrier_down_count (4.16)
Signed-off-by: David Decotigny <decot@googlers.com> [Florian: * rebase * add documentation * merge carrier_changes with up/down counters] Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
273c28bc |
| 12-Jan-2018 |
Kirill Tkhai <ktkhai@virtuozzo.com> |
net: Convert atomic_t net::count to refcount_t
Since net could be obtained from RCU lists, and there is a race with net destruction, the patch converts net::count to refcount_t.
This provides sanit
net: Convert atomic_t net::count to refcount_t
Since net could be obtained from RCU lists, and there is a race with net destruction, the patch converts net::count to refcount_t.
This provides sanity checks for the cases of incrementing counter of already dead net, when maybe_get_net() has to used instead of get_net().
Drivers: allyesconfig and allmodconfig are OK.
Suggested-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
c92eb77a |
| 14-Nov-2017 |
Roopa Prabhu <roopa@cumulusnetworks.com> |
net-sysfs: trigger netlink notification on ifalias change via sysfs
This patch adds netlink notifications on iflias changes via sysfs. makes it consistent with the netlink path which also calls netd
net-sysfs: trigger netlink notification on ifalias change via sysfs
This patch adds netlink notifications on iflias changes via sysfs. makes it consistent with the netlink path which also calls netdev_state_change. Also makes it consistent with other sysfs netdev_store operations.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
6c557001 |
| 02-Oct-2017 |
Florian Westphal <fw@strlen.de> |
net: core: decouple ifalias get/set from rtnl lock
Device alias can be set by either rtnetlink (rtnl is held) or sysfs.
rtnetlink hold the rtnl mutex, sysfs acquires it for this purpose. Add an ext
net: core: decouple ifalias get/set from rtnl lock
Device alias can be set by either rtnetlink (rtnl is held) or sysfs.
rtnetlink hold the rtnl mutex, sysfs acquires it for this purpose. Add an extra mutex for it and use rcu to protect concurrent accesses.
This allows the sysfs path to not take rtnl and would later allow to not hold it when dumping ifalias.
Based on suggestion from Eric Dumazet.
Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
6648c65e |
| 18-Aug-2017 |
stephen hemminger <stephen@networkplumber.org> |
net: style cleanups
Make code closer to current style. Mostly whitespace changes.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
|
#
667e427b |
| 18-Aug-2017 |
stephen hemminger <stephen@networkplumber.org> |
net: mark receive queue attributes ro_after_init
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
|
#
2b9c7581 |
| 18-Aug-2017 |
stephen hemminger <stephen@networkplumber.org> |
net: make queue attributes ro_after_init
The XPS queue attributes can be ro_after_init. Also use __ATTR_RX macros to simplify initialization.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.co
net: make queue attributes ro_after_init
The XPS queue attributes can be ro_after_init. Also use __ATTR_RX macros to simplify initialization.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
170c658a |
| 18-Aug-2017 |
stephen hemminger <stephen@networkplumber.org> |
net: make BQL sysfs attributes ro_after_init
Also fix macro to not have ; at end.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
|
#
718ad681 |
| 18-Aug-2017 |
stephen hemminger <stephen@networkplumber.org> |
net: drop unused attribute argument from sysfs queue funcs
The show and store functions don't need/use the attribute.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David
net: drop unused attribute argument from sysfs queue funcs
The show and store functions don't need/use the attribute.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
ec6cc599 |
| 18-Aug-2017 |
stephen hemminger <stephen@networkplumber.org> |
net: make net sysfs attributes ro_after_init
The attributes of net devices are immutable.
Ideally, attribute groups would contain const attributes but there are too many places that do modification
net: make net sysfs attributes ro_after_init
The attributes of net devices are immutable.
Ideally, attribute groups would contain const attributes but there are too many places that do modifications of list during startup (in other code) to allow that.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
737aec57 |
| 18-Aug-2017 |
stephen hemminger <stephen@networkplumber.org> |
net: constify net_ns_type_operations
This can be const.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
|
#
e6d473e6 |
| 18-Aug-2017 |
stephen hemminger <stephen@networkplumber.org> |
net: make net_class ro_after_init
The net_class in sysfs is only modified on init.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
|
#
b793dc5c |
| 18-Aug-2017 |
stephen hemminger <stephen@networkplumber.org> |
net: constify netdev_class_file
These functions are wrapper arount class_create_file which can take a const attribute.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David
net: constify netdev_class_file
These functions are wrapper arount class_create_file which can take a const attribute.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
d0d66837 |
| 18-Aug-2017 |
stephen hemminger <stephen@networkplumber.org> |
net: don't decrement kobj reference count on init failure
If kobject_init_and_add failed, then the failure path would decrement the reference count of the queue kobject whose reference count was alr
net: don't decrement kobj reference count on init failure
If kobject_init_and_add failed, then the failure path would decrement the reference count of the queue kobject whose reference count was already zero.
Fixes: 114cf5802165 ("bql: Byte queue limits") Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
c122e14d |
| 30-Jun-2017 |
Reshetova, Elena <elena.reshetova@intel.com> |
net: convert net.passive from atomic_t to refcount_t
refcount_t type and corresponding API should be used instead of atomic_t when the variable is used as a reference counter. This allows to avoid a
net: convert net.passive from atomic_t to refcount_t
refcount_t type and corresponding API should be used instead of atomic_t when the variable is used as a reference counter. This allows to avoid accidental refcounter overflows that might lead to use-after-free situations.
Signed-off-by: Elena Reshetova <elena.reshetova@intel.com> Signed-off-by: Hans Liljestrand <ishkamiel@gmail.com> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: David Windsor <dwindsor@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
38ef00cc |
| 29-Jun-2017 |
Arvind Yadav <arvind.yadav.cs@gmail.com> |
net: constify attribute_group structures.
attribute_groups are not supposed to change at runtime. All functions working with attribute_groups provided by <linux/device.h> work with const attribute_g
net: constify attribute_group structures.
attribute_groups are not supposed to change at runtime. All functions working with attribute_groups provided by <linux/device.h> work with const attribute_group. So mark the non-const structs as const.
File size before: text data bss dec hex filename 9968 3168 16 13152 3360 net/core/net-sysfs.o
File size After adding 'const': text data bss dec hex filename 10160 2976 16 13152 3360 net/core/net-sysfs.o
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
0cd29503 |
| 17-May-2017 |
Alexey Dobriyan <adobriyan@gmail.com> |
net: make struct net_device::tx_queue_len unsigned int
4 billion packet queue is something unthinkable so use 32-bit value for now.
Space savings on x86_64:
add/remove: 0/0 grow/shrink: 3/70 up/d
net: make struct net_device::tx_queue_len unsigned int
4 billion packet queue is something unthinkable so use 32-bit value for now.
Space savings on x86_64:
add/remove: 0/0 grow/shrink: 3/70 up/down: 16/-131 (-115) function old new delta change_tx_queue_len 94 108 +14 qdisc_create 1176 1177 +1 alloc_netdev_mqs 1124 1125 +1 xenvif_alloc 533 532 -1 x25_asy_setup 167 166 -1 ... tun_queue_resize 945 940 -5 pfifo_fast_enqueue 167 162 -5 qfq_init_qdisc 168 158 -10 tap_queue_resize 810 799 -11 transmit 719 698 -21
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|