summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-08-03fib: Fix undef compile warningYueHaibing
net/core/fib_rules.c:26:7: warning: "CONFIG_IP_MULTIPLE_TABLES" is not defined, evaluates to 0 [-Wundef] #elif CONFIG_IP_MULTIPLE_TABLES ^~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 8b66a6fd34f5 ("fib: fix another fib_rules_ops indirect call wrapper problem") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-By: Brian Vazquez <brianvv@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03mptcp: use mptcp_for_each_subflow in mptcp_stream_acceptGeliang Tang
Use mptcp_for_each_subflow in mptcp_stream_accept instead of open-coding. Signed-off-by: Geliang Tang <geliangtang@gmail.com> Acked-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03Merge tag 'mac80211-next-for-davem-2020-08-03' of ↵David S. Miller
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Johannes Berg says: ==================== A few more changes, notably: * handle new SAE (WPA3 authentication) status codes in the correct way * fix a while that should be an if instead, avoiding infinite loops * handle beacon filtering changing better ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net: stmmac: fix failed to suspend if phy based WOL is enabledJisheng Zhang
With the latest net-next tree, if test suspend/resume after enabling WOL, we get error as below: [ 487.086365] dpm_run_callback(): mdio_bus_suspend+0x0/0x30 returns -16 [ 487.086375] PM: Device stmmac-0:00 failed to suspend: error -16 -16 means -EBUSY, this is because I didn't enable wakeup of the correct device when implementing phy based WOL feature. To be honest, I caught the issue when implementing phy based WOL and then fix it locally, but forgot to amend the phy based wol patch. Today, I found the issue by testing net-next tree. Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03seg6_iptunnel: Refactor seg6_lwt_headroom out of uapi headerIoana-Ruxandra Stăncioi
Refactor the function seg6_lwt_headroom out of the seg6_iptunnel.h uapi header, because it is only used in seg6_iptunnel.c. Moreover, it is only used in the kernel code, as indicated by the "#ifdef __KERNEL__". Suggested-by: David Miller <davem@davemloft.net> Signed-off-by: Ioana-Ruxandra Stăncioi <stancioi@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03tcp: apply a floor of 1 for RTT samples from TCP timestampsJianfeng Wang
For retransmitted packets, TCP needs to resort to using TCP timestamps for computing RTT samples. In the common case where the data and ACK fall in the same 1-millisecond interval, TCP senders with millisecond- granularity TCP timestamps compute a ca_rtt_us of 0. This ca_rtt_us of 0 propagates to rs->rtt_us. This value of 0 can cause performance problems for congestion control modules. For example, in BBR, the zero min_rtt sample can bring the min_rtt and BDP estimate down to 0, reduce snd_cwnd and result in a low throughput. It would be hard to mitigate this with filtering in the congestion control module, because the proper floor to apply would depend on the method of RTT sampling (using timestamp options or internally-saved transmission timestamps). This fix applies a floor of 1 for the RTT sample delta from TCP timestamps, so that seq_rtt_us, ca_rtt_us, and rs->rtt_us will be at least 1 * (USEC_PER_SEC / TCP_TS_HZ). Note that the receiver RTT computation in tcp_rcv_rtt_measure() and min_rtt computation in tcp_update_rtt_min() both already apply a floor of 1 timestamp tick, so this commit makes the code more consistent in avoiding this edge case of a value of 0. Signed-off-by: Jianfeng Wang <jfwang@google.com> Signed-off-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Kevin Yang <yyd@google.com> Acked-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03tipc: Use is_broadcast_ether_addr() instead of memcmp()Huang Guobin
Using is_broadcast_ether_addr() instead of directly use memcmp() to determine if the ethernet address is broadcast address. spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Huang Guobin <huangguobin4@huawei.com> Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03Merge branch 'DPAA-FMan-driver-fixes'David S. Miller
Florinel Iordache says: ==================== DPAA FMan driver fixes Here are several fixes for the DPAA FMan driver. v2 changes: * corrected patch 4 by removing the line added by mistake * used longer fixes tags with the first 12 characters of the SHA-1 ID v3 changes: * remove the empty line inserted after fixes tag ==================== Acked-by: Madalin Bucur <madalin.bucur@oss.nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03fsl/fman: fix eth hash table allocationFlorinel Iordache
Fix memory allocation for ethernet address hash table. The code was wrongly allocating an array for eth hash table which is incorrect because this is the main structure for eth hash table (struct eth_hash_t) that contains inside a number of elements. Fixes: 57ba4c9b56d8 ("fsl/fman: Add FMan MAC support") Signed-off-by: Florinel Iordache <florinel.iordache@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03fsl/fman: check dereferencing null pointerFlorinel Iordache
Add a safe check to avoid dereferencing null pointer Fixes: 57ba4c9b56d8 ("fsl/fman: Add FMan MAC support") Signed-off-by: Florinel Iordache <florinel.iordache@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03fsl/fman: fix unreachable codeFlorinel Iordache
The parameter 'priority' is incorrectly forced to zero which ultimately induces logically dead code in the subsequent lines. Fixes: 57ba4c9b56d8 ("fsl/fman: Add FMan MAC support") Signed-off-by: Florinel Iordache <florinel.iordache@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03fsl/fman: fix dereference null return valueFlorinel Iordache
Check before using returned value to avoid dereferencing null pointer. Fixes: 18a6c85fcc78 ("fsl/fman: Add FMan Port Support") Signed-off-by: Florinel Iordache <florinel.iordache@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03fsl/fman: use 32-bit unsigned integerFlorinel Iordache
Potentially overflowing expression (ts_freq << 16 and intgr << 16) declared as type u32 (32-bit unsigned) is evaluated using 32-bit arithmetic and then used in a context that expects an expression of type u64 (64-bit unsigned) which ultimately is used as 16-bit unsigned by typecasting to u16. Fixed by using an unsigned 32-bit integer since the value is truncated anyway in the end. Fixes: 414fd46e7762 ("fsl/fman: Add FMan support") Signed-off-by: Florinel Iordache <florinel.iordache@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-nextDavid S. Miller
Pablo Neira Ayuso says: ==================== Netfilter updates for net-next 1) UAF in chain binding support from previous batch, from Dan Carpenter. 2) Queue up delayed work to expire connections with no destination, from Andrew Sy Kim. 3) Use fallthrough pseudo-keyword, from Gustavo A. R. Silva. 4) Replace HTTP links with HTTPS, from Alexander A. Klimov. 5) Remove superfluous null header checks in ip6tables, from Gaurav Singh. 6) Add extended netlink error reporting for expression. 7) Report EEXIST on overlapping chain, set elements and flowtable devices. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net: spider_net: Remove a useless memsetChristophe JAILLET
Avoid a memset after a call to 'dma_alloc_coherent()'. This is useless since commit 518a2f1925c3 ("dma-mapping: zero memory returned from dma_alloc_*") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net: spider_net: Fix the size used in a 'dma_free_coherent()' callChristophe JAILLET
Update the size used in 'dma_free_coherent()' in order to match the one used in the corresponding 'dma_alloc_coherent()', in 'spider_net_init_chain()'. Fixes: d4ed8f8d1fb7 ("Spidernet DMA coalescing") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net: sgi: ioc3-eth: Fix the size used in some 'dma_free_coherent()' callsChristophe JAILLET
Update the size used in 'dma_free_coherent()' in order to match the one used in the corresponding 'dma_alloc_coherent()'. Fixes: 369a782af0f1 ("net: sgi: ioc3-eth: ensure tx ring is 16k aligned.") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03liquidio: Fix wrong return value in cn23xx_get_pf_num()Tianjia Zhang
On an error exit path, a negative error code should be returned instead of a positive return value. Fixes: 0c45d7fe12c7e ("liquidio: fix use of pf in pass-through mode in a virtual machine") Cc: Rick Farrington <ricardo.farrington@cavium.com> Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net/enetc: Fix wrong return value in enetc_psfp_parse_clsflower()Tianjia Zhang
In the case of invalid rule, a positive value EINVAL is returned here. I think this is a typo error. It is necessary to return an error value. Cc: Po Liu <Po.Liu@nxp.com> Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net: ethernet: aquantia: Fix wrong return valueTianjia Zhang
In function hw_atl_a0_hw_multicast_list_set(), when an invalid request is encountered, a negative error code should be returned. Fixes: bab6de8fd180b ("net: ethernet: aquantia: Atlantic A0 and B0 specific functions") Cc: David VomLehn <vomlehn@texas.net> Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03atm: idt77252: avoid accessing the data mapped to streaming DMAJia-Ju Bai
In queue_skb(), skb->data is mapped to streaming DMA on line 850: dma_map_single(..., skb->data, ...); Then skb->data is accessed on lines 862 and 863: tbd->word_4 = (skb->data[0] << 24) | (skb->data[1] << 16) | (skb->data[2] << 8) | (skb->data[3] << 0); and on lines 893 and 894: tbd->word_4 = (skb->data[0] << 24) | (skb->data[1] << 16) | (skb->data[2] << 8) | (skb->data[3] << 0); These accesses may cause data inconsistency between CPU cache and hardware. To fix this problem, the calculation result of skb->data is stored in a local variable before DMA mapping, and then the driver accesses this local variable instead of skb->data. Signed-off-by: Jia-Ju Bai <baijiaju@tsinghua.edu.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03atm: eni: avoid accessing the data mapped to streaming DMAJia-Ju Bai
In do_tx(), skb->data is mapped to streaming DMA on line 1111: paddr = dma_map_single(...,skb->data,DMA_TO_DEVICE); Then skb->data is accessed on line 1153: (skb->data[3] & 0xf) This access may cause data inconsistency between CPU cache and hardware. To fix this problem, skb->data[3] is assigned to a local variable before DMA mapping, and then the driver accesses this local variable instead of skb->data[3]. Signed-off-by: Jia-Ju Bai <baijiaju@tsinghua.edu.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net: phy: mdio-mvusb: select MDIO_DEVRES in KconfigBartosz Golaszewski
PHYLIB is not selected by the mvusb driver but it uses mdio devres helpers. Explicitly select MDIO_DEVRES in this driver's Kconfig entry. Reported-by: kernel test robot <lkp@intel.com> Fixes: 1814cff26739 ("net: phy: add a Kconfig option for mdio_devres") Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03appletalk: Fix atalk_proc_init() return pathVincent Duvert
Add a missing return statement to atalk_proc_init so it doesn't return -ENOMEM when successful. This allows the appletalk module to load properly. Fixes: e2bcd8b0ce6e ("appletalk: use remove_proc_subtree to simplify procfs code") Link: https://www.downtowndougbrown.com/2020/08/hacking-up-a-fix-for-the-broken-appletalk-kernel-module-in-linux-5-1-and-newer/ Reported-by: Christopher KOBAYASHI <chris@disavowed.jp> Reported-by: Doug Brown <doug@downtowndougbrown.com> Signed-off-by: Vincent Duvert <vincent.ldev@duvert.net> [lukas: add missing tags] Signed-off-by: Lukas Wunner <lukas@wunner.de> Cc: stable@vger.kernel.org # v5.1+ Cc: Yue Haibing <yuehaibing@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net: dsa: qca8k: Add 802.1q VLAN supportJonathan McDowell
This adds full 802.1q VLAN support to the qca8k, allowing the use of vlan_filtering and more complicated bridging setups than allowed by basic port VLAN support. Tested with a number of untagged ports with separate VLANs and then a trunk port with all the VLANs tagged on it. v3: - Pull QCA8K_PORT_VID_DEF changes into separate cleanup patch - Reverse Christmas tree notation for variable definitions - Use untagged instead of tagged for consistency v2: - Return sensible errnos on failure rather than -1 (rmk) - Style cleanups based on Florian's feedback - Silently allow VLAN 0 as device correctly treats this as no tag Signed-off-by: Jonathan McDowell <noodles@earth.li> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Acked-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net: dsa: qca8k: Add define for port VIDJonathan McDowell
Rather than using a magic value of 1 when configuring the port VIDs add a QCA8K_PORT_VID_DEF define and use that instead. Also fix up the bitmask in the process; the top 4 bits are reserved so this wasn't a problem, but only masking 12 bits is the correct approach. Signed-off-by: Jonathan McDowell <noodles@earth.li> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Acked-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03Merge branch '100GbE' of ↵David S. Miller
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2020-08-01 This series contains updates to the ice driver only. Wei Yongjun marks power management functions with __maybe_unused. Nick disables VLAN pruning in promiscuous mode and renames grst_delay to grst_timeout. Kiran modifies the check for linearization and corrects the vsi_id mask value. Vignesh replaces the use of flow profile locks to RSS profile locks for RSS rule removal. Destroys flow profile lock on clearing XLT table and clears extraction sequence entries. Jesse adds some statistics and removes an unreported one. Brett allows for 2 queue configuration for VFs. Surabhi adds a check for failed allocation of an extraction sequence table. Tony updates the PTYPE lookup table and makes other trivial fixes. Victor extends profile ID locks to be held until all references are completed. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net: Pass NULL to skb_network_protocol() when we don't care about vlan depthMiaohe Lin
When we don't care about vlan depth, we could pass NULL instead of the address of a unused local variable to skb_network_protocol() as a param. Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net: Use __skb_pagelen() directly in skb_cow_data()Miaohe Lin
In fact, skb_pagelen() - skb_headlen() is equal to __skb_pagelen(), use it directly to avoid unnecessary skb_headlen() call. Also fix the CHECK note of checkpatch.pl: Comparison to NULL could be written "!__pskb_pull_tail" Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net: qed: use eth_zero_addr() to clear mac addressMiaohe Lin
Use eth_zero_addr() to clear mac address instead of memset(). Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net: qede: use eth_zero_addr() to clear mac addressMiaohe Lin
Use eth_zero_addr() to clear mac address instead of memset(). Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03cxgb4: fix extracting IP addresses in TC-FLOWER rulesRahul Lakkireddy
commit c8729cac2a11 ("cxgb4: add ethtool n-tuple filter insertion") has removed checking control key for determining IP address types for TC-FLOWER rules, which causes all the rules being inserted to hardware to become IPv6 rule type always. So, add back the check to select the correct IP address type to extract and hence fix the correct rule type being inserted to hardware. Also, ethtool_rx_flow_key doesn't have any control key and instead directly sets the IPv4/IPv6 address keys. So, explicitly set the IP address type for ethtool n-tuple filters to reuse the same code. Fixes: c8729cac2a11 ("cxgb4: add ethtool n-tuple filter insertion") Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03cxgb4: fix check for running offline ethtool selftestRahul Lakkireddy
The flag indicating the selftest to run is a bitmask. So, fix the check. Also, the selftests will fail if adapter initialization has not been completed yet. So, add appropriate check and bail sooner. Fixes: 7235ffae3d2c ("cxgb4: add loopback ethtool self-test") Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03Merge branch 'ionic-txrx-updates'David S. Miller
Shannon Nelson says: ==================== ionic txrx updates These are a few patches to do some cleanup in the packet handling and give us more flexibility in tuning performance by allowing us to put Tx handling on separate interrupts when it makes sense for particular traffic loads. v3: simplified queue count change logging, removed unnecessary check for no count change v2: dropped the original patch 2 for ringsize change changed the separated tx/rx interrupts to use ethtool -L ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03ionic: separate interrupt for Tx and RxShannon Nelson
Add the capability to split the Tx queues onto their own interrupts with their own napi contexts. This gives the opportunity for more direct control of Tx interrupt handling, such as CPU affinity and interrupt coalescing, useful for some traffic loads. v2: use ethtool -L, not a vendor specific priv-flag v3: simplify logging, drop unnecessary "no-change" tests Reviewed-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03ionic: tx separate servicingShannon Nelson
We give the tx clean path its own budget and service routine in order to give a little more leeway to be more aggressive, and in preparation for coming changes. We've found this gives us a little better performance in some packet processing scenarios without hurting other scenarios. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03ionic: use fewer firmware doorbells on rx fillShannon Nelson
We really don't need to hit the Rx queue doorbell so many times, we can wait to the end and cause a little less thrash. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net: gre: recompute gre csum for sctp over gre tunnelsLorenzo Bianconi
The GRE tunnel can be used to transport traffic that does not rely on a Internet checksum (e.g. SCTP). The issue can be triggered creating a GRE or GRETAP tunnel and transmitting SCTP traffic ontop of it where CRC offload has been disabled. In order to fix the issue we need to recompute the GRE csum in gre_gso_segment() not relying on the inner checksum. The issue is still present when we have the CRC offload enabled. In this case we need to disable the CRC offload if we require GRE checksum since otherwise skb_checksum() will report a wrong value. Fixes: 90017accff61 ("sctp: Add GSO support") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net: bridge: clear bridge's private skb space on xmitNikolay Aleksandrov
We need to clear all of the bridge private skb variables as they can be stale due to the packet being recirculated through the stack and then transmitted through the bridge device. Similar memset is already done on bridge's input. We've seen cases where proxyarp_replied was 1 on routed multicast packets transmitted through the bridge to ports with neigh suppress which were getting dropped. Same thing can in theory happen with the port isolation bit as well. Fixes: 821f1b21cabb ("bridge: add new BR_NEIGH_SUPPRESS port flag to suppress arp and nd flood") Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03ipv6/addrconf: use a boolean to choose between UNREGISTER/DOWNFlorent Fourcot
"how" was used as a boolean. Change the type to bool, and improve variable name Signed-off-by: Florent Fourcot <florent.fourcot@wifirst.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03ipv6/addrconf: call addrconf_ifdown with consistent valuesFlorent Fourcot
Second parameter of addrconf_ifdown "how" is used as a boolean internally. It does not make sense to call it with something different of 0 or 1. This value is set to 2 in all git history. Signed-off-by: Florent Fourcot <florent.fourcot@wifirst.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03Merge branch 'net-openvswitch-masks-cache-enhancements'David S. Miller
Eelco Chaudron says: ==================== net: openvswitch: masks cache enhancements This patchset adds two enhancements to the Open vSwitch masks cache. Changes in v4 [patch 2/2 only]: - Remove null check before calling free_percpu() - Make ovs_dp_change() return appropriate error codes Changes in v3 [patch 2/2 only]: - Use is_power_of_2() function - Use array_size() function - Fix remaining sparse errors Changes in v2 [patch 2/2 only]: - Fix sparse warnings - Fix netlink policy items reported by Florian Westphal ==================== Signed-off-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net: openvswitch: make masks cache size configurableEelco Chaudron
This patch makes the masks cache size configurable, or with a size of 0, disable it. Reviewed-by: Paolo Abeni <pabeni@redhat.com> Reviewed-by: Tonghao Zhang <xiangxia.m.yue@gmail.com> Signed-off-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net: openvswitch: add masks cache hit counterEelco Chaudron
Add a counter that counts the number of masks cache hits, and export it through the megaflow netlink statistics. Reviewed-by: Paolo Abeni <pabeni@redhat.com> Reviewed-by: Tonghao Zhang <xiangxia.m.yue@gmail.com> Signed-off-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net: mvpp2: fix memory leak in mvpp2_rxLorenzo Bianconi
Release skb memory in mvpp2_rx() if mvpp2_rx_refill routine fails Fixes: b5015854674b ("net: mvpp2: fix refilling BM pools in RX path") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Acked-by: Matteo Croce <mcroce@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03ethtool: ethnl_set_linkmodes: remove redundant null checkGaurav Singh
info cannot be NULL here since its being accessed earlier in the function: nlmsg_parse(info->nlhdr...). Remove this redundant NULL check. Signed-off-by: Gaurav Singh <gaurav1086@gmail.com> Reviewed-by: Michal Kubecek <mkubecek@suse.cz> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03openvswitch: Prevent kernel-infoleak in ovs_ct_put_key()Peilin Ye
ovs_ct_put_key() is potentially copying uninitialized kernel stack memory into socket buffers, since the compiler may leave a 3-byte hole at the end of `struct ovs_key_ct_tuple_ipv4` and `struct ovs_key_ct_tuple_ipv6`. Fix it by initializing `orig` with memset(). Fixes: 9dd7f8907c37 ("openvswitch: Add original direction conntrack tuple to sw_flow_key.") Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net/sched: act_ct: fix miss set mru for ovs after defrag in act_ctwenxu
When openvswitch conntrack offload with act_ct action. Fragment packets defrag in the ingress tc act_ct action and miss the next chain. Then the packet pass to the openvswitch datapath without the mru. The over mtu packet will be dropped in output action in openvswitch for over mtu. "kernel: net2: dropped over-mtu packet: 1528 > 1500" This patch add mru in the tc_skb_ext for adefrag and miss next chain situation. And also add mru in the qdisc_skb_cb. The act_ct set the mru to the qdisc_skb_cb when the packet defrag. And When the chain miss, The mru is set to tc_skb_ext which can be got by ovs datapath. Fixes: b57dc7c13ea9 ("net/sched: Introduce action ct") Signed-off-by: wenxu <wenxu@ucloud.cn> Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03Merge branch 'Improve-MDIO-Ethernet-PHY-reset'David S. Miller
Bruno Thomsen says: ==================== Improve MDIO Ethernet PHY reset This patch series is a result of trying to upstream a new device tree for a TQMa7D based board[1][2]. Initial this DTS used some deprecated PHY reset properties on the FEC device; NXP Ethernet MAC also known as Freescale Fast Ethernet Controller. When switching from FEC properties[3]: "phy-reset-gpios" "phy-reset-duration" "phy-reset-post-delay" To MDIO PHY properties[4]: "reset-gpios" "reset-assert-us" "reset-deassert-us" The result was that no Ethernet PHY device was detected on boot. This issue could be worked around by disabling PHY type ID auto- detection by using "ethernet-phy-id0022.1560" as compatible string and not "ethernet-phy-ieee802.3-c22". Upstreaming a DTS with this workaround was not accepted, so I digged into the MDIO reset flow and found that it had a few missing parts compared to the deprecated FEC reset function. After some more testing and logic analyzer traces it was revealed that the failed PHY communication was due to missing initial device reset. I was suggested[5] in a earlier mail thread to use MDIO bus reset as that was performed before auto-detection, but current device tree binding was limited to reset assert in usec. Microchip/Micrel Ethernet PHYs recommended reset circuit[8], figure 7-12, is a little "slow" after reset deassert as that is left to a RC circuit with a tau of ~100ms; using a 10k PU resistor together with a 10uF decoupling capacitor. The diode in serie of the reset signal converts the GPIO push-pull output into a open-drain output. So a post reset delay in the range of 500-1000ms is needed, depending on component tolerances and general hardware design margins. In the first version of this patch series[6] I reused the "reset-delay-us" property for reset deassert in usec as that would cause 50/50% duty-cycle, but that would always apply. The solution in this patch series is to add a new MDIO bus property, so post reset delay is optional and configured separately. MDIO bus properties[7]: "reset-delay-us" "reset-post-delay-us" (new) I have not marked this with "Fixes:" as no single commit is the cause and historically this code has only supported MDIO devices that need reset after auto-detection. The patch series also uses a new flexible sleep helper function that was introduced in 5.8-rc1, so the driver uses the optimal sleep function depending on value loaded from device tree. Future work in this area could add new properties on the MDIO device, so reset points are configurable, e.g. no reset, before/after auto-detection or both. [1] https://lore.kernel.org/linux-devicetree/20200629114927.17379-2-bruno.thomsen@gmail.com/ [2] https://lore.kernel.org/linux-devicetree/20200716172611.5349-2-bruno.thomsen@gmail.com/ [3] https://elixir.bootlin.com/linux/v5.7.8/source/Documentation/devicetree/bindings/net/fsl-fec.txt#L44 [4] https://elixir.bootlin.com/linux/v5.8-rc4/source/Documentation/devicetree/bindings/net/mdio.yaml#L78 [5] https://lore.kernel.org/netdev/CAOMZO5DtYDomD8FDCZDwYCSr2AwNT81Ay4==aDxXyBxtyvPiJA@mail.gmail.com/ [6] https://lore.kernel.org/netdev/20200728090203.17313-1-bruno.thomsen@gmail.com/ [7] https://elixir.bootlin.com/linux/v5.8-rc4/source/Documentation/devicetree/bindings/net/mdio.yaml#L36 [8] http://ww1.microchip.com/downloads/en/DeviceDoc/00002202C.pdf ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-03net: mdio device: use flexible sleeping in reset functionBruno Thomsen
MDIO device reset assert and deassert length was created by usleep_range() but that does not ensure optimal handling of all the different values from device tree properties. By switching to the new flexible sleeping helper function, fsleep(), the correct delay function is called depending on delay length, e.g. udelay(), usleep_range() or msleep(). Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>