nxge_fflp.h revision 4496171313bed39e96f21bc2f9faf2868e267ae3
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_NXGE_NXGE_FFLP_H
#define _SYS_NXGE_NXGE_FFLP_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <npi_fflp.h>
#define MAX_PARTITION 8
typedef struct _fflp_errlog {
typedef struct _fflp_stats {
/*
* The FCRAM (hash table) cosnists of 1 meg cells
* each 64 byte wide. Each cell can hold either of:
* 2 IPV4 Exact match entry (each 32 bytes)
* 1 IPV6 Exact match entry (each 56 bytes) and
* 1 Optimistic match entry (each 8 bytes)
* 8 Optimistic match entries (each 8 bytes)
* In the case IPV4 Exact match, half of the cell
* (the first or the second 32 bytes) could be used
* to hold 4 Optimistic matches
*/
#define FCRAM_CELL_EMPTY 0x00
#define FCRAM_CELL_IPV4_IPV4 0x01
#define FCRAM_CELL_IPV4_OPT 0x02
#define FCRAM_CELL_OPT_IPV4 0x04
#define FCRAM_CELL_IPV6_OPT 0x08
#define FCRAM_CELL_OPT_OPT 0x10
#define FCRAM_SUBAREA0_OCCUPIED 0x01
#define FCRAM_SUBAREA1_OCCUPIED 0x02
#define FCRAM_SUBAREA2_OCCUPIED 0x04
#define FCRAM_SUBAREA3_OCCUPIED 0x08
#define FCRAM_SUBAREA4_OCCUPIED 0x10
#define FCRAM_SUBAREA5_OCCUPIED 0x20
#define FCRAM_SUBAREA6_OCCUPIED 0x40
#define FCRAM_SUBAREA7_OCCUPIED 0x20
#define FCRAM_IPV4_SUBAREA0_OCCUPIED \
#define FCRAM_IPV4_SUBAREA4_OCCUPIED \
#define FCRAM_IPV6_SUBAREA0_OCCUPIED \
/*
* The current occupancy state of each FCRAM cell isy
* described by the fcram_cell_t data structure.
* The "type" field denotes the type of entry (or combination)
* the cell holds (FCRAM_CELL_EMPTY ...... FCRAM_CELL_OPT_OPT)
* The "occupied" field indicates if individual 8 bytes (subareas)
* with in the cell are occupied
*/
typedef struct _fcram_cell {
typedef struct _fcram_parition {
#define HASH_PARTITION_ENABLED 1
typedef struct _tcam_flow_spec {
/*
* Used for configuration.
* ndd as well nxge.conf use the following definitions
*/
#define NXGE_CLASS_CONFIG_PARAMS 20
/* Used for ip class flow key and tcam key config */
#define NXGE_CLASS_TCAM_LOOKUP 0x0001
#define NXGE_CLASS_TCAM_USE_SRC_ADDR 0x0002
#define NXGE_CLASS_FLOW_USE_PORTNUM 0x0010
#define NXGE_CLASS_FLOW_USE_L2DA 0x0020
#define NXGE_CLASS_FLOW_USE_VLAN 0x0040
#define NXGE_CLASS_FLOW_USE_PROTO 0x0080
#define NXGE_CLASS_FLOW_USE_IPSRC 0x0100
#define NXGE_CLASS_FLOW_USE_IPDST 0x0200
#define NXGE_CLASS_FLOW_USE_SRC_PORT 0x0400
#define NXGE_CLASS_FLOW_USE_DST_PORT 0x0800
#define NXGE_CLASS_DISCARD 0x80000000
/* these are used for quick configs */
#define NXGE_CLASS_FLOW_WEB_SERVER NXGE_CLASS_FLOW_USE_IPSRC | \
#define NXGE_CLASS_FLOW_GEN_SERVER NXGE_CLASS_FLOW_USE_IPSRC | \
/*
* used for use classes
*/
/* Ethernet Classes */
#define NXGE_CLASS_CFG_ETHER_TYPE_MASK 0x0000FFFF
#define NXGE_CLASS_CFG_ETHER_ENABLE_MASK 0x40000000
/* IP Classes */
#define NXGE_CLASS_CFG_IP_TOS_MASK 0x000000FF
#define NXGE_CLASS_CFG_IP_TOS_SHIFT 0
#define NXGE_CLASS_CFG_IP_TOS_MASK_MASK 0x0000FF00
#define NXGE_CLASS_CFG_IP_TOS_MASK_SHIFT 8
#define NXGE_CLASS_CFG_IP_PROTO_MASK 0x00FFFF00
#define NXGE_CLASS_CFG_IP_PROTO_SHIFT 16
#define NXGE_CLASS_CFG_IP_IPV6_MASK 0x01000000
#define NXGE_CLASS_CFG_IP_ENABLE_MASK 0x40000000
typedef struct _vlan_rdcgrp_map {
#define NXGE_INIT_VLAN_RDCG_TBL 32
typedef struct _nxge_classify {
#define NXGE_FFLP_HW_RESET 0x1
#define NXGE_FFLP_HW_INIT 0x2
#define NXGE_FFLP_SW_INIT 0x4
#define NXGE_FFLP_FCRAM_PART 0x80000000
#define NXGE_FLOW_NO_SUPPORT 0x0
#define NXGE_FLOW_USE_TCAM 0x1
#define NXGE_FLOW_USE_FCRAM 0x2
#define NXGE_FLOW_USE_TCAM_FCRAM 0x3
#define NXGE_FLOW_COMPUTE_H1 0x10
#define NXGE_FLOW_COMPUTE_H2 0x20
#ifdef __cplusplus
}
#endif
#endif /* _SYS_NXGE_NXGE_FFLP_H */