#ifndef _OPA_VNIC_INTERNAL_H #define _OPA_VNIC_INTERNAL_H /* * Copyright(c) 2017 Intel Corporation. * * This file is provided under a dual BSD/GPLv2 license. When using or * redistributing this file, you may do so under either license. * * GPL LICENSE SUMMARY * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * BSD LICENSE * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * - Neither the name of Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
*/
/* * struct __opa_per_veswport_info - OPA vnic per port info * * Same as opa_per_veswport_info without bitwise attribute.
*/ struct __opa_per_veswport_info {
u32 port_num;
/* Lock used to protect updates to mac table */ struct mutex mactbl_lock;
/* Lock used to protect access to vnic counters */
spinlock_t stats_lock;
u8 flow_tbl[OPA_VNIC_FLOW_TBL_SIZE];
unsignedlong trap_timeout;
u8 trap_count;
};
/* Same as opa_veswport_mactable_entry, but without bitwise attribute */ struct __opa_vnic_mactable_entry {
u8 mac_addr[ETH_ALEN];
u8 mac_addr_mask[ETH_ALEN];
u32 dlid_sd;
} __packed;
/** * struct opa_vnic_mac_tbl_node - OPA VNIC mac table node * @hlist: hash list handle * @index: index of entry in the mac table * @entry: entry in the table
*/ struct opa_vnic_mac_tbl_node { struct hlist_node hlist;
u16 index; struct __opa_vnic_mactable_entry entry;
};
#define v_dbg(format, arg...) \
netdev_dbg(adapter->netdev, format, ## arg) #define v_err(format, arg...) \
netdev_err(adapter->netdev, format, ## arg) #define v_info(format, arg...) \
netdev_info(adapter->netdev, format, ## arg) #define v_warn(format, arg...) \
netdev_warn(adapter->netdev, format, ## arg)
#define c_err(format, arg...) \
dev_err(&cport->ibdev->dev, format, ## arg) #define c_info(format, arg...) \
dev_info(&cport->ibdev->dev, format, ## arg) #define c_dbg(format, arg...) \
dev_dbg(&cport->ibdev->dev, format, ## arg)
/* The maximum allowed entries in the mac table */ #define OPA_VNIC_MAC_TBL_MAX_ENTRIES 2048 /* Limit of smac entries in mac table */ #define OPA_VNIC_MAX_SMAC_LIMIT 256
/* The last octet of the MAC address is used as the key to the hash table */ #define OPA_VNIC_MAC_HASH_IDX 5
/* The VNIC MAC hash table is of size 2^8 */ #define OPA_VNIC_MAC_TBL_HASH_BITS 8 #define OPA_VNIC_MAC_TBL_SIZE BIT(OPA_VNIC_MAC_TBL_HASH_BITS)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.