0d934416 | 05-Dec-2024 |
Daniel Machon <daniel.machon@microchip.com> |
net: sparx5: fix the maximum frame length register
[ Upstream commit ddd7ba006078a2bef5971b2dc5f8383d47f96207 ]
On port initialization, we configure the maximum frame length accepted by the receive
net: sparx5: fix the maximum frame length register
[ Upstream commit ddd7ba006078a2bef5971b2dc5f8383d47f96207 ]
On port initialization, we configure the maximum frame length accepted by the receive module associated with the port. This value is currently written to the MAX_LEN field of the DEV10G_MAC_ENA_CFG register, when in fact, it should be written to the DEV10G_MAC_MAXLEN_CFG register. Fix this.
Fixes: 946e7fd5053a ("net: sparx5: add port module support") Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
ff928d7b | 11-Apr-2024 |
Asbjørn Sloth Tønnesen <ast@fiberby.net> |
net: sparx5: flower: fix fragment flags handling
[ Upstream commit 68aba00483c7c4102429bcdfdece7289a8ab5c8e ]
I noticed that only 3 out of the 4 input bits were used, mt.key->flags & FLOW_DIS_IS_FR
net: sparx5: flower: fix fragment flags handling
[ Upstream commit 68aba00483c7c4102429bcdfdece7289a8ab5c8e ]
I noticed that only 3 out of the 4 input bits were used, mt.key->flags & FLOW_DIS_IS_FRAGMENT was never checked.
In order to avoid a complicated maze, I converted it to use a 16 byte mapping table.
As shown in the table below the old heuristics doesn't always do the right thing, ie. when FLOW_DIS_IS_FRAGMENT=1/1 then it used to only match follow-up fragment packets.
Here are all the combinations, and their resulting new/old VCAP key/mask filter:
/- FLOW_DIS_IS_FRAGMENT (key/mask) | /- FLOW_DIS_FIRST_FRAG (key/mask) | | /-- new VCAP fragment (key/mask) v v v v- old VCAP fragment (key/mask)
0/0 0/0 -/- -/- impossible (due to entry cond. on mask) 0/0 0/1 -/- 0/3 !! invalid (can't match non-fragment + follow-up frag) 0/0 1/0 -/- -/- impossible (key > mask) 0/0 1/1 1/3 1/3 first fragment
0/1 0/0 0/3 3/3 !! not fragmented 0/1 0/1 0/3 3/3 !! not fragmented (+ not first fragment) 0/1 1/0 -/- -/- impossible (key > mask) 0/1 1/1 -/- 1/3 !! invalid (non-fragment and first frag)
1/0 0/0 -/- -/- impossible (key > mask) 1/0 0/1 -/- -/- impossible (key > mask) 1/0 1/0 -/- -/- impossible (key > mask) 1/0 1/1 -/- -/- impossible (key > mask)
1/1 0/0 1/1 3/3 !! some fragment 1/1 0/1 3/3 3/3 follow-up fragment 1/1 1/0 -/- -/- impossible (key > mask) 1/1 1/1 1/3 1/3 first fragment
In the datasheet the VCAP fragment values are documented as: 0 = no fragment 1 = initial fragment 2 = suspicious fragment 3 = valid follow-up fragment
Result: 3 combinations match the old behavior, 3 combinations have been corrected, 2 combinations are now invalid, and fail, 8 combinations are impossible.
It should now be aligned with how FLOW_DIS_IS_FRAGMENT and FLOW_DIS_FIRST_FRAG is set in __skb_flow_dissect() in net/core/flow_dissector.c
Since the VCAP fragment values are not a bitfield, we have to ignore the suspicious fragment value, eg. when matching on any kind of fragment with FLOW_DIS_IS_FRAGMENT=1/1.
Only compile tested, and logic tested in userspace, as I unfortunately don't have access to this switch chip (yet).
Fixes: d6c2964db3fe ("net: microchip: sparx5: Adding more tc flower keys for the IS2 VCAP") Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com> Tested-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://lore.kernel.org/r/20240411111321.114095-1-ast@fiberby.net Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
fd770e85 | 01-Aug-2023 |
Vladimir Oltean <vladimir.oltean@nxp.com> |
net: remove phy_has_hwtstamp() -> phy_mii_ioctl() decision from converted drivers
It is desirable that the new .ndo_hwtstamp_set() API gives more uniformity, less overhead and future flexibility w.r
net: remove phy_has_hwtstamp() -> phy_mii_ioctl() decision from converted drivers
It is desirable that the new .ndo_hwtstamp_set() API gives more uniformity, less overhead and future flexibility w.r.t. the PHY timestamping behavior.
Currently there are some drivers which allow PHY timestamping through the procedure mentioned in Documentation/networking/timestamping.rst. They don't do anything locally if phy_has_hwtstamp() is set, except for lan966x which installs PTP packet traps.
Centralize that behavior in a new dev_set_hwtstamp_phylib() code function, which calls either phy_mii_ioctl() for the phylib PHY, or .ndo_hwtstamp_set() of the netdev, based on a single policy (currently simplistic: phy_has_hwtstamp()).
Any driver converted to .ndo_hwtstamp_set() will automatically opt into the centralized phylib timestamping policy. Unconverted drivers still get to choose whether they let the PHY handle timestamping or not.
Netdev drivers with integrated PHY drivers that don't use phylib presumably don't set dev->phydev, and those will always see HWTSTAMP_SOURCE_NETDEV requests even when converted. The timestamping policy will remain 100% up to them.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Horatiu Vultur <horatiu.vultur@microchip.com> Link: https://lore.kernel.org/r/20230801142824.1772134-13-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
e1d597ec | 07-Mar-2023 |
Steen Hegelund <steen.hegelund@microchip.com> |
net: microchip: sparx5: Add TC template support
This adds support for using the "template add" and "template destroy" functionality to change the port keyset configuration.
If the VCAP lookup alrea
net: microchip: sparx5: Add TC template support
This adds support for using the "template add" and "template destroy" functionality to change the port keyset configuration.
If the VCAP lookup already contains rules, the port keyset is left unchanged, as a change would make these rules unusable.
When the template is destroyed the port keyset configuration is restored. The filters using the template chain will automatically be deleted by the TC framework.
Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
d9f175b0 | 07-Mar-2023 |
Steen Hegelund <steen.hegelund@microchip.com> |
net: microchip: sparx5: Add port keyset changing functionality
With this its is now possible for clients (like TC) to change the port keyset configuration in the Sparx5 VCAPs.
This is typically don
net: microchip: sparx5: Add port keyset changing functionality
With this its is now possible for clients (like TC) to change the port keyset configuration in the Sparx5 VCAPs.
This is typically done per traffic class which is guided with the L3 protocol information. Before the change the current keyset configuration is collected in a list that is handed back to the client.
Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
52b28a93 | 14-Feb-2023 |
Steen Hegelund <steen.hegelund@microchip.com> |
net: microchip: sparx5: Add TC support for the ES0 VCAP
This enables the TC command to use the Sparx5 ES0 VCAP, and handling of rule links between IS0 and ES0.
Signed-off-by: Steen Hegelund <steen.
net: microchip: sparx5: Add TC support for the ES0 VCAP
This enables the TC command to use the Sparx5 ES0 VCAP, and handling of rule links between IS0 and ES0.
Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|
f2a77dd6 | 14-Feb-2023 |
Steen Hegelund <steen.hegelund@microchip.com> |
net: microchip: sparx5: Updated register interface with VCAP ES0 access
This provides access to the ES0 VCAP register targets
Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com> Signed-off
net: microchip: sparx5: Updated register interface with VCAP ES0 access
This provides access to the ES0 VCAP register targets
Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|
b5b0c364 | 14-Feb-2023 |
Steen Hegelund <steen.hegelund@microchip.com> |
net: microchip: sparx5: Improve the error handling for linked rules
Ensure that an error is returned if the VCAP instance was not found. The chain offset (diff) is allowed to be zero as this just me
net: microchip: sparx5: Improve the error handling for linked rules
Ensure that an error is returned if the VCAP instance was not found. The chain offset (diff) is allowed to be zero as this just means that the user did not request rules to be linked.
Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|