linux/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c

// SPDX-License-Identifier: GPL-2.0
/*
 * RSS and Classifier helpers for Marvell PPv2 Network Controller
 *
 * Copyright (C) 2014 Marvell
 *
 * Marcin Wojtas <[email protected]>
 */

#include "mvpp2.h"
#include "mvpp2_cls.h"
#include "mvpp2_prs.h"

#define MVPP2_DEF_FLOW(_type, _id, _opts, _ri, _ri_mask)

static const struct mvpp2_cls_flow cls_flows[MVPP2_N_PRS_FLOWS] =;

u32 mvpp2_cls_flow_hits(struct mvpp2 *priv, int index)
{}

void mvpp2_cls_flow_read(struct mvpp2 *priv, int index,
			 struct mvpp2_cls_flow_entry *fe)
{}

/* Update classification flow table registers */
static void mvpp2_cls_flow_write(struct mvpp2 *priv,
				 struct mvpp2_cls_flow_entry *fe)
{}

u32 mvpp2_cls_lookup_hits(struct mvpp2 *priv, int index)
{}

void mvpp2_cls_lookup_read(struct mvpp2 *priv, int lkpid, int way,
			   struct mvpp2_cls_lookup_entry *le)
{}

/* Update classification lookup table register */
static void mvpp2_cls_lookup_write(struct mvpp2 *priv,
				   struct mvpp2_cls_lookup_entry *le)
{}

/* Operations on flow entry */
static int mvpp2_cls_flow_hek_num_get(struct mvpp2_cls_flow_entry *fe)
{}

static void mvpp2_cls_flow_hek_num_set(struct mvpp2_cls_flow_entry *fe,
				       int num_of_fields)
{}

static int mvpp2_cls_flow_hek_get(struct mvpp2_cls_flow_entry *fe,
				  int field_index)
{}

static void mvpp2_cls_flow_hek_set(struct mvpp2_cls_flow_entry *fe,
				   int field_index, int field_id)
{}

static void mvpp2_cls_flow_eng_set(struct mvpp2_cls_flow_entry *fe,
				   int engine)
{}

int mvpp2_cls_flow_eng_get(struct mvpp2_cls_flow_entry *fe)
{}

static void mvpp2_cls_flow_port_id_sel(struct mvpp2_cls_flow_entry *fe,
				       bool from_packet)
{}

static void mvpp2_cls_flow_last_set(struct mvpp2_cls_flow_entry *fe,
				    bool is_last)
{}

static void mvpp2_cls_flow_pri_set(struct mvpp2_cls_flow_entry *fe, int prio)
{}

static void mvpp2_cls_flow_port_add(struct mvpp2_cls_flow_entry *fe,
				    u32 port)
{}

static void mvpp2_cls_flow_port_remove(struct mvpp2_cls_flow_entry *fe,
				       u32 port)
{}

static void mvpp2_cls_flow_lu_type_set(struct mvpp2_cls_flow_entry *fe,
				       u8 lu_type)
{}

/* Initialize the parser entry for the given flow */
static void mvpp2_cls_flow_prs_init(struct mvpp2 *priv,
				    const struct mvpp2_cls_flow *flow)
{}

/* Initialize the Lookup Id table entry for the given flow */
static void mvpp2_cls_flow_lkp_init(struct mvpp2 *priv,
				    const struct mvpp2_cls_flow *flow)
{}

static void mvpp2_cls_c2_write(struct mvpp2 *priv,
			       struct mvpp2_cls_c2_entry *c2)
{}

void mvpp2_cls_c2_read(struct mvpp2 *priv, int index,
		       struct mvpp2_cls_c2_entry *c2)
{}

static int mvpp2_cls_ethtool_flow_to_type(int flow_type)
{}

static int mvpp2_cls_c2_port_flow_index(struct mvpp2_port *port, int loc)
{}

/* Initialize the flow table entries for the given flow */
static void mvpp2_cls_flow_init(struct mvpp2 *priv,
				const struct mvpp2_cls_flow *flow)
{}

/* Adds a field to the Header Extracted Key generation parameters*/
static int mvpp2_flow_add_hek_field(struct mvpp2_cls_flow_entry *fe,
				    u32 field_id)
{}

static int mvpp2_flow_set_hek_fields(struct mvpp2_cls_flow_entry *fe,
				     unsigned long hash_opts)
{}

/* Returns the size, in bits, of the corresponding HEK field */
static int mvpp2_cls_hek_field_size(u32 field)
{}

const struct mvpp2_cls_flow *mvpp2_cls_flow_get(int flow)
{}

