Skip to content

Commit

Permalink
Merge branch 'net-lan969x-add-vcap-functionality'
Browse files Browse the repository at this point in the history
Daniel Machon says:

====================
net: lan969x: add VCAP functionality

== Description:

This series is the third of a multi-part series, that prepares and adds
support for the new lan969x switch driver.

The upstreaming efforts is split into multiple series (might change a
bit as we go along):

        1) Prepare the Sparx5 driver for lan969x (merged)

        2) Add support for lan969x (same basic features as Sparx5
           provides excl. FDMA and VCAP, merged).

    --> 3) Add lan969x VCAP functionality.

        4) Add RGMII and FDMA functionality.

== VCAP support:

The Versatile Content-Aware Processor (VCAP) is a content-aware packet
processor that allows wirespeed packet inspection for rich
implementation of, for example, advanced VLAN and QoS classification and
manipulations, IP source guarding, longest prefix matching for Layer-3
routing, and security features for wireline and wireless applications.
This is all achieved by programming rules into the VCAP.

When a VCAP is enabled, every frame passing through the switch is
analyzed and multiple keys are created based on the contents of the
frame. The frame is examined to determine the frame type (for example,
IPv4 TCP frame), so that the frame information is extracted according to
the frame type, port-specific configuration, and classification results
from the basic classification. Keys are applied to the VCAP and when
there is a match between a key and a rule in the VCAP, the rule is then
applied to the frame from which the key was extracted.

After this series is applied, the lan969x driver will support the same
VCAP functionality as Sparx5.

== Patch breakdown:

Patch #1 exposes some VCAP symbols for lan969x.

Patch #2 replaces VCAP uses of SPX5_PORTS with n_ports from the match
data.

Patch #3 adds new VCAP constants to match data

Patch #4 removes the is_sparx5() check to now initialize the VCAP API on
lan969x.

Patch #5 adds the auto-generated VCAP data for lan969x.

Patch #6 adds the VCAP configuration data for lan969x.

Signed-off-by: Daniel Machon <[email protected]>
====================

Link: https://patch.msgid.link/20241101-sparx5-lan969x-switch-driver-3-v1-0-3c76f22f4bfa@microchip.com
Signed-off-by: Paolo Abeni <[email protected]>
  • Loading branch information
Paolo Abeni committed Nov 5, 2024
2 parents 7af3a65 + 1091487 commit ccb3503
Show file tree
Hide file tree
Showing 10 changed files with 3,995 additions and 36 deletions.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/microchip/lan969x/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

obj-$(CONFIG_LAN969X_SWITCH) += lan969x-switch.o

lan969x-switch-y := lan969x_regs.o lan969x.o lan969x_calendar.o
lan969x-switch-y := lan969x_regs.o lan969x.o lan969x_calendar.o \
lan969x_vcap_ag_api.o lan969x_vcap_impl.o

# Provide include files
ccflags-y += -I$(srctree)/drivers/net/ethernet/microchip/fdma
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ethernet/microchip/lan969x/lan969x.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ static const struct sparx5_consts lan969x_consts = {
.qres_max_prio_idx = 315,
.qres_max_colour_idx = 323,
.tod_pin = 4,
.vcaps = lan969x_vcaps,
.vcap_stats = &lan969x_vcap_stats,
.vcaps_cfg = lan969x_vcap_inst_cfg,
};

static const struct sparx5_ops lan969x_ops = {
Expand Down
8 changes: 8 additions & 0 deletions drivers/net/ethernet/microchip/lan969x/lan969x.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@

#include "../sparx5/sparx5_main.h"
#include "../sparx5/sparx5_regs.h"
#include "../sparx5/sparx5_vcap_impl.h"

/* lan969x.c */
extern const struct sparx5_match_data lan969x_desc;

/* lan969x_vcap_ag_api.c */
extern const struct vcap_statistics lan969x_vcap_stats;
extern const struct vcap_info lan969x_vcaps[];

/* lan969x_vcap_impl.c */
extern const struct sparx5_vcap_inst lan969x_vcap_inst_cfg[];

/* lan969x_regs.c */
extern const unsigned int lan969x_tsize[TSIZE_LAST];
extern const unsigned int lan969x_raddr[RADDR_LAST];
Expand Down
Loading

0 comments on commit ccb3503

Please sign in to comment.