nxge_classify.c revision 0a8e077a7aaa5fa8697989cd69445512a997fc66
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <npi_fflp.h>
#include <nxge_defs.h>
#include <nxge_fflp.h>
#include <nxge_flow.h>
#include <nxge_impl.h>
#include <nxge_common.h>
/*
*
*/
int nxge_tcam_class_enable = 0;
int nxge_tcam_lookup_enable = 0;
/*
* Bit mapped
* 0x80000000: Drop
* 0x0000: NO TCAM Lookup Needed
* 0x0001: TCAM Lookup Needed with Dest Addr (IPv6)
* 0x0003: TCAM Lookup Needed with SRC Addr (IPv6)
* 0x0010: use MAC Port
* 0x0020: use L2DA
* 0x0040: use VLAN
* 0x0080: use proto
* 0x0100: use IP src addr
* 0x0200: use IP dest addr
* 0x0400: use Src Port
* 0x0800: use Dest Port
* 0x0fff: enable all options for IPv6 (with src addr)
* 0x0ffd: enable all options for IPv6 (with dest addr)
* 0x0fff: enable all options for IPv4
* 0x0ffd: enable all options for IPv4
*
*/
/*
* the default is to distribute as function of:
* protocol
* ip src address
* ip dest address
* src port
* dest port
*
* 0x0f80
*
*/
0xffffffffULL, /* h1_init */
0xffffULL, /* h2_init */
0x0, /* cfg_ether_usr1 */
0x0, /* cfg_ether_usr2 */
0x0, /* cfg_ip_usr4 */
0x0, /* cfg_ip_usr5 */
0x0, /* cfg_ip_usr6 */
0x0, /* cfg_ip_usr7 */
0x0, /* opt_ip_usr4 */
0x0, /* opt_ip_usr5 */
0x0, /* opt_ip_usr6 */
0x0, /* opt_ip_usr7 */
NXGE_CLASS_FLOW_GEN_SERVER, /* opt_ipv4_tcp */
NXGE_CLASS_FLOW_GEN_SERVER, /* opt_ipv4_udp */
NXGE_CLASS_FLOW_GEN_SERVER, /* opt_ipv4_ah */
NXGE_CLASS_FLOW_GEN_SERVER, /* opt_ipv4_sctp */
NXGE_CLASS_FLOW_GEN_SERVER, /* opt_ipv6_tcp */
NXGE_CLASS_FLOW_GEN_SERVER, /* opt_ipv6_udp */
NXGE_CLASS_FLOW_GEN_SERVER, /* opt_ipv6_ah */
NXGE_CLASS_FLOW_GEN_SERVER /* opt_ipv6_sctp */
};
0xffffffffULL, /* h1_init */
0xffffULL, /* h2_init */
0x0, /* cfg_ether_usr1 */
0x0, /* cfg_ether_usr2 */
0x0, /* cfg_ip_usr4 */
0x0, /* cfg_ip_usr5 */
0x0, /* cfg_ip_usr6 */
0x0, /* cfg_ip_usr7 */
0x0, /* opt_ip_usr4 */
0x0, /* opt_ip_usr5 */
0x0, /* opt_ip_usr6 */
0x0, /* opt_ip_usr7 */
NXGE_CLASS_FLOW_WEB_SERVER, /* opt_ipv4_tcp */
NXGE_CLASS_FLOW_GEN_SERVER, /* opt_ipv4_udp */
NXGE_CLASS_FLOW_GEN_SERVER, /* opt_ipv4_ah */
NXGE_CLASS_FLOW_GEN_SERVER, /* opt_ipv4_sctp */
NXGE_CLASS_FLOW_GEN_SERVER, /* opt_ipv6_tcp */
NXGE_CLASS_FLOW_GEN_SERVER, /* opt_ipv6_udp */
NXGE_CLASS_FLOW_GEN_SERVER, /* opt_ipv6_ah */
NXGE_CLASS_FLOW_GEN_SERVER /* opt_ipv6_sctp */
};
{
return (status);
return (status);
return (status);
return (NXGE_OK);
}
{
return (status);
}
return (NXGE_OK);
}
/* ARGSUSED */
{
if (cfg_param >= NXGE_CLASS_CONFIG_PARAMS)
return (-1);
switch (cfg_type) {
case CFG_L3_WEB:
break;
case CFG_L3_DISTRIBUTE:
default:
break;
}
return (cfg_value);
}
{
/* for now, get it from dma configs */
/*
* classify_init needs to call first.
*/
return (NXGE_OK);
}