summaryrefslogtreecommitdiffstats
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2019-08-01net: qcom/emac: use devm_platform_ioremap_resource() to simplify codeYueHaibing1-5/+2
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-08-01net: mediatek: use devm_platform_ioremap_resource() to simplify codeYueHaibing1-2/+1
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-08-01net: dsa: bcm_sf2: use devm_platform_ioremap_resource() to simplify codeYueHaibing1-3/+1
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-08-01net: dsa: b53: use devm_platform_ioremap_resource() to simplify codeYueHaibing1-6/+2
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-08-01net: dsa: lantiq: use devm_platform_ioremap_resource() to simplify codeYueHaibing1-7/+3
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-08-01mvpp2: use devm_platform_ioremap_resource() to simplify codeYueHaibing1-7/+3
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-31Merge tag 'mlx5-updates-2019-07-29' of ↵David S. Miller12-255/+424
git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2019-07-29 This series includes updates to mlx5 driver, 1) Simplifications, cleanup and warning prints improvements 2) From Vlad Buslov: Refactor mlx5 tc flow handling for unlocked execution (Part 1) Currently, all cls API hardware offloads driver callbacks require caller to hold rtnl lock when calling them. Cls API has already been updated to update software filters in parallel (on classifiers that support unlocked execution), however hardware offloads code still obtains rtnl lock before calling driver tc callbacks. This set implements partial support for unlocked execution that is leveraged by follow up refactorings in specific mlx5 tc subsystems and patch to cls API that implements API that allows drivers to register their callbacks as rtnl-unlocked. In mlx5 tc code mlx5e_tc_flow is the main structure that is used to represent tc filter. Currently, code the structure itself and its handlers in both tc and eswitch layers do not implement any kind of synchronizations and assume external global synchronization provided by rtnl lock instead. Implement following changes to remove dependency on rtnl lock in flow handling code that are intended to be used a groundwork for following changes to provide fully rtnl-independent mlx5 tc: - Extend struct mlx5e_tc_flow with atomic reference counter and rcu to allow concurrent access from multiple tc and neigh update workqueue instances without introducing any additional locks specific to the structure. Its 'flags' field type is changed to atomic bitmask ops which is necessary for tc to interact with other concurrent tc instances or concurrent neigh update that need to skip flows that are not fully initialized (new INIT_DONE flow flag) and can change the flags according to neighbor state (flipping OFFLOADED flag). - Protect unready flows list by new uplink_priv->unready_flows_lock mutex. - Convert calls to netdev APIs that require rtnl lock in flow handling code to their rcu counterparts. - Modify eswitch code that is called from tc layer and assume implicit external synchronization to be concurrency safe: change esw->offloads.num_flows type to atomic integer and re-arrange esw->state_lock usage to protect additional data. Some of approaches to synchronizations presented in this patch set are quite complicated (lockless concurrent usage of data structures with rcu and reference counting, using fine-grained locking when necessary, retry mechanisms to handle concurrent insertion of another instance of data structure with same key, etc.). This is necessary to allow calling the firmware in parallel in most cases, which is the main motivation of this change since firmware calls are mach heavier operation than atomic operations, multitude of locks and potential multiple retries during concurrent accesses to same elements. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-31staging/octeon: Fix build error without CONFIG_NETDEVICESYueHaibing1-1/+2
While do COMPILE_TEST build without CONFIG_NETDEVICES, we get Kconfig warning: WARNING: unmet direct dependencies detected for PHYLIB Depends on [n]: NETDEVICES [=n] Selected by [y]: - OCTEON_ETHERNET [=y] && STAGING [=y] && (CAVIUM_OCTEON_SOC && NETDEVICES [=n] || COMPILE_TEST [=y]) Reported-by: Hulk Robot <hulkci@huawei.com> Reported-by: Mark Brown <broonie@kernel.org> Fixes: 171a9bae68c7 ("staging/octeon: Allow test build on !MIPS") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-31Merge tag 'mac80211-next-for-davem-2019-07-31' of ↵David S. Miller9-44/+29
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Johannes Berg says: ==================== We have a reasonably large number of changes: * lots more HE (802.11ax) support, particularly things relevant for the the AP side, but also mesh support * debugfs cleanups from Greg * some more work on extended key ID * start using genl parallel_ops, as preparation for weaning ourselves off RTNL and getting parallelism * various other changes all over ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-31myri10ge: remove unneeded variableDing Xiang1-2/+1
"error" is unneeded,just return 0 Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-31net: ag71xx: Slighly simplify code in 'ag71xx_rings_init()'Christophe JAILLET1-1/+1
A few lines above, we have: tx_size = BIT(tx->order); So use 'tx_size' directly to be consistent with the way 'rx->descs_cpu' and 'rx->descs_dma' are computed below. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-31mac80211_hwsim: fill boottime_ns in netlink RX pathJohannes Berg1-0/+7
Give a proper boottime_ns value for netlink RX to avoid scan issues here. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Link: https://lore.kernel.org/r/20190729160605.1074-1-johannes@sipsolutions.net Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-07-30net: dsa: ksz: Add Microchip KSZ8795 DSA driverTristram Ha8-1/+2469
Add Microchip KSZ8795 DSA driver. Signed-off-by: Tristram Ha <Tristram.Ha@microchip.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Andrew Lunn <andrew@lunn.ch> Cc: David S. Miller <davem@davemloft.net> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Tristram Ha <Tristram.Ha@microchip.com> Cc: Vivien Didelot <vivien.didelot@gmail.com> Cc: Woojung Huh <woojung.huh@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-30vhost/vsock: split packets to send using multiple buffersStefano Garzarella1-18/+48
If the packets to sent to the guest are bigger than the buffer available, we can split them, using multiple buffers and fixing the length in the packet header. This is safe since virtio-vsock supports only stream sockets. Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-30vsock/virtio: limit the memory used per-socketStefano Garzarella1-0/+2
Since virtio-vsock was introduced, the buffers filled by the host and pushed to the guest using the vring, are directly queued in a per-socket list. These buffers are preallocated by the guest with a fixed size (4 KB). The maximum amount of memory used by each socket should be controlled by the credit mechanism. The default credit available per-socket is 256 KB, but if we use only 1 byte per packet, the guest can queue up to 262144 of 4 KB buffers, using up to 1 GB of memory per-socket. In addition, the guest will continue to fill the vring with new 4 KB free buffers to avoid starvation of other sockets. This patch mitigates this issue copying the payload of small packets (< 128 bytes) into the buffer of last packet queued, in order to avoid wasting memory. Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-30net: Remove dev_err() usage after platform_get_irq()Stephen Boyd20-68/+15
We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Cc: "David S. Miller" <davem@davemloft.net> Cc: Kalle Valo <kvalo@codeaurora.org> Cc: Saeed Mahameed <saeedm@mellanox.com> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Cc: Felix Fietkau <nbd@nbd.name> Cc: Lorenzo Bianconi <lorenzo@kernel.org> Cc: netdev@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-30net: Use skb_frag_off accessorsJonathan Lemon33-54/+54
Use accessor functions for skb fragment's page_offset instead of direct references, in preparation for bvec conversion. Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29net/mlx5e: Protect tc flow table with mutexVlad Buslov2-0/+9
TC flow table is created when first flow is added, and destroyed when last flow is removed. This assumes that all accesses to the table are externally synchronized with rtnl lock. To remove dependency on rtnl lock, add new mutex mlx5e_tc_table->t_lock and use it to protect the flow table. Signed-off-by: Vlad Buslov <vladbu@mellanox.com> Reviewed-by: Jianbo Liu <jianbol@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
2019-07-29net/mlx5e: Rely on rcu instead of rtnl lock when getting upper devVlad Buslov2-2/+18
Function netdev_master_upper_dev_get() generates warning if caller doesn't hold rtnl lock. Modify rules update path to use rcu version of that function. Signed-off-by: Vlad Buslov <vladbu@mellanox.com> Reviewed-by: Jianbo Liu <jianbol@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
2019-07-29net/mlx5e: Eswitch, use state_lock to synchronize vlan changeVlad Buslov2-12/+20
esw->state_lock is already used to protect vlan vport configuration change. However, all preparation and correctness checks, and code that sets vport data are not protected by this lock and assume external synchronization by rtnl lock. In order to remove dependency on rtnl lock, extend esw->state_lock protection to whole eswitch vlan add/del functions. Signed-off-by: Vlad Buslov <vladbu@mellanox.com> Reviewed-by: Jianbo Liu <jianbol@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
2019-07-29net/mlx5e: Eswitch, change offloads num_flows type to atomic64Vlad Buslov3-6/+8
Eswitch implements its own locking by means of state_lock mutex and multiple fine-grained lock in containing data structures, and is supposed to not rely on rtnl lock. However, eswitch offloads num_flows type is a regular long long integer and cannot be modified concurrently. This is an implicit assumptions that mlx5 tc is serialized (by rtnl lock or any other means). In order to remove implicit dependency on rtnl lock, change num_flows type to atomic64 to allow concurrent modifications. Signed-off-by: Vlad Buslov <vladbu@mellanox.com> Reviewed-by: Jianbo Liu <jianbol@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
2019-07-29net/mlx5e: Protect unready flows with dedicated lockVlad Buslov3-7/+40
In order to remove dependency on rtnl lock for protecting unready_flows list when reoffloading unready flows on workqueue, extend representor uplink private structure with dedicated 'unready_flows_lock' mutex. Take the lock in all users of unready_flows list before accessing it. Implement helper functions to add and delete unready flow. Signed-off-by: Vlad Buslov <vladbu@mellanox.com> Reviewed-by: Jianbo Liu <jianbol@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
2019-07-29net/mlx5e: Protect tc flows hashtable with rcuVlad Buslov1-7/+40
In order to remove dependency on rtnl lock, access to tc flows hashtable must be explicitly protected from concurrent flows removal. Extend tc flow structure with rcu to allow concurrent parallel access. Use rcu read lock to safely lookup flow in tc flows hash table, and take reference to it. Use rcu free for flow deletion to accommodate concurrent stats requests. Add new DELETED flow flag. Imlement new flow_flag_test_and_set() helper that is used to set a flag and return its previous value. Use it to atomically set the flag in mlx5e_delete_flower() to guarantee that flow can only be deleted once, even when same flow is deleted concurrently by multiple tasks. Signed-off-by: Vlad Buslov <vladbu@mellanox.com> Reviewed-by: Jianbo Liu <jianbol@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
2019-07-29net/mlx5e: Change flow flags type to unsigned longVlad Buslov4-97/+149
To remove dependency on rtnl lock and allow concurrent modification of 'flags' field of tc flow structure, change flow flag type to unsigned long and use atomic bit ops for reading and changing the flags. Implement auxiliary functions for setting, resetting and getting specific flag, and for checking most often used flag values. Always set flags with smp_mb__before_atomic() to ensure that all mlx5e_tc_flow are updated before concurrent readers can read new flags value. Rearrange all code paths to actually set flow->rule[] pointers before setting the OFFLOADED flag. On read side, use smp_mb__after_atomic() when accessing flags to ensure that offload-related flow fields are only read after the flags. Signed-off-by: Vlad Buslov <vladbu@mellanox.com> Reviewed-by: Jianbo Liu <jianbol@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
2019-07-29net/mlx5e: Extend tc flow struct with reference counterVlad Buslov1-88/+105
With new classifier type that doesn't require rtnl lock, following invariant holds: - Filter with specified cookie created only once. - Filter with specified cookie deleted only once. - Stats updates can be performed in parallel to each other. Extend tc flow with rcu and reference counter. To protect from concurrent delete, get reference to tc flow when: - Reading flow stats. - Accessing flow in neigh update handler. - Accessing flow in neigh update used value handler. Only free flow when reference counter reached zero. Modify flow cleanup to account for flows that could be not fully initialized by checking if flow is actually in the list of corresponding mod_hdr, hairpin and encap entries. Don't cleanup flow directly in case of error to allow concurrent neigh update (neigh update will be modified to always take reference to flow when using it). Signed-off-by: Vlad Buslov <vladbu@mellanox.com> Reviewed-by: Jianbo Liu <jianbol@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
2019-07-29net/mlx5e: Simplify get_route_and_out_devs helper functionEli Britstein1-12/+7
The helper function has "if" branches that do the same. Merge them to simplify the code. Signed-off-by: Eli Britstein <elibr@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
2019-07-29net/mlx5e: Fix unnecessary flow_block_cb_is_busy callwenxu1-4/+0
When call flow_block_cb_is_busy. The indr_priv is guaranteed to NULL ptr. So there is no need to call flow_bock_cb_is_busy. Fixes: 0d4fd02e7199 ("net: flow_offload: add flow_block_cb_is_busy() and use it") Signed-off-by: wenxu <wenxu@ucloud.cn> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
2019-07-29net/mlx5e: Improve ethtool rxnfc callback structureSaeed Mahameed3-22/+28
Don't choose who implements the rxnfc "get/set" callbacks according to CONFIG_MLX5_EN_RXNFC, instead have the callbacks always available and delegate to a function of a different driver module when needed (en_fs_ethtool.c), have stubs in en/fs.h to fallback to when en_fs_ethtool.c is compiled out, to avoid complications and ifdefs in en_main.c. Reviewed-by: Tariq Toukan <tariqt@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
2019-07-29net/mlx5e: Avoid warning print when not requiredSaeed Mahameed1-1/+2
When disabling CQE compression in favor of time-stamping, don't show a warning when CQE compression is already disabled. Reviewed-by: Tariq Toukan <tariqt@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
2019-07-29net/mlx5e: Print a warning when LRO feature is dropped or not allowedHuy Nguyen1-2/+3
When user enables LRO via ethtool and if the RQ mode is legacy, mlx5e_fix_features drops the request without any explanation. Add netdev_warn to cover this case. Fixes: 6c3a823e1e9c ("net/mlx5e: RX, Remove HW LRO support in legacy RQ") Signed-off-by: Huy Nguyen <huyn@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
2019-07-29bnxt_en: Add PCI IDs for 57500 series NPAR devices.Michael Chan1-0/+12
Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29bnxt_en: Support all variants of the 5750X chip family.Michael Chan1-2/+6
Define the 57508, 57504, and 57502 chip IDs that are all part of the BNXT_CHIP_P5 family of chips. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29bnxt_en: Refactor bnxt_init_one() and turn on TPA support on 57500 chips.Michael Chan2-53/+67
With the new TPA feature in the 57500 chips, we need to discover the feature first before setting up the netdev features. Refactor the the firmware probe and init logic more cleanly into 2 functions and and make these calls before setting up the netdev features. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29bnxt_en: Support TPA counters on 57500 chips.Michael Chan1-10/+31
Support the new expanded TPA v2 counters on 57500 B0 chips for ethtool -S. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29bnxt_en: Allocate the larger per-ring statistics block for 57500 chips.Michael Chan2-2/+9
The new TPA implemantation has additional TPA counters that extend the per-ring statistics block. Allocate the proper size accordingly. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29bnxt_en: Refactor ethtool ring statistics logic.Michael Chan1-50/+70
The current code assumes that the per ring statistics counters are fixed. In newer chips that support a newer version of TPA, the TPA counters are also changed. Refactor the code by defining these counter names in arrays so that it is easy to add a new array for a new set of counters supported by the newer chips. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29bnxt_en: Add hardware GRO setup function for 57500 chips.Michael Chan1-1/+32
Add a more optimized hardware GRO function to setup the SKB on 57500 chips. Some workaround code is no longer needed on 57500 chips and the pseudo checksum is also calculated in hardware, so no need to do the software pseudo checksum in the driver. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29bnxt_en: Add TPA ID mapping logic for 57500 chips.Michael Chan2-2/+53
The new TPA feature on 57500 supports a larger number of concurrent TPAs (up to 1024) divided among the functions. We need to add some logic to map the hardware TPA ID to a software index that keeps track of each TPA in progress. A 1:1 direct mapping without translation would be too wasteful as we would have to allocate 1024 TPA structures for each RX ring on each PCI function. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29bnxt_en: Add fast path logic for TPA on 57500 chips.Michael Chan1-25/+75
With all the previous refactoring, the TPA fast path can now be modified slightly to support TPA on the new chips. The main difference is that the agg completions are retrieved differently using the bnxt_get_tpa_agg_p5() function on the new chips. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29bnxt_en: Set TPA GRO mode flags on 57500 chips properly.Michael Chan1-3/+5
On 57500 chips, hardware GRO mode cannot be determined from the TPA end, so we need to check bp->flags to determine if we are in hardware GRO mode or not. Modify bnxt_set_features so that the TPA flags in bp->flags don't change until the device is closed. This will ensure that the fast path can safely rely on bp->flags to determine the TPA mode. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29bnxt_en: Refactor tunneled hardware GRO logic.Michael Chan1-41/+28
The 2 GRO functions to set up the hardware GRO SKB fields for 2 different hardware chips have practically identical logic for tunneled packets. Refactor the logic into a separate bnxt_gro_tunnel() function that can be used by both functions. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29bnxt_en: Handle standalone RX_AGG completions.Michael Chan1-2/+18
On the new 57500 chips, these new RX_AGG completions are not coalesced at the TPA_END completion. Handle these by storing them in the array in the bnxt_tpa_info struct, as they are seen when processing the CMPL ring. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29bnxt_en: Expand bnxt_tpa_info struct to support 57500 chips.Michael Chan2-6/+41
Add an aggregation array to bnxt_tpa_info struct to keep track of the aggregation completions. The aggregation completions are not completed at the TPA_END completion on 57500 chips so we need to keep track of them. The array is only allocated on the new chips when required. An agg_count field is also added to keep track of the number of these completions. The maximum concurrent TPA is now discovered from firmware instead of the hardcoded 64. Add a new bp->max_tpa to keep track of maximum configured TPA. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29bnxt_en: Refactor TPA logic.Michael Chan1-48/+69
Refactor the TPA logic slightly, so that the code can be more easily extended to support TPA on the new 57500 chips. In particular, the logic to get the next aggregation completion is refactored into a new function bnxt_get_agg() so that this operation is made more generalized. This operation will be different on the new chip in TPA mode. The logic to recycle the aggregation buffers has a new start index parameter added for the same purpose. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29bnxt_en: Add TPA structure definitions for BCM57500 chips.Michael Chan1-0/+67
The new chips have a slightly modified TPA interface for LRO/GRO_HW. Modify the TPA structures so that the same structures can also be used on the new chips. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29bnxt_en: Update firmware interface spec. to 1.10.0.89.Michael Chan2-16/+108
Among the changes are new CoS discard counters and new ctx_hw_stats_ext struct for the latest 5750X B0 chips. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29net: dsa: mv88e6xxx: avoid some redundant vtu load/purge operationsRasmus Villemoes1-1/+3
We have an ERPS (Ethernet Ring Protection Switching) setup involving mv88e6250 switches which we're in the process of switching to a BSP based on the mainline driver. Breaking any link in the ring works as expected, with the ring reconfiguring itself quickly and traffic continuing with almost no noticable drops. However, when plugging back the cable, we see 5+ second stalls. This has been tracked down to the userspace application in charge of the protocol missing a few CCM messages on the good link (the one that was not unplugged), causing it to broadcast a "signal fail". That message eventually reaches its link partner, which responds by blocking the port. Meanwhile, the first node has continued to block the port with the just plugged-in cable, breaking the network. And the reason for those missing CCM messages has in turn been tracked down to the VTU apparently being too busy servicing load/purge operations that the normal lookups are delayed. Initial state, the link between C and D is blocked in software. _____________________ / \ | | A ----- B ----- C *---- D Unplug the cable between C and D. _____________________ / \ | | A ----- B ----- C * * D Reestablish the link between C and D. _____________________ / \ | | A ----- B ----- C *---- D Somehow, enough VTU/ATU operations happen inside C that prevents the application from receving the CCM messages from B in a timely manner, so a Signal Fail message is sent by C. When B receives that, it responds by blocking its port. _____________________ / \ | | A ----- B *---* C *---- D Very shortly after this, the signal fail condition clears on the BC link (some CCM messages finally make it through), so C unblocks the port. However, a guard timer inside B prevents it from removing the blocking before 5 seconds have elapsed. It is not unlikely that our userspace ERPS implementation could be smarter and/or is simply buggy. However, this patch fixes the symptoms we see, and is a small optimization that should not break anything (knock wood). The idea is simply to avoid doing an VTU load of an entry identical to the one already present. To do that, we need to know whether mv88e6xxx_vtu_get() actually found an existing entry, or has just prepared a struct mv88e6xxx_vtu_entry for us to load. To that end, let vlan->valid be an output parameter. The other two callers of mv88e6xxx_vtu_get() are not affected by this patch since they pass new=false. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29r8169: make use of xmit_moreHeiner Kallweit1-5/+12
There was a previous attempt to use xmit_more, but the change had to be reverted because under load sometimes a transmit timeout occurred [0]. Maybe this was caused by a missing memory barrier, the new attempt keeps the memory barrier before the call to netif_stop_queue like it is used by the driver as of today. The new attempt also changes the order of some calls as suggested by Eric. [0] https://lkml.org/lkml/2019/2/10/39 Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29staging/octeon: Allow test build on !MIPSMatthew Wilcox (Oracle)14-78/+1466
Add compile test support by moving all includes of files under asm/octeon into octeon-ethernet.h, and if we're not on MIPS, stub out all the calls into the octeon support code in octeon-stubs.h Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29net: ag71xx: use resource_size for the ioremap sizeDing Xiang1-1/+1
use resource_size to calcuate ioremap size and make the code simpler. Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com> Signed-off-by: David S. Miller <davem@davemloft.net>