22 Sep, 2020
19 commits
-
Enable ALDPS(Advanced Link Down Power Saving) to save power when
link down.Signed-off-by: Jisheng Zhang
Reviewed-by: Andrew Lunn
Signed-off-by: David S. Miller -
There is an off-by-one error in rtl8366rb_is_vlan_valid()
making VLANs 0..4094 valid while it should be 1..4095.
Fix it.Fixes: d8652956cf37 ("net: dsa: realtek-smi: Add Realtek SMI driver")
Signed-off-by: Linus Walleij
Reviewed-by: Florian Fainelli
Signed-off-by: David S. Miller -
In mt7531_cpu_port_config(), if the variable port is neither 5 nor 6,
then variable interface will be used uninitialised. Change the function
to return -EINVAL in this case.As the return value of mt7531_cpu_port_config() is never checked
(even though it returns an int) add a check in the correct place so that
the error can be passed up the call stack. Now that we correctly handle
errors thrown in this function, also check the return value of
mt7531_mac_config() in case an error occurs here. Also add misisng
checks to mt7530_setup() and mt7531_setup(), which are another level
further up the call stack.Fixes: c288575f7810 ("net: dsa: mt7530: Add the support of MT7531 switch")
Addresses-Coverity: 1496993 ("Uninitialized variables")
Signed-off-by: Alex Dewar
Signed-off-by: David S. Miller -
Currently the backlog status in not exposed to user-space.
Since long backlogs (or simply not empty ones) can be a
source of noticeable latency, -RT deployments need some way
to inspect it.Additionally, there isn't a direct match between 'softnet_stat'
lines and the related CPU - sd for offline CPUs are not dumped -
so this patch also includes the CPU id into such entry.Signed-off-by: Paolo Abeni
Signed-off-by: David S. Miller -
Shay Agroskin says:
====================
Update license and polish ENA driver codeThis series adds the following:
- Change driver's license into SPDX format
- Capitalize all log prints in ENA driver
- Fix issues raised by static checkers
- Improve code readability by adding functions, fix spelling
mistakes etc.
- Update driver's documentationChanged from previous version:
v1->v2: dropped patch that transforms pr_* log prints into dev_* prints
====================Signed-off-by: David S. Miller
-
The PCI vendor IDs in the documentation inaccurately describe the ENA
devices. For example, the 1d0f:ec20 can have LLQ support. The driver
loads in LLQ mode by default, and a message is printed to the kernel
ring if the mode isn't supported by the device, so the device table
isn't needed.Also, LLQ can support various entry sizes, so the documentation is
updated to reflect that.Interrupt moderation description is also updated to be more accurate.
Signed-off-by: Shay Agroskin
Signed-off-by: David S. Miller -
After running Sparse checker on the driver using
make C=1 M=drivers/net/ethernet/amazon/enathe only error that is thrown is:
sparse: sparse: Using plain integer as NULL pointer
about the line
struct ena_calc_queue_size_ctx calc_queue_ctx = { 0 };This patch fixes this warning, thus making our driver free (for now) of
Sparse errors/warnings.To make a more complete work, this patch also fixes all static warnings
that were found using an internal static checker.Signed-off-by: Ido Segev
Signed-off-by: Shay Agroskin
Signed-off-by: David S. Miller -
The formal name changes to "ENA_ADMIN_RSS_INDIRECTION_TABLE_CONFIG".
Indirection is the ability to reference "something" using "something else"
instead of the value itself.
Indirection table, as the name implies, is the ability to reference
CPU/Queue value using hash-to-CPU table instead of CPU/Queue itself.This patch renames the variable keys_num, which describes the number of
words in the RSS hash key, to key_parts which makes its purpose clearer
in RSS context.Signed-off-by: Amit Bernstein
Signed-off-by: Shay Agroskin
Signed-off-by: David S. Miller -
The placement policy is printed in the process of queue creation in
ena_up(). No need to print it in ena_probe().Signed-off-by: Arthur Kiyanovski
Signed-off-by: Shay Agroskin
Signed-off-by: David S. Miller -
Capitalize all log strings printed by the ena driver to make their
format uniform across it.Also fix indentation, spelling mistakes and comments to improve code
readability. This also includes adding comments to macros/enums whose
purpose might be difficult to understand.
Separate some code into functions to make it easier to understand the
purpose of these lines.Signed-off-by: Amit Bernstein
Signed-off-by: Shay Agroskin
Signed-off-by: David S. Miller -
Make log prints in ena_netdev use the same log functions as the rest of
the driver.For the sake of consistency, all prints in ena_netdev file were
converted into netif_* format except where netdev struct isn't yet
defined. For these places, dev_* log functions are used (similar to
the patch for ena_com files).This commit leaves some corner cases which would be changed in a
future patch.Signed-off-by: Amit Bernstein
Signed-off-by: Shay Agroskin
Signed-off-by: David S. Miller -
All ena files should now use SPDX format in their license string. This
doesn't change the license of the files, but rather states the same
license in fewer words.Also update the license years in some of the files.
Signed-off-by: Shay Agroskin
Signed-off-by: David S. Miller -
Simplify the return expression.
Signed-off-by: Qinglang Miao
Signed-off-by: David S. Miller -
Simplify the return expression.
Signed-off-by: Qinglang Miao
Signed-off-by: David S. Miller -
Simplify the return expression.
Signed-off-by: Qinglang Miao
Reviewed-by: Claudiu Manoil
Signed-off-by: David S. Miller -
Simplify the return expression.
Signed-off-by: Qinglang Miao
Signed-off-by: David S. Miller -
Simplify the return expression.
Signed-off-by: Qinglang Miao
Reviewed-by: Ido Schimmel
Signed-off-by: David S. Miller -
Signed-off-by: Qinglang Miao
Signed-off-by: David S. Miller -
Simplify the return expression.
Signed-off-by: Qinglang Miao
Signed-off-by: David S. Miller
21 Sep, 2020
16 commits
-
sg_init_table zeroes its first argument, so the allocation of that argument
doesn't have to.the semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)//
@@
expression x,n,flags;
@@x =
- kcalloc
+ kmalloc_array
(n,sizeof(*x),flags)
...
sg_init_table(x,n)
//Signed-off-by: Julia Lawall
Signed-off-by: David S. Miller -
sg_init_table zeroes its first argument, so the allocation of that argument
doesn't have to.the semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)//
@@
expression x,n,flags;
@@x =
- kcalloc
+ kmalloc_array
(n,sizeof(struct scatterlist),flags)
...
sg_init_table(x,n)
//Signed-off-by: Julia Lawall
Signed-off-by: David S. Miller -
Vladimir Oltean says:
====================
DSA with VLAN filtering and offloading mastersThis series attempts to make DSA VLANs work in the presence of a master
interface that is:
- filtering, so it drops VLANs that aren't explicitly added to its
filter list
- offloading, so the old assumptions in the tagging code about there
being a VLAN tag in the skb are not necessarily true anymore.For more context:
https://lore.kernel.org/netdev/20200910150738.mwhh2i6j2qgacqev@skbuf/This probably marks the beginning of a series of patches in which DSA
starts paying much more attention to its upper interfaces, not only for
VLAN purposes but also for address filtering and for management of the
CPU flooding domain. There was a comment from Florian on whether we
could factor some of the mlxsw logic into some common functionality, but
it doesn't look so. This seems bound to be open-coded, but frankly there
isn't a lot to it.Changes in v2:
Applied Florian's cosmetic suggestion in patch 4/9.
====================Signed-off-by: David S. Miller
-
Check whether there is any hwaccel VLAN tag on RX, and if there is,
treat it as the tag_8021q header.Signed-off-by: Vladimir Oltean
Reviewed-by: Florian Fainelli
Signed-off-by: David S. Miller -
The whole purpose of tag_8021q is to send VLAN-tagged traffic to the
CPU, from which the driver can decode the source port and switch id.Currently this only works if the VLAN filtering on the master is
disabled. Change that by explicitly adding code to tag_8021q.c to add
the VLANs corresponding to the tags to the filter of the master
interface.Because we now need to call vlan_vid_add, then we also need to hold the
RTNL mutex. Propagate that requirement to the callers of dsa_8021q_setup
and modify the existing call sites as appropriate. Note that one call
path, sja1105_best_effort_vlan_filtering_set -> sja1105_vlan_filtering
-> sja1105_setup_8021q_tagging, was already holding this lock.Signed-off-by: Vladimir Oltean
Reviewed-by: Florian Fainelli
Signed-off-by: David S. Miller -
Most DSA switch tags shift the EtherType to the right, causing the
master to not parse the VLAN as VLAN.
However, not all switches do that (example: tail tags, tag_8021q etc),
and if the DSA master has "rx-vlan-filter: on" in ethtool -k, then we
have a problem.Therefore, we could populate the VLAN table of the master, just in case
(for some switches it will not make a difference), so that network I/O
can work even with a VLAN filtering master.Signed-off-by: Vladimir Oltean
Reviewed-by: Florian Fainelli
Signed-off-by: David S. Miller -
When the bridge has VLAN awareness disabled there isn't any duplication
of functionality, since the bridge does not process VLAN. Don't deny
adding 8021q uppers to DSA switch ports in that case. The switch is
supposed to simply pass traffic leaving the VLAN tag as-is, and the
stack will happily strip the VLAN tag for all 8021q uppers that exist.We need to ensure that there are no 8021q uppers when the user attempts
to enable bridge vlan_filtering.Signed-off-by: Vladimir Oltean
Reviewed-by: Florian Fainelli
Signed-off-by: David S. Miller -
The current logic beats me a little bit. The comment that "bridge skips
-EOPNOTSUPP, so skip the prepare phase" was introduced in commit
fb2dabad69f0 ("net: dsa: support VLAN filtering switchdev attr").I'm not sure:
(a) ok, the bridge skips -EOPNOTSUPP, but, so what, where are we
returning -EOPNOTSUPP?
(b) even if we are, and I'm just not seeing it, what is the causality
relationship between the bridge skipping -EOPNOTSUPP and DSA
skipping the prepare phase, and just returning zero?One thing is certain beyond doubt though, and that is that DSA currently
refuses VLAN filtering from the "commit" phase instead of "prepare", and
that this is not a good thing:ip link add br0 type bridge
ip link add br1 type bridge vlan_filtering 1
ip link set swp2 master br0
ip link set swp3 master br1
[ 3790.379389] 001: sja1105 spi0.1: VLAN filtering is a global setting
[ 3790.379399] 001: ------------[ cut here ]------------
[ 3790.379403] 001: WARNING: CPU: 1 PID: 515 at net/switchdev/switchdev.c:157 switchdev_port_attr_set_now+0x9c/0xa4
[ 3790.379420] 001: swp3: Commit of attribute (id=6) failed.
[ 3790.379533] 001: [] (switchdev_port_attr_set_now) from [] (nbp_vlan_init+0x84/0x148)
[ 3790.379544] 001: [] (nbp_vlan_init) from [] (br_add_if+0x514/0x670)
[ 3790.379554] 001: [] (br_add_if) from [] (do_setlink+0x38c/0xab0)
[ 3790.379565] 001: [] (do_setlink) from [] (__rtnl_newlink+0x44c/0x748)
[ 3790.379573] 001: [] (__rtnl_newlink) from [] (rtnl_newlink+0x44/0x60)
[ 3790.379580] 001: [] (rtnl_newlink) from [] (rtnetlink_rcv_msg+0x124/0x2f8)
[ 3790.379590] 001: [] (rtnetlink_rcv_msg) from [] (netlink_rcv_skb+0xb8/0x110)
[ 3790.379806] 001: ---[ end trace 0000000000000002 ]---
[ 3790.379819] 001: sja1105 spi0.1 swp3: failed to initialize vlan filtering on this portSo move the current logic that may fail (except ds->ops->port_vlan_filtering,
that is way harder) into the prepare stage of the switchdev transaction.Signed-off-by: Vladimir Oltean
Reviewed-by: Florian Fainelli
Signed-off-by: David S. Miller -
This is checking for the following order of operations, and makes sure
to deny that configuration:ip link add link swp2 name swp2.100 type vlan id 100
ip link add br0 type bridge vlan_filtering 1
ip link set swp2 master br0
bridge vlan add dev swp2 vid 100Instead of using vlan_for_each(), which looks at the VLAN filters
installed with vlan_vid_add(), just track the 8021q uppers. This has the
advantage of freeing up the vlan_vid_add() call for actual VLAN
filtering.There is another change in this patch. The check is moved in slave.c,
from switch.c. I don't think it makes sense to have this 8021q upper
check for each switch port that gets notified of that VLAN addition
(these include DSA links and CPU ports, we know those can't have 8021q
uppers because they don't have a net_device registered for them), so
just do it in slave.c, for that one slave interface.Signed-off-by: Vladimir Oltean
Reviewed-by: Florian Fainelli
Signed-off-by: David S. Miller -
DSA tries to prevent having a VLAN added by a bridge and by an 802.1Q
upper at the same time. It does that by checking the VID in
.ndo_vlan_rx_add_vid(), since that's something that the 8021q module
calls, via vlan_vid_add(). When a VLAN matches in both subsystems, this
check returns -EBUSY.However the vlan_vid_add() function isn't specific to the 8021q module
in any way at all. It is simply the kernel's way to tell an interface to
add a VLAN to its RX filter and not drop that VLAN. So there's no reason
to return -EBUSY when somebody tries to call vlan_vid_add() for a VLAN
that was installed by the bridge. The proper behavior is to accept that
configuration.So what's wrong is how DSA checks that it has an 8021q upper. It should
look at the actual uppers for that, not just assume that the 8021q
module was somewhere in the call stack of .ndo_vlan_rx_add_vid().Signed-off-by: Vladimir Oltean
Reviewed-by: Florian Fainelli
Signed-off-by: David S. Miller -
We'll be adding a new check in the PRECHANGEUPPER notifier, where we'll
need to check some VLAN uppers. It is hard to do that when there is
already a function named dsa_slave_upper_vlan_check. So rename this one.Not to mention that this function probably shouldn't have started with
"dsa_slave_" in the first place, since the struct net_device argument
isn't a DSA slave, but an 8021q upper of one.Signed-off-by: Vladimir Oltean
Reviewed-by: Florian Fainelli
Signed-off-by: David S. Miller -
There doesn't seem to be any strong technical reason for doing it this
way, but we'll be adding more checks for invalid upper device
configurations, and it will be easier to have them all grouped under
PRECHANGEUPPER.Tested that it still works:
ip link set br0 type bridge vlan_filtering 1
ip link add link swp2 name swp2.100 type vlan id 100
ip link set swp2.100 master br0
[ 20.321312] br0: port 5(swp2.100) entered blocking state
[ 20.326711] br0: port 5(swp2.100) entered disabled state
Error: dsa_core: Cannot enslave VLAN device into VLAN aware bridge.
[ 20.346549] br0: port 5(swp2.100) entered blocking state
[ 20.351957] br0: port 5(swp2.100) entered disabled stateSigned-off-by: Vladimir Oltean
Reviewed-by: Florian Fainelli
Signed-off-by: David S. Miller -
Fixes the following W=1 kernel build warning(s):
drivers/net/ethernet/marvell/mvneta.c:754:6: warning:
variable 'dummy' set but not used [-Wunused-but-set-variable]
754 | u32 dummy;
| ^~~~~This variable is not used in function mvneta_mib_counters_clear(), so
remove it to avoid build warning.Signed-off-by: Zhang Changzhong
Signed-off-by: David S. Miller -
When budget is non-zero, skb_unref() has already handled the
NULL checking.When budget is zero, the dev_consume_skb_any() has handled NULL
checking in __dev_kfree_skb_irq(), or dev_kfree_skb() which also
ultimately call skb_unref().So remove the unnecessary checking in napi_consume_skb().
Signed-off-by: Yunsheng Lin
Signed-off-by: David S. Miller -
Avoid copying skb_shared_info frags array in mvneta_swbm_build_skb() since
__build_skb_around() does not overwrite itSigned-off-by: Lorenzo Bianconi
Signed-off-by: David S. Miller -
We go to lengths to determine whether the PVID should be set
for this port or not, and then fail to take it into account.
Fix this oversight.Fixes: d8652956cf37 ("net: dsa: realtek-smi: Add Realtek SMI driver")
Signed-off-by: Linus Walleij
Signed-off-by: David S. Miller
20 Sep, 2020
5 commits
-
Dan Murphy says:
====================
100base Fx link modesAs per patch https://lore.kernel.org/patchwork/patch/1300241/ the link
modes for 100base FX full and half duplex modes did not exist. Adding
these link modes to the core and ethtool allow devices like the
DP83822, DP83869 and Broadcomm PHYs to properly advertise the correct
mode for Fiber 100Mbps.Corresponding user land ethtool patches are available but rely on
these patches to be applied first.
====================Signed-off-by: David S. Miller
-
Update the fiber advertisement for speed and duplex modes with the
100base-FX full and half linkmode entries.Signed-off-by: Dan Murphy
Reviewed-by: Andrew Lunn
Reviewed-by: Florian Fainelli
Signed-off-by: David S. Miller -
Add the ability to advertise the Fiber connection if the strap or the
op-mode is configured for 100Base-FX.Auto negotiation is not supported on this PHY when in fiber mode.
Signed-off-by: Dan Murphy
Reviewed-by: Andrew Lunn
Reviewed-by: Florian Fainelli
Signed-off-by: David S. Miller -
Add entries for the 100base-FX full and half duplex supported modes.
$ ethtool eth0
Supported ports: [ FIBRE ]
Supported link modes: 100baseFX/Half 100baseFX/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: No
Supported FEC modes: Not reported
Advertised link modes: 100baseFX/Half 100baseFX/Full
Advertised pause frame use: No
Advertised auto-negotiation: No
Advertised FEC modes: Not reported
Speed: 100Mb/s
Duplex: Full
Auto-negotiation: off
Port: MII
PHYAD: 1
Transceiver: external
Supports Wake-on: gs
Wake-on: d
SecureOn password: 00:00:00:00:00:00
Current message level: 0x00000000 (0)Link detected: yes
Signed-off-by: Dan Murphy
Reviewed-by: Andrew Lunn
Reviewed-by: Florian Fainelli
Signed-off-by: David S. Miller -
skb->nh.raw has been renamed as skb->network_header in 2007, in
commit b0e380b1d8a8 ("[SK_BUFF]: unions of just one member don't get
anything done, kill them")So here we change it to the new name.
Cc: Willem de Bruijn
Signed-off-by: Xie He
Signed-off-by: David S. Miller