/* Set the hash generation options for the given traffic flow.
 * One traffic flow (in the ethtool sense) has multiple classification flows,
 * to handle specific cases such as fragmentation, or the presence of a
 * VLAN / DSA Tag.
 *
 * Each of these individual flows has different constraints, for example we
 * can't hash fragmented packets on L4 data (else we would risk having packet
 * re-ordering), so each classification flows masks the options with their
 * supported ones.
 *
 */
static int mvpp2_port_rss_hash_opts_set(struct mvpp2_port *port, int flow_type,
					u16 requested_opts)
{}

u16 mvpp2_flow_get_hek_fields(struct mvpp2_cls_flow_entry *fe)
{}

/* Returns the hash opts for this flow. There are several classifier flows
 * for one traffic flow, this returns an aggregation of all configurations.
 */
static u16 mvpp2_port_rss_hash_opts_get(struct mvpp2_port *port, int flow_type)
{}

static void mvpp2_cls_port_init_flows(struct mvpp2 *priv)
{}

static void mvpp2_port_c2_cls_init(struct mvpp2_port *port)
{}

/* Classifier default initialization */
void mvpp2_cls_init(struct mvpp2 *priv)
{}

void mvpp2_cls_port_config(struct mvpp2_port *port)
{}

u32 mvpp2_cls_c2_hit_count(struct mvpp2 *priv, int c2_index)
{}

static void mvpp2_rss_port_c2_enable(struct mvpp2_port *port, u32 ctx)
{}

static void mvpp2_rss_port_c2_disable(struct mvpp2_port *port)
{}

static inline int mvpp22_rss_ctx(struct mvpp2_port *port, int port_rss_ctx)
{}

int mvpp22_port_rss_enable(struct mvpp2_port *port)
{}

int mvpp22_port_rss_disable(struct mvpp2_port *port)
{}

static void mvpp22_port_c2_lookup_disable(struct mvpp2_port *port, int entry)
{}

/* Set CPU queue number for oversize packets */
void mvpp2_cls_oversize_rxq_set(struct mvpp2_port *port)
{}

static int mvpp2_port_c2_tcam_rule_add(struct mvpp2_port *port,
				       struct mvpp2_rfs_rule *rule)
{}

static int mvpp2_port_c2_rfs_rule_insert(struct mvpp2_port *port,
					 struct mvpp2_rfs_rule *rule)
{}

static int mvpp2_port_cls_rfs_rule_remove(struct mvpp2_port *port,
					  struct mvpp2_rfs_rule *rule)
{}

static int mvpp2_port_flt_rfs_rule_insert(struct mvpp2_port *port,
					  struct mvpp2_rfs_rule *rule)
{}

static int mvpp2_cls_c2_build_match(struct mvpp2_rfs_rule *rule)
{}

static int mvpp2_cls_rfs_parse_rule(struct mvpp2_rfs_rule *rule)
{}

int mvpp2_ethtool_cls_rule_get(struct mvpp2_port *port,
			       struct ethtool_rxnfc *rxnfc)
{}

int mvpp2_ethtool_cls_rule_ins(struct mvpp2_port *port,
			       struct ethtool_rxnfc *info)
{}

int mvpp2_ethtool_cls_rule_del(struct mvpp2_port *port,
			       struct ethtool_rxnfc *info)
{}

static inline u32 mvpp22_rxfh_indir(struct mvpp2_port *port, u32 rxq)
{}

static void mvpp22_rss_fill_table(struct mvpp2_port *port,
				  struct mvpp2_rss_table *table,
				  u32 rss_ctx)
{}

static int mvpp22_rss_context_create(struct mvpp2_port *port, u32 *rss_ctx)
{}

int mvpp22_port_rss_ctx_create(struct mvpp2_port *port, u32 *port_ctx)
{}

static struct mvpp2_rss_table *mvpp22_rss_table_get(struct mvpp2 *priv,
						    int rss_ctx)
{}

int mvpp22_port_rss_ctx_delete(struct mvpp2_port *port, u32 port_ctx)
{}

int mvpp22_port_rss_ctx_indir_set(struct mvpp2_port *port, u32 port_ctx,
				  const u32 *indir)
{}

int mvpp22_port_rss_ctx_indir_get(struct mvpp2_port *port, u32 port_ctx,
				  u32 *indir)
{}

int mvpp2_ethtool_rxfh_set(struct mvpp2_port *port, struct ethtool_rxnfc *info)
{}

int mvpp2_ethtool_rxfh_get(struct mvpp2_port *port, struct ethtool_rxnfc *info)
{}

int mvpp22_port_rss_init(struct mvpp2_port *port)
{}