aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-07-29route: add support for directed broadcast forwardingXin Long5-1/+19
This patch implements the feature described in rfc1812#section-5.3.5.2 and rfc2644. It allows the router to forward directed broadcast when sysctl bc_forwarding is enabled. Note that this feature could be done by iptables -j TEE, but it would cause some problems: - target TEE's gateway param has to be set with a specific address, and it's not flexible especially when the route wants forward all directed broadcasts. - this duplicates the directed broadcasts so this may cause side effects to applications. Besides, to keep consistent with other os router like BSD, it's also necessary to implement it in the route rx path. Note that route cache needs to be flushed when bc_forwarding is changed. Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-29net/ipv6: allow any source address for sendmsg pktinfo with ip_nonlocal_bindVincent Bernat1-1/+2
When freebind feature is set of an IPv6 socket, any source address can be used when sending UDP datagrams using IPv6 PKTINFO ancillary message. Global non-local bind feature was added in commit 35a256fee52c ("ipv6: Nonlocal bind") for IPv6. This commit also allows IPv6 source address spoofing when non-local bind feature is enabled. Signed-off-by: Vincent Bernat <vincent@bernat.im> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-29Merge tag 'linux-can-next-for-4.19-20180727' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-nextDavid S. Miller27-2295/+6841
Marc Kleine-Budde says: ==================== pull-request: can-next 2018-01-16 this is a pull request for net-next/master consisting of 38 patches. Dan Murphy's patch fixes the path to a file in the comment of the CAN Error Message Frame Mask structure. A patch by Colin Ian King fixes a typo in the cc770 driver. The next patch is by me an sorts the Kconfigand Makefile entries of the CAN-USB driver subdir alphabetically. The patch by Jakob Unterwurzacher adds support for the UCAN USB-CAN adapter. YueHaibing's patch replaces a open coded skb_put()+memset() by skb_put_zero() in the CAN-dev infrastructure. Zhu Yi provides a patch to enable multi-queue CAN devices. Three patches by Luc Van Oostenryck fix the return value of several driver's xmit function, I contribute a patch for the a fourth driver. Fabio Estevam's patch switches the flexcan driver to SPDX identifier. Two patches by Jia-Ju Bai replace the mdelay() by a usleep_range() in the sja1000 drivers. The next 6 patches are by Anssi Hannula and refactor the xilinx CAN driver and add support for the xilinx CAN FD core. A patch by Gustavo A. R. Silva adds fallthrough annotation to the peak_usb driver. 5 patches by Stephane Grosjean for the peak CANFD driver do some cleanups and provide more improvements for further firmware releases. The remaining 13 patches are by Jimmy Assarsson and the first clean up the kvaser_usb driver, so that the later patches add support for the Kvaser USB hydra family. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-29qed: remove redundant functions qed_set_gft_event_id_cm_hdrYueHaibing1-13/+0
There are no in-tree callers of qed_set_gft_event_id_cm_hdr. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-29liquidio: remove redundant function cn23xx_dump_vf_iq_regsYueHaibing1-30/+0
There are no in-tree callers. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-28Merge branch 'tls-Fix-improper-revert-in-zerocopy_from_iter'David S. Miller1-11/+7
Doron Roberts-Kedes says: ==================== tls: Fix improper revert in zerocopy_from_iter This series fixes the improper iov_iter_revert introcded in "tls: Fix zerocopy_from_iter iov handling". ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-28tls: Fix improper revert in zerocopy_from_iterDoron Roberts-Kedes1-7/+5
The current code is problematic because the iov_iter is reverted and never advanced in the non-error case. This patch skips the revert in the non-error case. This patch also fixes the amount by which the iov_iter is reverted. Currently, iov_iter is reverted by size, which can be greater than the amount by which the iter was actually advanced. Instead, only revert by the amount that the iter was advanced. Fixes: 4718799817c5 ("tls: Fix zerocopy_from_iter iov handling") Signed-off-by: Doron Roberts-Kedes <doronrk@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-28tls: Remove dead code in tls_sw_sendmsgDoron Roberts-Kedes1-4/+2
tls_push_record either returns 0 on success or a negative value on failure. This patch removes code that would only be executed if tls_push_record were to return a positive value. Signed-off-by: Doron Roberts-Kedes <doronrk@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-28Merge branch 'mvneta-next'David S. Miller3-160/+272
Gregory CLEMENT says: ==================== A fix and a few improvements on mvneta This series brings some improvements for the mvneta driver and also adds a fix. Compared to the v2, the main change is another patch fixing a bug in mtu_change. Changelog: v1 -> v2 - In patch 2, use EXPORT_SYMBOL_GPL for mvneta_bm_get and mvneta_bm_put to be used in module, reported by kbuild test robot. - In patch 4, add the counter to the driver's ethtool state, suggested by David Miller. - In patch 6, use a single if, suggested by Marcin Wojtas v2 -> v3 - Adding a patch fixing the mtu change issue - Removing the inline keyword for mvneta_rx_refill() and let the comiler decided, suggested by David Miller. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-28net: mvneta: Improve the buffer allocation method for SWBMYelena Krivosheev1-98/+183
With system having a small memory (around 256MB), the state "cannot allocate memory to refill with new buffer" is reach pretty quickly. By this patch we changed buffer allocation method to a better handling of this use case by avoiding memory allocation issues. Signed-off-by: Yelena Krivosheev <yelena@marvell.com> [gregory: extract from a larger patch] Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-28net: mvneta: Verify hardware checksum only when offload checksum feature is setYelena Krivosheev1-1/+2
If the checksum offload feature is not set, then there is no point to check the status of the hardware. [gregory: extract from a larger patch] Signed-off-by: Yelena Krivosheev <yelena@marvell.com> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-28net: mvneta: Allocate page for the descriptorGregory CLEMENT2-41/+24
Instead of trying to allocate the exact amount of memory for each descriptor use a page for each of them, it allows to simplify the allocation management and increase the performance of the driver. Based on the work of Yelena Krivosheev <yelena@marvell.com> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-28net: mvneta: discriminate error cause for missed packetGregory CLEMENT1-6/+22
In order to improve the diagnostic in case of error, make the distinction between refill error and skb allocation error. Also make the information available through the ethtool state. Based on the work of Yelena Krivosheev <yelena@marvell.com> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-28net: mvneta: increase number of buffers in RX and TX queueYelena Krivosheev1-2/+2
The initial values were too small leading to poor performance when using the software buffer management. Signed-off-by: Yelena Krivosheev <yelena@marvell.com> [gregory: extract from a larger patch] Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-28net: mvneta: remove data pointer usage from device_node structureGregory CLEMENT3-6/+32
On year ago Rob Herring wanted to remove the data pointer from the device_node structure[1]. The mvneta driver seemed to be the only one which used (abused ?) it. However, the proposal of Rob to remove this pointer from the driver introduced a regression, and I tested and fixed an alternative way, but it was never submitted as a proper patch. Now here it is: Instead of using the device_node structure ->data pointer, we store the BM private data as the driver data of the BM platform_device. The core mvneta code can retrieve it by doing a lookup on which platform_device corresponds to the BM device tree node using of_find_device_by_node(), and get its driver data [1]https://www.spinics.net/lists/netdev/msg445197.html Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-28net: mvneta: fix mtu change on port without linkYelena Krivosheev1-1/+0
It is incorrect to enable TX/RX queues (call by mvneta_port_up()) for port without link. Indeed MTU change for interface without link causes TX queues to stuck. Fixes: c5aff18204da ("net: mvneta: driver for Marvell Armada 370/XP network unit") Signed-off-by: Yelena Krivosheev <yelena@marvell.com> [gregory.clement: adding Fixes tags and rewording commit log] Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-28net: ethernet: mvneta: Fix napi structure mixup on armada 3700Andrew Lunn1-10/+12
The mvneta Ethernet driver is used on a few different Marvell SoCs. Some SoCs have per cpu interrupts for Ethernet events. Some SoCs have a single interrupt, independent of the CPU. The driver handles this by having a per CPU napi structure when there are per CPU interrupts, and a global napi structure when there is a single interrupt. When the napi core calls mvneta_poll(), it passes the napi instance. This was not being propagated through the call chain, and instead the per-cpu napi instance was passed to napi_gro_receive() call. This breaks when there is a single global napi instance. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Fixes: 2636ac3cc2b4 ("net: mvneta: Add network support for Armada 3700 SoC") Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27net: tipc: bcast: Replace GFP_ATOMIC with GFP_KERNEL in tipc_bcast_init()Jia-Ju Bai1-1/+1
tipc_bcast_init() is never called in atomic context. It calls kzalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27net: tipc: name_table: Replace GFP_ATOMIC with GFP_KERNEL in tipc_nametbl_init()Jia-Ju Bai1-1/+1
tipc_nametbl_init() is never called in atomic context. It calls kzalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27net: usb: sr9700: Replace mdelay() with msleep() in sr9700_bind()Jia-Ju Bai1-1/+1
sr9700_bind() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27net: usb: pegasus: Replace mdelay() with msleep() in setup_pegasus_II()Jia-Ju Bai1-1/+1
setup_pegasus_II() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27net: phy: marvell: Replace mdelay() with msleep() in m88e1116r_config_init()Jia-Ju Bai1-1/+1
m88e1116r_config_init() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27net: nvidia: forcedeth: Replace GFP_ATOMIC with GFP_KERNEL in nv_probe()Jia-Ju Bai1-2/+2
nv_probe() is never called in atomic context. It calls dma_alloc_coherent() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27net: jme: Replace mdelay() with msleep() and usleep_range() in jme_wait_link()Jia-Ju Bai1-2/+2
jme_wait_link() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep() and usleep_range(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27net: hisilicon: hns: Replace mdelay() with msleep()Jia-Ju Bai2-4/+4
hns_ppe_common_init_hw() and hns_xgmac_init() are never called in atomic context. They call mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27net: amd: pcnet32: Replace GFP_ATOMIC with GFP_KERNEL in pcnet32_alloc_ring()Jia-Ju Bai1-4/+4
pcnet32_alloc_ring() is never called in atomic context. It calls kcalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27sch_cake: Make gso-splitting configurable from userspaceDave Taht1-6/+7
This patch restores cake's deployed behavior at line rate to always split gso, and makes gso splitting configurable from userspace. running cake unlimited (unshaped) at 1gigE, local traffic: no-split-gso bql limit: 131966 split-gso bql limit: ~42392-45420 On this 4 stream test splitting gso apart results in halving the observed interpacket latency at no loss in throughput. Summary of tcp_nup test run 'gso-split' (at 2018-07-26 16:03:51.824728): Ping (ms) ICMP : 0.83 0.81 ms 341 TCP upload avg : 235.43 235.39 Mbits/s 301 TCP upload sum : 941.71 941.56 Mbits/s 301 TCP upload::1 : 235.45 235.43 Mbits/s 271 TCP upload::2 : 235.45 235.41 Mbits/s 289 TCP upload::3 : 235.40 235.40 Mbits/s 288 TCP upload::4 : 235.41 235.40 Mbits/s 291 verses Summary of tcp_nup test run 'no-split-gso' (at 2018-07-26 16:37:23.563960): avg median # data pts Ping (ms) ICMP : 1.67 1.73 ms 348 TCP upload avg : 234.56 235.37 Mbits/s 301 TCP upload sum : 938.24 941.49 Mbits/s 301 TCP upload::1 : 234.55 235.38 Mbits/s 285 TCP upload::2 : 234.57 235.37 Mbits/s 286 TCP upload::3 : 234.58 235.37 Mbits/s 274 TCP upload::4 : 234.54 235.42 Mbits/s 288 Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27cxgb4: print ULD queue information managed by LLDRahul Lakkireddy1-19/+277
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27Merge branch 'l2tp-remove-unused-session-fields'David S. Miller6-87/+17
Guillaume Nault says: ==================== l2tp: remove unused session fields Several fields of the session structures can be set, but remain unused otherwise. This series removes these fields and explicitely ignores the associated ioctls and netlink attributes. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27l2tp: drop ->mru from struct l2tp_sessionGuillaume Nault6-51/+9
This field is not used. Treat PPPIOC*MRU the same way as PPPIOC*FLAGS: "get" requests return 0, while "set" requests vadidate the user supplied pointer but discard its value. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27l2tp: drop ->flags from struct pppol2tp_sessionGuillaume Nault1-11/+2
This field is not used. Keep validating user input in PPPIOCSFLAGS. Even though we discard the value, it would look wrong to succeed if an invalid address was passed from userspace. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27l2tp: ignore L2TP_ATTR_VLAN_ID netlink attributeGuillaume Nault3-6/+2
The value of this attribute is never used. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27l2tp: ignore L2TP_ATTR_DATA_SEQ netlink attributeGuillaume Nault4-20/+5
The value of this attribute is never used. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27net/rds/Kconfig: Correct the RDS dependsAnders Roxell1-1/+1
Remove prefix 'CONFIG_' from CONFIG_IPV6 Fixes: ba7d7e2677c0 ("net/rds/Kconfig: RDS should depend on IPV6") Reported-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27Merge branch 'mlxsw-Support-DSCP-prioritization-and-rewrite'David S. Miller6-6/+844
Ido Schimmel says: ==================== mlxsw: Support DSCP prioritization and rewrite Petr says: On ingress, a network device such as a switch assigns to packets priority based on various criteria. Common options include interpreting PCP and DSCP fields according to user configuration. When a packet egresses the switch, a reverse process may rewrite PCP and/or DSCP headers according to packet priority. So far, mlxsw has supported prioritization based on PCP (802.1p priority tag). This patch set introduces support for prioritization based on DSCP, and DSCP rewrite. To configure the DSCP-to-priority maps, the user is expected to invoke ieee_setapp and ieee_delapp DCBNL ops, e.g. by using lldptool: To decide whether or not to pay attention to DSCP values, the Spectrum switch recognize a per-port configuration of trust level. Until the first APP rule is added for a given port, this port's trust level stays at PCP, meaning that PCP is used for packet prioritization. With the first DSCP APP rule, the port is configured to trust DSCP instead, and it stays there until all DSCP APP rules are removed again. Besides the DSCP (value 5) selector, another selector that plays into packet prioritization is Ethernet type (value 1) with PID of 0. Such APP entries denote default priority[1]: With this patch set, mlxsw uses these values to configure priority for DSCP values not explicitly specified in DSCP APP map. In the future we expect to also use this to configure default port priority for untagged packets. Access to DSCP-to-priority map, priority-to-DSCP map, and default priority for a port is exposed through three new DCB helpers. Like the already-existing dcb_ieee_getapp_mask() helper, these helpers operate in terms of bitmaps, to support the arbitrary M:N mapping that the APP rules allow. Such interface presents all the relevant information from the APP database without necessitating exposition of iterators, locking or other complex primitives. It is up to the driver to then digest the mapping in a way that the device supports. In this patch set, mlxsw resolves conflicts by favoring higher-numbered DSCP values and priorities. In this patchset: - Patch #1 fixes a bug in DCB APP database management. - Patch #2 adds the getters described above. - Patches #3-#6 add Spectrum configuration registers. - Patch #7 adds the mlxsw logic that configures the device according to APP rules. - Patch #8 adds a self-test. The test is added to the subdirectory drivers/net/mlxsw. Even though it's not particularly specific to mlxsw, it's not suitable for running on soft devices (which don't support the ieee_getapp et.al.), and thus isn't a good fit for the general net/forwarding directory. [1] 802.1Q-2014, Table D-9 ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27selftests: mlxsw: Add test for trust-DSCPPetr Machata1-0/+248
Add a test that exercises the new code. Send DSCP-tagged packets, and observe how they are prioritized in the switch and the DSCP is updated on egress again. Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27mlxsw: spectrum: Support ieee_setapp, ieee_delappPetr Machata2-2/+271
The APP TLVs are used for communicating priority-to-protocol ID maps for a given netdevice. Support the following APP TLVs: - DSCP (selector 5) to configure priority-to-DSCP code point maps. Use these maps to configure packet priority on ingress, and DSCP code point rewrite on egress. - Default priority (selector 1, PID 0) to configure priority for the DSCP code points that don't have one assigned by the DSCP selector. In future this could also be used for assigning default port priority when a packet arrives without DSCP tagging. Besides setting up the maps themselves, also configure port trust level and rewrite bits. Port trust level determines whether, for a packet arriving through a certain port, the priority should be determined based on PCP or DSCP header fields. So far, mlxsw kept the device default of trust-PCP. Now, as soon as the first DSCP APP TLV is configured, switch to trust-DSCP. Only when all DSCP APP TLVs are removed, switch back to trust-PCP again. Note that the default priority APP TLV doesn't impact the trust level configuration. Rewrite bits determine whether DSCP and PCP fields of egressing packets should be updated according to switch priority. When port trust is switched to DSCP, enable rewrite of DSCP field. Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27mlxsw: reg: Add QoS Priority to DSCP Mapping RegisterPetr Machata1-0/+89
This register controls mapping from Priority to DSCP for purposes of rewrite. Note that rewrite happens as the packet is transmitted provided that the DSCP rewrite bit is enabled for the packet. Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27mlxsw: reg: Add QoS ReWrite Enable RegisterPetr Machata1-0/+39
This register configures the rewrite enable (whether PCP or DSCP value in packet should be updated according to packet priority) per receive port. Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27mlxsw: reg: Add QoS Priority Trust State RegisterPetr Machata1-0/+39
The QPTS register controls the port policy to calculate the switch priority and packet color based on incoming packet fields. Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27mlxsw: reg: Add QoS Port DSCP to Priority Mapping RegisterPetr Machata1-0/+52
The QPDPM register controls the mapping from DSCP field to Switch Priority for IP packets. Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27net: dcb: Add priority-to-DSCP map gettersPetr Machata2-0/+99
On ingress, a network device such as a switch assigns to packets priority based on various criteria. Common options include interpreting PCP and DSCP fields according to user configuration. When a packet egresses the switch, a reverse process may rewrite PCP and/or DSCP values according to packet priority. The following three functions support a) obtaining a DSCP-to-priority map or vice versa, and b) finding default-priority entries in APP database. The DCB subsystem supports for APP entries a very generous M:N mapping between priorities and protocol identifiers. Understandably, several (say) DSCP values can map to the same priority. But this asymmetry holds the other way around as well--one priority can map to several DSCP values. For this reason, the following functions operate in terms of bitmaps, with ones in positions that match some APP entry. - dcb_ieee_getapp_dscp_prio_mask_map() to compute for a given netdevice a map of DSCP-to-priority-mask, which gives for each DSCP value a bitmap of priorities related to that DSCP value by APP, along the lines of dcb_ieee_getapp_mask(). - dcb_ieee_getapp_prio_dscp_mask_map() similarly to compute for a given netdevice a map from priorities to a bitmap of DSCPs. - dcb_ieee_getapp_default_prio_mask() which finds all default-priority rules for a given port in APP database, and returns a mask of priorities allowed by these default-priority rules. Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27net: dcb: For wild-card lookups, use priority -1, not 0Petr Machata1-4/+7
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 <petrm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27net: sched: don't dump chains only held by actionsJiri Pirko4-14/+64
In case a chain is empty and not explicitly created by a user, such chain should not exist. The only exception is if there is an action "goto chain" pointing to it. In that case, don't show the chain in the dump. Track the chain references held by actions and use them to find out if a chain should or should not be shown in chain dump. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-nextDavid S. Miller18-246/+1331
Steffen Klassert says: ==================== pull request (net-next): ipsec-next 2018-07-27 1) Extend the output_mark to also support the input direction and masking the mark values before applying to the skb. 2) Add a new lookup key for the upcomming xfrm interfaces. 3) Extend the xfrm lookups to match xfrm interface IDs. 4) Add virtual xfrm interfaces. The purpose of these interfaces is to overcome the design limitations that the existing VTI devices have. The main limitations that we see with the current VTI are the following: VTI interfaces are L3 tunnels with configurable endpoints. For xfrm, the tunnel endpoint are already determined by the SA. So the VTI tunnel endpoints must be either the same as on the SA or wildcards. In case VTI tunnel endpoints are same as on the SA, we get a one to one correlation between the SA and the tunnel. So each SA needs its own tunnel interface. On the other hand, we can have only one VTI tunnel with wildcard src/dst tunnel endpoints in the system because the lookup is based on the tunnel endpoints. The existing tunnel lookup won't work with multiple tunnels with wildcard tunnel endpoints. Some usecases require more than on VTI tunnel of this type, for example if somebody has multiple namespaces and every namespace requires such a VTI. VTI needs separate interfaces for IPv4 and IPv6 tunnels. So when routing to a VTI, we have to know to which address family this traffic class is going to be encapsulated. This is a lmitation because it makes routing more complex and it is not always possible to know what happens behind the VTI, e.g. when the VTI is move to some namespace. VTI works just with tunnel mode SAs. We need generic interfaces that ensures transfomation, regardless of the xfrm mode and the encapsulated address family. VTI is configured with a combination GRE keys and xfrm marks. With this we have to deal with some extra cases in the generic tunnel lookup because the GRE keys on the VTI are actually not GRE keys, the GRE keys were just reused for something else. All extensions to the VTI interfaces would require to add even more complexity to the generic tunnel lookup. So to overcome this, we developed xfrm interfaces with the following design goal: It should be possible to tunnel IPv4 and IPv6 through the same interface. No limitation on xfrm mode (tunnel, transport and beet). Should be a generic virtual interface that ensures IPsec transformation, no need to know what happens behind the interface. Interfaces should be configured with a new key that must match a new policy/SA lookup key. The lookup logic should stay in the xfrm codebase, no need to change or extend generic routing and tunnel lookups. Should be possible to use IPsec hardware offloads of the underlying interface. 5) Remove xfrm pcpu policy cache. This was added after the flowcache removal, but it turned out to make things even worse. From Florian Westphal. 6) Allow to update the set mark on SA updates. From Nathan Harold. 7) Convert some timestamps to time64_t. From Arnd Bergmann. 8) Don't check the offload_handle in xfrm code, it is an opaque data cookie for the driver. From Shannon Nelson. 9) Remove xfrmi interface ID from flowi. After this pach no generic code is touched anymore to do xfrm interface lookups. From Benedict Wong. 10) Allow to update the xfrm interface ID on SA updates. From Nathan Harold. 11) Don't pass zero to ERR_PTR() in xfrm_resolve_and_create_bundle. From YueHaibing. 12) Return more detailed errors on xfrm interface creation. From Benedict Wong. 13) Use PTR_ERR_OR_ZERO instead of IS_ERR + PTR_ERR. From the kbuild test robot. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-27can: kvaser_usb: Simplify struct kvaser_cmd_cardinfoJimmy Assarsson1-11/+3
serial_number_high can be removed from the struct since it is never used in the USBcan II firmware. Signed-off-by: Jimmy Assarsson <jimmyassarsson@gmail.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-07-27can: kvaser_usb: Add support for Kvaser USB hydra familyJimmy Assarsson6-12/+2151
This patch adds support for a new Kvaser USB family, denoted hydra. The hydra family currently contains USB devices with one CAN channel up to five. There are devices with and without CAN FD support. Signed-off-by: Jimmy Assarsson <extja@kvaser.com> Signed-off-by: Christer Beskow <chbe@kvaser.com> Signed-off-by: Nicklas Johansson <extnj@kvaser.com> Signed-off-by: Martin Henriksson <mh@kvaser.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-07-27can: kvaser_usb: Split driver into kvaser_usb_core.c and kvaser_usb_leaf.cJimmy Assarsson6-2031/+2293
First part of adding support for Kvaser USB device family "hydra". Split kvaser_usb.c into kvaser_usb/kvaser_usb{.h,_core.c,_leaf.c}. kvaser_usb_core.c contains common functionality, such as USB writing/reading and allocation of netdev. kvaser_usb_leaf.c contains device specific code, used in kvaser_usb_core.c. struct kvaser_usb_dev_ops contains device specific functions that are common for all devices in the family. While, struct kvaser_usb_dev_cfg describes the device configurations in terms of CAN clock frequency, timestamp frequency and CAN controller bittiming constants. Signed-off-by: Jimmy Assarsson <extja@kvaser.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-07-27can: kvaser_usb: Add SPDX GPL-2.0 license identifierJimmy Assarsson1-6/+2
Add SPDX GPL-2.0 license identifier to kvaser_usb.c. Signed-off-by: Jimmy Assarsson <extja@kvaser.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-07-27can: kvaser_usb: Fix typosJimmy Assarsson1-7/+7
Fix some typos. Change can to CAN, when referring to Controller Area Network. Signed-off-by: Jimmy Assarsson <extja@kvaser.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>