restore lost packages from 0.2.3 + fix overwritten 0.2.4 files
- Restore 29 recipe symlinks (libdrm, qtbase, dbus, sddm, pipewire, etc.) - Restore 33 patches (KDE, libdrm, mesa, pipewire, sddm, wireplumber) - Restore 20+ local/scripts (audit, lint, test, build helpers) - Restore src/cook/scheduler.rs, status.rs, gnu-config/ - Restore scripts/patch-inclusion-gate.sh, run_mini1.sh, validate-collision-log.sh - Recover TLC source from HEAD (was overwritten by 0.2.3 checkout) - Recover 11 local/docs plans from HEAD (were overwritten) - Recover qt6-wayland-smoke symlink from HEAD - Fix MOTD: remove garbled ASCII art, use clean text - Update version: 0.2.0 -> 0.2.4 in os-release, motd, config - Reduce filesystem_size: 1536 -> 512 MiB - Add ABSOLUTE RULE to AGENTS.md: never delete/ignore packages - Reduce pcid scheme log verbosity: info -> debug
This commit is contained in:
@@ -0,0 +1,334 @@
|
||||
/*
|
||||
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef MLX4_CMD_H
|
||||
#define MLX4_CMD_H
|
||||
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/if_link.h>
|
||||
#include <linux/mlx4/device.h>
|
||||
#include <linux/netdevice.h>
|
||||
|
||||
enum {
|
||||
/* initialization and general commands */
|
||||
MLX4_CMD_SYS_EN = 0x1,
|
||||
MLX4_CMD_SYS_DIS = 0x2,
|
||||
MLX4_CMD_MAP_FA = 0xfff,
|
||||
MLX4_CMD_UNMAP_FA = 0xffe,
|
||||
MLX4_CMD_RUN_FW = 0xff6,
|
||||
MLX4_CMD_MOD_STAT_CFG = 0x34,
|
||||
MLX4_CMD_QUERY_DEV_CAP = 0x3,
|
||||
MLX4_CMD_QUERY_FW = 0x4,
|
||||
MLX4_CMD_ENABLE_LAM = 0xff8,
|
||||
MLX4_CMD_DISABLE_LAM = 0xff7,
|
||||
MLX4_CMD_QUERY_DDR = 0x5,
|
||||
MLX4_CMD_QUERY_ADAPTER = 0x6,
|
||||
MLX4_CMD_INIT_HCA = 0x7,
|
||||
MLX4_CMD_CLOSE_HCA = 0x8,
|
||||
MLX4_CMD_INIT_PORT = 0x9,
|
||||
MLX4_CMD_CLOSE_PORT = 0xa,
|
||||
MLX4_CMD_QUERY_HCA = 0xb,
|
||||
MLX4_CMD_QUERY_PORT = 0x43,
|
||||
MLX4_CMD_SENSE_PORT = 0x4d,
|
||||
MLX4_CMD_HW_HEALTH_CHECK = 0x50,
|
||||
MLX4_CMD_SET_PORT = 0xc,
|
||||
MLX4_CMD_SET_NODE = 0x5a,
|
||||
MLX4_CMD_QUERY_FUNC = 0x56,
|
||||
MLX4_CMD_ACCESS_DDR = 0x2e,
|
||||
MLX4_CMD_MAP_ICM = 0xffa,
|
||||
MLX4_CMD_UNMAP_ICM = 0xff9,
|
||||
MLX4_CMD_MAP_ICM_AUX = 0xffc,
|
||||
MLX4_CMD_UNMAP_ICM_AUX = 0xffb,
|
||||
MLX4_CMD_SET_ICM_SIZE = 0xffd,
|
||||
MLX4_CMD_ACCESS_REG = 0x3b,
|
||||
MLX4_CMD_ALLOCATE_VPP = 0x80,
|
||||
MLX4_CMD_SET_VPORT_QOS = 0x81,
|
||||
|
||||
/*master notify fw on finish for slave's flr*/
|
||||
MLX4_CMD_INFORM_FLR_DONE = 0x5b,
|
||||
MLX4_CMD_VIRT_PORT_MAP = 0x5c,
|
||||
MLX4_CMD_GET_OP_REQ = 0x59,
|
||||
|
||||
/* TPT commands */
|
||||
MLX4_CMD_SW2HW_MPT = 0xd,
|
||||
MLX4_CMD_QUERY_MPT = 0xe,
|
||||
MLX4_CMD_HW2SW_MPT = 0xf,
|
||||
MLX4_CMD_READ_MTT = 0x10,
|
||||
MLX4_CMD_WRITE_MTT = 0x11,
|
||||
MLX4_CMD_SYNC_TPT = 0x2f,
|
||||
|
||||
/* EQ commands */
|
||||
MLX4_CMD_MAP_EQ = 0x12,
|
||||
MLX4_CMD_SW2HW_EQ = 0x13,
|
||||
MLX4_CMD_HW2SW_EQ = 0x14,
|
||||
MLX4_CMD_QUERY_EQ = 0x15,
|
||||
|
||||
/* CQ commands */
|
||||
MLX4_CMD_SW2HW_CQ = 0x16,
|
||||
MLX4_CMD_HW2SW_CQ = 0x17,
|
||||
MLX4_CMD_QUERY_CQ = 0x18,
|
||||
MLX4_CMD_MODIFY_CQ = 0x2c,
|
||||
|
||||
/* SRQ commands */
|
||||
MLX4_CMD_SW2HW_SRQ = 0x35,
|
||||
MLX4_CMD_HW2SW_SRQ = 0x36,
|
||||
MLX4_CMD_QUERY_SRQ = 0x37,
|
||||
MLX4_CMD_ARM_SRQ = 0x40,
|
||||
|
||||
/* QP/EE commands */
|
||||
MLX4_CMD_RST2INIT_QP = 0x19,
|
||||
MLX4_CMD_INIT2RTR_QP = 0x1a,
|
||||
MLX4_CMD_RTR2RTS_QP = 0x1b,
|
||||
MLX4_CMD_RTS2RTS_QP = 0x1c,
|
||||
MLX4_CMD_SQERR2RTS_QP = 0x1d,
|
||||
MLX4_CMD_2ERR_QP = 0x1e,
|
||||
MLX4_CMD_RTS2SQD_QP = 0x1f,
|
||||
MLX4_CMD_SQD2SQD_QP = 0x38,
|
||||
MLX4_CMD_SQD2RTS_QP = 0x20,
|
||||
MLX4_CMD_2RST_QP = 0x21,
|
||||
MLX4_CMD_QUERY_QP = 0x22,
|
||||
MLX4_CMD_INIT2INIT_QP = 0x2d,
|
||||
MLX4_CMD_SUSPEND_QP = 0x32,
|
||||
MLX4_CMD_UNSUSPEND_QP = 0x33,
|
||||
MLX4_CMD_UPDATE_QP = 0x61,
|
||||
/* special QP and management commands */
|
||||
MLX4_CMD_CONF_SPECIAL_QP = 0x23,
|
||||
MLX4_CMD_MAD_IFC = 0x24,
|
||||
MLX4_CMD_MAD_DEMUX = 0x203,
|
||||
|
||||
/* multicast commands */
|
||||
MLX4_CMD_READ_MCG = 0x25,
|
||||
MLX4_CMD_WRITE_MCG = 0x26,
|
||||
MLX4_CMD_MGID_HASH = 0x27,
|
||||
|
||||
/* miscellaneous commands */
|
||||
MLX4_CMD_DIAG_RPRT = 0x30,
|
||||
MLX4_CMD_NOP = 0x31,
|
||||
MLX4_CMD_CONFIG_DEV = 0x3a,
|
||||
MLX4_CMD_ACCESS_MEM = 0x2e,
|
||||
MLX4_CMD_SET_VEP = 0x52,
|
||||
|
||||
/* Ethernet specific commands */
|
||||
MLX4_CMD_SET_VLAN_FLTR = 0x47,
|
||||
MLX4_CMD_SET_MCAST_FLTR = 0x48,
|
||||
MLX4_CMD_DUMP_ETH_STATS = 0x49,
|
||||
|
||||
/* Communication channel commands */
|
||||
MLX4_CMD_ARM_COMM_CHANNEL = 0x57,
|
||||
MLX4_CMD_GEN_EQE = 0x58,
|
||||
|
||||
/* virtual commands */
|
||||
MLX4_CMD_ALLOC_RES = 0xf00,
|
||||
MLX4_CMD_FREE_RES = 0xf01,
|
||||
MLX4_CMD_MCAST_ATTACH = 0xf05,
|
||||
MLX4_CMD_UCAST_ATTACH = 0xf06,
|
||||
MLX4_CMD_PROMISC = 0xf08,
|
||||
MLX4_CMD_QUERY_FUNC_CAP = 0xf0a,
|
||||
MLX4_CMD_QP_ATTACH = 0xf0b,
|
||||
|
||||
/* debug commands */
|
||||
MLX4_CMD_QUERY_DEBUG_MSG = 0x2a,
|
||||
MLX4_CMD_SET_DEBUG_MSG = 0x2b,
|
||||
|
||||
/* statistics commands */
|
||||
MLX4_CMD_QUERY_IF_STAT = 0X54,
|
||||
MLX4_CMD_SET_IF_STAT = 0X55,
|
||||
|
||||
/* register/delete flow steering network rules */
|
||||
MLX4_QP_FLOW_STEERING_ATTACH = 0x65,
|
||||
MLX4_QP_FLOW_STEERING_DETACH = 0x66,
|
||||
MLX4_FLOW_STEERING_IB_UC_QP_RANGE = 0x64,
|
||||
|
||||
/* Update and read QCN parameters */
|
||||
MLX4_CMD_CONGESTION_CTRL_OPCODE = 0x68,
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_CMD_TIME_CLASS_A = 60000,
|
||||
MLX4_CMD_TIME_CLASS_B = 60000,
|
||||
MLX4_CMD_TIME_CLASS_C = 60000,
|
||||
};
|
||||
|
||||
enum {
|
||||
/* virtual to physical port mapping opcode modifiers */
|
||||
MLX4_GET_PORT_VIRT2PHY = 0x0,
|
||||
MLX4_SET_PORT_VIRT2PHY = 0x1,
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_MAILBOX_SIZE = 4096,
|
||||
MLX4_ACCESS_MEM_ALIGN = 256,
|
||||
};
|
||||
|
||||
enum {
|
||||
/* Set port opcode modifiers */
|
||||
MLX4_SET_PORT_IB_OPCODE = 0x0,
|
||||
MLX4_SET_PORT_ETH_OPCODE = 0x1,
|
||||
MLX4_SET_PORT_BEACON_OPCODE = 0x4,
|
||||
};
|
||||
|
||||
enum {
|
||||
/* Set port Ethernet input modifiers */
|
||||
MLX4_SET_PORT_GENERAL = 0x0,
|
||||
MLX4_SET_PORT_RQP_CALC = 0x1,
|
||||
MLX4_SET_PORT_MAC_TABLE = 0x2,
|
||||
MLX4_SET_PORT_VLAN_TABLE = 0x3,
|
||||
MLX4_SET_PORT_PRIO_MAP = 0x4,
|
||||
MLX4_SET_PORT_GID_TABLE = 0x5,
|
||||
MLX4_SET_PORT_PRIO2TC = 0x8,
|
||||
MLX4_SET_PORT_SCHEDULER = 0x9,
|
||||
MLX4_SET_PORT_VXLAN = 0xB,
|
||||
MLX4_SET_PORT_ROCE_ADDR = 0xD
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_CMD_MAD_DEMUX_CONFIG = 0,
|
||||
MLX4_CMD_MAD_DEMUX_QUERY_STATE = 1,
|
||||
MLX4_CMD_MAD_DEMUX_QUERY_RESTR = 2, /* Query mad demux restrictions */
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_CMD_WRAPPED,
|
||||
MLX4_CMD_NATIVE
|
||||
};
|
||||
|
||||
/*
|
||||
* MLX4_RX_CSUM_MODE_VAL_NON_TCP_UDP -
|
||||
* Receive checksum value is reported in CQE also for non TCP/UDP packets.
|
||||
*
|
||||
* MLX4_RX_CSUM_MODE_L4 -
|
||||
* L4_CSUM bit in CQE, which indicates whether or not L4 checksum
|
||||
* was validated correctly, is supported.
|
||||
*
|
||||
* MLX4_RX_CSUM_MODE_IP_OK_IP_NON_TCP_UDP -
|
||||
* IP_OK CQE's field is supported also for non TCP/UDP IP packets.
|
||||
*
|
||||
* MLX4_RX_CSUM_MODE_MULTI_VLAN -
|
||||
* Receive Checksum offload is supported for packets with more than 2 vlan headers.
|
||||
*/
|
||||
enum mlx4_rx_csum_mode {
|
||||
MLX4_RX_CSUM_MODE_VAL_NON_TCP_UDP = 1UL << 0,
|
||||
MLX4_RX_CSUM_MODE_L4 = 1UL << 1,
|
||||
MLX4_RX_CSUM_MODE_IP_OK_IP_NON_TCP_UDP = 1UL << 2,
|
||||
MLX4_RX_CSUM_MODE_MULTI_VLAN = 1UL << 3
|
||||
};
|
||||
|
||||
struct mlx4_config_dev_params {
|
||||
u16 vxlan_udp_dport;
|
||||
u8 rx_csum_flags_port_1;
|
||||
u8 rx_csum_flags_port_2;
|
||||
};
|
||||
|
||||
enum mlx4_en_congestion_control_algorithm {
|
||||
MLX4_CTRL_ALGO_802_1_QAU_REACTION_POINT = 0,
|
||||
};
|
||||
|
||||
enum mlx4_en_congestion_control_opmod {
|
||||
MLX4_CONGESTION_CONTROL_GET_PARAMS,
|
||||
MLX4_CONGESTION_CONTROL_GET_STATISTICS,
|
||||
MLX4_CONGESTION_CONTROL_SET_PARAMS = 4,
|
||||
};
|
||||
|
||||
struct mlx4_dev;
|
||||
|
||||
struct mlx4_cmd_mailbox {
|
||||
void *buf;
|
||||
dma_addr_t dma;
|
||||
};
|
||||
|
||||
int __mlx4_cmd(struct mlx4_dev *dev, u64 in_param, u64 *out_param,
|
||||
int out_is_imm, u32 in_modifier, u8 op_modifier,
|
||||
u16 op, unsigned long timeout, int native);
|
||||
|
||||
/* Invoke a command with no output parameter */
|
||||
static inline int mlx4_cmd(struct mlx4_dev *dev, u64 in_param, u32 in_modifier,
|
||||
u8 op_modifier, u16 op, unsigned long timeout,
|
||||
int native)
|
||||
{
|
||||
return __mlx4_cmd(dev, in_param, NULL, 0, in_modifier,
|
||||
op_modifier, op, timeout, native);
|
||||
}
|
||||
|
||||
/* Invoke a command with an output mailbox */
|
||||
static inline int mlx4_cmd_box(struct mlx4_dev *dev, u64 in_param, u64 out_param,
|
||||
u32 in_modifier, u8 op_modifier, u16 op,
|
||||
unsigned long timeout, int native)
|
||||
{
|
||||
return __mlx4_cmd(dev, in_param, &out_param, 0, in_modifier,
|
||||
op_modifier, op, timeout, native);
|
||||
}
|
||||
|
||||
/*
|
||||
* Invoke a command with an immediate output parameter (and copy the
|
||||
* output into the caller's out_param pointer after the command
|
||||
* executes).
|
||||
*/
|
||||
static inline int mlx4_cmd_imm(struct mlx4_dev *dev, u64 in_param, u64 *out_param,
|
||||
u32 in_modifier, u8 op_modifier, u16 op,
|
||||
unsigned long timeout, int native)
|
||||
{
|
||||
return __mlx4_cmd(dev, in_param, out_param, 1, in_modifier,
|
||||
op_modifier, op, timeout, native);
|
||||
}
|
||||
|
||||
struct mlx4_cmd_mailbox *mlx4_alloc_cmd_mailbox(struct mlx4_dev *dev);
|
||||
void mlx4_free_cmd_mailbox(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox);
|
||||
|
||||
int mlx4_get_counter_stats(struct mlx4_dev *dev, int counter_index,
|
||||
struct mlx4_counter *counter_stats, int reset);
|
||||
int mlx4_get_vf_stats(struct mlx4_dev *dev, int port, int vf_idx,
|
||||
struct ifla_vf_stats *vf_stats);
|
||||
u32 mlx4_comm_get_version(void);
|
||||
int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u8 *mac);
|
||||
int mlx4_set_vf_vlan(struct mlx4_dev *dev, int port, int vf, u16 vlan,
|
||||
u8 qos, __be16 proto);
|
||||
int mlx4_set_vf_rate(struct mlx4_dev *dev, int port, int vf, int min_tx_rate,
|
||||
int max_tx_rate);
|
||||
int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting);
|
||||
int mlx4_get_vf_config(struct mlx4_dev *dev, int port, int vf, struct ifla_vf_info *ivf);
|
||||
int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_state);
|
||||
int mlx4_config_dev_retrieval(struct mlx4_dev *dev,
|
||||
struct mlx4_config_dev_params *params);
|
||||
void mlx4_cmd_wake_completions(struct mlx4_dev *dev);
|
||||
void mlx4_report_internal_err_comm_event(struct mlx4_dev *dev);
|
||||
/*
|
||||
* mlx4_get_slave_default_vlan -
|
||||
* return true if VST ( default vlan)
|
||||
* if VST, will return vlan & qos (if not NULL)
|
||||
*/
|
||||
bool mlx4_get_slave_default_vlan(struct mlx4_dev *dev, int port, int slave,
|
||||
u16 *vlan, u8 *qos);
|
||||
|
||||
#define MLX4_COMM_GET_IF_REV(cmd_chan_ver) (u8)((cmd_chan_ver) >> 8)
|
||||
#define COMM_CHAN_EVENT_INTERNAL_ERR (1 << 17)
|
||||
|
||||
#endif /* MLX4_CMD_H */
|
||||
@@ -0,0 +1,187 @@
|
||||
/*
|
||||
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef MLX4_CQ_H
|
||||
#define MLX4_CQ_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/if_ether.h>
|
||||
|
||||
#include <linux/mlx4/device.h>
|
||||
#include <linux/mlx4/doorbell.h>
|
||||
|
||||
struct mlx4_cqe {
|
||||
__be32 vlan_my_qpn;
|
||||
__be32 immed_rss_invalid;
|
||||
__be32 g_mlpath_rqpn;
|
||||
__be16 sl_vid;
|
||||
union {
|
||||
struct {
|
||||
__be16 rlid;
|
||||
__be16 status;
|
||||
u8 ipv6_ext_mask;
|
||||
u8 badfcs_enc;
|
||||
};
|
||||
u8 smac[ETH_ALEN];
|
||||
};
|
||||
__be32 byte_cnt;
|
||||
__be16 wqe_index;
|
||||
__be16 checksum;
|
||||
u8 reserved[3];
|
||||
u8 owner_sr_opcode;
|
||||
};
|
||||
|
||||
struct mlx4_err_cqe {
|
||||
__be32 my_qpn;
|
||||
u32 reserved1[5];
|
||||
__be16 wqe_index;
|
||||
u8 vendor_err_syndrome;
|
||||
u8 syndrome;
|
||||
u8 reserved2[3];
|
||||
u8 owner_sr_opcode;
|
||||
};
|
||||
|
||||
struct mlx4_ts_cqe {
|
||||
__be32 vlan_my_qpn;
|
||||
__be32 immed_rss_invalid;
|
||||
__be32 g_mlpath_rqpn;
|
||||
__be32 timestamp_hi;
|
||||
__be16 status;
|
||||
u8 ipv6_ext_mask;
|
||||
u8 badfcs_enc;
|
||||
__be32 byte_cnt;
|
||||
__be16 wqe_index;
|
||||
__be16 checksum;
|
||||
u8 reserved;
|
||||
__be16 timestamp_lo;
|
||||
u8 owner_sr_opcode;
|
||||
} __packed;
|
||||
|
||||
enum {
|
||||
MLX4_CQE_L2_TUNNEL_IPOK = 1 << 31,
|
||||
MLX4_CQE_CVLAN_PRESENT_MASK = 1 << 29,
|
||||
MLX4_CQE_SVLAN_PRESENT_MASK = 1 << 30,
|
||||
MLX4_CQE_L2_TUNNEL = 1 << 27,
|
||||
MLX4_CQE_L2_TUNNEL_CSUM = 1 << 26,
|
||||
MLX4_CQE_L2_TUNNEL_IPV4 = 1 << 25,
|
||||
|
||||
MLX4_CQE_QPN_MASK = 0xffffff,
|
||||
MLX4_CQE_VID_MASK = 0xfff,
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_CQE_OWNER_MASK = 0x80,
|
||||
MLX4_CQE_IS_SEND_MASK = 0x40,
|
||||
MLX4_CQE_OPCODE_MASK = 0x1f
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_CQE_SYNDROME_LOCAL_LENGTH_ERR = 0x01,
|
||||
MLX4_CQE_SYNDROME_LOCAL_QP_OP_ERR = 0x02,
|
||||
MLX4_CQE_SYNDROME_LOCAL_PROT_ERR = 0x04,
|
||||
MLX4_CQE_SYNDROME_WR_FLUSH_ERR = 0x05,
|
||||
MLX4_CQE_SYNDROME_MW_BIND_ERR = 0x06,
|
||||
MLX4_CQE_SYNDROME_BAD_RESP_ERR = 0x10,
|
||||
MLX4_CQE_SYNDROME_LOCAL_ACCESS_ERR = 0x11,
|
||||
MLX4_CQE_SYNDROME_REMOTE_INVAL_REQ_ERR = 0x12,
|
||||
MLX4_CQE_SYNDROME_REMOTE_ACCESS_ERR = 0x13,
|
||||
MLX4_CQE_SYNDROME_REMOTE_OP_ERR = 0x14,
|
||||
MLX4_CQE_SYNDROME_TRANSPORT_RETRY_EXC_ERR = 0x15,
|
||||
MLX4_CQE_SYNDROME_RNR_RETRY_EXC_ERR = 0x16,
|
||||
MLX4_CQE_SYNDROME_REMOTE_ABORTED_ERR = 0x22,
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_CQE_STATUS_IPV4 = 1 << 6,
|
||||
MLX4_CQE_STATUS_IPV4F = 1 << 7,
|
||||
MLX4_CQE_STATUS_IPV6 = 1 << 8,
|
||||
MLX4_CQE_STATUS_IPV4OPT = 1 << 9,
|
||||
MLX4_CQE_STATUS_TCP = 1 << 10,
|
||||
MLX4_CQE_STATUS_UDP = 1 << 11,
|
||||
MLX4_CQE_STATUS_IPOK = 1 << 12,
|
||||
};
|
||||
|
||||
/* L4_CSUM is logically part of status, but has to checked against badfcs_enc */
|
||||
enum {
|
||||
MLX4_CQE_STATUS_L4_CSUM = 1 << 2,
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_CQE_LLC = 1,
|
||||
MLX4_CQE_SNAP = 1 << 1,
|
||||
MLX4_CQE_BAD_FCS = 1 << 4,
|
||||
};
|
||||
|
||||
#define MLX4_MAX_CQ_PERIOD (BIT(16) - 1)
|
||||
#define MLX4_MAX_CQ_COUNT (BIT(16) - 1)
|
||||
|
||||
static inline void mlx4_cq_arm(struct mlx4_cq *cq, u32 cmd,
|
||||
void __iomem *uar_page,
|
||||
spinlock_t *doorbell_lock)
|
||||
{
|
||||
__be32 doorbell[2];
|
||||
u32 sn;
|
||||
u32 ci;
|
||||
|
||||
sn = cq->arm_sn & 3;
|
||||
ci = cq->cons_index & 0xffffff;
|
||||
|
||||
*cq->arm_db = cpu_to_be32(sn << 28 | cmd | ci);
|
||||
|
||||
/*
|
||||
* Make sure that the doorbell record in host memory is
|
||||
* written before ringing the doorbell via PCI MMIO.
|
||||
*/
|
||||
wmb();
|
||||
|
||||
doorbell[0] = cpu_to_be32(sn << 28 | cmd | cq->cqn);
|
||||
doorbell[1] = cpu_to_be32(ci);
|
||||
|
||||
mlx4_write64(doorbell, uar_page + MLX4_CQ_DOORBELL, doorbell_lock);
|
||||
}
|
||||
|
||||
static inline void mlx4_cq_set_ci(struct mlx4_cq *cq)
|
||||
{
|
||||
*cq->set_ci_db = cpu_to_be32(cq->cons_index & 0xffffff);
|
||||
}
|
||||
|
||||
enum {
|
||||
MLX4_CQ_DB_REQ_NOT_SOL = 1 << 24,
|
||||
MLX4_CQ_DB_REQ_NOT = 2 << 24
|
||||
};
|
||||
|
||||
int mlx4_cq_modify(struct mlx4_dev *dev, struct mlx4_cq *cq,
|
||||
u16 count, u16 period);
|
||||
int mlx4_cq_resize(struct mlx4_dev *dev, struct mlx4_cq *cq,
|
||||
int entries, struct mlx4_mtt *mtt);
|
||||
|
||||
#endif /* MLX4_CQ_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright (c) 2004 Topspin Communications. All rights reserved.
|
||||
* Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2005 Mellanox Technologies. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef MLX4_DOORBELL_H
|
||||
#define MLX4_DOORBELL_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/io.h>
|
||||
|
||||
#define MLX4_SEND_DOORBELL 0x14
|
||||
#define MLX4_CQ_DOORBELL 0x20
|
||||
|
||||
#if BITS_PER_LONG == 64
|
||||
/*
|
||||
* Assume that we can just write a 64-bit doorbell atomically. s390
|
||||
* actually doesn't have writeq() but S/390 systems don't even have
|
||||
* PCI so we won't worry about it.
|
||||
*/
|
||||
|
||||
#define MLX4_DECLARE_DOORBELL_LOCK(name)
|
||||
#define MLX4_INIT_DOORBELL_LOCK(ptr) do { } while (0)
|
||||
#define MLX4_GET_DOORBELL_LOCK(ptr) (NULL)
|
||||
|
||||
static inline void mlx4_write64(__be32 val[2], void __iomem *dest,
|
||||
spinlock_t *doorbell_lock)
|
||||
{
|
||||
__raw_writeq(*(u64 *) val, dest);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* Just fall back to a spinlock to protect the doorbell if
|
||||
* BITS_PER_LONG is 32 -- there's no portable way to do atomic 64-bit
|
||||
* MMIO writes.
|
||||
*/
|
||||
|
||||
#define MLX4_DECLARE_DOORBELL_LOCK(name) spinlock_t name;
|
||||
#define MLX4_INIT_DOORBELL_LOCK(ptr) spin_lock_init(ptr)
|
||||
#define MLX4_GET_DOORBELL_LOCK(ptr) (ptr)
|
||||
|
||||
static inline void mlx4_write64(__be32 val[2], void __iomem *dest,
|
||||
spinlock_t *doorbell_lock)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(doorbell_lock, flags);
|
||||
__raw_writel((__force u32) val[0], dest);
|
||||
__raw_writel((__force u32) val[1], dest + 4);
|
||||
spin_unlock_irqrestore(doorbell_lock, flags);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* MLX4_DOORBELL_H */
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef MLX4_DRIVER_H
|
||||
#define MLX4_DRIVER_H
|
||||
|
||||
#include <net/devlink.h>
|
||||
#include <linux/auxiliary_bus.h>
|
||||
#include <linux/notifier.h>
|
||||
#include <linux/mlx4/device.h>
|
||||
|
||||
#define MLX4_ADEV_NAME "mlx4_core"
|
||||
|
||||
struct mlx4_dev;
|
||||
|
||||
#define MLX4_MAC_MASK 0xffffffffffffULL
|
||||
|
||||
enum mlx4_dev_event {
|
||||
MLX4_DEV_EVENT_CATASTROPHIC_ERROR,
|
||||
MLX4_DEV_EVENT_PORT_UP,
|
||||
MLX4_DEV_EVENT_PORT_DOWN,
|
||||
MLX4_DEV_EVENT_PORT_REINIT,
|
||||
MLX4_DEV_EVENT_PORT_MGMT_CHANGE,
|
||||
MLX4_DEV_EVENT_SLAVE_INIT,
|
||||
MLX4_DEV_EVENT_SLAVE_SHUTDOWN,
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_INTFF_BONDING = 1 << 0
|
||||
};
|
||||
|
||||
struct mlx4_adrv {
|
||||
struct auxiliary_driver adrv;
|
||||
enum mlx4_protocol protocol;
|
||||
int flags;
|
||||
};
|
||||
|
||||
int mlx4_register_auxiliary_driver(struct mlx4_adrv *madrv);
|
||||
void mlx4_unregister_auxiliary_driver(struct mlx4_adrv *madrv);
|
||||
|
||||
int mlx4_register_event_notifier(struct mlx4_dev *dev,
|
||||
struct notifier_block *nb);
|
||||
int mlx4_unregister_event_notifier(struct mlx4_dev *dev,
|
||||
struct notifier_block *nb);
|
||||
|
||||
struct devlink_port *mlx4_get_devlink_port(struct mlx4_dev *dev, int port);
|
||||
|
||||
#endif /* MLX4_DRIVER_H */
|
||||
@@ -0,0 +1,508 @@
|
||||
/*
|
||||
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef MLX4_QP_H
|
||||
#define MLX4_QP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/if_ether.h>
|
||||
|
||||
#include <linux/mlx4/device.h>
|
||||
|
||||
#define MLX4_INVALID_LKEY 0x100
|
||||
|
||||
enum mlx4_qp_optpar {
|
||||
MLX4_QP_OPTPAR_ALT_ADDR_PATH = 1 << 0,
|
||||
MLX4_QP_OPTPAR_RRE = 1 << 1,
|
||||
MLX4_QP_OPTPAR_RAE = 1 << 2,
|
||||
MLX4_QP_OPTPAR_RWE = 1 << 3,
|
||||
MLX4_QP_OPTPAR_PKEY_INDEX = 1 << 4,
|
||||
MLX4_QP_OPTPAR_Q_KEY = 1 << 5,
|
||||
MLX4_QP_OPTPAR_RNR_TIMEOUT = 1 << 6,
|
||||
MLX4_QP_OPTPAR_PRIMARY_ADDR_PATH = 1 << 7,
|
||||
MLX4_QP_OPTPAR_SRA_MAX = 1 << 8,
|
||||
MLX4_QP_OPTPAR_RRA_MAX = 1 << 9,
|
||||
MLX4_QP_OPTPAR_PM_STATE = 1 << 10,
|
||||
MLX4_QP_OPTPAR_RETRY_COUNT = 1 << 12,
|
||||
MLX4_QP_OPTPAR_RNR_RETRY = 1 << 13,
|
||||
MLX4_QP_OPTPAR_ACK_TIMEOUT = 1 << 14,
|
||||
MLX4_QP_OPTPAR_SCHED_QUEUE = 1 << 16,
|
||||
MLX4_QP_OPTPAR_COUNTER_INDEX = 1 << 20,
|
||||
MLX4_QP_OPTPAR_VLAN_STRIPPING = 1 << 21,
|
||||
};
|
||||
|
||||
enum mlx4_qp_state {
|
||||
MLX4_QP_STATE_RST = 0,
|
||||
MLX4_QP_STATE_INIT = 1,
|
||||
MLX4_QP_STATE_RTR = 2,
|
||||
MLX4_QP_STATE_RTS = 3,
|
||||
MLX4_QP_STATE_SQER = 4,
|
||||
MLX4_QP_STATE_SQD = 5,
|
||||
MLX4_QP_STATE_ERR = 6,
|
||||
MLX4_QP_STATE_SQ_DRAINING = 7,
|
||||
MLX4_QP_NUM_STATE
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_QP_ST_RC = 0x0,
|
||||
MLX4_QP_ST_UC = 0x1,
|
||||
MLX4_QP_ST_RD = 0x2,
|
||||
MLX4_QP_ST_UD = 0x3,
|
||||
MLX4_QP_ST_XRC = 0x6,
|
||||
MLX4_QP_ST_MLX = 0x7
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_QP_PM_MIGRATED = 0x3,
|
||||
MLX4_QP_PM_ARMED = 0x0,
|
||||
MLX4_QP_PM_REARM = 0x1
|
||||
};
|
||||
|
||||
enum {
|
||||
/* params1 */
|
||||
MLX4_QP_BIT_SRE = 1 << 15,
|
||||
MLX4_QP_BIT_SWE = 1 << 14,
|
||||
MLX4_QP_BIT_SAE = 1 << 13,
|
||||
/* params2 */
|
||||
MLX4_QP_BIT_RRE = 1 << 15,
|
||||
MLX4_QP_BIT_RWE = 1 << 14,
|
||||
MLX4_QP_BIT_RAE = 1 << 13,
|
||||
MLX4_QP_BIT_FPP = 1 << 3,
|
||||
MLX4_QP_BIT_RIC = 1 << 4,
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_RSS_HASH_XOR = 0,
|
||||
MLX4_RSS_HASH_TOP = 1,
|
||||
|
||||
MLX4_RSS_UDP_IPV6 = 1 << 0,
|
||||
MLX4_RSS_UDP_IPV4 = 1 << 1,
|
||||
MLX4_RSS_TCP_IPV6 = 1 << 2,
|
||||
MLX4_RSS_IPV6 = 1 << 3,
|
||||
MLX4_RSS_TCP_IPV4 = 1 << 4,
|
||||
MLX4_RSS_IPV4 = 1 << 5,
|
||||
|
||||
MLX4_RSS_BY_OUTER_HEADERS = 0 << 6,
|
||||
MLX4_RSS_BY_INNER_HEADERS = 2 << 6,
|
||||
MLX4_RSS_BY_INNER_HEADERS_IPONLY = 3 << 6,
|
||||
|
||||
/* offset of mlx4_rss_context within mlx4_qp_context.pri_path */
|
||||
MLX4_RSS_OFFSET_IN_QPC_PRI_PATH = 0x24,
|
||||
/* offset of being RSS indirection QP within mlx4_qp_context.flags */
|
||||
MLX4_RSS_QPC_FLAG_OFFSET = 13,
|
||||
};
|
||||
|
||||
#define MLX4_EN_RSS_KEY_SIZE 40
|
||||
|
||||
struct mlx4_rss_context {
|
||||
__be32 base_qpn;
|
||||
__be32 default_qpn;
|
||||
u16 reserved;
|
||||
u8 hash_fn;
|
||||
u8 flags;
|
||||
__be32 rss_key[MLX4_EN_RSS_KEY_SIZE / sizeof(__be32)];
|
||||
__be32 base_qpn_udp;
|
||||
};
|
||||
|
||||
struct mlx4_qp_path {
|
||||
u8 fl;
|
||||
union {
|
||||
u8 vlan_control;
|
||||
u8 control;
|
||||
};
|
||||
u8 disable_pkey_check;
|
||||
u8 pkey_index;
|
||||
u8 counter_index;
|
||||
u8 grh_mylmc;
|
||||
__be16 rlid;
|
||||
u8 ackto;
|
||||
u8 mgid_index;
|
||||
u8 static_rate;
|
||||
u8 hop_limit;
|
||||
__be32 tclass_flowlabel;
|
||||
u8 rgid[16];
|
||||
u8 sched_queue;
|
||||
u8 vlan_index;
|
||||
u8 feup;
|
||||
u8 fvl_rx;
|
||||
u8 reserved4[2];
|
||||
u8 dmac[ETH_ALEN];
|
||||
};
|
||||
|
||||
enum { /* fl */
|
||||
MLX4_FL_CV = 1 << 6,
|
||||
MLX4_FL_SV = 1 << 5,
|
||||
MLX4_FL_ETH_HIDE_CQE_VLAN = 1 << 2,
|
||||
MLX4_FL_ETH_SRC_CHECK_MC_LB = 1 << 1,
|
||||
MLX4_FL_ETH_SRC_CHECK_UC_LB = 1 << 0,
|
||||
};
|
||||
|
||||
enum { /* control */
|
||||
MLX4_CTRL_ETH_SRC_CHECK_IF_COUNTER = 1 << 7,
|
||||
};
|
||||
|
||||
enum { /* vlan_control */
|
||||
MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED = 1 << 6,
|
||||
MLX4_VLAN_CTRL_ETH_TX_BLOCK_PRIO_TAGGED = 1 << 5, /* 802.1p priority tag */
|
||||
MLX4_VLAN_CTRL_ETH_TX_BLOCK_UNTAGGED = 1 << 4,
|
||||
MLX4_VLAN_CTRL_ETH_RX_BLOCK_TAGGED = 1 << 2,
|
||||
MLX4_VLAN_CTRL_ETH_RX_BLOCK_PRIO_TAGGED = 1 << 1, /* 802.1p priority tag */
|
||||
MLX4_VLAN_CTRL_ETH_RX_BLOCK_UNTAGGED = 1 << 0
|
||||
};
|
||||
|
||||
enum { /* feup */
|
||||
MLX4_FEUP_FORCE_ETH_UP = 1 << 6, /* force Eth UP */
|
||||
MLX4_FSM_FORCE_ETH_SRC_MAC = 1 << 5, /* force Source MAC */
|
||||
MLX4_FVL_FORCE_ETH_VLAN = 1 << 3 /* force Eth vlan */
|
||||
};
|
||||
|
||||
enum { /* fvl_rx */
|
||||
MLX4_FVL_RX_FORCE_ETH_VLAN = 1 << 0 /* enforce Eth rx vlan */
|
||||
};
|
||||
|
||||
struct mlx4_qp_context {
|
||||
__be32 flags;
|
||||
__be32 pd;
|
||||
u8 mtu_msgmax;
|
||||
u8 rq_size_stride;
|
||||
u8 sq_size_stride;
|
||||
u8 rlkey_roce_mode;
|
||||
__be32 usr_page;
|
||||
__be32 local_qpn;
|
||||
__be32 remote_qpn;
|
||||
struct mlx4_qp_path pri_path;
|
||||
struct mlx4_qp_path alt_path;
|
||||
__be32 params1;
|
||||
u32 reserved1;
|
||||
__be32 next_send_psn;
|
||||
__be32 cqn_send;
|
||||
__be16 roce_entropy;
|
||||
__be16 reserved2[3];
|
||||
__be32 last_acked_psn;
|
||||
__be32 ssn;
|
||||
__be32 params2;
|
||||
__be32 rnr_nextrecvpsn;
|
||||
__be32 xrcd;
|
||||
__be32 cqn_recv;
|
||||
__be64 db_rec_addr;
|
||||
__be32 qkey;
|
||||
__be32 srqn;
|
||||
__be32 msn;
|
||||
__be16 rq_wqe_counter;
|
||||
__be16 sq_wqe_counter;
|
||||
u32 reserved3;
|
||||
__be16 rate_limit_params;
|
||||
u8 reserved4;
|
||||
u8 qos_vport;
|
||||
__be32 param3;
|
||||
__be32 nummmcpeers_basemkey;
|
||||
u8 log_page_size;
|
||||
u8 reserved5[2];
|
||||
u8 mtt_base_addr_h;
|
||||
__be32 mtt_base_addr_l;
|
||||
u32 reserved6[10];
|
||||
};
|
||||
|
||||
struct mlx4_update_qp_context {
|
||||
__be64 qp_mask;
|
||||
__be64 primary_addr_path_mask;
|
||||
__be64 secondary_addr_path_mask;
|
||||
u64 reserved1;
|
||||
struct mlx4_qp_context qp_context;
|
||||
u64 reserved2[58];
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_UPD_QP_MASK_PM_STATE = 32,
|
||||
MLX4_UPD_QP_MASK_VSD = 33,
|
||||
MLX4_UPD_QP_MASK_QOS_VPP = 34,
|
||||
MLX4_UPD_QP_MASK_RATE_LIMIT = 35,
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_UPD_QP_PATH_MASK_PKEY_INDEX = 0 + 32,
|
||||
MLX4_UPD_QP_PATH_MASK_FSM = 1 + 32,
|
||||
MLX4_UPD_QP_PATH_MASK_MAC_INDEX = 2 + 32,
|
||||
MLX4_UPD_QP_PATH_MASK_FVL = 3 + 32,
|
||||
MLX4_UPD_QP_PATH_MASK_CV = 4 + 32,
|
||||
MLX4_UPD_QP_PATH_MASK_VLAN_INDEX = 5 + 32,
|
||||
MLX4_UPD_QP_PATH_MASK_ETH_HIDE_CQE_VLAN = 6 + 32,
|
||||
MLX4_UPD_QP_PATH_MASK_ETH_TX_BLOCK_UNTAGGED = 7 + 32,
|
||||
MLX4_UPD_QP_PATH_MASK_ETH_TX_BLOCK_1P = 8 + 32,
|
||||
MLX4_UPD_QP_PATH_MASK_ETH_TX_BLOCK_TAGGED = 9 + 32,
|
||||
MLX4_UPD_QP_PATH_MASK_ETH_RX_BLOCK_UNTAGGED = 10 + 32,
|
||||
MLX4_UPD_QP_PATH_MASK_ETH_RX_BLOCK_1P = 11 + 32,
|
||||
MLX4_UPD_QP_PATH_MASK_ETH_RX_BLOCK_TAGGED = 12 + 32,
|
||||
MLX4_UPD_QP_PATH_MASK_FEUP = 13 + 32,
|
||||
MLX4_UPD_QP_PATH_MASK_SCHED_QUEUE = 14 + 32,
|
||||
MLX4_UPD_QP_PATH_MASK_IF_COUNTER_INDEX = 15 + 32,
|
||||
MLX4_UPD_QP_PATH_MASK_FVL_RX = 16 + 32,
|
||||
MLX4_UPD_QP_PATH_MASK_ETH_SRC_CHECK_UC_LB = 18 + 32,
|
||||
MLX4_UPD_QP_PATH_MASK_ETH_SRC_CHECK_MC_LB = 19 + 32,
|
||||
MLX4_UPD_QP_PATH_MASK_SV = 22 + 32,
|
||||
};
|
||||
|
||||
enum { /* param3 */
|
||||
MLX4_STRIP_VLAN = 1 << 30
|
||||
};
|
||||
|
||||
/* Which firmware version adds support for NEC (NoErrorCompletion) bit */
|
||||
#define MLX4_FW_VER_WQE_CTRL_NEC mlx4_fw_ver(2, 2, 232)
|
||||
|
||||
enum {
|
||||
MLX4_WQE_CTRL_NEC = 1 << 29,
|
||||
MLX4_WQE_CTRL_IIP = 1 << 28,
|
||||
MLX4_WQE_CTRL_ILP = 1 << 27,
|
||||
MLX4_WQE_CTRL_FENCE = 1 << 6,
|
||||
MLX4_WQE_CTRL_CQ_UPDATE = 3 << 2,
|
||||
MLX4_WQE_CTRL_SOLICITED = 1 << 1,
|
||||
MLX4_WQE_CTRL_IP_CSUM = 1 << 4,
|
||||
MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5,
|
||||
MLX4_WQE_CTRL_INS_CVLAN = 1 << 6,
|
||||
MLX4_WQE_CTRL_INS_SVLAN = 1 << 7,
|
||||
MLX4_WQE_CTRL_STRONG_ORDER = 1 << 7,
|
||||
MLX4_WQE_CTRL_FORCE_LOOPBACK = 1 << 0,
|
||||
};
|
||||
|
||||
union mlx4_wqe_qpn_vlan {
|
||||
struct {
|
||||
__be16 vlan_tag;
|
||||
u8 ins_vlan;
|
||||
u8 fence_size;
|
||||
};
|
||||
__be32 bf_qpn;
|
||||
};
|
||||
|
||||
struct mlx4_wqe_ctrl_seg {
|
||||
__be32 owner_opcode;
|
||||
union mlx4_wqe_qpn_vlan qpn_vlan;
|
||||
/*
|
||||
* High 24 bits are SRC remote buffer; low 8 bits are flags:
|
||||
* [7] SO (strong ordering)
|
||||
* [5] TCP/UDP checksum
|
||||
* [4] IP checksum
|
||||
* [3:2] C (generate completion queue entry)
|
||||
* [1] SE (solicited event)
|
||||
* [0] FL (force loopback)
|
||||
*/
|
||||
union {
|
||||
__be32 srcrb_flags;
|
||||
__be16 srcrb_flags16[2];
|
||||
};
|
||||
/*
|
||||
* imm is immediate data for send/RDMA write w/ immediate;
|
||||
* also invalidation key for send with invalidate; input
|
||||
* modifier for WQEs on CCQs.
|
||||
*/
|
||||
__be32 imm;
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_WQE_MLX_VL15 = 1 << 17,
|
||||
MLX4_WQE_MLX_SLR = 1 << 16
|
||||
};
|
||||
|
||||
struct mlx4_wqe_mlx_seg {
|
||||
u8 owner;
|
||||
u8 reserved1[2];
|
||||
u8 opcode;
|
||||
__be16 sched_prio;
|
||||
u8 reserved2;
|
||||
u8 size;
|
||||
/*
|
||||
* [17] VL15
|
||||
* [16] SLR
|
||||
* [15:12] static rate
|
||||
* [11:8] SL
|
||||
* [4] ICRC
|
||||
* [3:2] C
|
||||
* [0] FL (force loopback)
|
||||
*/
|
||||
__be32 flags;
|
||||
__be16 rlid;
|
||||
u16 reserved3;
|
||||
};
|
||||
|
||||
struct mlx4_wqe_datagram_seg {
|
||||
__be32 av[8];
|
||||
__be32 dqpn;
|
||||
__be32 qkey;
|
||||
__be16 vlan;
|
||||
u8 mac[ETH_ALEN];
|
||||
};
|
||||
|
||||
struct mlx4_wqe_lso_seg {
|
||||
__be32 mss_hdr_size;
|
||||
__be32 header[];
|
||||
};
|
||||
|
||||
enum mlx4_wqe_bind_seg_flags2 {
|
||||
MLX4_WQE_BIND_ZERO_BASED = (1 << 30),
|
||||
MLX4_WQE_BIND_TYPE_2 = (1 << 31),
|
||||
};
|
||||
|
||||
struct mlx4_wqe_bind_seg {
|
||||
__be32 flags1;
|
||||
__be32 flags2;
|
||||
__be32 new_rkey;
|
||||
__be32 lkey;
|
||||
__be64 addr;
|
||||
__be64 length;
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_WQE_FMR_PERM_LOCAL_READ = 1 << 27,
|
||||
MLX4_WQE_FMR_PERM_LOCAL_WRITE = 1 << 28,
|
||||
MLX4_WQE_FMR_AND_BIND_PERM_REMOTE_READ = 1 << 29,
|
||||
MLX4_WQE_FMR_AND_BIND_PERM_REMOTE_WRITE = 1 << 30,
|
||||
MLX4_WQE_FMR_AND_BIND_PERM_ATOMIC = 1 << 31
|
||||
};
|
||||
|
||||
struct mlx4_wqe_fmr_seg {
|
||||
__be32 flags;
|
||||
__be32 mem_key;
|
||||
__be64 buf_list;
|
||||
__be64 start_addr;
|
||||
__be64 reg_len;
|
||||
__be32 offset;
|
||||
__be32 page_size;
|
||||
u32 reserved[2];
|
||||
};
|
||||
|
||||
struct mlx4_wqe_fmr_ext_seg {
|
||||
u8 flags;
|
||||
u8 reserved;
|
||||
__be16 app_mask;
|
||||
__be16 wire_app_tag;
|
||||
__be16 mem_app_tag;
|
||||
__be32 wire_ref_tag_base;
|
||||
__be32 mem_ref_tag_base;
|
||||
};
|
||||
|
||||
struct mlx4_wqe_local_inval_seg {
|
||||
u64 reserved1;
|
||||
__be32 mem_key;
|
||||
u32 reserved2;
|
||||
u64 reserved3[2];
|
||||
};
|
||||
|
||||
struct mlx4_wqe_raddr_seg {
|
||||
__be64 raddr;
|
||||
__be32 rkey;
|
||||
u32 reserved;
|
||||
};
|
||||
|
||||
struct mlx4_wqe_atomic_seg {
|
||||
__be64 swap_add;
|
||||
__be64 compare;
|
||||
};
|
||||
|
||||
struct mlx4_wqe_masked_atomic_seg {
|
||||
__be64 swap_add;
|
||||
__be64 compare;
|
||||
__be64 swap_add_mask;
|
||||
__be64 compare_mask;
|
||||
};
|
||||
|
||||
struct mlx4_wqe_data_seg {
|
||||
__be32 byte_count;
|
||||
__be32 lkey;
|
||||
__be64 addr;
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_INLINE_ALIGN = 64,
|
||||
MLX4_INLINE_SEG = 1 << 31,
|
||||
};
|
||||
|
||||
struct mlx4_wqe_inline_seg {
|
||||
__be32 byte_count;
|
||||
__u8 data[];
|
||||
};
|
||||
|
||||
enum mlx4_update_qp_attr {
|
||||
MLX4_UPDATE_QP_SMAC = 1 << 0,
|
||||
MLX4_UPDATE_QP_VSD = 1 << 1,
|
||||
MLX4_UPDATE_QP_RATE_LIMIT = 1 << 2,
|
||||
MLX4_UPDATE_QP_QOS_VPORT = 1 << 3,
|
||||
MLX4_UPDATE_QP_ETH_SRC_CHECK_MC_LB = 1 << 4,
|
||||
MLX4_UPDATE_QP_SUPPORTED_ATTRS = (1 << 5) - 1
|
||||
};
|
||||
|
||||
enum mlx4_update_qp_params_flags {
|
||||
MLX4_UPDATE_QP_PARAMS_FLAGS_ETH_CHECK_MC_LB = 1 << 0,
|
||||
MLX4_UPDATE_QP_PARAMS_FLAGS_VSD_ENABLE = 1 << 1,
|
||||
};
|
||||
|
||||
struct mlx4_update_qp_params {
|
||||
u8 smac_index;
|
||||
u8 qos_vport;
|
||||
u32 flags;
|
||||
u16 rate_unit;
|
||||
u16 rate_val;
|
||||
};
|
||||
|
||||
struct mlx4_qp *mlx4_qp_lookup(struct mlx4_dev *dev, u32 qpn);
|
||||
int mlx4_update_qp(struct mlx4_dev *dev, u32 qpn,
|
||||
enum mlx4_update_qp_attr attr,
|
||||
struct mlx4_update_qp_params *params);
|
||||
int mlx4_qp_modify(struct mlx4_dev *dev, struct mlx4_mtt *mtt,
|
||||
enum mlx4_qp_state cur_state, enum mlx4_qp_state new_state,
|
||||
struct mlx4_qp_context *context, enum mlx4_qp_optpar optpar,
|
||||
int sqd_event, struct mlx4_qp *qp);
|
||||
|
||||
int mlx4_qp_query(struct mlx4_dev *dev, struct mlx4_qp *qp,
|
||||
struct mlx4_qp_context *context);
|
||||
|
||||
int mlx4_qp_to_ready(struct mlx4_dev *dev, struct mlx4_mtt *mtt,
|
||||
struct mlx4_qp_context *context,
|
||||
struct mlx4_qp *qp, enum mlx4_qp_state *qp_state);
|
||||
|
||||
static inline struct mlx4_qp *__mlx4_qp_lookup(struct mlx4_dev *dev, u32 qpn)
|
||||
{
|
||||
return radix_tree_lookup(&dev->qp_table_tree, qpn & (dev->caps.num_qps - 1));
|
||||
}
|
||||
|
||||
void mlx4_qp_remove(struct mlx4_dev *dev, struct mlx4_qp *qp);
|
||||
|
||||
static inline u16 folded_qp(u32 q)
|
||||
{
|
||||
u16 res;
|
||||
|
||||
res = ((q & 0xff) ^ ((q & 0xff0000) >> 16)) | (q & 0xff00);
|
||||
return res;
|
||||
}
|
||||
|
||||
u16 mlx4_qp_roce_entropy(struct mlx4_dev *dev, u32 qpn);
|
||||
|
||||
void mlx4_put_qp(struct mlx4_qp *qp);
|
||||
#endif /* MLX4_QP_H */
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef MLX4_SRQ_H
|
||||
#define MLX4_SRQ_H
|
||||
|
||||
struct mlx4_wqe_srq_next_seg {
|
||||
u16 reserved1;
|
||||
__be16 next_wqe_index;
|
||||
u32 reserved2[3];
|
||||
};
|
||||
|
||||
struct mlx4_srq *mlx4_srq_lookup(struct mlx4_dev *dev, u32 srqn);
|
||||
|
||||
#endif /* MLX4_SRQ_H */
|
||||
Reference in New Issue
Block a user