summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2017-09-20virtio-net: support XDP_REDIRECTJason Wang
This patch tries to add XDP_REDIRECT for virtio-net. The changes are not complex as we could use exist XDP_TX helpers for most of the work. The rest is passing the XDP_TX to NAPI handler for implementing batching. Cc: John Fastabend <john.fastabend@gmail.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-20virtio-net: add packet len average only when needed during XDPJason Wang
There's no need to add packet len average in the case of XDP_PASS since it will be done soon after skb is created. Cc: John Fastabend <john.fastabend@gmail.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-20virtio-net: remove unnecessary parameter of virtnet_xdp_xmit()Jason Wang
CC: John Fastabend <john.fastabend@gmail.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-20net: dsa: lan9303: Add adjust_link() methodEgil Hjelmeland
Make the driver react to device tree "fixed-link" declaration on CPU port. - turn off autonegotiation - force speed 10 or 100 mb/s - force duplex mode Signed-off-by: Egil Hjelmeland <privat@egil-hjelmeland.no> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-20macvlan: code refine to check data before usingZhang Shengju
This patch checks data first at one place, return if it's null. Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19team: fall back to hash if table entry is emptyJim Hanko
If the hash to port mapping table does not have a valid port (i.e. when a port goes down), fall back to the simple hashing mechanism to avoid dropping packets. Signed-off-by: Jim Hanko <hanko@drivescale.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19net: dsa: bcm_sf2: Utilize b53_{enable, disable}_portFlorian Fainelli
Export b53_{enable,disable}_port and use these two functions in bcm_sf2_port_setup and bcm_sf2_port_disable. The generic functions cannot be used without wrapping because we need to manage additional switch integration details (PHY, Broadcom tag etc.). Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19net: dsa: bcm_sf2: Use SF2_NUM_EGRESS_QUEUES for CFPFlorian Fainelli
The magic number 8 in 3 locations in bcm_sf2_cfp.c actually designates the number of switch port egress queues, so use that define instead of open-coding it. Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19net: dsa: b53: Export b53_imp_vlan_setup()Florian Fainelli
bcm_sf2 and b53 do exactly the same thing, so share that piece. Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19net: dsa: b53: Wire-up EEEFlorian Fainelli
Add support for enabling and disabling EEE, as well as re-negotiating it in .adjust_link() and in .port_enable(). Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19net: dsa: b53: Move EEE functions to b53Florian Fainelli
Move the bcm_sf2 EEE-related functions to the b53 driver because this is shared code amongst Gigabit capable switch, only 5325 and 5365 are too old to support that. Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19net: dsa: b53: Define EEE register pageFlorian Fainelli
In preparation for migrating the EEE code from bcm_sf2 to b53, define the full EEE register page and offsets within that page. Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19net: dsa: b53: Move Broadcom header setup to b53Florian Fainelli
The code to enable Broadcom tags/headers is largely switch independent, and in preparation for enabling it for multiple devices with b53, move the code we have in bcm_sf2.c to b53_common.c Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19net: dsa: b53: Use a macro to define I/O operationsFlorian Fainelli
Instead of repeating the same pattern: acquire mutex, read/write, release mutex, define a macro: b53_build_op() which takes the type (read|write), I/O size, and value (scalar or pointer). This helps with fixing bugs that could exist (e.g: missing barrier, lock etc.). Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19net: dsa: bcm_sf2: Defer port enabling to calling port_enableFlorian Fainelli
There is no need to configure the enabled ports once in bcm_sf2_sw_setup() and then a second time around when dsa_switch_ops::port_enable is called, just do it when port_enable is called which is better in terms of power consumption and correctness. Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19net: dsa: b53: Defer port enabling to calling port_enableFlorian Fainelli
There is no need to configure the enabled ports once in b53_setup() and then a second time around when dsa_switch_ops::port_enable is called, just do it when port_enable is called which is better in terms of power consumption and correctness. Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19net: dsa: b53: Make b53_enable_cpu_port() take a port argumentFlorian Fainelli
In preparation for future changes allowing the configuring of multiple CPU ports, make b53_enable_cpu_port() take a port argument. Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19net: dsa: b53: Remove is_cpu_port()Florian Fainelli
This is not used anywhere, so remove it. Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19mlxsw: spectrum: Add multicast router traps and trap groupsYotam Gigi
Add three new traps needed for multicast routing: - PIM: Trap for PIM protocol control packets. - RPF: Trap for packets that fail the RPF check on a specific hardware route entry. - MULTICAST: Generic trap for multicast. It is used for routes that trap the packets to the CPU. The RPF and MULTICAST traps have rate limiters as these traps may have line-rate of packets trapped. The PIM trap has a rate limiter similarly to other L3 control protocols. The rate limiters are implemented by adding three new trap groups for the newly introduced traps. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19mlxsw: spectrum_router: Export RIF dev access functionYotam Gigi
The mlxsw_sp_rif struct, defined as private struct in spectrum_router.c will be used in the multicast router source file. Due to the fact that the dev field will be needed by the multicast router logic, add an access function to it. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19mlxsw: reg: Configure RIF to forward IPv4 multicast packets by defaultYotam Gigi
Turn on two bits on the Spectrum RIF configuration: - IPv4 multicast: when a multicast packet arrives on a RIF, send it to go through multicast routes lookup. - IPv4 multicast forwarding enable: when multicast packet arrives on a RIF, allow it to be forwarded by multicast routes. If this bit is not set, multicast packets will go through multicast routing lookup but will be dropped at the egress of the ports. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19mlxsw: reg: Add Router Rules Copy RegisterYotam Gigi
The RRCR register is used for copying and moving TCAM multicast routes from different offsets. It will be used to allow routes relocation for parman ops as part of the multicast router offloading logic. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19mlxsw: reg: Add the Router Multicast Forwarding Table Version 2 registerYotam Gigi
The RMFT-V2 register is used to configure and query the multicast table and will be used by the multicast router offloading logic. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19mlxsw: resources: Add multicast ERIF list entries resourceYotam Gigi
The multicast ERIF list entries resource indicates the number of entries that can be put in one rigr2 register operation. While the register can hold up to MLXSW_REG_RIGR2_MAX_ERIFS ( = 32) ERIF entries, the actual number allowed by firmware is indicated with this resource. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19mlxsw: reg: Add the Router Interface Group Version 2 registerYotam Gigi
The RIGR-V2 register is used to add, remove and query egress interface list of a multicast forwarding entry and it will be used by the multicast router offloading logic. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19mlxsw: reg: Add The Router TCAM Allocation registerYotam Gigi
This register is used for allocation of regions in the TCAM table and it will be used by the multicast router offloading logic. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19mlxsw: reg: Rename the flexible action set length fieldYotam Gigi
The MLXSW_REG_PXXX_FLEX_ACTION_SET_LEN is relevant for the multicast router registers too, so rename it to have a general name which is not bound to a specific register. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19mlxsw: acl: Change trap ACL action to get the trap_id as a parameterYotam Gigi
Allow the trap ACL action to be configured with different traps. This allows the multicast router offloading code to use that same ACL action with the multicast router traps. By using different traps, the multicast router can have different trap policies and can handle the packet differently. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19mlxsw: acl: Introduce mcrouter ACL actionYotam Gigi
The Spectrum multicast forwarding is done using an ACL action. Add the mcrouter ACL action that will be used to offload the multicast router logic. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19mlxsw: spectrum: Move ACL flexible actions instance to spectrumYotam Gigi
A flexible action instance allows, given a set of ops, creating, committing and sharing a set of ACL action blocks. The flexible action instance in question is using the spectrum KVD linear space to store the flexible action sets. Move this flexible action instance to the common spectrum struct to allow other users (such as multicast router) to get that functionality. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19mlxsw: spectrum: Change init orderYotam Gigi
The multicast router offloading code is going to require the counter_pools initialization to occur before the router initialization, thus, change the spectrum initialization order to fix it. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-19net: mvpp2: remove useless gotoAntoine Tenart
Remove a goto in the PPv2 tx function which jumps to the next line anyway. This is a cosmetic commit. Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-18net: korina: bump versionRoman Yeryomin
Signed-off-by: Roman Yeryomin <roman@advem.lv> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-18net: korina: update authorsRoman Yeryomin
Signed-off-by: Roman Yeryomin <roman@advem.lv> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-18net: korina: whitespace cleanupRoman Yeryomin
Signed-off-by: Roman Yeryomin <roman@advem.lv> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-18net: korina: use GRORoman Yeryomin
Performance gain when receiving locally is 55->95Mbps and 50->65Mbps for NAT. Signed-off-by: Roman Yeryomin <roman@advem.lv> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-18net: korina: use NAPI_POLL_WEIGHTRoman Yeryomin
Signed-off-by: Roman Yeryomin <roman@advem.lv> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-18net: korina: optimize rx descriptor flags processingRoman Yeryomin
Signed-off-by: Roman Yeryomin <roman@advem.lv> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-18net: korina: don't use overflow and underflow interruptsRoman Yeryomin
When such interrupts occur there is not much we can do. Dropping the whole ring doesn't help and only produces high packet loss. If we just ignore the interrupt the mac will drop one or few packets instead of the whole ring. Also this will lower the irq handling load and increase performance. Signed-off-by: Roman Yeryomin <roman@advem.lv> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-18hamradio: baycom: use new parport device modelSudip Mukherjee
Modify baycom driver to use the new parallel port device model. Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Acked-By: Thomas Sailer <t.sailer@alumni.ethz.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-18net/ethernet/freescale: fix warning for ucc_gethValentin Longchamp
uf_info.regs is resource_size_t i.e. phys_addr_t that can be either u32 or u64 according to CONFIG_PHYS_ADDR_T_64BIT. The printk format is thus adaptet to u64 and the regs value cast to u64 to take both u32 and u64 into account. Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-18forcedeth: replace pci_map_single with dma_map_single functionsZhu Yanjun
pci_map_single functions are obsolete. So replace them with dma_map_single functions. Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-18s390/qeth: tidy up parameter naming for qeth_do_send_packet()Jens Remus
Cppcheck reports the following for drivers/s390/net/qeth_core.h: warning - line 1560 - Function 'qeth_do_send_packet' argument order different: declaration 'card, queue, skb, hdr, hd_len, offset, elements' definition 'card, queue, skb, hdr, offset, hd_len, elements_needed'. Match the naming in the function's declaration against its definition. Signed-off-by: Jens Remus <jremus@linux.vnet.ibm.com> Reviewed-by: Julian Wiedmann <jwi@linux.vnet.ibm.com> Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-18s390/qeth: fold VLAN handling into l3_rebuild_skb()Julian Wiedmann
Move the overly complicated VLAN processing from the L3 RX handler into its l3_rebuild_skb() helper. No change in functionality. Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com> Reviewed-by: Ursula Braun <ubraun@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-18s390/qeth: translate SETVLAN/DELVLAN errorsJulian Wiedmann
Properly return any error encountered during VLAN processing to the the caller. Resulting change in behaviour: if SETVLAN fails while registering a new VLAN ID, the stack no longer creates the corresponding vlan device. Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com> Reviewed-by: Ursula Braun <ubraun@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-18s390/qeth: simplify L3 sysfs group managementJulian Wiedmann
Use the right helpers to create/remove all attribute groups in one go. Suggested-by: Hans Wippel <hwippel@linux.vnet.ibm.com> Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com> Reviewed-by: Ursula Braun <ubraun@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-18s390/qeth: don't take queue lock in send_packet_fast()Julian Wiedmann
Locking the output queue prior to TX is needed on OSA devices, to synchronize against a packing flush from the TX completion code (via qeth_check_outbound_queue()). But send_packet_fast() is only used for IQDs, which don't do packing. So remove the locking, and apply some easy cleanups. Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com> Reviewed-by: Ursula Braun <ubraun@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-18s390/qeth: remove unused code in qdio_establish_cq()Julian Wiedmann
Storing the number of input buffers into 'i' has no effect, it is immediately re-assigned in the next line. Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com> Reviewed-by: Ursula Braun <ubraun@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-18s390/qeth: add VNICC get/set timeout supportHans Wippel
HiperSockets allow configuring so called VNIC Characteristics (VNICC) that influence how the underlying hardware handles packets. For VNICCs, additional commands for getting and setting timeouts are available. Currently, the learning VNICC uses these commands. * Learning VNICC: If learning is enabled on a qeth device, the device learns the source MAC addresses of outgoing packets and incoming packets to those learned MAC addresses are received. For learning, the timeout specifies the idle period in seconds, after which the underlying hardware removes a learned MAC address again. This patch adds support for the IPA commands that are required to get and set the current timeout values for the learning VNIC characteristic. Also, it introduces the sysfs interface that allows users to configure the timeout. Signed-off-by: Hans Wippel <hwippel@linux.vnet.ibm.com> Reviewed-by: Julian Wiedmann <jwi@linux.vnet.ibm.com> Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-18s390/qeth: add VNICC enable/disable supportHans Wippel
HiperSocket devices allow enabling and disabling so called VNIC Characteristics (VNICC) that influence how the underlying hardware handles packets. These VNICCs are: * Flooding VNICC: Flooding allows specifying if packets to unknown destination MAC addresses are received by the qeth device. * Multicast flooding VNICC: Multicast flooding allows specifying if packets to multicast MAC addresses are received by the qeth device. * Learning VNICC: If learning is enabled on a qeth device, the device learns the source MAC addresses of outgoing packets and incoming packets to those learned MAC addresses are received. * Takeover setvmac VNICC: If takeover setvmac is configured on a qeth device, the MAC address of this device can be configured on a different qeth device with the setvmac IPA command. * Takeover by learning VNICC: If takeover learning is enabled on a qeth device, the MAC address of this device can be learned (learning VNICC) on a different qeth device. * BridgePort invisible VNICC: If BridgePort invisible is enabled on a qeth device, (1) packets from this device are not sent to a BridgePort enabled qeth device and (2) packets coming from a BridgePort enabled qeth device are not received by this device. * Receive broadcast VNICC: Receive broadcast allows configuring if a qeth device receives packets with the broadcast destination MAC address. This patch adds support for the IPA commands that are required to enable and disable these VNIC characteristics on qeth devices. As a prerequisite, it also adds the query commands IPA command. The query commands IPA command allows requesting the supported commands for each characteristic from the underlying hardware. Additionally, this patch provides users with a sysfs user interface to enable/disable the VNICCs mentioned above. Signed-off-by: Hans Wippel <hwippel@linux.vnet.ibm.com> Reviewed-by: Julian Wiedmann <jwi@linux.vnet.ibm.com> Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>