#
55e84c3c |
| 02-Sep-2024 |
Daniel Machon <daniel.machon@microchip.com> |
net: sparx5: use contiguous memory for tx buffers
Currently, the driver uses a linked list for storing the tx buffer addresses. This requires a good amount of extra bookkeeping code. Ditch the linke
net: sparx5: use contiguous memory for tx buffers
Currently, the driver uses a linked list for storing the tx buffer addresses. This requires a good amount of extra bookkeeping code. Ditch the linked list in favor of tx buffers being in the same contiguous memory space as the DCB's and the DB's. The FDMA library has a helper for this - so use that.
The tx buffer addresses are now retrieved as an offset into the FDMA memory space.
Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com> Reviewed-by: Jens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com> Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
0a5c4408 |
| 02-Sep-2024 |
Daniel Machon <daniel.machon@microchip.com> |
net: sparx5: use the FDMA library for allocation of tx buffers
Use the two functions: fdma_alloc_phys() and fdma_dcb_init() for tx buffer allocation and use the new buffers throughout.
In order to
net: sparx5: use the FDMA library for allocation of tx buffers
Use the two functions: fdma_alloc_phys() and fdma_dcb_init() for tx buffer allocation and use the new buffers throughout.
In order to replace the old buffers with the new ones, we have to do the following refactoring:
- use fdma_alloc_phys() and fdma_dcb_init()
- replace the variables: tx->dma, tx->first_entry and tx->curr_entry with the equivalents from the FDMA struct.
- replace uses of sparx5_db_hw and sparx5_tx_dcb_hw with fdma_db and fdma_dcb.
- add sparx5_fdma_tx_dataptr_cb callback for obtaining the dataptr.
- Initialize FDMA struct values.
Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com> Reviewed-by: Jens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com> Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
8fec1cea |
| 02-Sep-2024 |
Daniel Machon <daniel.machon@microchip.com> |
net: sparx5: use the FDMA library for allocation of rx buffers
Use the two functions: fdma_alloc_phys() and fdma_dcb_init() for rx buffer allocation and use the new buffers throughout.
In order to
net: sparx5: use the FDMA library for allocation of rx buffers
Use the two functions: fdma_alloc_phys() and fdma_dcb_init() for rx buffer allocation and use the new buffers throughout.
In order to replace the old buffers with the new ones, we have to do the following refactoring:
- use fdma_alloc_phys() and fdma_dcb_init()
- replace the variables: rx->dma, rx->dcb_entries and rx->last_entry with the equivalents from the FDMA struct.
- replace uses of sparx5_db_hw and sparx5_rx_dcb_hw with fdma_db and fdma_dcb.
- add sparx5_fdma_rx_dataptr_cb callback for obtaining the dataptr.
- Initialize FDMA struct values.
Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com> Reviewed-by: Jens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com> Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
e8218f7a |
| 02-Sep-2024 |
Daniel Machon <daniel.machon@microchip.com> |
net: sparx5: replace a few variables with new equivalent ones
Replace the old rx and tx variables: channel_id, FDMA_DCB_MAX, FDMA_RX_DCB_MAX_DBS, FDMA_TX_DCB_MAX_DBS, dcb_index and db_index with the
net: sparx5: replace a few variables with new equivalent ones
Replace the old rx and tx variables: channel_id, FDMA_DCB_MAX, FDMA_RX_DCB_MAX_DBS, FDMA_TX_DCB_MAX_DBS, dcb_index and db_index with the equivalents from the FDMA rx and tx structs. These variables are not entangled in any buffer allocation and can therefore be replaced in advance.
Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com> Reviewed-by: Jens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com> Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
947a72f4 |
| 02-Sep-2024 |
Daniel Machon <daniel.machon@microchip.com> |
net: sparx5: use FDMA library symbols
Include and use the new FDMA header, which now provides the required masks and bit offsets for operating on the DCB's and DB's.
Signed-off-by: Daniel Machon <d
net: sparx5: use FDMA library symbols
Include and use the new FDMA header, which now provides the required masks and bit offsets for operating on the DCB's and DB's.
Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com> Reviewed-by: Jens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com> Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
5af946f4 |
| 20-Apr-2024 |
Daniel Machon <daniel.machon@microchip.com> |
net: sparx5: add support for matchall mirror stats
Add support for tc matchall mirror stats. When a new matchall mirror rule is added, the baseline stats for that port is saved.
Signed-off-by: Dani
net: sparx5: add support for matchall mirror stats
Add support for tc matchall mirror stats. When a new matchall mirror rule is added, the baseline stats for that port is saved.
Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
4e50d72b |
| 20-Apr-2024 |
Daniel Machon <daniel.machon@microchip.com> |
net: sparx5: add port mirroring implementation
The hardware supports three independent mirroring probes. Each probe can be configured to mirror rx or tx traffic (direction).
Using tc matchall, it i
net: sparx5: add port mirroring implementation
The hardware supports three independent mirroring probes. Each probe can be configured to mirror rx or tx traffic (direction).
Using tc matchall, it is now possible to add a source port and a monitor port to a mirror probe. Depending on the mirror direction, rx or tx traffic from a source port will be mirrored to the monitor port.
A single source port can be a member of multiple mirror probes.
Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
1ede4acf |
| 20-Apr-2024 |
Daniel Machon <daniel.machon@microchip.com> |
net: sparx5: add bookkeeping code for matchall rules
In preparation for new tc matchall rules, we add a bit of bookkeeping code to keep track of them. The rules are identified by the cookie passed f
net: sparx5: add bookkeeping code for matchall rules
In preparation for new tc matchall rules, we add a bit of bookkeeping code to keep track of them. The rules are identified by the cookie passed from the tc stack.
Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
603ead96 |
| 19-Feb-2024 |
Horatiu Vultur <horatiu.vultur@microchip.com> |
net: sparx5: Add spinlock for frame transmission from CPU
Both registers used when doing manual injection or fdma injection are shared between all the net devices of the switch. It was noticed that
net: sparx5: Add spinlock for frame transmission from CPU
Both registers used when doing manual injection or fdma injection are shared between all the net devices of the switch. It was noticed that when having two process which each of them trying to inject frames on different ethernet ports, that the HW started to behave strange, by sending out more frames then expected. When doing fdma injection it is required to set the frame in the DCB and then make sure that the next pointer of the last DCB is invalid. But because there is no locks for this, then easily this pointer between the DCB can be broken and then it would create a loop of DCBs. And that means that the HW will continuously transmit these frames in a loop. Until the SW will break this loop. Therefore to fix this issue, add a spin lock for when accessing the registers for manual or fdma injection.
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> Reviewed-by: Daniel Machon <daniel.machon@microchip.com> Fixes: f3cad2611a77 ("net: sparx5: add hostmode with phylink support") Link: https://lore.kernel.org/r/20240219080043.1561014-1-horatiu.vultur@microchip.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
#
dff96d7c |
| 21-Aug-2023 |
Yue Haibing <yuehaibing@huawei.com> |
net: microchip: Remove unused declarations
Commit 264a9c5c9dff ("net: sparx5: Remove unused GLAG handling in PGID") removed sparx5_pgid_alloc_glag() but not its declaration. Commit 27d293cceee5 ("ne
net: microchip: Remove unused declarations
Commit 264a9c5c9dff ("net: sparx5: Remove unused GLAG handling in PGID") removed sparx5_pgid_alloc_glag() but not its declaration. Commit 27d293cceee5 ("net: microchip: sparx5: Add support for rule count by cookie") removed vcap_rule_iter() but not its declaration. Commit 8beef08f4618 ("net: microchip: sparx5: Adding initial VCAP API support") declared but never implemented vcap_api_set_client().
Signed-off-by: Yue Haibing <yuehaibing@huawei.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://lore.kernel.org/r/20230821135556.43224-1-yuehaibing@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
#
7bdde444 |
| 01-Aug-2023 |
Vladimir Oltean <vladimir.oltean@nxp.com> |
net: sparx5: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()
The hardware timestamping through ndo_eth_ioctl() is going away. Convert the sparx5 driver to the new API before that can be removed
net: sparx5: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()
The hardware timestamping through ndo_eth_ioctl() is going away. Convert the sparx5 driver to the new API before that can be removed.
After removing the timestamping logic from sparx5_port_ioctl(), the rest is equivalent to phy_do_ioctl().
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com> Link: https://lore.kernel.org/r/20230801142824.1772134-9-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
#
1c14432d |
| 07-Mar-2023 |
Steen Hegelund <steen.hegelund@microchip.com> |
net: microchip: sparx5: Add TC template list to a port
This adds a list that is used to collect the templates that are active on a port.
This allows the template creation to change the port configu
net: microchip: sparx5: Add TC template list to a port
This adds a list that is used to collect the templates that are active on a port.
This allows the template creation to change the port configuration and the template destruction to change it back.
Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
e116b19d |
| 02-Feb-2023 |
Daniel Machon <daniel.machon@microchip.com> |
net: microchip: sparx5: initialize PSFP
Initialize the SDLB's, stream gates and stream filters.
Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Simon Horman <simon.horman@co
net: microchip: sparx5: initialize PSFP
Initialize the SDLB's, stream gates and stream filters.
Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
ae3e691f |
| 02-Feb-2023 |
Daniel Machon <daniel.machon@microchip.com> |
net: microchip: sparx5: add support for PSFP stream filters
Add support for configuring PSFP stream filters (IEEE 802.1Q-2018, 8.6.5.1.1).
The VCAP CLM (VCAP IS0 ingress classifier) classifies stre
net: microchip: sparx5: add support for PSFP stream filters
Add support for configuring PSFP stream filters (IEEE 802.1Q-2018, 8.6.5.1.1).
The VCAP CLM (VCAP IS0 ingress classifier) classifies streams, identified by ISDX (Ingress Service Index, frame metadata), and maps ISDX to streams.
Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
c70a5e2c |
| 02-Feb-2023 |
Daniel Machon <daniel.machon@microchip.com> |
net: microchip: sparx5: add support for PSFP stream gates
Add support for configuring PSFP stream gates (IEEE 802.1Q-2018, 8.6.5.1.2).
Stream gates are time-based policers used by PSFP. Frames are
net: microchip: sparx5: add support for PSFP stream gates
Add support for configuring PSFP stream gates (IEEE 802.1Q-2018, 8.6.5.1.2).
Stream gates are time-based policers used by PSFP. Frames are dropped based on the gate state (OPEN/ CLOSE), whose state will be altered based on the Gate Control List (GCL) and current PTP time. Apart from time-based policing, stream gates can alter egress queue selection for the frames that pass through the Gate. This is done through Internal Priority Selector (IPS). Stream gates are mapped from stream filters.
Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
9e02131e |
| 02-Feb-2023 |
Daniel Machon <daniel.machon@microchip.com> |
net: microchip: sparx5: add function for calculating PTP basetime
Add a new function for calculating PTP basetime, required by the stream gate scheduler to calculate gate state (open / close).
Sign
net: microchip: sparx5: add function for calculating PTP basetime
Add a new function for calculating PTP basetime, required by the stream gate scheduler to calculate gate state (open / close).
Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
d2185e79 |
| 02-Feb-2023 |
Daniel Machon <daniel.machon@microchip.com> |
net: microchip: sparx5: add support for PSFP flow-meters
Add support for configuring PSFP flow-meters (IEEE 802.1Q-2018, 8.6.5.1.3).
The VCAP CLM (VCAP IS0 ingress classifier) classifies streams, i
net: microchip: sparx5: add support for PSFP flow-meters
Add support for configuring PSFP flow-meters (IEEE 802.1Q-2018, 8.6.5.1.3).
The VCAP CLM (VCAP IS0 ingress classifier) classifies streams, identified by ISDX (Ingress Service Index, frame metadata), and maps ISDX to flow-meters. SDLB's provide the flow-meter parameters.
Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
1db82abf |
| 02-Feb-2023 |
Daniel Machon <daniel.machon@microchip.com> |
net: microchip: sparx5: add support for service policers
Add initial API for configuring policers. This patch add support for service policers.
Signed-off-by: Daniel Machon <daniel.machon@microchip
net: microchip: sparx5: add support for service policers
Add initial API for configuring policers. This patch add support for service policers.
Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
9bf50889 |
| 02-Feb-2023 |
Daniel Machon <daniel.machon@microchip.com> |
net: microchip: sparx5: add support for Service Dual Leacky Buckets
Add support for Service Dual Leacky Buckets (SDLB), used to implement PSFP flow-meters. Buckets are linked together in a leak chai
net: microchip: sparx5: add support for Service Dual Leacky Buckets
Add support for Service Dual Leacky Buckets (SDLB), used to implement PSFP flow-meters. Buckets are linked together in a leak chain of a leak group. Leak groups a preconfigured to serve buckets within a certain rate interval.
Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
bb535c0d |
| 02-Feb-2023 |
Daniel Machon <daniel.machon@microchip.com> |
net: microchip: sparx5: add resource pools
Add resource pools and accessor functions. These pools can be queried by the driver, whenever a finite resource is required. Some resources can be reused,
net: microchip: sparx5: add resource pools
Add resource pools and accessor functions. These pools can be queried by the driver, whenever a finite resource is required. Some resources can be reused, in which case an index and a reference count is used to keep track of users.
Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
e0305cc1 |
| 17-Nov-2022 |
Steen Hegelund <steen.hegelund@microchip.com> |
net: microchip: sparx5: Add VCAP debugFS support
Add a debugFS root folder for Sparx5 and add a vcap folder underneath with the VCAP instances and the ports
Signed-off-by: Steen Hegelund <steen.heg
net: microchip: sparx5: Add VCAP debugFS support
Add a debugFS root folder for Sparx5 and add a vcap folder underneath with the VCAP instances and the ports
Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
92ef3d01 |
| 01-Nov-2022 |
Daniel Machon <daniel.machon@microchip.com> |
net: microchip: sparx5: add support for offloading pcp table
Add new registers and functions to support offload of pcp app entries.
Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Signed
net: microchip: sparx5: add support for offloading pcp table
Add new registers and functions to support offload of pcp app entries.
Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|
#
8beef08f |
| 20-Oct-2022 |
Steen Hegelund <steen.hegelund@microchip.com> |
net: microchip: sparx5: Adding initial VCAP API support
This provides the initial VCAP API framework and Sparx5 specific VCAP implementation.
When the Sparx5 Switchdev driver is initialized it will
net: microchip: sparx5: Adding initial VCAP API support
This provides the initial VCAP API framework and Sparx5 specific VCAP implementation.
When the Sparx5 Switchdev driver is initialized it will also initialize its VCAP module, and this hooks up the concrete Sparx5 VCAP model to the VCAP API, so that the VCAP API knows what VCAP instances are available.
Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
73ea7350 |
| 29-Sep-2022 |
Nathan Huckleberry <nhuck@google.com> |
net: sparx5: Fix return type of sparx5_port_xmit_impl
The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev).
net: sparx5: Fix return type of sparx5_port_xmit_impl
The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev).
The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition.
The return type of sparx5_port_xmit_impl should be changed from int to netdev_tx_t.
Reported-by: Dan Carpenter <error27@gmail.com> Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Signed-off-by: Nathan Huckleberry <nhuck@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
75554fe0 |
| 06-Sep-2022 |
Casper Andersson <casper.casan@gmail.com> |
net: sparx5: fix function return type to match actual type
Function returns error integer, not bool.
Does not have any impact on functionality.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com
net: sparx5: fix function return type to match actual type
Function returns error integer, not bool.
Does not have any impact on functionality.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Casper Andersson <casper.casan@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20220906065815.3856323-1-casper.casan@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|