aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tunnel4.c (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2019-01-19net: namespace: perform strict checks also for doit handlersJakub Kicinski1-2/+36
Make RTM_GETNSID's doit handler use strict checks when NETLINK_F_STRICT_CHK is set. v2: - don't check size >= sizeof(struct rtgenmsg) (Nicolas). Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-19rtnetlink: ifinfo: perform strict checks also for doit handlerJakub Kicinski1-1/+48
Make RTM_GETLINK's doit handler use strict checks when NETLINK_F_STRICT_CHK is set. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-19rtnetlink: stats: reject requests for unknown statsJakub Kicinski1-0/+4
In the spirit of strict checks reject requests of stats the kernel does not support when NETLINK_F_STRICT_CHK is set. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-19rtnetlink: stats: validate attributes in get as well as dumpsJakub Kicinski1-21/+37
Make sure NETLINK_GET_STRICT_CHK influences both GETSTATS doit as well as the dump. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-19net: netlink: add helper to retrieve NETLINK_F_STRICT_CHKJakub Kicinski2-0/+9
Dumps can read state of the NETLINK_F_STRICT_CHK flag from a field in the callback structure. For non-dump GET requests we need a way to access the state of that flag from a socket. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-19virtio-net: per-queue RPS configWillem de Bruijn1-0/+1
On multiqueue network devices, RPS maps are configured independently for each receive queue through /sys/class/net/$DEV/queues/rx-*. On virtio-net currently all packets use the map from rx-0, because the real rx queue is not known at time of map lookup by get_rps_cpu. Call skb_record_rx_queue in the driver rx path to make lookup work. Recording the receive queue has ramifications beyond RPS, such as in sticky load balancing decisions for sockets (skb_tx_hash) and XPS. Reported-by: Mark Hlady <mhlady@google.com> Signed-off-by: Willem de Bruijn <willemb@google.com> Acked-by: Jason Wang <jasowang@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-19sch_api: Change signature of qdisc_tree_reduce_backlog() to use intsToke Høiland-Jørgensen2-4/+2
There are now several places where qdisc_tree_reduce_backlog() is called with a negative number of packets (to signal an increase in number of packets in the queue). Rather than rely on overflow behaviour, change the function signature to use signed integers to communicate this usage to people reading the code. Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-18net: hns3: add HNAE3_RESTORE_CLIENT interface in enet moduleYunsheng Lin4-28/+40
The HNAE3_INIT_CLIENT interface is also used when changing tc configuration, vlan/mac hardware table does not need to be restored when tc configuration changes. This patch adds a HNAE3_RESTORE_CLIENT interface to restore the vlan/mac hardware table when resetting. Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-18net: hns3: do reinitialization while ETS configuration changedHuazhong Tan4-15/+22
When the ETS information is changed, the network device needs to be re-initialized, otherwise the information such as the receiving queue will be incorrect. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-18net: hns3: fix wrong combined count returned by ethtool -lHuazhong Tan1-4/+3
The current code returns the number of all queues that can be used and the number of queues that have been allocated, which is incorrect. What should be returned is the number of queues allocated for each enabled TC and the number of queues that can be allocated. This patch fixes it. Fixes: 482d2e9c1cc7 ("net: hns3: add support to query tqps number") Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-18net: hns3: adjust the use of alloc_tqps and num_tqpsHuazhong Tan1-3/+7
The alloc_tqps field of struct hclge_vport represents the total number of tqps allocated to the vport. The num_tqps of struct hnae3_knic_private_info indicates the total number of all enabled tqps, which needs to be distinguished during use. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-18net: hns3: fix user configuration loss for ethtool -LHuazhong Tan4-49/+47
Ethtool -L option with the combined parameter is for changing the number of multi-purpose channels of the specified network device. Under the current scheme, the user configuration information will be lost after the reset or TC information changed. This patch fixes this issue. By default, this configuration is set to the minimum between the number of queues for each enabled TCs and the maximum number support available in the hardware. When there is a user configuration, regardless of the reset or TC information change, it should keep the user's configuration while it is under the hardware limits, otherwise set to the maximum number support available in the hardware. Fixes: 09f2af6405b8 ("net: hns3: add support to modify tqps number") Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-18net: hns3: remove redundant codes in hclge_knic_setupHuazhong Tan2-17/+2
The TC info will be updated in hclge_tm_vport_tc_info_update(), so hclge_knic_setup() no need to do it again. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-18net: hns3: modify parameter checks in the hns3_set_channelsHuazhong Tan1-4/+3
The number of queues for each enabled TC should range from 1 to the maximum available value, and return directly if the value is same as the current one. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-18net: hns3: add interface hclge_tm_bp_setupHuazhong Tan1-8/+15
Provide a common interface to complete the back pressure settings of all enabled TCs. So other functions directly call this interface to complete the corresponding operation. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-18net: hns3: reuse reinitialization interface in the hns3_set_channelsHuazhong Tan1-63/+12
There is already common interface for network device reinitialization, so hns3_set_channels() should just call them. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-18net: hns3: remove unnecessary hns3_adjust_tqps_numHuazhong Tan1-6/+0
The parameter passed to hns3_set_channels() are already the number of queues per channel of the enabled TC, so it is not need to divide the number of enabled TCs. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-18net: hns3: remove unused member in struct hns3_enet_ringHuazhong Tan2-2/+0
The irq_init_flag field in struct hns3_enet_ring is unnecessary. This patch removes it. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-18net: hns3: modify enet reinitialization interfaceHuazhong Tan1-2/+16
hns3_reset_notify_init_enet and hns3_reset_notify_uninit_enet are the reinitialization interface that will be called when the device reset, the number of TC changed, or the queue length changed. So these two function should call hns3_get_ring_config() and hns3_put_ring_config() to allocate and free memory for the ring with the correct number. Also this patch fixes a double free problem when hns3_reset_notify_uninit_enet calling hns3_nic_dealloc_vector_data Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>