aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2015-03-08net: stmmac: make reset control an optional requirementDinh Nguyen1-1/+3
Not having a reset control line to the ethernet controller should not be a hard failure. Instead, add support for deferred probing and just print out a debug statement. Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com> Cc: Vince Bridgers <vbridger@opensource.altera.com> CC: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-08Merge branch 'mpls-next'David S. Miller4-53/+85
Eric W. Biederman says: ==================== mpls: Minor fixes and cleanups This is a bunch of small changes that have come out of the discussions of the mpls code and the automated tests that people run against things. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-08neigh: Use neigh table index for neigh_packet_xmitEric W. Biederman3-24/+34
Remove a little bit of unnecessary work when transmitting a packet with neigh_packet_xmit. Use the neighbour table index not the address family as a parameter. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-08mpls: Fix the openvswitch select of NET_MPLS_GSOEric W. Biederman1-0/+1
Fix the OPENVSWITCH Kconfig option and old Kconfigs by having OPENVSWITCH select both NET_MPLS_GSO and MPLSO. A Kbuild test robot reported that when NET_MPLS_GSO is selected by OPENVSWITCH the generated .config is broken because MPLS is not selected. Cc: Simon Horman <horms@verge.net.au> Fixes: cec9166ca4e mpls: Refactor how the mpls module is built Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Reviewed-by: Simon Horman <horms@verge.net.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-08mpls: Correct the ttl decrement.Eric W. Biederman1-1/+1
According to RFC3032 section 2.4.2 packets with an outgoing ttl of 0 MUST NOT be forwarded. According to section 2.4.1 an outgoing TTL of 0 comes from an incomming TTL <= 1. Therefore any packets that is received with a ttl <= 1 should not have it's ttl decremented and forwarded. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-08mpls: Better error code for unsupported option.Eric W. Biederman1-1/+1
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-08mpls: Cleanup the rcu usage in the code.Eric W. Biederman1-26/+47
Sparse was generating a lot of warnings mostly from missing annotations in the code. Add missing annotations and in a few cases tweak the code for performance by moving work before loops. This also fixes a problematic ommision of rcu_assign_pointer and rcu_dereference. Hopefully with complete rcu annotations any new rcu errors will stick out like a sore thumb. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-08mpls: Fix the kzalloc argument order in mpls_rt_allocEric W. Biederman1-1/+1
*Blink* I got the argument order wrong to kzalloc and the code was working properly when tested. *Blink* Fix that. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-08neterion: remove reference to ifconfigstephen hemminger2-2/+2
Remove reference to obsolete ifconfig command. MTU can be changed with ip command instead. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-07Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-nextDavid S. Miller14-570/+284
Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2015-03-07 This series contains updates to i40e and i40evf only. Most notably, Greg provides the patch to remove the dreaded configfs changes in the driver. Shannon cleans up a sparse warning by simply straighting out the code so it is less convoluted. Fixes an issue where the vector allocation was trying too hard to save vectors for VMDq, to the point of not giving the PF enough when in a tight situation, such as an NPAR partition. Changed the driver to make sure that the PF will get all the queues and vectors it wants to fill out its destiny. Cleans up reporting to only print the port and VEB stats if it is the first partition of a multiplexed port. Catherine cleans up some duplicated code by simply removing the duplicate code. Kamil cleans up the driver by removing an un-needed endian conversion because it is already done by a register read function. Jesse fixes a variable width of a datatype, where a u16 should have been a u32. Also cleans up debug_read_register() to resolve some sparse warnings. Updates the driver to use prefetch() to get the next Tx descriptor, like in ixgbe, to improve performance. Akeem moves around code to enable/disable loopback so that other non-SRIOV supported driver functions can take advantage of the changes. Anjali cleans up the logging for adding/deleting FD-SB filters, since ethtool shows all the filters on an interface. Updates the driver to use l4_tunnel type generically to keep code flow simple. Simplifies the RSS code since the driver initializes the rss_size_max in sw_init. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-07net: dsa: mv88e6352: Add support for EEEGuenter Roeck1-0/+2
Enable EEE support for MV88E6352. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-07net: dsa: mv88e6xxx: Add EEE supportGuenter Roeck2-0/+54
EEE configuration is similar for the various MV88E6xxx chips. Add generic support for it. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-07net: bcmgenet: rework Rx queue initPetri Gynther1-16/+27
In preparation for supporting multiple Rx queues: 1. Move the initialization of priv->num_rx_bds, priv->rx_bds, and priv->rx_cbs from bcmgenet_init_rx_ring() to bcmgenet_init_dma() since they are not specific to a single Rx queue. Mimics the Tx init model where priv->num_tx_bds, priv->tx_bds, and priv->tx_cbs are initialized in bcmgenet_init_dma(). 2. Program DMA_MBUF_DONE_THRESH = 1 so that future Rx queues Q0-Q15 will get per-packet Rx interrupt. 3. Group DMA_START_ADDR, RDMA_READ_PTR, RDMA_WRITE_PTR, and DMA_END_ADDR initialization together. Mimics the Tx init model. 4. There is 1-to-1 mapping between RxCBs and RxBDs. Precalculate RxCB->bd_addr so that it can be used in the future. Signed-off-by: Petri Gynther <pgynther@google.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-07Merge branch 'macb-next'David S. Miller11-673/+503
Merge branch 'macb-next' Boris Brezillon says: ==================== net/macb: merge at91_ether driver into macb driver The rm9200 boards use the dedicated at91_ether driver instead of the regular macb driver. Both the macb and at91_ether drivers can be compiled as separated modules. Since the at91_ether driver uses code from the macb driver, at91_ether.ko depends on macb.ko. However the macb.ko module always fails to load on rm9200 boards: the macb_probe() function expects a hclk clock which doesn't exist on rm9200. Then the at91_ether.ko can't be loaded in turn due to unresolved dependencies. This series of patches fix this issue by merging at91_ether into macb. Patch 1 is fixing a problem that might happen when enabling ARM multi-platform suppot. Changes since v3: - move "net: macb: remove #if defined(CONFIG_ARCH_AT91) sections" patch into this series to avoid dependency on other patch series. Changes since v2: - rebase after changed brought by commit "net: macb: remove #if defined(CONFIG_ARCH_AT91) sections" Changes since v1: - rework probe functions to share common probing logic ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-07net/macb: merge at91_ether driver into macb driverCyrille Pitchen5-655/+484
macb and at91_ether drivers can be compiled as modules, but the at91_ether driver use some functions and variables defined in the macb one, thus creating a dependency on the macb driver. Since these drivers are sharing the same logic we can easily merge at91_ether into macb. In order to factorize common probing logic we've added an ->init() function to struct macb_config (the structure associated with the compatible string), and moved macb specific init code from macb_probe to macb_init. Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Tested-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-07net/macb: unify clock managementCyrille Pitchen1-17/+14
Most of the functions from the Common Clk Framework handle NULL pointer as input argument. Since the TX clock is optional, we now set tx_clk to NULL value instead of ERR_PTR(-ENOENT) when this clock is not available. This simplifies the clock management and avoid the need to test tx_clk value. Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-07net: macb: remove #if defined(CONFIG_ARCH_AT91) sectionsBoris BREZILLON2-15/+19
With multi platform support those sections could lead to unexpected behavior if both ARCH_AT91 and another ARM SoC using the MACB IP are selected. Add two new capabilities to encode the default MII mode and the presence of a CLKEN bit in USRIO register. Then define the appropriate config for IPs embedded in at91 SoCs. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Reviewed-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-07ARM: at91/dt: fix macb compatible stringsBoris BREZILLON6-6/+6
Some at91 SoCs embed a 10/100 Mbit Ethernet IP, that is based on the at91sam9260 SoC. Fix at91 DTs accordingly. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Reviewed-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-07i40e: Strip configfs codeGreg Rose5-374/+0
The use of configfs is not allowed in network drivers. Strip the code that uses it. Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-07i40e/i40evf: Bump versionSravanthi Tangeda2-2/+2
Bump i40e to 1.2.12 and i40evf to 1.2.6. Change-ID: I641871da3a9abd396b28eda5744a4d68493c1400 Signed-off-by: Sravanthi Tangeda <sravanthi.tangeda@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-07i40e/i40evf: enable prefetch of Tx descriptors during cleanupJesse Brandeburg2-0/+4
Performance can be improved a bit by imitating ixgbe and using prefetch to get us the next Tx descriptor. Change-ID: Ice7ffd4cd0ce87c35295059bdb7972a7f53723aa Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-07i40e: Simplify code for rss_size_max configAnjali Singhai Jain1-5/+2
We initialize the pf->rss_size_max in sw_init now and hence this code can be simplified. Change-ID: I1a7abc837604a40bc65e6c6b21190b909ed6bb21 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-07i40e/i40evf: Simplify tunnel selection logicAnjali Singhai Jain2-4/+20
Use l4_tunnel type generically to keep code flow simple. Change-ID: Ic52287e3b1ca4204e6b6e13431890c1a6ae9c422 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-07i40e: FD filters flush policy changesAnjali Singhai Jain3-20/+67
Since GLQF_FDCNT_0 register now has the right offset, use it to simplify our FD flush flow. If the filter add error happens to be for SB we just auto disable SB. If filter error happens to be for ATR, auto disable ATR and mark the state to FD_FLUSH_REQUESTED. Which gets cleared when flush completes. If we are entering flush too quickly (< 30 seconds) and we have quite a few SB rules, its time to disable ATR for good. Since SB + ATR rules is most likely making the FD table unstable. ATR can be re-enabled by turning ntuple off (ethtool -K ntuple off) and will remain off after turning ntuple on till it gets unstable again. Change-ID: I2154a2e0a5d44851a2f0eb8731e2f1d4a4d1acbc Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-07i40e: Avoid logs while adding/deleting FD-SB filtersAnjali Singhai Jain1-3/+3
It is not necessary to print FD filter add/delete log with normal debug settings because ethtool -n ethx shows all the FD-SB filters on an interface. The log can still be turned on through higher debug levels and it will continue to print a log if there was an error in the add/delete process. Change-ID: I67db2baf49e2075d2f537de40f7895e5b02cd610 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-07i40e: print port stats only on partition 1Shannon Nelson1-3/+3
Only print the port and veb stats if this is the first partition of a multiplexed port. Change-ID: I7ce0c323cdee5cfd2e54d8bea5b0b9102987e671 Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-07i40e: Move code to enable/disable Loopback to the main fileAkeem G Abodunrin3-70/+68
Since changes made to enable or disable loopback for all VSIs, not only SR-IOV or PCIOV, then it became necessary to move the associated functions to main file - so that other non-SRIOV supported driver can take advantage of the changes. Change-ID: I59a49fd23a6136acda5e16f8d1e5ac7fd9c5fc05 Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-07i40e: rework vector reservationShannon Nelson1-19/+56
The initial problem solved here is that the vector allocation was trying too hard to save vectors for VMDq, to the point of not giving the PF enough when in a tight situation such as an NPAR partition. This change makes sure that the PF will get all the queues and vectors it wants to fill out its destiny. Essentially, nothing is specially reserved for VMDq, it simply gets whatever is left after the PF, FCoE, and FD sideband get what they want. Additionally, the calculations for the reservations were harder to follow than necessary, so I've made it more straight forward. Change-ID: I99b384f104535b686c690b8ef0a787559485c8d4 Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-07i40e: clean up debug_read_registerJesse Brandeburg1-6/+4
There were some additional spaces and strange (double swapping) logic in this function that I started looking at because sparse was warning. This fixes the sparse warning and fixes up the other issues. Change-ID: I72a91a4197cd45921602649040e6bd25e5f17c0a Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-07i40e: store msg_enable in the right sizeJesse Brandeburg1-1/+1
The kernel returns a u32 for netif_msg_init, and we were storing it in a u16. Fix the width of the datatype. Change-ID: I4b23326e5707c91cd59325c5a1ccb2ba7a3974fc Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-07i40e: Remove unneeded conversionKamil Krawczyk1-1/+0
Remove LE16 to CPU endianes conversion from i40e_read_nvm_word_srctl function, as it's already done by register read function. Change-ID: I739f0f20a9b8e18223e54c0ca5443e63d75da878 Signed-off-by: Kamil Krawczyk <kamil.krawczyk@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-07i40e: Remove duplicate codeCatherine Sullivan1-8/+0
This series of code was repeated twice, remove one of them. Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-07i40e/i40evf: Refactor i40e_debug_aq and make some functions staticShannon Nelson6-54/+54
A sparse complaint in i40e_debug_aq in a funky buffer write goes away by straightening out the code out to something less convoluted. Also fix some other sparse warnings while we are at it, making some functions static and using NULL instead of 0. Change-ID: I93907534fe1f1f675830774b3d14ecf1c6ffc9a0 Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-06rocker: sparse: fix dynamic allocation on stack warningScott Feldman2-1/+3
Signed-off-by: Scott Feldman <sfeldma@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-06rocker: quiet sparce endianess warningsScott Feldman1-3/+5
Signed-off-by: Scott Feldman <sfeldma@gmail.com> Reviewed-by: Jonathan Toppins <jtoppins@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-06ebpf: bpf_map_*: fix linker error on avr32 and openrisc archDaniel Borkmann1-0/+5
Fengguang reported, that on openrisc and avr32 architectures, we get the following linker errors on *_defconfig builds that have no bpf syscall support: net/built-in.o:(.rodata+0x1cd0): undefined reference to `bpf_map_lookup_elem_proto' net/built-in.o:(.rodata+0x1cd4): undefined reference to `bpf_map_update_elem_proto' net/built-in.o:(.rodata+0x1cd8): undefined reference to `bpf_map_delete_elem_proto' Fix it up by providing built-in weak definitions of the symbols, so they can be overridden when the syscall is enabled. I think the issue might be that gcc is not able to optimize all that away. This patch fixes the linker errors for me, tested with Fengguang's make.cross [1] script. [1] https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross Reported-by: Fengguang Wu <fengguang.wu@intel.com> Fixes: d4052c4aea0c ("ebpf: remove CONFIG_BPF_SYSCALL ifdefs in socket filter code") Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-06net: gro: remove obsolete code from skb_gro_receive()Eric Dumazet1-44/+1
Some drivers use copybreak to copy tiny frames into smaller skb, and this smaller skb might not have skb->head_frag set for various reasons. skb_gro_receive() currently doesn't allow to aggregate the smaller skb into the previous GRO packet if this GRO packet has at least 2 MSS in it. Following workload easily demonstrates the problem. netperf -t TCP_RR -H target -- -r 3000,3000 (tcpdump shows one GRO packet with 2 MSS, plus one additional packet of 104 bytes that should have been appended.) It turns out that we can remove code from skb_gro_receive(), because commit 8a29111c7ca6 ("net: gro: allow to build full sized skb") and its followups removed the assumption that a GRO packet with a frag_list had to have an empty head. Removing this code allows the aggregation of the last (incomplete) frame in some RPC workloads. Note that tcp_gro_receive() already takes care of forcing a flush if necessary, including this case. If we want to avoid using frag_list in the first place (in forwarding workloads for example, as the outgoing NIC is generally not able to cope with skbs having a frag_list), we need to address this separately. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-06ax25: remove unneeded NULL test in ax_xmit()Dan Carpenter1-5/+3
We get a static checker warning here on devel kernels: drivers/net/hamradio/mkiss.c:560 ax_xmit() warn: variable dereferenced before check 'skb' (see line 532) It turns out that the NULL check can be deleted. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-06Merge branch 'mlx4-qcn'David S. Miller9-6/+364
Or Gerlitz says: ==================== Add QCN support to the DCB NL layer This series from Shani Michaeli adds support for the IEEE QCN attribute to the kernel DCB NL stack, and implementation in the mlx4 driver which programs the firmware according to the admin directives. changes from V0: - applied feedback from John and added his acked-by to patch #1 ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-06net/mlx4_en: Add QCN parameters and statistics handlingShani Michaeli2-0/+219
Implement the IEEE DCB handlers for set/get QCN parameters and statistics reading per TC. Signed-off-by: Shani Michaeli <shanim@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-06net/mlx4_core: Add basic elements for QCNShani Michaeli4-3/+35
Add device capability, firmware command opcode and etc prior elements needed for QCN suppprt. Disable SRIOV VF view/access for QCN is disabled. While here, remove a redundant offset definition into the QUERY_DEV_CAP mailbox. Signed-off-by: Shani Michaeli <shanim@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-06net/dcb: Add IEEE QCN attributeShani Michaeli3-3/+110
As specified in 802.1Qau spec. Add this optional attribute to the DCB netlink layer. To allow for application to use the new attribute, NIC drivers should implement and register the callbacks ieee_getqcn, ieee_setqcn and ieee_getqcnstats. The QCN attribute holds a set of parameters for management, and a set of statistics to provide informative data on Congestion-Control defined by this spec. Signed-off-by: Shani Michaeli <shanim@mellanox.com> Signed-off-by: Shachar Raindel <raindel@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Acked-by: John Fastabend <john.r.fastabend@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-06Merge branch 'fib_trie-next'David S. Miller1-406/+401
Alexander Duyck says: ==================== The rest of the FIB patches (add key_vector to fib_table) This patch series is the rest of what I had originally planned for this kernel release. It adds a structure called key_vector which is embedded within every tnode, leaf, and the trie root itself. By doing this we can navigate from any point within the trie to any other point fairly quickly and avoiding NULL pointer checks in the case of a backtrace. As a result we can pipeline things a bit further since we don't have to worry about dereferencing NULL in a backtrace. This can amount to significant savings on a long backtrace. I decided to drop the up-level code as that conflicts with combining the main and local tries. I have one patch as an RFC that currently combines the tries however it still needs some work as we have to split the local and main tries in the event of custom rules being defined. As such we are probably going to be doing some more hacking on fib_table_flush_external as that will also need to flush the local entries from the main trie and place them back in the local trie. v2: Rebased on the switchdev FIB offload work ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-06fib_trie: Add key vector to root, return parent key_vector in resizeAlexander Duyck1-232/+201
This change makes it so that the root of the trie contains a key_vector, by doing this we make room to essentially collapse the entire trie by at least one cache line as we can store the information about the tnode or leaf that is pointed to in the root. Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-06fib_trie: Move parent from key_vector to tnodeAlexander Duyck1-6/+5
This change pulls the parent pointer from the key_vector and places it in the tnode structure. Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-06fib_trie: Pull empty_children and full_children into tnodeAlexander Duyck1-15/+16
This pulls the information about the child array out of the key_vector and places it in the tnode since that is where it is needed. Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-06fib_trie: Move rcu from key_vector to tnode, add accessors.Alexander Duyck1-18/+16
RCU is only needed once for the entire node, not once per key_vector so we can pull that out and move it to the tnode structure. In addition add accessors to be used inside the RCU functions so that we can more easily get from the key vector to either the tnode or the trie pointers. Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-06fib_trie: Add tnode struct as a container for fields not needed in key_vectorAlexander Duyck1-33/+39
This change pulls the fields not explicitly needed in the key_vector and placed them in the new tnode structure. By doing this we will eventually be able to reduce the key_vector down to 16 bytes on 64 bit systems, and 12 bytes on 32 bit systems. Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-06fib_trie: Rename tnode_child_length to child_lengthAlexander Duyck1-24/+29
We are now checking the length of a key_vector instead of a tnode so it makes sense to probably just rename this to child_length since it would probably even be applicable to a leaf. Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-06fib_trie: replace tnode_get_child functions with get_child macrosAlexander Duyck1-36/+24
I am replacing the tnode_get_child call with get_child since we are techically pulling the child out of a key_vector now and not a tnode. Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>