2019-05-31 07:16:56 +00:00
|
|
|
/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
|
|
|
|
/* Microsemi Ocelot Switch driver
|
|
|
|
* Copyright (c) 2019 Microsemi Corporation
|
|
|
|
*/
|
|
|
|
|
2020-06-20 15:43:46 +00:00
|
|
|
#ifndef _MSCC_OCELOT_VCAP_H_
|
|
|
|
#define _MSCC_OCELOT_VCAP_H_
|
2019-05-31 07:16:56 +00:00
|
|
|
|
|
|
|
#include "ocelot.h"
|
2020-03-29 11:51:57 +00:00
|
|
|
#include "ocelot_police.h"
|
2019-05-31 07:16:56 +00:00
|
|
|
#include <net/sch_generic.h>
|
|
|
|
#include <net/pkt_cls.h>
|
|
|
|
|
2020-10-02 12:02:20 +00:00
|
|
|
#define OCELOT_POLICER_DISCARD 0x17f
|
|
|
|
|
2019-05-31 07:16:56 +00:00
|
|
|
struct ocelot_ipv4 {
|
|
|
|
u8 addr[4];
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ocelot_vcap_bit {
|
|
|
|
OCELOT_VCAP_BIT_ANY,
|
|
|
|
OCELOT_VCAP_BIT_0,
|
|
|
|
OCELOT_VCAP_BIT_1
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ocelot_vcap_u8 {
|
|
|
|
u8 value[1];
|
|
|
|
u8 mask[1];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ocelot_vcap_u16 {
|
|
|
|
u8 value[2];
|
|
|
|
u8 mask[2];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ocelot_vcap_u24 {
|
|
|
|
u8 value[3];
|
|
|
|
u8 mask[3];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ocelot_vcap_u32 {
|
|
|
|
u8 value[4];
|
|
|
|
u8 mask[4];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ocelot_vcap_u40 {
|
|
|
|
u8 value[5];
|
|
|
|
u8 mask[5];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ocelot_vcap_u48 {
|
|
|
|
u8 value[6];
|
|
|
|
u8 mask[6];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ocelot_vcap_u64 {
|
|
|
|
u8 value[8];
|
|
|
|
u8 mask[8];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ocelot_vcap_u128 {
|
|
|
|
u8 value[16];
|
|
|
|
u8 mask[16];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ocelot_vcap_vid {
|
|
|
|
u16 value;
|
|
|
|
u16 mask;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ocelot_vcap_ipv4 {
|
|
|
|
struct ocelot_ipv4 value;
|
|
|
|
struct ocelot_ipv4 mask;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ocelot_vcap_udp_tcp {
|
|
|
|
u16 value;
|
|
|
|
u16 mask;
|
|
|
|
};
|
|
|
|
|
2020-10-02 12:02:24 +00:00
|
|
|
struct ocelot_vcap_port {
|
|
|
|
u8 value;
|
|
|
|
u8 mask;
|
|
|
|
};
|
|
|
|
|
2020-06-20 15:43:46 +00:00
|
|
|
enum ocelot_vcap_key_type {
|
|
|
|
OCELOT_VCAP_KEY_ANY,
|
|
|
|
OCELOT_VCAP_KEY_ETYPE,
|
|
|
|
OCELOT_VCAP_KEY_LLC,
|
|
|
|
OCELOT_VCAP_KEY_SNAP,
|
|
|
|
OCELOT_VCAP_KEY_ARP,
|
|
|
|
OCELOT_VCAP_KEY_IPV4,
|
|
|
|
OCELOT_VCAP_KEY_IPV6
|
2019-05-31 07:16:56 +00:00
|
|
|
};
|
|
|
|
|
2020-06-20 15:43:46 +00:00
|
|
|
struct ocelot_vcap_key_vlan {
|
2019-05-31 07:16:56 +00:00
|
|
|
struct ocelot_vcap_vid vid; /* VLAN ID (12 bit) */
|
|
|
|
struct ocelot_vcap_u8 pcp; /* PCP (3 bit) */
|
|
|
|
enum ocelot_vcap_bit dei; /* DEI */
|
|
|
|
enum ocelot_vcap_bit tagged; /* Tagged/untagged frame */
|
|
|
|
};
|
|
|
|
|
2020-06-20 15:43:46 +00:00
|
|
|
struct ocelot_vcap_key_etype {
|
2019-05-31 07:16:56 +00:00
|
|
|
struct ocelot_vcap_u48 dmac;
|
|
|
|
struct ocelot_vcap_u48 smac;
|
|
|
|
struct ocelot_vcap_u16 etype;
|
|
|
|
struct ocelot_vcap_u16 data; /* MAC data */
|
|
|
|
};
|
|
|
|
|
2020-06-20 15:43:46 +00:00
|
|
|
struct ocelot_vcap_key_llc {
|
2019-05-31 07:16:56 +00:00
|
|
|
struct ocelot_vcap_u48 dmac;
|
|
|
|
struct ocelot_vcap_u48 smac;
|
|
|
|
|
|
|
|
/* LLC header: DSAP at byte 0, SSAP at byte 1, Control at byte 2 */
|
|
|
|
struct ocelot_vcap_u32 llc;
|
|
|
|
};
|
|
|
|
|
2020-06-20 15:43:46 +00:00
|
|
|
struct ocelot_vcap_key_snap {
|
2019-05-31 07:16:56 +00:00
|
|
|
struct ocelot_vcap_u48 dmac;
|
|
|
|
struct ocelot_vcap_u48 smac;
|
|
|
|
|
|
|
|
/* SNAP header: Organization Code at byte 0, Type at byte 3 */
|
|
|
|
struct ocelot_vcap_u40 snap;
|
|
|
|
};
|
|
|
|
|
2020-06-20 15:43:46 +00:00
|
|
|
struct ocelot_vcap_key_arp {
|
2019-05-31 07:16:56 +00:00
|
|
|
struct ocelot_vcap_u48 smac;
|
|
|
|
enum ocelot_vcap_bit arp; /* Opcode ARP/RARP */
|
|
|
|
enum ocelot_vcap_bit req; /* Opcode request/reply */
|
|
|
|
enum ocelot_vcap_bit unknown; /* Opcode unknown */
|
|
|
|
enum ocelot_vcap_bit smac_match; /* Sender MAC matches SMAC */
|
|
|
|
enum ocelot_vcap_bit dmac_match; /* Target MAC matches DMAC */
|
|
|
|
|
|
|
|
/**< Protocol addr. length 4, hardware length 6 */
|
|
|
|
enum ocelot_vcap_bit length;
|
|
|
|
|
|
|
|
enum ocelot_vcap_bit ip; /* Protocol address type IP */
|
|
|
|
enum ocelot_vcap_bit ethernet; /* Hardware address type Ethernet */
|
|
|
|
struct ocelot_vcap_ipv4 sip; /* Sender IP address */
|
|
|
|
struct ocelot_vcap_ipv4 dip; /* Target IP address */
|
|
|
|
};
|
|
|
|
|
2020-06-20 15:43:46 +00:00
|
|
|
struct ocelot_vcap_key_ipv4 {
|
2019-05-31 07:16:56 +00:00
|
|
|
enum ocelot_vcap_bit ttl; /* TTL zero */
|
|
|
|
enum ocelot_vcap_bit fragment; /* Fragment */
|
|
|
|
enum ocelot_vcap_bit options; /* Header options */
|
|
|
|
struct ocelot_vcap_u8 ds;
|
|
|
|
struct ocelot_vcap_u8 proto; /* Protocol */
|
|
|
|
struct ocelot_vcap_ipv4 sip; /* Source IP address */
|
|
|
|
struct ocelot_vcap_ipv4 dip; /* Destination IP address */
|
|
|
|
struct ocelot_vcap_u48 data; /* Not UDP/TCP: IP data */
|
|
|
|
struct ocelot_vcap_udp_tcp sport; /* UDP/TCP: Source port */
|
|
|
|
struct ocelot_vcap_udp_tcp dport; /* UDP/TCP: Destination port */
|
|
|
|
enum ocelot_vcap_bit tcp_fin;
|
|
|
|
enum ocelot_vcap_bit tcp_syn;
|
|
|
|
enum ocelot_vcap_bit tcp_rst;
|
|
|
|
enum ocelot_vcap_bit tcp_psh;
|
|
|
|
enum ocelot_vcap_bit tcp_ack;
|
|
|
|
enum ocelot_vcap_bit tcp_urg;
|
|
|
|
enum ocelot_vcap_bit sip_eq_dip; /* SIP equals DIP */
|
|
|
|
enum ocelot_vcap_bit sport_eq_dport; /* SPORT equals DPORT */
|
|
|
|
enum ocelot_vcap_bit seq_zero; /* TCP sequence number is zero */
|
|
|
|
};
|
|
|
|
|
2020-06-20 15:43:46 +00:00
|
|
|
struct ocelot_vcap_key_ipv6 {
|
2019-05-31 07:16:56 +00:00
|
|
|
struct ocelot_vcap_u8 proto; /* IPv6 protocol */
|
|
|
|
struct ocelot_vcap_u128 sip; /* IPv6 source (byte 0-7 ignored) */
|
net: mscc: ocelot: offload ingress skbedit and vlan actions to VCAP IS1
VCAP IS1 is a VCAP module which can filter on the most common L2/L3/L4
Ethernet keys, and modify the results of the basic QoS classification
and VLAN classification based on those flow keys.
There are 3 VCAP IS1 lookups, mapped over chains 10000, 11000 and 12000.
Currently the driver is hardcoded to use IS1_ACTION_TYPE_NORMAL half
keys.
Note that the VLAN_MANGLE has been omitted for now. In hardware, the
VCAP_IS1_ACT_VID_REPLACE_ENA field replaces the classified VLAN
(metadata associated with the frame) and not the VLAN from the header
itself. There are currently some issues which need to be addressed when
operating in standalone, or in bridge with vlan_filtering=0 modes,
because in those cases the switch ports have VLAN awareness disabled,
and changing the classified VLAN to anything other than the pvid causes
the packets to be dropped. Another issue is that on egress, we expect
port tagging to push the classified VLAN, but port tagging is disabled
in the modes mentioned above, so although the classified VLAN is
replaced, it is not visible in the packet transmitted by the switch.
Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-10-02 12:02:23 +00:00
|
|
|
struct ocelot_vcap_u128 dip; /* IPv6 destination (byte 0-7 ignored) */
|
2019-05-31 07:16:56 +00:00
|
|
|
enum ocelot_vcap_bit ttl; /* TTL zero */
|
|
|
|
struct ocelot_vcap_u8 ds;
|
|
|
|
struct ocelot_vcap_u48 data; /* Not UDP/TCP: IP data */
|
|
|
|
struct ocelot_vcap_udp_tcp sport;
|
|
|
|
struct ocelot_vcap_udp_tcp dport;
|
|
|
|
enum ocelot_vcap_bit tcp_fin;
|
|
|
|
enum ocelot_vcap_bit tcp_syn;
|
|
|
|
enum ocelot_vcap_bit tcp_rst;
|
|
|
|
enum ocelot_vcap_bit tcp_psh;
|
|
|
|
enum ocelot_vcap_bit tcp_ack;
|
|
|
|
enum ocelot_vcap_bit tcp_urg;
|
|
|
|
enum ocelot_vcap_bit sip_eq_dip; /* SIP equals DIP */
|
|
|
|
enum ocelot_vcap_bit sport_eq_dport; /* SPORT equals DPORT */
|
|
|
|
enum ocelot_vcap_bit seq_zero; /* TCP sequence number is zero */
|
|
|
|
};
|
|
|
|
|
2020-10-02 12:02:20 +00:00
|
|
|
enum ocelot_mask_mode {
|
|
|
|
OCELOT_MASK_MODE_NONE,
|
|
|
|
OCELOT_MASK_MODE_PERMIT_DENY,
|
|
|
|
OCELOT_MASK_MODE_POLICY,
|
|
|
|
OCELOT_MASK_MODE_REDIRECT,
|
|
|
|
};
|
|
|
|
|
2020-10-02 12:02:24 +00:00
|
|
|
enum ocelot_es0_tag {
|
|
|
|
OCELOT_NO_ES0_TAG,
|
|
|
|
OCELOT_ES0_TAG,
|
|
|
|
OCELOT_FORCE_PORT_TAG,
|
|
|
|
OCELOT_FORCE_UNTAG,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ocelot_tag_tpid_sel {
|
|
|
|
OCELOT_TAG_TPID_SEL_8021Q,
|
|
|
|
OCELOT_TAG_TPID_SEL_8021AD,
|
|
|
|
};
|
|
|
|
|
2020-10-02 12:02:20 +00:00
|
|
|
struct ocelot_vcap_action {
|
|
|
|
union {
|
2020-10-02 12:02:24 +00:00
|
|
|
/* VCAP ES0 */
|
|
|
|
struct {
|
|
|
|
enum ocelot_es0_tag push_outer_tag;
|
|
|
|
enum ocelot_es0_tag push_inner_tag;
|
|
|
|
enum ocelot_tag_tpid_sel tag_a_tpid_sel;
|
|
|
|
int tag_a_vid_sel;
|
|
|
|
int tag_a_pcp_sel;
|
|
|
|
u16 vid_a_val;
|
|
|
|
u8 pcp_a_val;
|
|
|
|
u8 dei_a_val;
|
|
|
|
enum ocelot_tag_tpid_sel tag_b_tpid_sel;
|
|
|
|
int tag_b_vid_sel;
|
|
|
|
int tag_b_pcp_sel;
|
|
|
|
u16 vid_b_val;
|
|
|
|
u8 pcp_b_val;
|
|
|
|
u8 dei_b_val;
|
|
|
|
};
|
|
|
|
|
net: mscc: ocelot: offload ingress skbedit and vlan actions to VCAP IS1
VCAP IS1 is a VCAP module which can filter on the most common L2/L3/L4
Ethernet keys, and modify the results of the basic QoS classification
and VLAN classification based on those flow keys.
There are 3 VCAP IS1 lookups, mapped over chains 10000, 11000 and 12000.
Currently the driver is hardcoded to use IS1_ACTION_TYPE_NORMAL half
keys.
Note that the VLAN_MANGLE has been omitted for now. In hardware, the
VCAP_IS1_ACT_VID_REPLACE_ENA field replaces the classified VLAN
(metadata associated with the frame) and not the VLAN from the header
itself. There are currently some issues which need to be addressed when
operating in standalone, or in bridge with vlan_filtering=0 modes,
because in those cases the switch ports have VLAN awareness disabled,
and changing the classified VLAN to anything other than the pvid causes
the packets to be dropped. Another issue is that on egress, we expect
port tagging to push the classified VLAN, but port tagging is disabled
in the modes mentioned above, so although the classified VLAN is
replaced, it is not visible in the packet transmitted by the switch.
Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-10-02 12:02:23 +00:00
|
|
|
/* VCAP IS1 */
|
|
|
|
struct {
|
|
|
|
bool vid_replace_ena;
|
|
|
|
u16 vid;
|
|
|
|
bool vlan_pop_cnt_ena;
|
|
|
|
int vlan_pop_cnt;
|
|
|
|
bool pcp_dei_ena;
|
|
|
|
u8 pcp;
|
|
|
|
u8 dei;
|
|
|
|
bool qos_ena;
|
|
|
|
u8 qos_val;
|
|
|
|
u8 pag_override_mask;
|
|
|
|
u8 pag_val;
|
|
|
|
};
|
|
|
|
|
2020-10-02 12:02:20 +00:00
|
|
|
/* VCAP IS2 */
|
|
|
|
struct {
|
|
|
|
bool cpu_copy_ena;
|
|
|
|
u8 cpu_qu_num;
|
|
|
|
enum ocelot_mask_mode mask_mode;
|
|
|
|
unsigned long port_mask;
|
|
|
|
bool police_ena;
|
|
|
|
struct ocelot_policer pol;
|
|
|
|
u32 pol_ix;
|
|
|
|
};
|
|
|
|
};
|
2019-05-31 07:16:56 +00:00
|
|
|
};
|
|
|
|
|
2020-06-20 15:43:46 +00:00
|
|
|
struct ocelot_vcap_stats {
|
2019-05-31 07:16:56 +00:00
|
|
|
u64 bytes;
|
|
|
|
u64 pkts;
|
|
|
|
u64 used;
|
|
|
|
};
|
|
|
|
|
net: mscc: ocelot: create TCAM skeleton from tc filter chains
For Ocelot switches, there are 2 ingress pipelines for flow offload
rules: VCAP IS1 (Ingress Classification) and IS2 (Security Enforcement).
IS1 and IS2 support different sets of actions. The pipeline order for a
packet on ingress is:
Basic classification -> VCAP IS1 -> VCAP IS2
Furthermore, IS1 is looked up 3 times, and IS2 is looked up twice (each
TCAM entry can be configured to match only on the first lookup, or only
on the second, or on both etc).
Because the TCAMs are completely independent in hardware, and because of
the fixed pipeline, we actually have very limited options when it comes
to offloading complex rules to them while still maintaining the same
semantics with the software data path.
This patch maps flow offload rules to ingress TCAMs according to a
predefined chain index number. There is going to be a script in
selftests that clarifies the usage model.
There is also an egress TCAM (VCAP ES0, the Egress Rewriter), which is
modeled on top of the default chain 0 of the egress qdisc, because it
doesn't have multiple lookups.
Suggested-by: Allan W. Nielsen <allan.nielsen@microchip.com>
Co-developed-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-10-02 12:02:22 +00:00
|
|
|
enum ocelot_vcap_filter_type {
|
|
|
|
OCELOT_VCAP_FILTER_DUMMY,
|
|
|
|
OCELOT_VCAP_FILTER_PAG,
|
|
|
|
OCELOT_VCAP_FILTER_OFFLOAD,
|
|
|
|
};
|
|
|
|
|
2020-06-20 15:43:46 +00:00
|
|
|
struct ocelot_vcap_filter {
|
2019-05-31 07:16:56 +00:00
|
|
|
struct list_head list;
|
|
|
|
|
net: mscc: ocelot: create TCAM skeleton from tc filter chains
For Ocelot switches, there are 2 ingress pipelines for flow offload
rules: VCAP IS1 (Ingress Classification) and IS2 (Security Enforcement).
IS1 and IS2 support different sets of actions. The pipeline order for a
packet on ingress is:
Basic classification -> VCAP IS1 -> VCAP IS2
Furthermore, IS1 is looked up 3 times, and IS2 is looked up twice (each
TCAM entry can be configured to match only on the first lookup, or only
on the second, or on both etc).
Because the TCAMs are completely independent in hardware, and because of
the fixed pipeline, we actually have very limited options when it comes
to offloading complex rules to them while still maintaining the same
semantics with the software data path.
This patch maps flow offload rules to ingress TCAMs according to a
predefined chain index number. There is going to be a script in
selftests that clarifies the usage model.
There is also an egress TCAM (VCAP ES0, the Egress Rewriter), which is
modeled on top of the default chain 0 of the egress qdisc, because it
doesn't have multiple lookups.
Suggested-by: Allan W. Nielsen <allan.nielsen@microchip.com>
Co-developed-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-10-02 12:02:22 +00:00
|
|
|
enum ocelot_vcap_filter_type type;
|
|
|
|
int block_id;
|
|
|
|
int goto_target;
|
|
|
|
int lookup;
|
net: mscc: ocelot: offload ingress skbedit and vlan actions to VCAP IS1
VCAP IS1 is a VCAP module which can filter on the most common L2/L3/L4
Ethernet keys, and modify the results of the basic QoS classification
and VLAN classification based on those flow keys.
There are 3 VCAP IS1 lookups, mapped over chains 10000, 11000 and 12000.
Currently the driver is hardcoded to use IS1_ACTION_TYPE_NORMAL half
keys.
Note that the VLAN_MANGLE has been omitted for now. In hardware, the
VCAP_IS1_ACT_VID_REPLACE_ENA field replaces the classified VLAN
(metadata associated with the frame) and not the VLAN from the header
itself. There are currently some issues which need to be addressed when
operating in standalone, or in bridge with vlan_filtering=0 modes,
because in those cases the switch ports have VLAN awareness disabled,
and changing the classified VLAN to anything other than the pvid causes
the packets to be dropped. Another issue is that on egress, we expect
port tagging to push the classified VLAN, but port tagging is disabled
in the modes mentioned above, so although the classified VLAN is
replaced, it is not visible in the packet transmitted by the switch.
Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-10-02 12:02:23 +00:00
|
|
|
u8 pag;
|
2019-05-31 07:16:56 +00:00
|
|
|
u16 prio;
|
|
|
|
u32 id;
|
|
|
|
|
2020-10-02 12:02:20 +00:00
|
|
|
struct ocelot_vcap_action action;
|
2020-06-20 15:43:46 +00:00
|
|
|
struct ocelot_vcap_stats stats;
|
2020-10-02 12:02:24 +00:00
|
|
|
/* For VCAP IS1 and IS2 */
|
2020-04-17 19:03:08 +00:00
|
|
|
unsigned long ingress_port_mask;
|
2020-10-02 12:02:24 +00:00
|
|
|
/* For VCAP ES0 */
|
|
|
|
struct ocelot_vcap_port ingress_port;
|
|
|
|
struct ocelot_vcap_port egress_port;
|
2019-05-31 07:16:56 +00:00
|
|
|
|
|
|
|
enum ocelot_vcap_bit dmac_mc;
|
|
|
|
enum ocelot_vcap_bit dmac_bc;
|
2020-06-20 15:43:46 +00:00
|
|
|
struct ocelot_vcap_key_vlan vlan;
|
2019-05-31 07:16:56 +00:00
|
|
|
|
2020-06-20 15:43:46 +00:00
|
|
|
enum ocelot_vcap_key_type key_type;
|
2019-05-31 07:16:56 +00:00
|
|
|
union {
|
2020-06-20 15:43:46 +00:00
|
|
|
/* OCELOT_VCAP_KEY_ANY: No specific fields */
|
|
|
|
struct ocelot_vcap_key_etype etype;
|
|
|
|
struct ocelot_vcap_key_llc llc;
|
|
|
|
struct ocelot_vcap_key_snap snap;
|
|
|
|
struct ocelot_vcap_key_arp arp;
|
|
|
|
struct ocelot_vcap_key_ipv4 ipv4;
|
|
|
|
struct ocelot_vcap_key_ipv6 ipv6;
|
|
|
|
} key;
|
2019-05-31 07:16:56 +00:00
|
|
|
};
|
|
|
|
|
2020-06-20 15:43:46 +00:00
|
|
|
int ocelot_vcap_filter_add(struct ocelot *ocelot,
|
|
|
|
struct ocelot_vcap_filter *rule,
|
|
|
|
struct netlink_ext_ack *extack);
|
|
|
|
int ocelot_vcap_filter_del(struct ocelot *ocelot,
|
|
|
|
struct ocelot_vcap_filter *rule);
|
|
|
|
int ocelot_vcap_filter_stats_update(struct ocelot *ocelot,
|
|
|
|
struct ocelot_vcap_filter *rule);
|
2020-09-29 22:27:32 +00:00
|
|
|
struct ocelot_vcap_filter *
|
|
|
|
ocelot_vcap_block_find_filter_by_id(struct ocelot_vcap_block *block, int id);
|
2019-05-31 07:16:56 +00:00
|
|
|
|
2020-09-29 22:27:26 +00:00
|
|
|
void ocelot_detect_vcap_constants(struct ocelot *ocelot);
|
2020-06-20 15:43:46 +00:00
|
|
|
int ocelot_vcap_init(struct ocelot *ocelot);
|
2019-05-31 07:16:56 +00:00
|
|
|
|
net: mscc: ocelot: simplify tc-flower offload structures
The ocelot tc-flower offload binds a second flow block callback (apart
from the one for matchall) just because it uses a different block
private structure (ocelot_port_private for matchall, ocelot_port_block
for flower).
But ocelot_port_block just appears to be boilerplate, and doesn't help
with anything in particular at all, it's just useless glue between the
(global!) struct ocelot_acl_block *block pointer, and a per-netdevice
struct ocelot_port_private *priv.
So let's just simplify that, and make struct ocelot_port_private be the
private structure for the block offload. This makes us able to use the
same flow callback as in the case of matchall.
This also reveals that the struct ocelot_acl_block *block is used rather
strangely, as mentioned above: it is defined globally, allocated at
probe time, and freed at unbind time. So just move the structure to the
main ocelot structure, which gives further opportunity for
simplification.
Also get rid of backpointers from struct ocelot_acl_block and struct
ocelot_ace_rule back to struct ocelot, by reworking the function
prototypes, where necessary, to use a more DSA-friendly "struct ocelot
*ocelot, int port" format.
And finally, remove the debugging prints that were added during
development, since they provide no useful information at this point.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Allan W. Nielsen <allan.nielsen@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-29 14:31:06 +00:00
|
|
|
int ocelot_setup_tc_cls_flower(struct ocelot_port_private *priv,
|
|
|
|
struct flow_cls_offload *f,
|
|
|
|
bool ingress);
|
2019-05-31 07:16:57 +00:00
|
|
|
|
2020-06-20 15:43:46 +00:00
|
|
|
#endif /* _MSCC_OCELOT_VCAP_H_ */
|