Merge cf1ca1f66d ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net") into android-mainline
Steps on the way to 6.10-rc1 Change-Id: Iaa429009c933ff60e6038c87713f2e8ab1573dfd Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -16,6 +16,11 @@ definitions:
|
||||
name: stringset
|
||||
type: enum
|
||||
entries: []
|
||||
-
|
||||
name: header-flags
|
||||
enum-name:
|
||||
type: flags
|
||||
entries: [ compact-bitsets, omit-reply, stats ]
|
||||
|
||||
attribute-sets:
|
||||
-
|
||||
@@ -30,6 +35,7 @@ attribute-sets:
|
||||
-
|
||||
name: flags
|
||||
type: u32
|
||||
enum: header-flags
|
||||
|
||||
-
|
||||
name: bitset-bit
|
||||
|
||||
@@ -1296,9 +1296,9 @@ static int bnxt_agg_bufs_valid(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
|
||||
return RX_AGG_CMP_VALID(agg, *raw_cons);
|
||||
}
|
||||
|
||||
static inline struct sk_buff *bnxt_copy_skb(struct bnxt_napi *bnapi, u8 *data,
|
||||
unsigned int len,
|
||||
dma_addr_t mapping)
|
||||
static struct sk_buff *bnxt_copy_data(struct bnxt_napi *bnapi, u8 *data,
|
||||
unsigned int len,
|
||||
dma_addr_t mapping)
|
||||
{
|
||||
struct bnxt *bp = bnapi->bp;
|
||||
struct pci_dev *pdev = bp->pdev;
|
||||
@@ -1318,6 +1318,39 @@ static inline struct sk_buff *bnxt_copy_skb(struct bnxt_napi *bnapi, u8 *data,
|
||||
bp->rx_dir);
|
||||
|
||||
skb_put(skb, len);
|
||||
|
||||
return skb;
|
||||
}
|
||||
|
||||
static struct sk_buff *bnxt_copy_skb(struct bnxt_napi *bnapi, u8 *data,
|
||||
unsigned int len,
|
||||
dma_addr_t mapping)
|
||||
{
|
||||
return bnxt_copy_data(bnapi, data, len, mapping);
|
||||
}
|
||||
|
||||
static struct sk_buff *bnxt_copy_xdp(struct bnxt_napi *bnapi,
|
||||
struct xdp_buff *xdp,
|
||||
unsigned int len,
|
||||
dma_addr_t mapping)
|
||||
{
|
||||
unsigned int metasize = 0;
|
||||
u8 *data = xdp->data;
|
||||
struct sk_buff *skb;
|
||||
|
||||
len = xdp->data_end - xdp->data_meta;
|
||||
metasize = xdp->data - xdp->data_meta;
|
||||
data = xdp->data_meta;
|
||||
|
||||
skb = bnxt_copy_data(bnapi, data, len, mapping);
|
||||
if (!skb)
|
||||
return skb;
|
||||
|
||||
if (metasize) {
|
||||
skb_metadata_set(skb, metasize);
|
||||
__skb_pull(skb, metasize);
|
||||
}
|
||||
|
||||
return skb;
|
||||
}
|
||||
|
||||
@@ -2101,14 +2134,17 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
|
||||
}
|
||||
|
||||
if (xdp_active) {
|
||||
if (bnxt_rx_xdp(bp, rxr, cons, xdp, data, &data_ptr, &len, event)) {
|
||||
if (bnxt_rx_xdp(bp, rxr, cons, &xdp, data, &data_ptr, &len, event)) {
|
||||
rc = 1;
|
||||
goto next_rx;
|
||||
}
|
||||
}
|
||||
|
||||
if (len <= bp->rx_copy_thresh) {
|
||||
skb = bnxt_copy_skb(bnapi, data_ptr, len, dma_addr);
|
||||
if (!xdp_active)
|
||||
skb = bnxt_copy_skb(bnapi, data_ptr, len, dma_addr);
|
||||
else
|
||||
skb = bnxt_copy_xdp(bnapi, &xdp, len, dma_addr);
|
||||
bnxt_reuse_rx_data(rxr, cons, data);
|
||||
if (!skb) {
|
||||
if (agg_bufs) {
|
||||
@@ -2481,6 +2517,9 @@ static bool bnxt_event_error_report(struct bnxt *bp, u32 data1, u32 data2)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED:
|
||||
netdev_warn(bp->dev, "Speed change not supported with dual rate transceivers on this board\n");
|
||||
break;
|
||||
default:
|
||||
netdev_err(bp->dev, "FW reported unknown error type %u\n",
|
||||
err_type);
|
||||
@@ -3551,14 +3590,15 @@ static void bnxt_free_rx_rings(struct bnxt *bp)
|
||||
}
|
||||
|
||||
static int bnxt_alloc_rx_page_pool(struct bnxt *bp,
|
||||
struct bnxt_rx_ring_info *rxr)
|
||||
struct bnxt_rx_ring_info *rxr,
|
||||
int numa_node)
|
||||
{
|
||||
struct page_pool_params pp = { 0 };
|
||||
|
||||
pp.pool_size = bp->rx_agg_ring_size;
|
||||
if (BNXT_RX_PAGE_MODE(bp))
|
||||
pp.pool_size += bp->rx_ring_size;
|
||||
pp.nid = dev_to_node(&bp->pdev->dev);
|
||||
pp.nid = numa_node;
|
||||
pp.napi = &rxr->bnapi->napi;
|
||||
pp.netdev = bp->dev;
|
||||
pp.dev = &bp->pdev->dev;
|
||||
@@ -3578,7 +3618,8 @@ static int bnxt_alloc_rx_page_pool(struct bnxt *bp,
|
||||
|
||||
static int bnxt_alloc_rx_rings(struct bnxt *bp)
|
||||
{
|
||||
int i, rc = 0, agg_rings = 0;
|
||||
int numa_node = dev_to_node(&bp->pdev->dev);
|
||||
int i, rc = 0, agg_rings = 0, cpu;
|
||||
|
||||
if (!bp->rx_ring)
|
||||
return -ENOMEM;
|
||||
@@ -3589,10 +3630,15 @@ static int bnxt_alloc_rx_rings(struct bnxt *bp)
|
||||
for (i = 0; i < bp->rx_nr_rings; i++) {
|
||||
struct bnxt_rx_ring_info *rxr = &bp->rx_ring[i];
|
||||
struct bnxt_ring_struct *ring;
|
||||
int cpu_node;
|
||||
|
||||
ring = &rxr->rx_ring_struct;
|
||||
|
||||
rc = bnxt_alloc_rx_page_pool(bp, rxr);
|
||||
cpu = cpumask_local_spread(i, numa_node);
|
||||
cpu_node = cpu_to_node(cpu);
|
||||
netdev_dbg(bp->dev, "Allocating page pool for rx_ring[%d] on numa_node: %d\n",
|
||||
i, cpu_node);
|
||||
rc = bnxt_alloc_rx_page_pool(bp, rxr, cpu_node);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
@@ -11796,6 +11842,46 @@ static void bnxt_cfg_usr_fltrs(struct bnxt *bp)
|
||||
bnxt_cfg_one_usr_fltr(bp, usr_fltr);
|
||||
}
|
||||
|
||||
static int bnxt_set_xps_mapping(struct bnxt *bp)
|
||||
{
|
||||
int numa_node = dev_to_node(&bp->pdev->dev);
|
||||
unsigned int q_idx, map_idx, cpu, i;
|
||||
const struct cpumask *cpu_mask_ptr;
|
||||
int nr_cpus = num_online_cpus();
|
||||
cpumask_t *q_map;
|
||||
int rc = 0;
|
||||
|
||||
q_map = kcalloc(bp->tx_nr_rings_per_tc, sizeof(*q_map), GFP_KERNEL);
|
||||
if (!q_map)
|
||||
return -ENOMEM;
|
||||
|
||||
/* Create CPU mask for all TX queues across MQPRIO traffic classes.
|
||||
* Each TC has the same number of TX queues. The nth TX queue for each
|
||||
* TC will have the same CPU mask.
|
||||
*/
|
||||
for (i = 0; i < nr_cpus; i++) {
|
||||
map_idx = i % bp->tx_nr_rings_per_tc;
|
||||
cpu = cpumask_local_spread(i, numa_node);
|
||||
cpu_mask_ptr = get_cpu_mask(cpu);
|
||||
cpumask_or(&q_map[map_idx], &q_map[map_idx], cpu_mask_ptr);
|
||||
}
|
||||
|
||||
/* Register CPU mask for each TX queue except the ones marked for XDP */
|
||||
for (q_idx = 0; q_idx < bp->dev->real_num_tx_queues; q_idx++) {
|
||||
map_idx = q_idx % bp->tx_nr_rings_per_tc;
|
||||
rc = netif_set_xps_queue(bp->dev, &q_map[map_idx], q_idx);
|
||||
if (rc) {
|
||||
netdev_warn(bp->dev, "Error setting XPS for q:%d\n",
|
||||
q_idx);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
kfree(q_map);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
|
||||
{
|
||||
int rc = 0;
|
||||
@@ -11858,8 +11944,12 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
|
||||
}
|
||||
}
|
||||
|
||||
if (irq_re_init)
|
||||
if (irq_re_init) {
|
||||
udp_tunnel_nic_reset_ntf(bp->dev);
|
||||
rc = bnxt_set_xps_mapping(bp);
|
||||
if (rc)
|
||||
netdev_warn(bp->dev, "failed to set xps mapping\n");
|
||||
}
|
||||
|
||||
if (bp->tx_nr_rings_xdp < num_possible_cpus()) {
|
||||
if (!static_key_enabled(&bnxt_xdp_locking_key))
|
||||
@@ -15561,6 +15651,10 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)
|
||||
|
||||
netdev_info(bp->dev, "PCI Slot Reset\n");
|
||||
|
||||
if (!(bp->flags & BNXT_FLAG_CHIP_P5_PLUS) &&
|
||||
test_bit(BNXT_STATE_PCI_CHANNEL_IO_FROZEN, &bp->state))
|
||||
msleep(900);
|
||||
|
||||
rtnl_lock();
|
||||
|
||||
if (pci_enable_device(pdev)) {
|
||||
|
||||
@@ -468,6 +468,10 @@ struct cmd_nums {
|
||||
#define HWRM_TF_GLOBAL_CFG_GET 0x2fdUL
|
||||
#define HWRM_TF_IF_TBL_SET 0x2feUL
|
||||
#define HWRM_TF_IF_TBL_GET 0x2ffUL
|
||||
#define HWRM_TF_RESC_USAGE_SET 0x300UL
|
||||
#define HWRM_TF_RESC_USAGE_QUERY 0x301UL
|
||||
#define HWRM_TF_TBL_TYPE_ALLOC 0x302UL
|
||||
#define HWRM_TF_TBL_TYPE_FREE 0x303UL
|
||||
#define HWRM_TFC_TBL_SCOPE_QCAPS 0x380UL
|
||||
#define HWRM_TFC_TBL_SCOPE_ID_ALLOC 0x381UL
|
||||
#define HWRM_TFC_TBL_SCOPE_CONFIG 0x382UL
|
||||
@@ -495,6 +499,7 @@ struct cmd_nums {
|
||||
#define HWRM_TFC_IF_TBL_SET 0x398UL
|
||||
#define HWRM_TFC_IF_TBL_GET 0x399UL
|
||||
#define HWRM_TFC_TBL_SCOPE_CONFIG_GET 0x39aUL
|
||||
#define HWRM_TFC_RESC_USAGE_QUERY 0x39bUL
|
||||
#define HWRM_SV 0x400UL
|
||||
#define HWRM_DBG_READ_DIRECT 0xff10UL
|
||||
#define HWRM_DBG_READ_INDIRECT 0xff11UL
|
||||
@@ -604,8 +609,8 @@ struct hwrm_err_output {
|
||||
#define HWRM_VERSION_MAJOR 1
|
||||
#define HWRM_VERSION_MINOR 10
|
||||
#define HWRM_VERSION_UPDATE 3
|
||||
#define HWRM_VERSION_RSVD 15
|
||||
#define HWRM_VERSION_STR "1.10.3.15"
|
||||
#define HWRM_VERSION_RSVD 39
|
||||
#define HWRM_VERSION_STR "1.10.3.39"
|
||||
|
||||
/* hwrm_ver_get_input (size:192b/24B) */
|
||||
struct hwrm_ver_get_input {
|
||||
@@ -1328,8 +1333,9 @@ struct hwrm_async_event_cmpl_error_report_base {
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_INVALID_SIGNAL 0x2UL
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_NVM 0x3UL
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DOORBELL_DROP_THRESHOLD 0x4UL
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_THERMAL_THRESHOLD 0x5UL
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_LAST ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_THERMAL_THRESHOLD
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_THERMAL_THRESHOLD 0x5UL
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED 0x6UL
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_LAST ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED
|
||||
};
|
||||
|
||||
/* hwrm_async_event_cmpl_error_report_pause_storm (size:128b/16B) */
|
||||
@@ -1478,6 +1484,30 @@ struct hwrm_async_event_cmpl_error_report_thermal {
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR_LAST ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR_INCREASING
|
||||
};
|
||||
|
||||
/* hwrm_async_event_cmpl_error_report_dual_data_rate_not_supported (size:128b/16B) */
|
||||
struct hwrm_async_event_cmpl_error_report_dual_data_rate_not_supported {
|
||||
__le16 type;
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_TYPE_MASK 0x3fUL
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_TYPE_SFT 0
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_TYPE_HWRM_ASYNC_EVENT 0x2eUL
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_TYPE_LAST ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_TYPE_HWRM_ASYNC_EVENT
|
||||
__le16 event_id;
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_EVENT_ID_ERROR_REPORT 0x45UL
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_EVENT_ID_LAST ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_EVENT_ID_ERROR_REPORT
|
||||
__le32 event_data2;
|
||||
u8 opaque_v;
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_V 0x1UL
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_OPAQUE_MASK 0xfeUL
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_OPAQUE_SFT 1
|
||||
u8 timestamp_lo;
|
||||
__le16 timestamp_hi;
|
||||
__le32 event_data1;
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_EVENT_DATA1_ERROR_TYPE_MASK 0xffUL
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_EVENT_DATA1_ERROR_TYPE_SFT 0
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED 0x6UL
|
||||
#define ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_EVENT_DATA1_ERROR_TYPE_LAST ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED
|
||||
};
|
||||
|
||||
/* hwrm_func_reset_input (size:192b/24B) */
|
||||
struct hwrm_func_reset_input {
|
||||
__le16 req_type;
|
||||
@@ -1781,6 +1811,9 @@ struct hwrm_func_qcaps_output {
|
||||
#define FUNC_QCAPS_RESP_FLAGS_EXT2_ROCE_VF_RESOURCE_MGMT_SUPPORTED 0x100000UL
|
||||
#define FUNC_QCAPS_RESP_FLAGS_EXT2_UDCC_SUPPORTED 0x200000UL
|
||||
#define FUNC_QCAPS_RESP_FLAGS_EXT2_TIMED_TX_SO_TXTIME_SUPPORTED 0x400000UL
|
||||
#define FUNC_QCAPS_RESP_FLAGS_EXT2_SW_MAX_RESOURCE_LIMITS_SUPPORTED 0x800000UL
|
||||
#define FUNC_QCAPS_RESP_FLAGS_EXT2_TF_INGRESS_NIC_FLOW_SUPPORTED 0x1000000UL
|
||||
#define FUNC_QCAPS_RESP_FLAGS_EXT2_LPBK_STATS_SUPPORTED 0x2000000UL
|
||||
__le16 tunnel_disable_flag;
|
||||
#define FUNC_QCAPS_RESP_TUNNEL_DISABLE_FLAG_DISABLE_VXLAN 0x1UL
|
||||
#define FUNC_QCAPS_RESP_TUNNEL_DISABLE_FLAG_DISABLE_NGE 0x2UL
|
||||
@@ -1791,10 +1824,8 @@ struct hwrm_func_qcaps_output {
|
||||
#define FUNC_QCAPS_RESP_TUNNEL_DISABLE_FLAG_DISABLE_MPLS 0x40UL
|
||||
#define FUNC_QCAPS_RESP_TUNNEL_DISABLE_FLAG_DISABLE_PPPOE 0x80UL
|
||||
__le16 xid_partition_cap;
|
||||
#define FUNC_QCAPS_RESP_XID_PARTITION_CAP_KTLS_TKC 0x1UL
|
||||
#define FUNC_QCAPS_RESP_XID_PARTITION_CAP_KTLS_RKC 0x2UL
|
||||
#define FUNC_QCAPS_RESP_XID_PARTITION_CAP_QUIC_TKC 0x4UL
|
||||
#define FUNC_QCAPS_RESP_XID_PARTITION_CAP_QUIC_RKC 0x8UL
|
||||
#define FUNC_QCAPS_RESP_XID_PARTITION_CAP_TX_CK 0x1UL
|
||||
#define FUNC_QCAPS_RESP_XID_PARTITION_CAP_RX_CK 0x2UL
|
||||
u8 device_serial_number[8];
|
||||
__le16 ctxs_per_partition;
|
||||
u8 unused_2[2];
|
||||
@@ -1844,6 +1875,7 @@ struct hwrm_func_qcfg_output {
|
||||
#define FUNC_QCFG_RESP_FLAGS_FAST_RESET_ALLOWED 0x1000UL
|
||||
#define FUNC_QCFG_RESP_FLAGS_MULTI_ROOT 0x2000UL
|
||||
#define FUNC_QCFG_RESP_FLAGS_ENABLE_RDMA_SRIOV 0x4000UL
|
||||
#define FUNC_QCFG_RESP_FLAGS_ROCE_VNIC_ID_VALID 0x8000UL
|
||||
u8 mac_address[6];
|
||||
__le16 pci_id;
|
||||
__le16 alloc_rsscos_ctx;
|
||||
@@ -1955,7 +1987,7 @@ struct hwrm_func_qcfg_output {
|
||||
#define FUNC_QCFG_RESP_DB_PAGE_SIZE_2MB 0x9UL
|
||||
#define FUNC_QCFG_RESP_DB_PAGE_SIZE_4MB 0xaUL
|
||||
#define FUNC_QCFG_RESP_DB_PAGE_SIZE_LAST FUNC_QCFG_RESP_DB_PAGE_SIZE_4MB
|
||||
u8 unused_2[2];
|
||||
__le16 roce_vnic_id;
|
||||
__le32 partition_min_bw;
|
||||
#define FUNC_QCFG_RESP_PARTITION_MIN_BW_BW_VALUE_MASK 0xfffffffUL
|
||||
#define FUNC_QCFG_RESP_PARTITION_MIN_BW_BW_VALUE_SFT 0
|
||||
@@ -2003,6 +2035,8 @@ struct hwrm_func_qcfg_output {
|
||||
__le32 roce_max_srq_per_vf;
|
||||
__le32 roce_max_gid_per_vf;
|
||||
__le16 xid_partition_cfg;
|
||||
#define FUNC_QCFG_RESP_XID_PARTITION_CFG_TX_CK 0x1UL
|
||||
#define FUNC_QCFG_RESP_XID_PARTITION_CFG_RX_CK 0x2UL
|
||||
u8 unused_7;
|
||||
u8 valid;
|
||||
};
|
||||
@@ -2229,10 +2263,8 @@ struct hwrm_func_cfg_input {
|
||||
__le32 roce_max_srq_per_vf;
|
||||
__le32 roce_max_gid_per_vf;
|
||||
__le16 xid_partition_cfg;
|
||||
#define FUNC_CFG_REQ_XID_PARTITION_CFG_KTLS_TKC 0x1UL
|
||||
#define FUNC_CFG_REQ_XID_PARTITION_CFG_KTLS_RKC 0x2UL
|
||||
#define FUNC_CFG_REQ_XID_PARTITION_CFG_QUIC_TKC 0x4UL
|
||||
#define FUNC_CFG_REQ_XID_PARTITION_CFG_QUIC_RKC 0x8UL
|
||||
#define FUNC_CFG_REQ_XID_PARTITION_CFG_TX_CK 0x1UL
|
||||
#define FUNC_CFG_REQ_XID_PARTITION_CFG_RX_CK 0x2UL
|
||||
__le16 unused_2;
|
||||
};
|
||||
|
||||
@@ -2416,6 +2448,7 @@ struct hwrm_func_drv_rgtr_input {
|
||||
#define FUNC_DRV_RGTR_REQ_FLAGS_RSS_STRICT_HASH_TYPE_SUPPORT 0x100UL
|
||||
#define FUNC_DRV_RGTR_REQ_FLAGS_NPAR_1_2_SUPPORT 0x200UL
|
||||
#define FUNC_DRV_RGTR_REQ_FLAGS_ASYM_QUEUE_CFG_SUPPORT 0x400UL
|
||||
#define FUNC_DRV_RGTR_REQ_FLAGS_TF_INGRESS_NIC_FLOW_MODE 0x800UL
|
||||
__le32 enables;
|
||||
#define FUNC_DRV_RGTR_REQ_ENABLES_OS_TYPE 0x1UL
|
||||
#define FUNC_DRV_RGTR_REQ_ENABLES_VER 0x2UL
|
||||
@@ -3636,19 +3669,22 @@ struct hwrm_func_backing_store_cfg_v2_input {
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_FP_TQM_RING 0x6UL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_MRAV 0xeUL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_TIM 0xfUL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_TKC 0x13UL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_RKC 0x14UL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_MP_TQM_RING 0x15UL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_SQ_DB_SHADOW 0x16UL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_RQ_DB_SHADOW 0x17UL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_SRQ_DB_SHADOW 0x18UL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_CQ_DB_SHADOW 0x19UL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_QUIC_TKC 0x1aUL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_QUIC_RKC 0x1bUL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_TBL_SCOPE 0x1cUL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_XID_PARTITION 0x1dUL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_INVALID 0xffffUL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_LAST FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_INVALID
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_SRT_TRACE 0x1eUL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_SRT2_TRACE 0x1fUL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_CRT_TRACE 0x20UL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_CRT2_TRACE 0x21UL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_RIGP0_TRACE 0x22UL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_L2_HWRM_TRACE 0x23UL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_ROCE_HWRM_TRACE 0x24UL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_INVALID 0xffffUL
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_LAST FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_INVALID
|
||||
__le16 instance;
|
||||
__le32 flags;
|
||||
#define FUNC_BACKING_STORE_CFG_V2_REQ_FLAGS_PREBOOT_MODE 0x1UL
|
||||
@@ -3707,17 +3743,22 @@ struct hwrm_func_backing_store_qcfg_v2_input {
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_FP_TQM_RING 0x6UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_MRAV 0xeUL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_TIM 0xfUL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_TKC 0x13UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_RKC 0x14UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_TX_CK 0x13UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_RX_CK 0x14UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_MP_TQM_RING 0x15UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_SQ_DB_SHADOW 0x16UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_RQ_DB_SHADOW 0x17UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_SRQ_DB_SHADOW 0x18UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_CQ_DB_SHADOW 0x19UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_QUIC_TKC 0x1aUL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_QUIC_RKC 0x1bUL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_TBL_SCOPE 0x1cUL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_XID_PARTITION_TABLE 0x1dUL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_SRT_TRACE 0x1eUL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_SRT2_TRACE 0x1fUL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_CRT_TRACE 0x20UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_CRT2_TRACE 0x21UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_RIGP0_TRACE 0x22UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_L2_HWRM_TRACE 0x23UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_ROCE_HWRM_TRACE 0x24UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_INVALID 0xffffUL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_LAST FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_INVALID
|
||||
__le16 instance;
|
||||
@@ -3740,15 +3781,18 @@ struct hwrm_func_backing_store_qcfg_v2_output {
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_FP_TQM_RING 0x6UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_MRAV 0xeUL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_TIM 0xfUL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_TKC 0x13UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_RKC 0x14UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_MP_TQM_RING 0x15UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_QUIC_TKC 0x1aUL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_QUIC_RKC 0x1bUL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_TBL_SCOPE 0x1cUL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_XID_PARTITION 0x1dUL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_INVALID 0xffffUL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_LAST FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_INVALID
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_SRT_TRACE 0x1eUL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_SRT2_TRACE 0x1fUL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_CRT_TRACE 0x20UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_CRT2_TRACE 0x21UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_RIGP0_TRACE 0x22UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_L2_HWRM_TRACE 0x23UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_ROCE_HWRM_TRACE 0x24UL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_INVALID 0xffffUL
|
||||
#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_LAST FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_INVALID
|
||||
__le16 instance;
|
||||
__le32 flags;
|
||||
__le64 page_dir;
|
||||
@@ -3841,19 +3885,22 @@ struct hwrm_func_backing_store_qcaps_v2_input {
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_FP_TQM_RING 0x6UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_MRAV 0xeUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_TIM 0xfUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_KTLS_TKC 0x13UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_KTLS_RKC 0x14UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_MP_TQM_RING 0x15UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_SQ_DB_SHADOW 0x16UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_RQ_DB_SHADOW 0x17UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_SRQ_DB_SHADOW 0x18UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_CQ_DB_SHADOW 0x19UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_QUIC_TKC 0x1aUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_QUIC_RKC 0x1bUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_TBL_SCOPE 0x1cUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_XID_PARTITION 0x1dUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_INVALID 0xffffUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_LAST FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_INVALID
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_SRT_TRACE 0x1eUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_SRT2_TRACE 0x1fUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_CRT_TRACE 0x20UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_CRT2_TRACE 0x21UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_RIGP0_TRACE 0x22UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_L2_HWRM_TRACE 0x23UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_ROCE_HWRM_TRACE 0x24UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_INVALID 0xffffUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_LAST FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_INVALID
|
||||
u8 rsvd[6];
|
||||
};
|
||||
|
||||
@@ -3873,19 +3920,22 @@ struct hwrm_func_backing_store_qcaps_v2_output {
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_FP_TQM_RING 0x6UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_MRAV 0xeUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_TIM 0xfUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_KTLS_TKC 0x13UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_KTLS_RKC 0x14UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_MP_TQM_RING 0x15UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_SQ_DB_SHADOW 0x16UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_RQ_DB_SHADOW 0x17UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_SRQ_DB_SHADOW 0x18UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_CQ_DB_SHADOW 0x19UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_QUIC_TKC 0x1aUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_QUIC_RKC 0x1bUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_TBL_SCOPE 0x1cUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_XID_PARTITION 0x1dUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_INVALID 0xffffUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_LAST FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_INVALID
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_SRT_TRACE 0x1eUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_SRT2_TRACE 0x1fUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_CRT_TRACE 0x20UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_CRT2_TRACE 0x21UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_RIGP0_TRACE 0x22UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_L2_HWRM_TRACE 0x23UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_ROCE_HWRM_TRACE 0x24UL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_INVALID 0xffffUL
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_LAST FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_INVALID
|
||||
__le16 entry_size;
|
||||
__le32 flags;
|
||||
#define FUNC_BACKING_STORE_QCAPS_V2_RESP_FLAGS_ENABLE_CTX_KIND_INIT 0x1UL
|
||||
@@ -3990,6 +4040,7 @@ struct hwrm_func_drv_if_change_output {
|
||||
__le32 flags;
|
||||
#define FUNC_DRV_IF_CHANGE_RESP_FLAGS_RESC_CHANGE 0x1UL
|
||||
#define FUNC_DRV_IF_CHANGE_RESP_FLAGS_HOT_FW_RESET_DONE 0x2UL
|
||||
#define FUNC_DRV_IF_CHANGE_RESP_FLAGS_CAPS_CHANGE 0x4UL
|
||||
u8 unused_0[3];
|
||||
u8 valid;
|
||||
};
|
||||
@@ -4472,7 +4523,11 @@ struct hwrm_port_phy_qcfg_output {
|
||||
#define PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_QSFP (0xcUL << 24)
|
||||
#define PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_QSFPPLUS (0xdUL << 24)
|
||||
#define PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_QSFP28 (0x11UL << 24)
|
||||
#define PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_LAST PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_QSFP28
|
||||
#define PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_QSFPDD (0x18UL << 24)
|
||||
#define PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_QSFP112 (0x1eUL << 24)
|
||||
#define PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_SFPDD (0x1fUL << 24)
|
||||
#define PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_CSFP (0x20UL << 24)
|
||||
#define PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_LAST PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_CSFP
|
||||
__le16 fec_cfg;
|
||||
#define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_NONE_SUPPORTED 0x1UL
|
||||
#define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_AUTONEG_SUPPORTED 0x2UL
|
||||
@@ -7380,7 +7435,7 @@ struct hwrm_cfa_l2_filter_free_output {
|
||||
u8 valid;
|
||||
};
|
||||
|
||||
/* hwrm_cfa_l2_filter_cfg_input (size:320b/40B) */
|
||||
/* hwrm_cfa_l2_filter_cfg_input (size:384b/48B) */
|
||||
struct hwrm_cfa_l2_filter_cfg_input {
|
||||
__le16 req_type;
|
||||
__le16 cmpl_ring;
|
||||
@@ -7399,12 +7454,22 @@ struct hwrm_cfa_l2_filter_cfg_input {
|
||||
#define CFA_L2_FILTER_CFG_REQ_FLAGS_TRAFFIC_L2 (0x1UL << 2)
|
||||
#define CFA_L2_FILTER_CFG_REQ_FLAGS_TRAFFIC_ROCE (0x2UL << 2)
|
||||
#define CFA_L2_FILTER_CFG_REQ_FLAGS_TRAFFIC_LAST CFA_L2_FILTER_CFG_REQ_FLAGS_TRAFFIC_ROCE
|
||||
#define CFA_L2_FILTER_CFG_REQ_FLAGS_REMAP_OP_MASK 0x30UL
|
||||
#define CFA_L2_FILTER_CFG_REQ_FLAGS_REMAP_OP_SFT 4
|
||||
#define CFA_L2_FILTER_CFG_REQ_FLAGS_REMAP_OP_NO_UPDATE (0x0UL << 4)
|
||||
#define CFA_L2_FILTER_CFG_REQ_FLAGS_REMAP_OP_BYPASS_LKUP (0x1UL << 4)
|
||||
#define CFA_L2_FILTER_CFG_REQ_FLAGS_REMAP_OP_ENABLE_LKUP (0x2UL << 4)
|
||||
#define CFA_L2_FILTER_CFG_REQ_FLAGS_REMAP_OP_LAST CFA_L2_FILTER_CFG_REQ_FLAGS_REMAP_OP_ENABLE_LKUP
|
||||
__le32 enables;
|
||||
#define CFA_L2_FILTER_CFG_REQ_ENABLES_DST_ID 0x1UL
|
||||
#define CFA_L2_FILTER_CFG_REQ_ENABLES_NEW_MIRROR_VNIC_ID 0x2UL
|
||||
#define CFA_L2_FILTER_CFG_REQ_ENABLES_PROF_FUNC 0x4UL
|
||||
#define CFA_L2_FILTER_CFG_REQ_ENABLES_L2_CONTEXT_ID 0x8UL
|
||||
__le64 l2_filter_id;
|
||||
__le32 dst_id;
|
||||
__le32 new_mirror_vnic_id;
|
||||
__le32 prof_func;
|
||||
__le32 l2_context_id;
|
||||
};
|
||||
|
||||
/* hwrm_cfa_l2_filter_cfg_output (size:128b/16B) */
|
||||
@@ -8466,7 +8531,15 @@ struct hwrm_tunnel_dst_port_query_input {
|
||||
#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_SRV6 0xfUL
|
||||
#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_VXLAN_GPE 0x10UL
|
||||
#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_GRE 0x11UL
|
||||
#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_LAST TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_GRE
|
||||
#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_ULP_DYN_UPAR 0x12UL
|
||||
#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES01 0x13UL
|
||||
#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES02 0x14UL
|
||||
#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES03 0x15UL
|
||||
#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES04 0x16UL
|
||||
#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES05 0x17UL
|
||||
#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES06 0x18UL
|
||||
#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES07 0x19UL
|
||||
#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_LAST TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES07
|
||||
u8 tunnel_next_proto;
|
||||
u8 unused_0[6];
|
||||
};
|
||||
@@ -8514,7 +8587,15 @@ struct hwrm_tunnel_dst_port_alloc_input {
|
||||
#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_SRV6 0xfUL
|
||||
#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE 0x10UL
|
||||
#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_GRE 0x11UL
|
||||
#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_LAST TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_GRE
|
||||
#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_ULP_DYN_UPAR 0x12UL
|
||||
#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES01 0x13UL
|
||||
#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES02 0x14UL
|
||||
#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES03 0x15UL
|
||||
#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES04 0x16UL
|
||||
#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES05 0x17UL
|
||||
#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES06 0x18UL
|
||||
#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES07 0x19UL
|
||||
#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_LAST TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES07
|
||||
u8 tunnel_next_proto;
|
||||
__be16 tunnel_dst_port_val;
|
||||
u8 unused_0[4];
|
||||
@@ -8565,7 +8646,15 @@ struct hwrm_tunnel_dst_port_free_input {
|
||||
#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_SRV6 0xfUL
|
||||
#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN_GPE 0x10UL
|
||||
#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GRE 0x11UL
|
||||
#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_LAST TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GRE
|
||||
#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_ULP_DYN_UPAR 0x12UL
|
||||
#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES01 0x13UL
|
||||
#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES02 0x14UL
|
||||
#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES03 0x15UL
|
||||
#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES04 0x16UL
|
||||
#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES05 0x17UL
|
||||
#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES06 0x18UL
|
||||
#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES07 0x19UL
|
||||
#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_LAST TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_ULP_DYN_UPAR_RES07
|
||||
u8 tunnel_next_proto;
|
||||
__le16 tunnel_dst_port_id;
|
||||
u8 unused_0[4];
|
||||
@@ -8860,7 +8949,7 @@ struct hwrm_stat_generic_qstats_output {
|
||||
u8 valid;
|
||||
};
|
||||
|
||||
/* generic_sw_hw_stats (size:1408b/176B) */
|
||||
/* generic_sw_hw_stats (size:1472b/184B) */
|
||||
struct generic_sw_hw_stats {
|
||||
__le64 pcie_statistics_tx_tlp;
|
||||
__le64 pcie_statistics_rx_tlp;
|
||||
@@ -8884,6 +8973,7 @@ struct generic_sw_hw_stats {
|
||||
__le64 hw_db_recov_dbs_dropped;
|
||||
__le64 hw_db_recov_drops_serviced;
|
||||
__le64 hw_db_recov_dbs_recovered;
|
||||
__le64 hw_db_recov_oo_drop_count;
|
||||
};
|
||||
|
||||
/* hwrm_fw_reset_input (size:192b/24B) */
|
||||
|
||||
@@ -197,7 +197,7 @@ void bnxt_xdp_buff_init(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,
|
||||
dma_sync_single_for_cpu(&pdev->dev, mapping + offset, len, bp->rx_dir);
|
||||
|
||||
xdp_init_buff(xdp, buflen, &rxr->xdp_rxq);
|
||||
xdp_prepare_buff(xdp, data_ptr - offset, offset, len, false);
|
||||
xdp_prepare_buff(xdp, data_ptr - offset, offset, len, true);
|
||||
}
|
||||
|
||||
void bnxt_xdp_buff_frags_free(struct bnxt_rx_ring_info *rxr,
|
||||
@@ -222,7 +222,7 @@ void bnxt_xdp_buff_frags_free(struct bnxt_rx_ring_info *rxr,
|
||||
* false - packet should be passed to the stack.
|
||||
*/
|
||||
bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons,
|
||||
struct xdp_buff xdp, struct page *page, u8 **data_ptr,
|
||||
struct xdp_buff *xdp, struct page *page, u8 **data_ptr,
|
||||
unsigned int *len, u8 *event)
|
||||
{
|
||||
struct bpf_prog *xdp_prog = READ_ONCE(rxr->xdp_prog);
|
||||
@@ -244,9 +244,9 @@ bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons,
|
||||
|
||||
txr = rxr->bnapi->tx_ring[0];
|
||||
/* BNXT_RX_PAGE_MODE(bp) when XDP enabled */
|
||||
orig_data = xdp.data;
|
||||
orig_data = xdp->data;
|
||||
|
||||
act = bpf_prog_run_xdp(xdp_prog, &xdp);
|
||||
act = bpf_prog_run_xdp(xdp_prog, xdp);
|
||||
|
||||
tx_avail = bnxt_tx_avail(bp, txr);
|
||||
/* If the tx ring is not full, we must not update the rx producer yet
|
||||
@@ -255,10 +255,10 @@ bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons,
|
||||
if (tx_avail != bp->tx_ring_size)
|
||||
*event &= ~BNXT_RX_EVENT;
|
||||
|
||||
*len = xdp.data_end - xdp.data;
|
||||
if (orig_data != xdp.data) {
|
||||
offset = xdp.data - xdp.data_hard_start;
|
||||
*data_ptr = xdp.data_hard_start + offset;
|
||||
*len = xdp->data_end - xdp->data;
|
||||
if (orig_data != xdp->data) {
|
||||
offset = xdp->data - xdp->data_hard_start;
|
||||
*data_ptr = xdp->data_hard_start + offset;
|
||||
}
|
||||
|
||||
switch (act) {
|
||||
@@ -270,8 +270,8 @@ bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons,
|
||||
mapping = rx_buf->mapping - bp->rx_dma_offset;
|
||||
*event &= BNXT_TX_CMP_EVENT;
|
||||
|
||||
if (unlikely(xdp_buff_has_frags(&xdp))) {
|
||||
struct skb_shared_info *sinfo = xdp_get_shared_info_from_buff(&xdp);
|
||||
if (unlikely(xdp_buff_has_frags(xdp))) {
|
||||
struct skb_shared_info *sinfo = xdp_get_shared_info_from_buff(xdp);
|
||||
|
||||
tx_needed += sinfo->nr_frags;
|
||||
*event = BNXT_AGG_EVENT;
|
||||
@@ -279,7 +279,7 @@ bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons,
|
||||
|
||||
if (tx_avail < tx_needed) {
|
||||
trace_xdp_exception(bp->dev, xdp_prog, act);
|
||||
bnxt_xdp_buff_frags_free(rxr, &xdp);
|
||||
bnxt_xdp_buff_frags_free(rxr, xdp);
|
||||
bnxt_reuse_rx_data(rxr, cons, page);
|
||||
return true;
|
||||
}
|
||||
@@ -289,7 +289,7 @@ bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons,
|
||||
|
||||
*event |= BNXT_TX_EVENT;
|
||||
__bnxt_xmit_xdp(bp, txr, mapping + offset, *len,
|
||||
NEXT_RX(rxr->rx_prod), &xdp);
|
||||
NEXT_RX(rxr->rx_prod), xdp);
|
||||
bnxt_reuse_rx_data(rxr, cons, page);
|
||||
return true;
|
||||
case XDP_REDIRECT:
|
||||
@@ -306,12 +306,12 @@ bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons,
|
||||
/* if we are unable to allocate a new buffer, abort and reuse */
|
||||
if (bnxt_alloc_rx_data(bp, rxr, rxr->rx_prod, GFP_ATOMIC)) {
|
||||
trace_xdp_exception(bp->dev, xdp_prog, act);
|
||||
bnxt_xdp_buff_frags_free(rxr, &xdp);
|
||||
bnxt_xdp_buff_frags_free(rxr, xdp);
|
||||
bnxt_reuse_rx_data(rxr, cons, page);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (xdp_do_redirect(bp->dev, &xdp, xdp_prog)) {
|
||||
if (xdp_do_redirect(bp->dev, xdp, xdp_prog)) {
|
||||
trace_xdp_exception(bp->dev, xdp_prog, act);
|
||||
page_pool_recycle_direct(rxr->page_pool, page);
|
||||
return true;
|
||||
@@ -326,7 +326,7 @@ bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons,
|
||||
trace_xdp_exception(bp->dev, xdp_prog, act);
|
||||
fallthrough;
|
||||
case XDP_DROP:
|
||||
bnxt_xdp_buff_frags_free(rxr, &xdp);
|
||||
bnxt_xdp_buff_frags_free(rxr, xdp);
|
||||
bnxt_reuse_rx_data(rxr, cons, page);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ struct bnxt_sw_tx_bd *bnxt_xmit_bd(struct bnxt *bp,
|
||||
struct xdp_buff *xdp);
|
||||
void bnxt_tx_int_xdp(struct bnxt *bp, struct bnxt_napi *bnapi, int budget);
|
||||
bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons,
|
||||
struct xdp_buff xdp, struct page *page, u8 **data_ptr,
|
||||
struct xdp_buff *xdp, struct page *page, u8 **data_ptr,
|
||||
unsigned int *len, u8 *event);
|
||||
int bnxt_xdp(struct net_device *dev, struct netdev_bpf *xdp);
|
||||
int bnxt_xdp_xmit(struct net_device *dev, int num_frames,
|
||||
|
||||
@@ -4019,7 +4019,7 @@ static int tg3_power_up(struct tg3 *tp)
|
||||
|
||||
static int tg3_setup_phy(struct tg3 *, bool);
|
||||
|
||||
static int tg3_power_down_prepare(struct tg3 *tp)
|
||||
static void tg3_power_down_prepare(struct tg3 *tp)
|
||||
{
|
||||
u32 misc_host_ctrl;
|
||||
bool device_should_wake, do_low_power;
|
||||
@@ -4263,7 +4263,7 @@ static int tg3_power_down_prepare(struct tg3 *tp)
|
||||
|
||||
tg3_ape_driver_state_change(tp, RESET_KIND_SHUTDOWN);
|
||||
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
static void tg3_power_down(struct tg3 *tp)
|
||||
@@ -18084,7 +18084,6 @@ static int tg3_suspend(struct device *device)
|
||||
{
|
||||
struct net_device *dev = dev_get_drvdata(device);
|
||||
struct tg3 *tp = netdev_priv(dev);
|
||||
int err = 0;
|
||||
|
||||
rtnl_lock();
|
||||
|
||||
@@ -18108,32 +18107,11 @@ static int tg3_suspend(struct device *device)
|
||||
tg3_flag_clear(tp, INIT_COMPLETE);
|
||||
tg3_full_unlock(tp);
|
||||
|
||||
err = tg3_power_down_prepare(tp);
|
||||
if (err) {
|
||||
int err2;
|
||||
|
||||
tg3_full_lock(tp, 0);
|
||||
|
||||
tg3_flag_set(tp, INIT_COMPLETE);
|
||||
err2 = tg3_restart_hw(tp, true);
|
||||
if (err2)
|
||||
goto out;
|
||||
|
||||
tg3_timer_start(tp);
|
||||
|
||||
netif_device_attach(dev);
|
||||
tg3_netif_start(tp);
|
||||
|
||||
out:
|
||||
tg3_full_unlock(tp);
|
||||
|
||||
if (!err2)
|
||||
tg3_phy_start(tp);
|
||||
}
|
||||
tg3_power_down_prepare(tp);
|
||||
|
||||
unlock:
|
||||
rtnl_unlock();
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int tg3_resume(struct device *device)
|
||||
|
||||
@@ -580,7 +580,7 @@ mtk_flow_entry_update_l2(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
|
||||
|
||||
idle = cur_idle;
|
||||
entry->data.ib1 &= ~ib1_ts_mask;
|
||||
entry->data.ib1 |= hwe->ib1 & ib1_ts_mask;
|
||||
entry->data.ib1 |= ib1 & ib1_ts_mask;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -143,8 +143,8 @@ static ssize_t average_read(struct file *filp, char __user *buf, size_t count,
|
||||
return simple_read_from_buffer(buf, count, pos, tbuf, ret);
|
||||
}
|
||||
|
||||
static ssize_t average_write(struct file *filp, const char __user *buf,
|
||||
size_t count, loff_t *pos)
|
||||
static ssize_t reset_write(struct file *filp, const char __user *buf,
|
||||
size_t count, loff_t *pos)
|
||||
{
|
||||
struct mlx5_cmd_stats *stats;
|
||||
|
||||
@@ -152,6 +152,11 @@ static ssize_t average_write(struct file *filp, const char __user *buf,
|
||||
spin_lock_irq(&stats->lock);
|
||||
stats->sum = 0;
|
||||
stats->n = 0;
|
||||
stats->failed = 0;
|
||||
stats->failed_mbox_status = 0;
|
||||
stats->last_failed_errno = 0;
|
||||
stats->last_failed_mbox_status = 0;
|
||||
stats->last_failed_syndrome = 0;
|
||||
spin_unlock_irq(&stats->lock);
|
||||
|
||||
*pos += count;
|
||||
@@ -159,11 +164,16 @@ static ssize_t average_write(struct file *filp, const char __user *buf,
|
||||
return count;
|
||||
}
|
||||
|
||||
static const struct file_operations stats_fops = {
|
||||
static const struct file_operations reset_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = simple_open,
|
||||
.write = reset_write,
|
||||
};
|
||||
|
||||
static const struct file_operations average_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = simple_open,
|
||||
.read = average_read,
|
||||
.write = average_write,
|
||||
};
|
||||
|
||||
static ssize_t slots_read(struct file *filp, char __user *buf, size_t count,
|
||||
@@ -228,8 +238,10 @@ void mlx5_cmdif_debugfs_init(struct mlx5_core_dev *dev)
|
||||
continue;
|
||||
stats->root = debugfs_create_dir(namep, *cmd);
|
||||
|
||||
debugfs_create_file("reset", 0200, stats->root, stats,
|
||||
&reset_fops);
|
||||
debugfs_create_file("average", 0400, stats->root, stats,
|
||||
&stats_fops);
|
||||
&average_fops);
|
||||
debugfs_create_u64("n", 0400, stats->root, &stats->n);
|
||||
debugfs_create_u64("failed", 0400, stats->root, &stats->failed);
|
||||
debugfs_create_u64("failed_mbox_status", 0400, stats->root,
|
||||
|
||||
@@ -1160,7 +1160,7 @@ void mlx5e_vxlan_set_netdev_info(struct mlx5e_priv *priv);
|
||||
void mlx5e_ethtool_get_drvinfo(struct mlx5e_priv *priv,
|
||||
struct ethtool_drvinfo *drvinfo);
|
||||
void mlx5e_ethtool_get_strings(struct mlx5e_priv *priv,
|
||||
uint32_t stringset, uint8_t *data);
|
||||
u32 stringset, u8 *data);
|
||||
int mlx5e_ethtool_get_sset_count(struct mlx5e_priv *priv, int sset);
|
||||
void mlx5e_ethtool_get_ethtool_stats(struct mlx5e_priv *priv,
|
||||
struct ethtool_stats *stats, u64 *data);
|
||||
|
||||
@@ -565,7 +565,7 @@ mlx5e_xmit_xdp_frame(struct mlx5e_xdpsq *sq, struct mlx5e_xmit_data *xdptxd,
|
||||
linear = !!(dma_len - inline_hdr_sz);
|
||||
ds_cnt = MLX5E_TX_WQE_EMPTY_DS_COUNT + linear + !!inline_hdr_sz;
|
||||
|
||||
/* check_result must be 0 if sinfo is passed. */
|
||||
/* check_result must be 0 if xdptxd->has_frags is true. */
|
||||
if (!check_result) {
|
||||
int stop_room = 1;
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ void mlx5e_accel_fs_del_sk(struct mlx5_flow_handle *rule)
|
||||
|
||||
struct mlx5_flow_handle *mlx5e_accel_fs_add_sk(struct mlx5e_flow_steering *fs,
|
||||
struct sock *sk, u32 tirn,
|
||||
uint32_t flow_tag)
|
||||
u32 flow_tag)
|
||||
{
|
||||
struct mlx5e_accel_fs_tcp *fs_tcp = mlx5e_fs_get_accel_tcp(fs);
|
||||
struct mlx5_flow_destination dest = {};
|
||||
|
||||
@@ -11,14 +11,14 @@ int mlx5e_accel_fs_tcp_create(struct mlx5e_flow_steering *fs);
|
||||
void mlx5e_accel_fs_tcp_destroy(struct mlx5e_flow_steering *fs);
|
||||
struct mlx5_flow_handle *mlx5e_accel_fs_add_sk(struct mlx5e_flow_steering *fs,
|
||||
struct sock *sk, u32 tirn,
|
||||
uint32_t flow_tag);
|
||||
u32 flow_tag);
|
||||
void mlx5e_accel_fs_del_sk(struct mlx5_flow_handle *rule);
|
||||
#else
|
||||
static inline int mlx5e_accel_fs_tcp_create(struct mlx5e_flow_steering *fs) { return 0; }
|
||||
static inline void mlx5e_accel_fs_tcp_destroy(struct mlx5e_flow_steering *fs) {}
|
||||
static inline struct mlx5_flow_handle *mlx5e_accel_fs_add_sk(struct mlx5e_flow_steering *fs,
|
||||
struct sock *sk, u32 tirn,
|
||||
uint32_t flow_tag)
|
||||
u32 flow_tag)
|
||||
{ return ERR_PTR(-EOPNOTSUPP); }
|
||||
static inline void mlx5e_accel_fs_del_sk(struct mlx5_flow_handle *rule) {}
|
||||
#endif
|
||||
|
||||
@@ -78,13 +78,10 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(ipsec_hw)
|
||||
unsigned int i;
|
||||
|
||||
if (!priv->ipsec)
|
||||
return idx;
|
||||
return;
|
||||
|
||||
for (i = 0; i < NUM_IPSEC_HW_COUNTERS; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN,
|
||||
mlx5e_ipsec_hw_stats_desc[i].format);
|
||||
|
||||
return idx;
|
||||
ethtool_puts(data, mlx5e_ipsec_hw_stats_desc[i].format);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(ipsec_hw)
|
||||
@@ -92,14 +89,14 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(ipsec_hw)
|
||||
int i;
|
||||
|
||||
if (!priv->ipsec)
|
||||
return idx;
|
||||
return;
|
||||
|
||||
mlx5e_accel_ipsec_fs_read_stats(priv, &priv->ipsec->hw_stats);
|
||||
for (i = 0; i < NUM_IPSEC_HW_COUNTERS; i++)
|
||||
data[idx++] = MLX5E_READ_CTR_ATOMIC64(&priv->ipsec->hw_stats,
|
||||
mlx5e_ipsec_hw_stats_desc, i);
|
||||
|
||||
return idx;
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR_ATOMIC64(&priv->ipsec->hw_stats,
|
||||
mlx5e_ipsec_hw_stats_desc, i));
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(ipsec_sw)
|
||||
@@ -115,9 +112,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(ipsec_sw)
|
||||
|
||||
if (priv->ipsec)
|
||||
for (i = 0; i < NUM_IPSEC_SW_COUNTERS; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN,
|
||||
mlx5e_ipsec_sw_stats_desc[i].format);
|
||||
return idx;
|
||||
ethtool_puts(data, mlx5e_ipsec_sw_stats_desc[i].format);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(ipsec_sw)
|
||||
@@ -126,9 +121,10 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(ipsec_sw)
|
||||
|
||||
if (priv->ipsec)
|
||||
for (i = 0; i < NUM_IPSEC_SW_COUNTERS; i++)
|
||||
data[idx++] = MLX5E_READ_CTR_ATOMIC64(&priv->ipsec->sw_stats,
|
||||
mlx5e_ipsec_sw_stats_desc, i);
|
||||
return idx;
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR_ATOMIC64(
|
||||
&priv->ipsec->sw_stats,
|
||||
mlx5e_ipsec_sw_stats_desc, i));
|
||||
}
|
||||
|
||||
MLX5E_DEFINE_STATS_GRP(ipsec_hw, 0);
|
||||
|
||||
@@ -95,8 +95,8 @@ int mlx5e_ktls_init(struct mlx5e_priv *priv);
|
||||
void mlx5e_ktls_cleanup(struct mlx5e_priv *priv);
|
||||
|
||||
int mlx5e_ktls_get_count(struct mlx5e_priv *priv);
|
||||
int mlx5e_ktls_get_strings(struct mlx5e_priv *priv, uint8_t *data);
|
||||
int mlx5e_ktls_get_stats(struct mlx5e_priv *priv, u64 *data);
|
||||
void mlx5e_ktls_get_strings(struct mlx5e_priv *priv, u8 **data);
|
||||
void mlx5e_ktls_get_stats(struct mlx5e_priv *priv, u64 **data);
|
||||
|
||||
#else
|
||||
static inline void mlx5e_ktls_build_netdev(struct mlx5e_priv *priv)
|
||||
@@ -144,15 +144,9 @@ static inline bool mlx5e_is_ktls_rx(struct mlx5_core_dev *mdev)
|
||||
static inline int mlx5e_ktls_init(struct mlx5e_priv *priv) { return 0; }
|
||||
static inline void mlx5e_ktls_cleanup(struct mlx5e_priv *priv) { }
|
||||
static inline int mlx5e_ktls_get_count(struct mlx5e_priv *priv) { return 0; }
|
||||
static inline int mlx5e_ktls_get_strings(struct mlx5e_priv *priv, uint8_t *data)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void mlx5e_ktls_get_strings(struct mlx5e_priv *priv, u8 **data) { }
|
||||
|
||||
static inline int mlx5e_ktls_get_stats(struct mlx5e_priv *priv, u64 *data)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void mlx5e_ktls_get_stats(struct mlx5e_priv *priv, u64 **data) { }
|
||||
#endif
|
||||
|
||||
#endif /* __MLX5E_TLS_H__ */
|
||||
|
||||
@@ -58,35 +58,31 @@ int mlx5e_ktls_get_count(struct mlx5e_priv *priv)
|
||||
return ARRAY_SIZE(mlx5e_ktls_sw_stats_desc);
|
||||
}
|
||||
|
||||
int mlx5e_ktls_get_strings(struct mlx5e_priv *priv, uint8_t *data)
|
||||
void mlx5e_ktls_get_strings(struct mlx5e_priv *priv, u8 **data)
|
||||
{
|
||||
unsigned int i, n, idx = 0;
|
||||
unsigned int i, n;
|
||||
|
||||
if (!priv->tls)
|
||||
return 0;
|
||||
return;
|
||||
|
||||
n = mlx5e_ktls_get_count(priv);
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN,
|
||||
mlx5e_ktls_sw_stats_desc[i].format);
|
||||
|
||||
return n;
|
||||
ethtool_puts(data, mlx5e_ktls_sw_stats_desc[i].format);
|
||||
}
|
||||
|
||||
int mlx5e_ktls_get_stats(struct mlx5e_priv *priv, u64 *data)
|
||||
void mlx5e_ktls_get_stats(struct mlx5e_priv *priv, u64 **data)
|
||||
{
|
||||
unsigned int i, n, idx = 0;
|
||||
unsigned int i, n;
|
||||
|
||||
if (!priv->tls)
|
||||
return 0;
|
||||
return;
|
||||
|
||||
n = mlx5e_ktls_get_count(priv);
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
data[idx++] = MLX5E_READ_CTR_ATOMIC64(&priv->tls->sw_stats,
|
||||
mlx5e_ktls_sw_stats_desc,
|
||||
i);
|
||||
|
||||
return n;
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR_ATOMIC64(&priv->tls->sw_stats,
|
||||
mlx5e_ktls_sw_stats_desc, i));
|
||||
}
|
||||
|
||||
@@ -38,16 +38,13 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(macsec_hw)
|
||||
unsigned int i;
|
||||
|
||||
if (!priv->macsec)
|
||||
return idx;
|
||||
return;
|
||||
|
||||
if (!mlx5e_is_macsec_device(priv->mdev))
|
||||
return idx;
|
||||
return;
|
||||
|
||||
for (i = 0; i < NUM_MACSEC_HW_COUNTERS; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN,
|
||||
mlx5e_macsec_hw_stats_desc[i].format);
|
||||
|
||||
return idx;
|
||||
ethtool_puts(data, mlx5e_macsec_hw_stats_desc[i].format);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(macsec_hw)
|
||||
@@ -56,19 +53,18 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(macsec_hw)
|
||||
int i;
|
||||
|
||||
if (!priv->macsec)
|
||||
return idx;
|
||||
return;
|
||||
|
||||
if (!mlx5e_is_macsec_device(priv->mdev))
|
||||
return idx;
|
||||
return;
|
||||
|
||||
macsec_fs = priv->mdev->macsec_fs;
|
||||
mlx5_macsec_fs_get_stats_fill(macsec_fs, mlx5_macsec_fs_get_stats(macsec_fs));
|
||||
for (i = 0; i < NUM_MACSEC_HW_COUNTERS; i++)
|
||||
data[idx++] = MLX5E_READ_CTR64_CPU(mlx5_macsec_fs_get_stats(macsec_fs),
|
||||
mlx5e_macsec_hw_stats_desc,
|
||||
i);
|
||||
|
||||
return idx;
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR64_CPU(
|
||||
mlx5_macsec_fs_get_stats(macsec_fs),
|
||||
mlx5e_macsec_hw_stats_desc, i));
|
||||
}
|
||||
|
||||
MLX5E_DEFINE_STATS_GRP(macsec_hw, 0);
|
||||
|
||||
@@ -219,6 +219,13 @@ void mlx5e_build_ptys2ethtool_map(void)
|
||||
ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT,
|
||||
ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT,
|
||||
ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT);
|
||||
MLX5_BUILD_PTYS2ETHTOOL_CONFIG(MLX5E_800GAUI_8_800GBASE_CR8_KR8, ext,
|
||||
ETHTOOL_LINK_MODE_800000baseCR8_Full_BIT,
|
||||
ETHTOOL_LINK_MODE_800000baseKR8_Full_BIT,
|
||||
ETHTOOL_LINK_MODE_800000baseDR8_Full_BIT,
|
||||
ETHTOOL_LINK_MODE_800000baseDR8_2_Full_BIT,
|
||||
ETHTOOL_LINK_MODE_800000baseSR8_Full_BIT,
|
||||
ETHTOOL_LINK_MODE_800000baseVR8_Full_BIT);
|
||||
}
|
||||
|
||||
static void mlx5e_ethtool_get_speed_arr(struct mlx5_core_dev *mdev,
|
||||
@@ -269,8 +276,7 @@ void mlx5e_ethtool_get_strings(struct mlx5e_priv *priv, u32 stringset, u8 *data)
|
||||
switch (stringset) {
|
||||
case ETH_SS_PRIV_FLAGS:
|
||||
for (i = 0; i < MLX5E_NUM_PFLAGS; i++)
|
||||
strcpy(data + i * ETH_GSTRING_LEN,
|
||||
mlx5e_priv_flags[i].name);
|
||||
ethtool_puts(&data, mlx5e_priv_flags[i].name);
|
||||
break;
|
||||
|
||||
case ETH_SS_TEST:
|
||||
|
||||
@@ -896,8 +896,7 @@ static void mlx5e_set_inner_ttc_params(struct mlx5e_flow_steering *fs,
|
||||
int tt;
|
||||
|
||||
memset(ttc_params, 0, sizeof(*ttc_params));
|
||||
ttc_params->ns = mlx5_get_flow_namespace(fs->mdev,
|
||||
MLX5_FLOW_NAMESPACE_KERNEL);
|
||||
ttc_params->ns_type = MLX5_FLOW_NAMESPACE_KERNEL;
|
||||
ft_attr->level = MLX5E_INNER_TTC_FT_LEVEL;
|
||||
ft_attr->prio = MLX5E_NIC_PRIO;
|
||||
|
||||
@@ -920,8 +919,7 @@ void mlx5e_set_ttc_params(struct mlx5e_flow_steering *fs,
|
||||
int tt;
|
||||
|
||||
memset(ttc_params, 0, sizeof(*ttc_params));
|
||||
ttc_params->ns = mlx5_get_flow_namespace(fs->mdev,
|
||||
MLX5_FLOW_NAMESPACE_KERNEL);
|
||||
ttc_params->ns_type = MLX5_FLOW_NAMESPACE_KERNEL;
|
||||
ft_attr->level = MLX5E_TTC_FT_LEVEL;
|
||||
ft_attr->prio = MLX5E_NIC_PRIO;
|
||||
|
||||
|
||||
@@ -135,9 +135,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(sw_rep)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_VPORT_REP_SW_COUNTERS; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN,
|
||||
sw_rep_stats_desc[i].format);
|
||||
return idx;
|
||||
ethtool_puts(data, sw_rep_stats_desc[i].format);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(sw_rep)
|
||||
@@ -145,9 +143,9 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(sw_rep)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_VPORT_REP_SW_COUNTERS; i++)
|
||||
data[idx++] = MLX5E_READ_CTR64_CPU(&priv->stats.sw,
|
||||
sw_rep_stats_desc, i);
|
||||
return idx;
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR64_CPU(&priv->stats.sw,
|
||||
sw_rep_stats_desc, i));
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(sw_rep)
|
||||
@@ -176,11 +174,9 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(vport_rep)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_VPORT_REP_HW_COUNTERS; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN, vport_rep_stats_desc[i].format);
|
||||
ethtool_puts(data, vport_rep_stats_desc[i].format);
|
||||
for (i = 0; i < NUM_VPORT_REP_LOOPBACK_COUNTERS(priv->mdev); i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN,
|
||||
vport_rep_loopback_stats_desc[i].format);
|
||||
return idx;
|
||||
ethtool_puts(data, vport_rep_loopback_stats_desc[i].format);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(vport_rep)
|
||||
@@ -188,12 +184,14 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(vport_rep)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_VPORT_REP_HW_COUNTERS; i++)
|
||||
data[idx++] = MLX5E_READ_CTR64_CPU(&priv->stats.rep_stats,
|
||||
vport_rep_stats_desc, i);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR64_CPU(&priv->stats.rep_stats,
|
||||
vport_rep_stats_desc, i));
|
||||
for (i = 0; i < NUM_VPORT_REP_LOOPBACK_COUNTERS(priv->mdev); i++)
|
||||
data[idx++] = MLX5E_READ_CTR64_CPU(&priv->stats.rep_stats,
|
||||
vport_rep_loopback_stats_desc, i);
|
||||
return idx;
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR64_CPU(&priv->stats.rep_stats,
|
||||
vport_rep_loopback_stats_desc, i));
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vport_rep)
|
||||
@@ -276,7 +274,7 @@ out:
|
||||
}
|
||||
|
||||
static void mlx5e_rep_get_strings(struct net_device *dev,
|
||||
u32 stringset, uint8_t *data)
|
||||
u32 stringset, u8 *data)
|
||||
{
|
||||
struct mlx5e_priv *priv = netdev_priv(dev);
|
||||
|
||||
|
||||
@@ -359,7 +359,7 @@ int mlx5e_self_test_fill_strings(struct mlx5e_priv *priv, u8 *data)
|
||||
if (st.cond_func && st.cond_func(priv))
|
||||
continue;
|
||||
if (data)
|
||||
strcpy(data + count * ETH_GSTRING_LEN, st.name);
|
||||
ethtool_puts(&data, st.name);
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
|
||||
@@ -41,6 +41,11 @@
|
||||
#include <net/page_pool/helpers.h>
|
||||
#endif
|
||||
|
||||
void mlx5e_ethtool_put_stat(u64 **data, u64 val)
|
||||
{
|
||||
*(*data)++ = val;
|
||||
}
|
||||
|
||||
static unsigned int stats_grps_num(struct mlx5e_priv *priv)
|
||||
{
|
||||
return !priv->profile->stats_grps_num ? 0 :
|
||||
@@ -90,17 +95,17 @@ void mlx5e_stats_fill(struct mlx5e_priv *priv, u64 *data, int idx)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num_stats_grps; i++)
|
||||
idx = stats_grps[i]->fill_stats(priv, data, idx);
|
||||
stats_grps[i]->fill_stats(priv, &data);
|
||||
}
|
||||
|
||||
void mlx5e_stats_fill_strings(struct mlx5e_priv *priv, u8 *data)
|
||||
{
|
||||
mlx5e_stats_grp_t *stats_grps = priv->profile->stats_grps;
|
||||
const unsigned int num_stats_grps = stats_grps_num(priv);
|
||||
int i, idx = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num_stats_grps; i++)
|
||||
idx = stats_grps[i]->fill_strings(priv, data, idx);
|
||||
stats_grps[i]->fill_strings(priv, &data);
|
||||
}
|
||||
|
||||
/* Concrete NIC Stats */
|
||||
@@ -257,8 +262,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(sw)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_SW_COUNTERS; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN, sw_stats_desc[i].format);
|
||||
return idx;
|
||||
ethtool_puts(data, sw_stats_desc[i].format);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(sw)
|
||||
@@ -266,8 +270,9 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(sw)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_SW_COUNTERS; i++)
|
||||
data[idx++] = MLX5E_READ_CTR64_CPU(&priv->stats.sw, sw_stats_desc, i);
|
||||
return idx;
|
||||
mlx5e_ethtool_put_stat(data,
|
||||
MLX5E_READ_CTR64_CPU(&priv->stats.sw,
|
||||
sw_stats_desc, i));
|
||||
}
|
||||
|
||||
static void mlx5e_stats_grp_sw_update_stats_xdp_red(struct mlx5e_sw_stats *s,
|
||||
@@ -591,14 +596,10 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(qcnt)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_Q_COUNTERS && q_counter_any(priv); i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN,
|
||||
q_stats_desc[i].format);
|
||||
ethtool_puts(data, q_stats_desc[i].format);
|
||||
|
||||
for (i = 0; i < NUM_DROP_RQ_COUNTERS && priv->drop_rq_q_counter; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN,
|
||||
drop_rq_stats_desc[i].format);
|
||||
|
||||
return idx;
|
||||
ethtool_puts(data, drop_rq_stats_desc[i].format);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(qcnt)
|
||||
@@ -606,12 +607,13 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(qcnt)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_Q_COUNTERS && q_counter_any(priv); i++)
|
||||
data[idx++] = MLX5E_READ_CTR32_CPU(&priv->stats.qcnt,
|
||||
q_stats_desc, i);
|
||||
mlx5e_ethtool_put_stat(data,
|
||||
MLX5E_READ_CTR32_CPU(&priv->stats.qcnt,
|
||||
q_stats_desc, i));
|
||||
for (i = 0; i < NUM_DROP_RQ_COUNTERS && priv->drop_rq_q_counter; i++)
|
||||
data[idx++] = MLX5E_READ_CTR32_CPU(&priv->stats.qcnt,
|
||||
drop_rq_stats_desc, i);
|
||||
return idx;
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR32_CPU(&priv->stats.qcnt,
|
||||
drop_rq_stats_desc, i));
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(qcnt)
|
||||
@@ -685,18 +687,13 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(vnic_env)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_VNIC_ENV_STEER_COUNTERS(priv->mdev); i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN,
|
||||
vnic_env_stats_steer_desc[i].format);
|
||||
ethtool_puts(data, vnic_env_stats_steer_desc[i].format);
|
||||
|
||||
for (i = 0; i < NUM_VNIC_ENV_DEV_OOB_COUNTERS(priv->mdev); i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN,
|
||||
vnic_env_stats_dev_oob_desc[i].format);
|
||||
ethtool_puts(data, vnic_env_stats_dev_oob_desc[i].format);
|
||||
|
||||
for (i = 0; i < NUM_VNIC_ENV_DROP_COUNTERS(priv->mdev); i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN,
|
||||
vnic_env_stats_drop_desc[i].format);
|
||||
|
||||
return idx;
|
||||
ethtool_puts(data, vnic_env_stats_drop_desc[i].format);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(vnic_env)
|
||||
@@ -704,18 +701,22 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(vnic_env)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_VNIC_ENV_STEER_COUNTERS(priv->mdev); i++)
|
||||
data[idx++] = MLX5E_READ_CTR64_BE(priv->stats.vnic.query_vnic_env_out,
|
||||
vnic_env_stats_steer_desc, i);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR64_BE(priv->stats.vnic.query_vnic_env_out,
|
||||
vnic_env_stats_steer_desc, i));
|
||||
|
||||
for (i = 0; i < NUM_VNIC_ENV_DEV_OOB_COUNTERS(priv->mdev); i++)
|
||||
data[idx++] = MLX5E_READ_CTR32_BE(priv->stats.vnic.query_vnic_env_out,
|
||||
vnic_env_stats_dev_oob_desc, i);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR32_BE(priv->stats.vnic.query_vnic_env_out,
|
||||
vnic_env_stats_dev_oob_desc, i));
|
||||
|
||||
for (i = 0; i < NUM_VNIC_ENV_DROP_COUNTERS(priv->mdev); i++)
|
||||
data[idx++] = MLX5E_READ_CTR32_BE(priv->stats.vnic.query_vnic_env_out,
|
||||
vnic_env_stats_drop_desc, i);
|
||||
|
||||
return idx;
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR32_BE(priv->stats.vnic.query_vnic_env_out,
|
||||
vnic_env_stats_drop_desc, i));
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vnic_env)
|
||||
@@ -798,13 +799,10 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(vport)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_VPORT_COUNTERS; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN, vport_stats_desc[i].format);
|
||||
ethtool_puts(data, vport_stats_desc[i].format);
|
||||
|
||||
for (i = 0; i < NUM_VPORT_LOOPBACK_COUNTERS(priv->mdev); i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN,
|
||||
vport_loopback_stats_desc[i].format);
|
||||
|
||||
return idx;
|
||||
ethtool_puts(data, vport_loopback_stats_desc[i].format);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(vport)
|
||||
@@ -812,14 +810,16 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(vport)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_VPORT_COUNTERS; i++)
|
||||
data[idx++] = MLX5E_READ_CTR64_BE(priv->stats.vport.query_vport_out,
|
||||
vport_stats_desc, i);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR64_BE(priv->stats.vport.query_vport_out,
|
||||
vport_stats_desc, i));
|
||||
|
||||
for (i = 0; i < NUM_VPORT_LOOPBACK_COUNTERS(priv->mdev); i++)
|
||||
data[idx++] = MLX5E_READ_CTR64_BE(priv->stats.vport.query_vport_out,
|
||||
vport_loopback_stats_desc, i);
|
||||
|
||||
return idx;
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR64_BE(priv->stats.vport.query_vport_out,
|
||||
vport_loopback_stats_desc, i));
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vport)
|
||||
@@ -868,8 +868,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(802_3)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_PPORT_802_3_COUNTERS; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN, pport_802_3_stats_desc[i].format);
|
||||
return idx;
|
||||
ethtool_puts(data, pport_802_3_stats_desc[i].format);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(802_3)
|
||||
@@ -877,9 +876,10 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(802_3)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_PPORT_802_3_COUNTERS; i++)
|
||||
data[idx++] = MLX5E_READ_CTR64_BE(&priv->stats.pport.IEEE_802_3_counters,
|
||||
pport_802_3_stats_desc, i);
|
||||
return idx;
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR64_BE(
|
||||
&priv->stats.pport.IEEE_802_3_counters,
|
||||
pport_802_3_stats_desc, i));
|
||||
}
|
||||
|
||||
#define MLX5_BASIC_PPCNT_SUPPORTED(mdev) \
|
||||
@@ -1029,8 +1029,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(2863)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_PPORT_2863_COUNTERS; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN, pport_2863_stats_desc[i].format);
|
||||
return idx;
|
||||
ethtool_puts(data, pport_2863_stats_desc[i].format);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(2863)
|
||||
@@ -1038,9 +1037,10 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(2863)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_PPORT_2863_COUNTERS; i++)
|
||||
data[idx++] = MLX5E_READ_CTR64_BE(&priv->stats.pport.RFC_2863_counters,
|
||||
pport_2863_stats_desc, i);
|
||||
return idx;
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR64_BE(
|
||||
&priv->stats.pport.RFC_2863_counters,
|
||||
pport_2863_stats_desc, i));
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(2863)
|
||||
@@ -1088,8 +1088,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(2819)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_PPORT_2819_COUNTERS; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN, pport_2819_stats_desc[i].format);
|
||||
return idx;
|
||||
ethtool_puts(data, pport_2819_stats_desc[i].format);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(2819)
|
||||
@@ -1097,9 +1096,10 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(2819)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_PPORT_2819_COUNTERS; i++)
|
||||
data[idx++] = MLX5E_READ_CTR64_BE(&priv->stats.pport.RFC_2819_counters,
|
||||
pport_2819_stats_desc, i);
|
||||
return idx;
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR64_BE(
|
||||
&priv->stats.pport.RFC_2819_counters,
|
||||
pport_2819_stats_desc, i));
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(2819)
|
||||
@@ -1215,21 +1215,18 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(phy)
|
||||
struct mlx5_core_dev *mdev = priv->mdev;
|
||||
int i;
|
||||
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN, "link_down_events_phy");
|
||||
ethtool_puts(data, "link_down_events_phy");
|
||||
|
||||
if (!MLX5_CAP_PCAM_FEATURE(mdev, ppcnt_statistical_group))
|
||||
return idx;
|
||||
return;
|
||||
|
||||
for (i = 0; i < NUM_PPORT_PHY_STATISTICAL_COUNTERS; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN,
|
||||
pport_phy_statistical_stats_desc[i].format);
|
||||
ethtool_puts(data, pport_phy_statistical_stats_desc[i].format);
|
||||
|
||||
if (MLX5_CAP_PCAM_FEATURE(mdev, per_lane_error_counters))
|
||||
for (i = 0; i < NUM_PPORT_PHY_STATISTICAL_PER_LANE_COUNTERS; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN,
|
||||
pport_phy_statistical_err_lanes_stats_desc[i].format);
|
||||
|
||||
return idx;
|
||||
ethtool_puts(data,
|
||||
pport_phy_statistical_err_lanes_stats_desc[i].format);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(phy)
|
||||
@@ -1238,24 +1235,29 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(phy)
|
||||
int i;
|
||||
|
||||
/* link_down_events_phy has special handling since it is not stored in __be64 format */
|
||||
data[idx++] = MLX5_GET(ppcnt_reg, priv->stats.pport.phy_counters,
|
||||
counter_set.phys_layer_cntrs.link_down_events);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5_GET(ppcnt_reg, priv->stats.pport.phy_counters,
|
||||
counter_set.phys_layer_cntrs.link_down_events));
|
||||
|
||||
if (!MLX5_CAP_PCAM_FEATURE(mdev, ppcnt_statistical_group))
|
||||
return idx;
|
||||
return;
|
||||
|
||||
for (i = 0; i < NUM_PPORT_PHY_STATISTICAL_COUNTERS; i++)
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR64_BE(&priv->stats.pport.phy_statistical_counters,
|
||||
pport_phy_statistical_stats_desc, i);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR64_BE(
|
||||
&priv->stats.pport.phy_statistical_counters,
|
||||
pport_phy_statistical_stats_desc, i));
|
||||
|
||||
if (MLX5_CAP_PCAM_FEATURE(mdev, per_lane_error_counters))
|
||||
for (i = 0; i < NUM_PPORT_PHY_STATISTICAL_PER_LANE_COUNTERS; i++)
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR64_BE(&priv->stats.pport.phy_statistical_counters,
|
||||
pport_phy_statistical_err_lanes_stats_desc,
|
||||
i);
|
||||
return idx;
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR64_BE(
|
||||
&priv->stats.pport
|
||||
.phy_statistical_counters,
|
||||
pport_phy_statistical_err_lanes_stats_desc,
|
||||
i));
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(phy)
|
||||
@@ -1436,9 +1438,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(eth_ext)
|
||||
|
||||
if (MLX5_CAP_PCAM_FEATURE((priv)->mdev, rx_buffer_fullness_counters))
|
||||
for (i = 0; i < NUM_PPORT_ETH_EXT_COUNTERS; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN,
|
||||
pport_eth_ext_stats_desc[i].format);
|
||||
return idx;
|
||||
ethtool_puts(data, pport_eth_ext_stats_desc[i].format);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(eth_ext)
|
||||
@@ -1447,10 +1447,11 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(eth_ext)
|
||||
|
||||
if (MLX5_CAP_PCAM_FEATURE((priv)->mdev, rx_buffer_fullness_counters))
|
||||
for (i = 0; i < NUM_PPORT_ETH_EXT_COUNTERS; i++)
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR64_BE(&priv->stats.pport.eth_ext_counters,
|
||||
pport_eth_ext_stats_desc, i);
|
||||
return idx;
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR64_BE(
|
||||
&priv->stats.pport.eth_ext_counters,
|
||||
pport_eth_ext_stats_desc, i));
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(eth_ext)
|
||||
@@ -1516,19 +1517,16 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(pcie)
|
||||
|
||||
if (MLX5_CAP_MCAM_FEATURE((priv)->mdev, pcie_performance_group))
|
||||
for (i = 0; i < NUM_PCIE_PERF_COUNTERS; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN,
|
||||
pcie_perf_stats_desc[i].format);
|
||||
ethtool_puts(data, pcie_perf_stats_desc[i].format);
|
||||
|
||||
if (MLX5_CAP_MCAM_FEATURE((priv)->mdev, tx_overflow_buffer_pkt))
|
||||
for (i = 0; i < NUM_PCIE_PERF_COUNTERS64; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN,
|
||||
pcie_perf_stats_desc64[i].format);
|
||||
ethtool_puts(data, pcie_perf_stats_desc64[i].format);
|
||||
|
||||
if (MLX5_CAP_MCAM_FEATURE((priv)->mdev, pcie_outbound_stalled))
|
||||
for (i = 0; i < NUM_PCIE_PERF_STALL_COUNTERS; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN,
|
||||
pcie_perf_stall_stats_desc[i].format);
|
||||
return idx;
|
||||
ethtool_puts(data,
|
||||
pcie_perf_stall_stats_desc[i].format);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(pcie)
|
||||
@@ -1537,22 +1535,27 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(pcie)
|
||||
|
||||
if (MLX5_CAP_MCAM_FEATURE((priv)->mdev, pcie_performance_group))
|
||||
for (i = 0; i < NUM_PCIE_PERF_COUNTERS; i++)
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR32_BE(&priv->stats.pcie.pcie_perf_counters,
|
||||
pcie_perf_stats_desc, i);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR32_BE(
|
||||
&priv->stats.pcie.pcie_perf_counters,
|
||||
pcie_perf_stats_desc, i));
|
||||
|
||||
if (MLX5_CAP_MCAM_FEATURE((priv)->mdev, tx_overflow_buffer_pkt))
|
||||
for (i = 0; i < NUM_PCIE_PERF_COUNTERS64; i++)
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR64_BE(&priv->stats.pcie.pcie_perf_counters,
|
||||
pcie_perf_stats_desc64, i);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR64_BE(
|
||||
&priv->stats.pcie.pcie_perf_counters,
|
||||
pcie_perf_stats_desc64, i));
|
||||
|
||||
if (MLX5_CAP_MCAM_FEATURE((priv)->mdev, pcie_outbound_stalled))
|
||||
for (i = 0; i < NUM_PCIE_PERF_STALL_COUNTERS; i++)
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR32_BE(&priv->stats.pcie.pcie_perf_counters,
|
||||
pcie_perf_stall_stats_desc, i);
|
||||
return idx;
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR32_BE(
|
||||
&priv->stats.pcie.pcie_perf_counters,
|
||||
pcie_perf_stall_stats_desc, i));
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(pcie)
|
||||
@@ -1609,18 +1612,18 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(per_port_buff_congest)
|
||||
int i, prio;
|
||||
|
||||
if (!MLX5_CAP_GEN(mdev, sbcam_reg))
|
||||
return idx;
|
||||
return;
|
||||
|
||||
for (prio = 0; prio < NUM_PPORT_PRIO; prio++) {
|
||||
for (i = 0; i < NUM_PPORT_PER_TC_PRIO_COUNTERS; i++)
|
||||
sprintf(data + (idx++) * ETH_GSTRING_LEN,
|
||||
pport_per_tc_prio_stats_desc[i].format, prio);
|
||||
ethtool_sprintf(data,
|
||||
pport_per_tc_prio_stats_desc[i].format,
|
||||
prio);
|
||||
for (i = 0; i < NUM_PPORT_PER_TC_CONGEST_PRIO_COUNTERS; i++)
|
||||
sprintf(data + (idx++) * ETH_GSTRING_LEN,
|
||||
pport_per_tc_congest_prio_stats_desc[i].format, prio);
|
||||
ethtool_sprintf(data,
|
||||
pport_per_tc_congest_prio_stats_desc[i].format,
|
||||
prio);
|
||||
}
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(per_port_buff_congest)
|
||||
@@ -1630,20 +1633,24 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(per_port_buff_congest)
|
||||
int i, prio;
|
||||
|
||||
if (!MLX5_CAP_GEN(mdev, sbcam_reg))
|
||||
return idx;
|
||||
return;
|
||||
|
||||
for (prio = 0; prio < NUM_PPORT_PRIO; prio++) {
|
||||
for (i = 0; i < NUM_PPORT_PER_TC_PRIO_COUNTERS; i++)
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR64_BE(&pport->per_tc_prio_counters[prio],
|
||||
pport_per_tc_prio_stats_desc, i);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR64_BE(
|
||||
&pport->per_tc_prio_counters[prio],
|
||||
pport_per_tc_prio_stats_desc, i));
|
||||
for (i = 0; i < NUM_PPORT_PER_TC_CONGEST_PRIO_COUNTERS ; i++)
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR64_BE(&pport->per_tc_congest_prio_counters[prio],
|
||||
pport_per_tc_congest_prio_stats_desc, i);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR64_BE(
|
||||
&pport->per_tc_congest_prio_counters
|
||||
[prio],
|
||||
pport_per_tc_congest_prio_stats_desc,
|
||||
i));
|
||||
}
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
static void mlx5e_grp_per_tc_prio_update_stats(struct mlx5e_priv *priv)
|
||||
@@ -1728,35 +1735,33 @@ static int mlx5e_grp_per_prio_traffic_get_num_stats(void)
|
||||
return NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS * NUM_PPORT_PRIO;
|
||||
}
|
||||
|
||||
static int mlx5e_grp_per_prio_traffic_fill_strings(struct mlx5e_priv *priv,
|
||||
u8 *data,
|
||||
int idx)
|
||||
static void mlx5e_grp_per_prio_traffic_fill_strings(struct mlx5e_priv *priv,
|
||||
u8 **data)
|
||||
{
|
||||
int i, prio;
|
||||
|
||||
for (prio = 0; prio < NUM_PPORT_PRIO; prio++) {
|
||||
for (i = 0; i < NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS; i++)
|
||||
sprintf(data + (idx++) * ETH_GSTRING_LEN,
|
||||
pport_per_prio_traffic_stats_desc[i].format, prio);
|
||||
ethtool_sprintf(data,
|
||||
pport_per_prio_traffic_stats_desc[i].format,
|
||||
prio);
|
||||
}
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
static int mlx5e_grp_per_prio_traffic_fill_stats(struct mlx5e_priv *priv,
|
||||
u64 *data,
|
||||
int idx)
|
||||
static void mlx5e_grp_per_prio_traffic_fill_stats(struct mlx5e_priv *priv,
|
||||
u64 **data)
|
||||
{
|
||||
int i, prio;
|
||||
|
||||
for (prio = 0; prio < NUM_PPORT_PRIO; prio++) {
|
||||
for (i = 0; i < NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS; i++)
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR64_BE(&priv->stats.pport.per_prio_counters[prio],
|
||||
pport_per_prio_traffic_stats_desc, i);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR64_BE(
|
||||
&priv->stats.pport
|
||||
.per_prio_counters[prio],
|
||||
pport_per_prio_traffic_stats_desc, i));
|
||||
}
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
static const struct counter_desc pport_per_prio_pfc_stats_desc[] = {
|
||||
@@ -1816,9 +1821,8 @@ static int mlx5e_grp_per_prio_pfc_get_num_stats(struct mlx5e_priv *priv)
|
||||
NUM_PPORT_PFC_STALL_COUNTERS(priv);
|
||||
}
|
||||
|
||||
static int mlx5e_grp_per_prio_pfc_fill_strings(struct mlx5e_priv *priv,
|
||||
u8 *data,
|
||||
int idx)
|
||||
static void mlx5e_grp_per_prio_pfc_fill_strings(struct mlx5e_priv *priv,
|
||||
u8 **data)
|
||||
{
|
||||
unsigned long pfc_combined;
|
||||
int i, prio;
|
||||
@@ -1829,28 +1833,26 @@ static int mlx5e_grp_per_prio_pfc_fill_strings(struct mlx5e_priv *priv,
|
||||
char pfc_string[ETH_GSTRING_LEN];
|
||||
|
||||
snprintf(pfc_string, sizeof(pfc_string), "prio%d", prio);
|
||||
sprintf(data + (idx++) * ETH_GSTRING_LEN,
|
||||
pport_per_prio_pfc_stats_desc[i].format, pfc_string);
|
||||
ethtool_sprintf(data,
|
||||
pport_per_prio_pfc_stats_desc[i].format,
|
||||
pfc_string);
|
||||
}
|
||||
}
|
||||
|
||||
if (mlx5e_query_global_pause_combined(priv)) {
|
||||
for (i = 0; i < NUM_PPORT_PER_PRIO_PFC_COUNTERS; i++) {
|
||||
sprintf(data + (idx++) * ETH_GSTRING_LEN,
|
||||
pport_per_prio_pfc_stats_desc[i].format, "global");
|
||||
ethtool_sprintf(data,
|
||||
pport_per_prio_pfc_stats_desc[i].format,
|
||||
"global");
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < NUM_PPORT_PFC_STALL_COUNTERS(priv); i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN,
|
||||
pport_pfc_stall_stats_desc[i].format);
|
||||
|
||||
return idx;
|
||||
ethtool_puts(data, pport_pfc_stall_stats_desc[i].format);
|
||||
}
|
||||
|
||||
static int mlx5e_grp_per_prio_pfc_fill_stats(struct mlx5e_priv *priv,
|
||||
u64 *data,
|
||||
int idx)
|
||||
static void mlx5e_grp_per_prio_pfc_fill_stats(struct mlx5e_priv *priv,
|
||||
u64 **data)
|
||||
{
|
||||
unsigned long pfc_combined;
|
||||
int i, prio;
|
||||
@@ -1858,25 +1860,30 @@ static int mlx5e_grp_per_prio_pfc_fill_stats(struct mlx5e_priv *priv,
|
||||
pfc_combined = mlx5e_query_pfc_combined(priv);
|
||||
for_each_set_bit(prio, &pfc_combined, NUM_PPORT_PRIO) {
|
||||
for (i = 0; i < NUM_PPORT_PER_PRIO_PFC_COUNTERS; i++) {
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR64_BE(&priv->stats.pport.per_prio_counters[prio],
|
||||
pport_per_prio_pfc_stats_desc, i);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR64_BE(
|
||||
&priv->stats.pport
|
||||
.per_prio_counters[prio],
|
||||
pport_per_prio_pfc_stats_desc, i));
|
||||
}
|
||||
}
|
||||
|
||||
if (mlx5e_query_global_pause_combined(priv)) {
|
||||
for (i = 0; i < NUM_PPORT_PER_PRIO_PFC_COUNTERS; i++) {
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR64_BE(&priv->stats.pport.per_prio_counters[0],
|
||||
pport_per_prio_pfc_stats_desc, i);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR64_BE(
|
||||
&priv->stats.pport.per_prio_counters[0],
|
||||
pport_per_prio_pfc_stats_desc, i));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < NUM_PPORT_PFC_STALL_COUNTERS(priv); i++)
|
||||
data[idx++] = MLX5E_READ_CTR64_BE(&priv->stats.pport.per_prio_counters[0],
|
||||
pport_pfc_stall_stats_desc, i);
|
||||
|
||||
return idx;
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR64_BE(
|
||||
&priv->stats.pport.per_prio_counters[0],
|
||||
pport_pfc_stall_stats_desc, i));
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(per_prio)
|
||||
@@ -1887,16 +1894,14 @@ static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(per_prio)
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(per_prio)
|
||||
{
|
||||
idx = mlx5e_grp_per_prio_traffic_fill_strings(priv, data, idx);
|
||||
idx = mlx5e_grp_per_prio_pfc_fill_strings(priv, data, idx);
|
||||
return idx;
|
||||
mlx5e_grp_per_prio_traffic_fill_strings(priv, data);
|
||||
mlx5e_grp_per_prio_pfc_fill_strings(priv, data);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(per_prio)
|
||||
{
|
||||
idx = mlx5e_grp_per_prio_traffic_fill_stats(priv, data, idx);
|
||||
idx = mlx5e_grp_per_prio_pfc_fill_stats(priv, data, idx);
|
||||
return idx;
|
||||
mlx5e_grp_per_prio_traffic_fill_stats(priv, data);
|
||||
mlx5e_grp_per_prio_pfc_fill_stats(priv, data);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(per_prio)
|
||||
@@ -1944,12 +1949,10 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(pme)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_PME_STATUS_STATS; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN, mlx5e_pme_status_desc[i].format);
|
||||
ethtool_puts(data, mlx5e_pme_status_desc[i].format);
|
||||
|
||||
for (i = 0; i < NUM_PME_ERR_STATS; i++)
|
||||
strcpy(data + (idx++) * ETH_GSTRING_LEN, mlx5e_pme_error_desc[i].format);
|
||||
|
||||
return idx;
|
||||
ethtool_puts(data, mlx5e_pme_error_desc[i].format);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(pme)
|
||||
@@ -1960,14 +1963,14 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(pme)
|
||||
mlx5_get_pme_stats(priv->mdev, &pme_stats);
|
||||
|
||||
for (i = 0; i < NUM_PME_STATUS_STATS; i++)
|
||||
data[idx++] = MLX5E_READ_CTR64_CPU(pme_stats.status_counters,
|
||||
mlx5e_pme_status_desc, i);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR64_CPU(pme_stats.status_counters,
|
||||
mlx5e_pme_status_desc, i));
|
||||
|
||||
for (i = 0; i < NUM_PME_ERR_STATS; i++)
|
||||
data[idx++] = MLX5E_READ_CTR64_CPU(pme_stats.error_counters,
|
||||
mlx5e_pme_error_desc, i);
|
||||
|
||||
return idx;
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR64_CPU(pme_stats.error_counters,
|
||||
mlx5e_pme_error_desc, i));
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(pme) { return; }
|
||||
@@ -1979,12 +1982,12 @@ static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(tls)
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(tls)
|
||||
{
|
||||
return idx + mlx5e_ktls_get_strings(priv, data + idx * ETH_GSTRING_LEN);
|
||||
mlx5e_ktls_get_strings(priv, data);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(tls)
|
||||
{
|
||||
return idx + mlx5e_ktls_get_stats(priv, data + idx);
|
||||
mlx5e_ktls_get_stats(priv, data);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(tls) { return; }
|
||||
@@ -2264,10 +2267,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(qos)
|
||||
|
||||
for (qid = 0; qid < max_qos_sqs; qid++)
|
||||
for (i = 0; i < NUM_QOS_SQ_STATS; i++)
|
||||
sprintf(data + (idx++) * ETH_GSTRING_LEN,
|
||||
qos_sq_stats_desc[i].format, qid);
|
||||
|
||||
return idx;
|
||||
ethtool_sprintf(data, qos_sq_stats_desc[i].format, qid);
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(qos)
|
||||
@@ -2284,10 +2284,10 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(qos)
|
||||
struct mlx5e_sq_stats *s = READ_ONCE(stats[qid]);
|
||||
|
||||
for (i = 0; i < NUM_QOS_SQ_STATS; i++)
|
||||
data[idx++] = MLX5E_READ_CTR64_CPU(s, qos_sq_stats_desc, i);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR64_CPU(s, qos_sq_stats_desc, i));
|
||||
}
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(qos) { return; }
|
||||
@@ -2312,29 +2312,29 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(ptp)
|
||||
int i, tc;
|
||||
|
||||
if (!priv->tx_ptp_opened && !priv->rx_ptp_opened)
|
||||
return idx;
|
||||
return;
|
||||
|
||||
for (i = 0; i < NUM_PTP_CH_STATS; i++)
|
||||
sprintf(data + (idx++) * ETH_GSTRING_LEN,
|
||||
"%s", ptp_ch_stats_desc[i].format);
|
||||
ethtool_puts(data, ptp_ch_stats_desc[i].format);
|
||||
|
||||
if (priv->tx_ptp_opened) {
|
||||
for (tc = 0; tc < priv->max_opened_tc; tc++)
|
||||
for (i = 0; i < NUM_PTP_SQ_STATS; i++)
|
||||
sprintf(data + (idx++) * ETH_GSTRING_LEN,
|
||||
ptp_sq_stats_desc[i].format, tc);
|
||||
ethtool_sprintf(data,
|
||||
ptp_sq_stats_desc[i].format,
|
||||
tc);
|
||||
|
||||
for (tc = 0; tc < priv->max_opened_tc; tc++)
|
||||
for (i = 0; i < NUM_PTP_CQ_STATS; i++)
|
||||
sprintf(data + (idx++) * ETH_GSTRING_LEN,
|
||||
ptp_cq_stats_desc[i].format, tc);
|
||||
ethtool_sprintf(data,
|
||||
ptp_cq_stats_desc[i].format,
|
||||
tc);
|
||||
}
|
||||
if (priv->rx_ptp_opened) {
|
||||
for (i = 0; i < NUM_PTP_RQ_STATS; i++)
|
||||
sprintf(data + (idx++) * ETH_GSTRING_LEN,
|
||||
ptp_rq_stats_desc[i].format, MLX5E_PTP_CHANNEL_IX);
|
||||
ethtool_sprintf(data, ptp_rq_stats_desc[i].format,
|
||||
MLX5E_PTP_CHANNEL_IX);
|
||||
}
|
||||
return idx;
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(ptp)
|
||||
@@ -2342,33 +2342,35 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(ptp)
|
||||
int i, tc;
|
||||
|
||||
if (!priv->tx_ptp_opened && !priv->rx_ptp_opened)
|
||||
return idx;
|
||||
return;
|
||||
|
||||
for (i = 0; i < NUM_PTP_CH_STATS; i++)
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR64_CPU(&priv->ptp_stats.ch,
|
||||
ptp_ch_stats_desc, i);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR64_CPU(&priv->ptp_stats.ch,
|
||||
ptp_ch_stats_desc, i));
|
||||
|
||||
if (priv->tx_ptp_opened) {
|
||||
for (tc = 0; tc < priv->max_opened_tc; tc++)
|
||||
for (i = 0; i < NUM_PTP_SQ_STATS; i++)
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR64_CPU(&priv->ptp_stats.sq[tc],
|
||||
ptp_sq_stats_desc, i);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR64_CPU(
|
||||
&priv->ptp_stats.sq[tc],
|
||||
ptp_sq_stats_desc, i));
|
||||
|
||||
for (tc = 0; tc < priv->max_opened_tc; tc++)
|
||||
for (i = 0; i < NUM_PTP_CQ_STATS; i++)
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR64_CPU(&priv->ptp_stats.cq[tc],
|
||||
ptp_cq_stats_desc, i);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR64_CPU(
|
||||
&priv->ptp_stats.cq[tc],
|
||||
ptp_cq_stats_desc, i));
|
||||
}
|
||||
if (priv->rx_ptp_opened) {
|
||||
for (i = 0; i < NUM_PTP_RQ_STATS; i++)
|
||||
data[idx++] =
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR64_CPU(&priv->ptp_stats.rq,
|
||||
ptp_rq_stats_desc, i);
|
||||
ptp_rq_stats_desc, i));
|
||||
}
|
||||
return idx;
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(ptp) { return; }
|
||||
@@ -2394,38 +2396,29 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(channels)
|
||||
|
||||
for (i = 0; i < max_nch; i++)
|
||||
for (j = 0; j < NUM_CH_STATS; j++)
|
||||
sprintf(data + (idx++) * ETH_GSTRING_LEN,
|
||||
ch_stats_desc[j].format, i);
|
||||
ethtool_sprintf(data, ch_stats_desc[j].format, i);
|
||||
|
||||
for (i = 0; i < max_nch; i++) {
|
||||
for (j = 0; j < NUM_RQ_STATS; j++)
|
||||
sprintf(data + (idx++) * ETH_GSTRING_LEN,
|
||||
rq_stats_desc[j].format, i);
|
||||
ethtool_sprintf(data, rq_stats_desc[j].format, i);
|
||||
for (j = 0; j < NUM_XSKRQ_STATS * is_xsk; j++)
|
||||
sprintf(data + (idx++) * ETH_GSTRING_LEN,
|
||||
xskrq_stats_desc[j].format, i);
|
||||
ethtool_sprintf(data, xskrq_stats_desc[j].format, i);
|
||||
for (j = 0; j < NUM_RQ_XDPSQ_STATS; j++)
|
||||
sprintf(data + (idx++) * ETH_GSTRING_LEN,
|
||||
rq_xdpsq_stats_desc[j].format, i);
|
||||
ethtool_sprintf(data, rq_xdpsq_stats_desc[j].format, i);
|
||||
}
|
||||
|
||||
for (tc = 0; tc < priv->max_opened_tc; tc++)
|
||||
for (i = 0; i < max_nch; i++)
|
||||
for (j = 0; j < NUM_SQ_STATS; j++)
|
||||
sprintf(data + (idx++) * ETH_GSTRING_LEN,
|
||||
sq_stats_desc[j].format,
|
||||
i + tc * max_nch);
|
||||
ethtool_sprintf(data, sq_stats_desc[j].format,
|
||||
i + tc * max_nch);
|
||||
|
||||
for (i = 0; i < max_nch; i++) {
|
||||
for (j = 0; j < NUM_XSKSQ_STATS * is_xsk; j++)
|
||||
sprintf(data + (idx++) * ETH_GSTRING_LEN,
|
||||
xsksq_stats_desc[j].format, i);
|
||||
ethtool_sprintf(data, xsksq_stats_desc[j].format, i);
|
||||
for (j = 0; j < NUM_XDPSQ_STATS; j++)
|
||||
sprintf(data + (idx++) * ETH_GSTRING_LEN,
|
||||
xdpsq_stats_desc[j].format, i);
|
||||
ethtool_sprintf(data, xdpsq_stats_desc[j].format, i);
|
||||
}
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(channels)
|
||||
@@ -2436,44 +2429,50 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(channels)
|
||||
|
||||
for (i = 0; i < max_nch; i++)
|
||||
for (j = 0; j < NUM_CH_STATS; j++)
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR64_CPU(&priv->channel_stats[i]->ch,
|
||||
ch_stats_desc, j);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR64_CPU(
|
||||
&priv->channel_stats[i]->ch,
|
||||
ch_stats_desc, j));
|
||||
|
||||
for (i = 0; i < max_nch; i++) {
|
||||
for (j = 0; j < NUM_RQ_STATS; j++)
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR64_CPU(&priv->channel_stats[i]->rq,
|
||||
rq_stats_desc, j);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR64_CPU(
|
||||
&priv->channel_stats[i]->rq,
|
||||
rq_stats_desc, j));
|
||||
for (j = 0; j < NUM_XSKRQ_STATS * is_xsk; j++)
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR64_CPU(&priv->channel_stats[i]->xskrq,
|
||||
xskrq_stats_desc, j);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR64_CPU(
|
||||
&priv->channel_stats[i]->xskrq,
|
||||
xskrq_stats_desc, j));
|
||||
for (j = 0; j < NUM_RQ_XDPSQ_STATS; j++)
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR64_CPU(&priv->channel_stats[i]->rq_xdpsq,
|
||||
rq_xdpsq_stats_desc, j);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR64_CPU(
|
||||
&priv->channel_stats[i]->rq_xdpsq,
|
||||
rq_xdpsq_stats_desc, j));
|
||||
}
|
||||
|
||||
for (tc = 0; tc < priv->max_opened_tc; tc++)
|
||||
for (i = 0; i < max_nch; i++)
|
||||
for (j = 0; j < NUM_SQ_STATS; j++)
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR64_CPU(&priv->channel_stats[i]->sq[tc],
|
||||
sq_stats_desc, j);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data,
|
||||
MLX5E_READ_CTR64_CPU(
|
||||
&priv->channel_stats[i]->sq[tc],
|
||||
sq_stats_desc, j));
|
||||
|
||||
for (i = 0; i < max_nch; i++) {
|
||||
for (j = 0; j < NUM_XSKSQ_STATS * is_xsk; j++)
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR64_CPU(&priv->channel_stats[i]->xsksq,
|
||||
xsksq_stats_desc, j);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR64_CPU(
|
||||
&priv->channel_stats[i]->xsksq,
|
||||
xsksq_stats_desc, j));
|
||||
for (j = 0; j < NUM_XDPSQ_STATS; j++)
|
||||
data[idx++] =
|
||||
MLX5E_READ_CTR64_CPU(&priv->channel_stats[i]->xdpsq,
|
||||
xdpsq_stats_desc, j);
|
||||
mlx5e_ethtool_put_stat(
|
||||
data, MLX5E_READ_CTR64_CPU(
|
||||
&priv->channel_stats[i]->xdpsq,
|
||||
xdpsq_stats_desc, j));
|
||||
}
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(channels) { return; }
|
||||
|
||||
@@ -71,11 +71,13 @@ struct mlx5e_priv;
|
||||
struct mlx5e_stats_grp {
|
||||
u16 update_stats_mask;
|
||||
int (*get_num_stats)(struct mlx5e_priv *priv);
|
||||
int (*fill_strings)(struct mlx5e_priv *priv, u8 *data, int idx);
|
||||
int (*fill_stats)(struct mlx5e_priv *priv, u64 *data, int idx);
|
||||
void (*fill_strings)(struct mlx5e_priv *priv, u8 **data);
|
||||
void (*fill_stats)(struct mlx5e_priv *priv, u64 **data);
|
||||
void (*update_stats)(struct mlx5e_priv *priv);
|
||||
};
|
||||
|
||||
void mlx5e_ethtool_put_stat(u64 **data, u64 val);
|
||||
|
||||
typedef const struct mlx5e_stats_grp *const mlx5e_stats_grp_t;
|
||||
|
||||
#define MLX5E_STATS_GRP_OP(grp, name) mlx5e_stats_grp_ ## grp ## _ ## name
|
||||
@@ -87,10 +89,10 @@ typedef const struct mlx5e_stats_grp *const mlx5e_stats_grp_t;
|
||||
void MLX5E_STATS_GRP_OP(grp, update_stats)(struct mlx5e_priv *priv)
|
||||
|
||||
#define MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(grp) \
|
||||
int MLX5E_STATS_GRP_OP(grp, fill_strings)(struct mlx5e_priv *priv, u8 *data, int idx)
|
||||
void MLX5E_STATS_GRP_OP(grp, fill_strings)(struct mlx5e_priv *priv, u8 **data)
|
||||
|
||||
#define MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(grp) \
|
||||
int MLX5E_STATS_GRP_OP(grp, fill_stats)(struct mlx5e_priv *priv, u64 *data, int idx)
|
||||
void MLX5E_STATS_GRP_OP(grp, fill_stats)(struct mlx5e_priv *priv, u64 **data)
|
||||
|
||||
#define MLX5E_STATS_GRP(grp) mlx5e_stats_grp_ ## grp
|
||||
|
||||
|
||||
@@ -835,8 +835,7 @@ static void mlx5e_hairpin_set_ttc_params(struct mlx5e_hairpin *hp,
|
||||
|
||||
memset(ttc_params, 0, sizeof(*ttc_params));
|
||||
|
||||
ttc_params->ns = mlx5_get_flow_namespace(hp->func_mdev,
|
||||
MLX5_FLOW_NAMESPACE_KERNEL);
|
||||
ttc_params->ns_type = MLX5_FLOW_NAMESPACE_KERNEL;
|
||||
for (tt = 0; tt < MLX5_NUM_TT; tt++) {
|
||||
ttc_params->dests[tt].type = MLX5_FLOW_DESTINATION_TYPE_TIR;
|
||||
ttc_params->dests[tt].tir_num =
|
||||
|
||||
@@ -688,6 +688,12 @@ static int create_async_eqs(struct mlx5_core_dev *dev)
|
||||
if (err)
|
||||
goto err2;
|
||||
|
||||
/* Skip page eq creation when the device does not request for page requests */
|
||||
if (MLX5_CAP_GEN(dev, page_request_disable)) {
|
||||
mlx5_core_dbg(dev, "Skip page EQ creation\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
param = (struct mlx5_eq_param) {
|
||||
.irq = table->ctrl_irq,
|
||||
.nent = /* TODO: sriov max_vf + */ 1,
|
||||
@@ -716,7 +722,8 @@ static void destroy_async_eqs(struct mlx5_core_dev *dev)
|
||||
{
|
||||
struct mlx5_eq_table *table = dev->priv.eq_table;
|
||||
|
||||
cleanup_async_eq(dev, &table->pages_eq, "pages");
|
||||
if (!MLX5_CAP_GEN(dev, page_request_disable))
|
||||
cleanup_async_eq(dev, &table->pages_eq, "pages");
|
||||
cleanup_async_eq(dev, &table->async_eq, "async");
|
||||
mlx5_cmd_allowed_opcode(dev, MLX5_CMD_OP_DESTROY_EQ);
|
||||
mlx5_cmd_use_polling(dev);
|
||||
|
||||
@@ -283,7 +283,7 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mlx5_cmd_init_hca(struct mlx5_core_dev *dev, uint32_t *sw_owner_id)
|
||||
int mlx5_cmd_init_hca(struct mlx5_core_dev *dev, u32 *sw_owner_id)
|
||||
{
|
||||
u32 in[MLX5_ST_SZ_DW(init_hca_in)] = {};
|
||||
int i;
|
||||
|
||||
@@ -449,13 +449,11 @@ static void set_tt_map(struct mlx5_lag_port_sel *port_sel,
|
||||
static void mlx5_lag_set_inner_ttc_params(struct mlx5_lag *ldev,
|
||||
struct ttc_params *ttc_params)
|
||||
{
|
||||
struct mlx5_core_dev *dev = ldev->pf[MLX5_LAG_P1].dev;
|
||||
struct mlx5_lag_port_sel *port_sel = &ldev->port_sel;
|
||||
struct mlx5_flow_table_attr *ft_attr;
|
||||
int tt;
|
||||
|
||||
ttc_params->ns = mlx5_get_flow_namespace(dev,
|
||||
MLX5_FLOW_NAMESPACE_PORT_SEL);
|
||||
ttc_params->ns_type = MLX5_FLOW_NAMESPACE_PORT_SEL;
|
||||
ft_attr = &ttc_params->ft_attr;
|
||||
ft_attr->level = MLX5_LAG_FT_LEVEL_INNER_TTC;
|
||||
|
||||
@@ -470,13 +468,11 @@ static void mlx5_lag_set_inner_ttc_params(struct mlx5_lag *ldev,
|
||||
static void mlx5_lag_set_outer_ttc_params(struct mlx5_lag *ldev,
|
||||
struct ttc_params *ttc_params)
|
||||
{
|
||||
struct mlx5_core_dev *dev = ldev->pf[MLX5_LAG_P1].dev;
|
||||
struct mlx5_lag_port_sel *port_sel = &ldev->port_sel;
|
||||
struct mlx5_flow_table_attr *ft_attr;
|
||||
int tt;
|
||||
|
||||
ttc_params->ns = mlx5_get_flow_namespace(dev,
|
||||
MLX5_FLOW_NAMESPACE_PORT_SEL);
|
||||
ttc_params->ns_type = MLX5_FLOW_NAMESPACE_PORT_SEL;
|
||||
ft_attr = &ttc_params->ft_attr;
|
||||
ft_attr->level = MLX5_LAG_FT_LEVEL_TTC;
|
||||
|
||||
|
||||
@@ -9,21 +9,24 @@
|
||||
#include "mlx5_core.h"
|
||||
#include "lib/fs_ttc.h"
|
||||
|
||||
#define MLX5_TTC_NUM_GROUPS 3
|
||||
#define MLX5_TTC_GROUP1_SIZE (BIT(3) + MLX5_NUM_TUNNEL_TT)
|
||||
#define MLX5_TTC_GROUP2_SIZE BIT(1)
|
||||
#define MLX5_TTC_GROUP3_SIZE BIT(0)
|
||||
#define MLX5_TTC_TABLE_SIZE (MLX5_TTC_GROUP1_SIZE +\
|
||||
MLX5_TTC_GROUP2_SIZE +\
|
||||
MLX5_TTC_GROUP3_SIZE)
|
||||
#define MLX5_TTC_MAX_NUM_GROUPS 4
|
||||
#define MLX5_TTC_GROUP_TCPUDP_SIZE (MLX5_TT_IPV6_UDP + 1)
|
||||
|
||||
#define MLX5_INNER_TTC_NUM_GROUPS 3
|
||||
#define MLX5_INNER_TTC_GROUP1_SIZE BIT(3)
|
||||
#define MLX5_INNER_TTC_GROUP2_SIZE BIT(1)
|
||||
#define MLX5_INNER_TTC_GROUP3_SIZE BIT(0)
|
||||
#define MLX5_INNER_TTC_TABLE_SIZE (MLX5_INNER_TTC_GROUP1_SIZE +\
|
||||
MLX5_INNER_TTC_GROUP2_SIZE +\
|
||||
MLX5_INNER_TTC_GROUP3_SIZE)
|
||||
struct mlx5_fs_ttc_groups {
|
||||
bool use_l4_type;
|
||||
int num_groups;
|
||||
int group_size[MLX5_TTC_MAX_NUM_GROUPS];
|
||||
};
|
||||
|
||||
static int mlx5_fs_ttc_table_size(const struct mlx5_fs_ttc_groups *groups)
|
||||
{
|
||||
int i, sz = 0;
|
||||
|
||||
for (i = 0; i < groups->num_groups; i++)
|
||||
sz += groups->group_size[i];
|
||||
|
||||
return sz;
|
||||
}
|
||||
|
||||
/* L3/L4 traffic type classifier */
|
||||
struct mlx5_ttc_table {
|
||||
@@ -138,6 +141,53 @@ static struct mlx5_etype_proto ttc_tunnel_rules[] = {
|
||||
|
||||
};
|
||||
|
||||
enum TTC_GROUP_TYPE {
|
||||
TTC_GROUPS_DEFAULT = 0,
|
||||
TTC_GROUPS_USE_L4_TYPE = 1,
|
||||
};
|
||||
|
||||
static const struct mlx5_fs_ttc_groups ttc_groups[] = {
|
||||
[TTC_GROUPS_DEFAULT] = {
|
||||
.num_groups = 3,
|
||||
.group_size = {
|
||||
BIT(3) + MLX5_NUM_TUNNEL_TT,
|
||||
BIT(1),
|
||||
BIT(0),
|
||||
},
|
||||
},
|
||||
[TTC_GROUPS_USE_L4_TYPE] = {
|
||||
.use_l4_type = true,
|
||||
.num_groups = 4,
|
||||
.group_size = {
|
||||
MLX5_TTC_GROUP_TCPUDP_SIZE,
|
||||
BIT(3) + MLX5_NUM_TUNNEL_TT - MLX5_TTC_GROUP_TCPUDP_SIZE,
|
||||
BIT(1),
|
||||
BIT(0),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
static const struct mlx5_fs_ttc_groups inner_ttc_groups[] = {
|
||||
[TTC_GROUPS_DEFAULT] = {
|
||||
.num_groups = 3,
|
||||
.group_size = {
|
||||
BIT(3),
|
||||
BIT(1),
|
||||
BIT(0),
|
||||
},
|
||||
},
|
||||
[TTC_GROUPS_USE_L4_TYPE] = {
|
||||
.use_l4_type = true,
|
||||
.num_groups = 4,
|
||||
.group_size = {
|
||||
MLX5_TTC_GROUP_TCPUDP_SIZE,
|
||||
BIT(3) - MLX5_TTC_GROUP_TCPUDP_SIZE,
|
||||
BIT(1),
|
||||
BIT(0),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
u8 mlx5_get_proto_by_tunnel_type(enum mlx5_tunnel_types tt)
|
||||
{
|
||||
return ttc_tunnel_rules[tt].proto;
|
||||
@@ -188,9 +238,29 @@ static u8 mlx5_etype_to_ipv(u16 ethertype)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mlx5_fs_ttc_set_match_proto(void *headers_c, void *headers_v,
|
||||
u8 proto, bool use_l4_type)
|
||||
{
|
||||
int l4_type;
|
||||
|
||||
if (use_l4_type && (proto == IPPROTO_TCP || proto == IPPROTO_UDP)) {
|
||||
if (proto == IPPROTO_TCP)
|
||||
l4_type = MLX5_PACKET_L4_TYPE_TCP;
|
||||
else
|
||||
l4_type = MLX5_PACKET_L4_TYPE_UDP;
|
||||
|
||||
MLX5_SET_TO_ONES(fte_match_set_lyr_2_4, headers_c, l4_type);
|
||||
MLX5_SET(fte_match_set_lyr_2_4, headers_v, l4_type, l4_type);
|
||||
} else {
|
||||
MLX5_SET_TO_ONES(fte_match_set_lyr_2_4, headers_c, ip_protocol);
|
||||
MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_protocol, proto);
|
||||
}
|
||||
}
|
||||
|
||||
static struct mlx5_flow_handle *
|
||||
mlx5_generate_ttc_rule(struct mlx5_core_dev *dev, struct mlx5_flow_table *ft,
|
||||
struct mlx5_flow_destination *dest, u16 etype, u8 proto)
|
||||
struct mlx5_flow_destination *dest, u16 etype, u8 proto,
|
||||
bool use_l4_type)
|
||||
{
|
||||
int match_ipv_outer =
|
||||
MLX5_CAP_FLOWTABLE_NIC_RX(dev,
|
||||
@@ -207,8 +277,13 @@ mlx5_generate_ttc_rule(struct mlx5_core_dev *dev, struct mlx5_flow_table *ft,
|
||||
|
||||
if (proto) {
|
||||
spec->match_criteria_enable = MLX5_MATCH_OUTER_HEADERS;
|
||||
MLX5_SET_TO_ONES(fte_match_param, spec->match_criteria, outer_headers.ip_protocol);
|
||||
MLX5_SET(fte_match_param, spec->match_value, outer_headers.ip_protocol, proto);
|
||||
mlx5_fs_ttc_set_match_proto(MLX5_ADDR_OF(fte_match_param,
|
||||
spec->match_criteria,
|
||||
outer_headers),
|
||||
MLX5_ADDR_OF(fte_match_param,
|
||||
spec->match_value,
|
||||
outer_headers),
|
||||
proto, use_l4_type);
|
||||
}
|
||||
|
||||
ipv = mlx5_etype_to_ipv(etype);
|
||||
@@ -234,7 +309,8 @@ mlx5_generate_ttc_rule(struct mlx5_core_dev *dev, struct mlx5_flow_table *ft,
|
||||
|
||||
static int mlx5_generate_ttc_table_rules(struct mlx5_core_dev *dev,
|
||||
struct ttc_params *params,
|
||||
struct mlx5_ttc_table *ttc)
|
||||
struct mlx5_ttc_table *ttc,
|
||||
bool use_l4_type)
|
||||
{
|
||||
struct mlx5_flow_handle **trules;
|
||||
struct mlx5_ttc_rule *rules;
|
||||
@@ -251,7 +327,8 @@ static int mlx5_generate_ttc_table_rules(struct mlx5_core_dev *dev,
|
||||
continue;
|
||||
rule->rule = mlx5_generate_ttc_rule(dev, ft, ¶ms->dests[tt],
|
||||
ttc_rules[tt].etype,
|
||||
ttc_rules[tt].proto);
|
||||
ttc_rules[tt].proto,
|
||||
use_l4_type);
|
||||
if (IS_ERR(rule->rule)) {
|
||||
err = PTR_ERR(rule->rule);
|
||||
rule->rule = NULL;
|
||||
@@ -273,7 +350,8 @@ static int mlx5_generate_ttc_table_rules(struct mlx5_core_dev *dev,
|
||||
trules[tt] = mlx5_generate_ttc_rule(dev, ft,
|
||||
¶ms->tunnel_dests[tt],
|
||||
ttc_tunnel_rules[tt].etype,
|
||||
ttc_tunnel_rules[tt].proto);
|
||||
ttc_tunnel_rules[tt].proto,
|
||||
use_l4_type);
|
||||
if (IS_ERR(trules[tt])) {
|
||||
err = PTR_ERR(trules[tt]);
|
||||
trules[tt] = NULL;
|
||||
@@ -289,7 +367,8 @@ del_rules:
|
||||
}
|
||||
|
||||
static int mlx5_create_ttc_table_groups(struct mlx5_ttc_table *ttc,
|
||||
bool use_ipv)
|
||||
bool use_ipv,
|
||||
const struct mlx5_fs_ttc_groups *groups)
|
||||
{
|
||||
int inlen = MLX5_ST_SZ_BYTES(create_flow_group_in);
|
||||
int ix = 0;
|
||||
@@ -297,7 +376,7 @@ static int mlx5_create_ttc_table_groups(struct mlx5_ttc_table *ttc,
|
||||
int err;
|
||||
u8 *mc;
|
||||
|
||||
ttc->g = kcalloc(MLX5_TTC_NUM_GROUPS, sizeof(*ttc->g), GFP_KERNEL);
|
||||
ttc->g = kcalloc(groups->num_groups, sizeof(*ttc->g), GFP_KERNEL);
|
||||
if (!ttc->g)
|
||||
return -ENOMEM;
|
||||
in = kvzalloc(inlen, GFP_KERNEL);
|
||||
@@ -307,16 +386,31 @@ static int mlx5_create_ttc_table_groups(struct mlx5_ttc_table *ttc,
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* L4 Group */
|
||||
mc = MLX5_ADDR_OF(create_flow_group_in, in, match_criteria);
|
||||
MLX5_SET_TO_ONES(fte_match_param, mc, outer_headers.ip_protocol);
|
||||
if (use_ipv)
|
||||
MLX5_SET_TO_ONES(fte_match_param, mc, outer_headers.ip_version);
|
||||
else
|
||||
MLX5_SET_TO_ONES(fte_match_param, mc, outer_headers.ethertype);
|
||||
MLX5_SET_CFG(in, match_criteria_enable, MLX5_MATCH_OUTER_HEADERS);
|
||||
|
||||
/* TCP UDP group */
|
||||
if (groups->use_l4_type) {
|
||||
MLX5_SET_TO_ONES(fte_match_param, mc, outer_headers.l4_type);
|
||||
MLX5_SET_CFG(in, start_flow_index, ix);
|
||||
ix += groups->group_size[ttc->num_groups];
|
||||
MLX5_SET_CFG(in, end_flow_index, ix - 1);
|
||||
ttc->g[ttc->num_groups] = mlx5_create_flow_group(ttc->t, in);
|
||||
if (IS_ERR(ttc->g[ttc->num_groups]))
|
||||
goto err;
|
||||
ttc->num_groups++;
|
||||
|
||||
MLX5_SET(fte_match_param, mc, outer_headers.l4_type, 0);
|
||||
}
|
||||
|
||||
/* L4 Group */
|
||||
MLX5_SET_TO_ONES(fte_match_param, mc, outer_headers.ip_protocol);
|
||||
MLX5_SET_CFG(in, start_flow_index, ix);
|
||||
ix += MLX5_TTC_GROUP1_SIZE;
|
||||
ix += groups->group_size[ttc->num_groups];
|
||||
MLX5_SET_CFG(in, end_flow_index, ix - 1);
|
||||
ttc->g[ttc->num_groups] = mlx5_create_flow_group(ttc->t, in);
|
||||
if (IS_ERR(ttc->g[ttc->num_groups]))
|
||||
@@ -326,7 +420,7 @@ static int mlx5_create_ttc_table_groups(struct mlx5_ttc_table *ttc,
|
||||
/* L3 Group */
|
||||
MLX5_SET(fte_match_param, mc, outer_headers.ip_protocol, 0);
|
||||
MLX5_SET_CFG(in, start_flow_index, ix);
|
||||
ix += MLX5_TTC_GROUP2_SIZE;
|
||||
ix += groups->group_size[ttc->num_groups];
|
||||
MLX5_SET_CFG(in, end_flow_index, ix - 1);
|
||||
ttc->g[ttc->num_groups] = mlx5_create_flow_group(ttc->t, in);
|
||||
if (IS_ERR(ttc->g[ttc->num_groups]))
|
||||
@@ -336,7 +430,7 @@ static int mlx5_create_ttc_table_groups(struct mlx5_ttc_table *ttc,
|
||||
/* Any Group */
|
||||
memset(in, 0, inlen);
|
||||
MLX5_SET_CFG(in, start_flow_index, ix);
|
||||
ix += MLX5_TTC_GROUP3_SIZE;
|
||||
ix += groups->group_size[ttc->num_groups];
|
||||
MLX5_SET_CFG(in, end_flow_index, ix - 1);
|
||||
ttc->g[ttc->num_groups] = mlx5_create_flow_group(ttc->t, in);
|
||||
if (IS_ERR(ttc->g[ttc->num_groups]))
|
||||
@@ -358,7 +452,7 @@ static struct mlx5_flow_handle *
|
||||
mlx5_generate_inner_ttc_rule(struct mlx5_core_dev *dev,
|
||||
struct mlx5_flow_table *ft,
|
||||
struct mlx5_flow_destination *dest,
|
||||
u16 etype, u8 proto)
|
||||
u16 etype, u8 proto, bool use_l4_type)
|
||||
{
|
||||
MLX5_DECLARE_FLOW_ACT(flow_act);
|
||||
struct mlx5_flow_handle *rule;
|
||||
@@ -379,8 +473,13 @@ mlx5_generate_inner_ttc_rule(struct mlx5_core_dev *dev,
|
||||
|
||||
if (proto) {
|
||||
spec->match_criteria_enable = MLX5_MATCH_INNER_HEADERS;
|
||||
MLX5_SET_TO_ONES(fte_match_param, spec->match_criteria, inner_headers.ip_protocol);
|
||||
MLX5_SET(fte_match_param, spec->match_value, inner_headers.ip_protocol, proto);
|
||||
mlx5_fs_ttc_set_match_proto(MLX5_ADDR_OF(fte_match_param,
|
||||
spec->match_criteria,
|
||||
inner_headers),
|
||||
MLX5_ADDR_OF(fte_match_param,
|
||||
spec->match_value,
|
||||
inner_headers),
|
||||
proto, use_l4_type);
|
||||
}
|
||||
|
||||
rule = mlx5_add_flow_rules(ft, spec, &flow_act, dest, 1);
|
||||
@@ -395,7 +494,8 @@ mlx5_generate_inner_ttc_rule(struct mlx5_core_dev *dev,
|
||||
|
||||
static int mlx5_generate_inner_ttc_table_rules(struct mlx5_core_dev *dev,
|
||||
struct ttc_params *params,
|
||||
struct mlx5_ttc_table *ttc)
|
||||
struct mlx5_ttc_table *ttc,
|
||||
bool use_l4_type)
|
||||
{
|
||||
struct mlx5_ttc_rule *rules;
|
||||
struct mlx5_flow_table *ft;
|
||||
@@ -413,7 +513,8 @@ static int mlx5_generate_inner_ttc_table_rules(struct mlx5_core_dev *dev,
|
||||
rule->rule = mlx5_generate_inner_ttc_rule(dev, ft,
|
||||
¶ms->dests[tt],
|
||||
ttc_rules[tt].etype,
|
||||
ttc_rules[tt].proto);
|
||||
ttc_rules[tt].proto,
|
||||
use_l4_type);
|
||||
if (IS_ERR(rule->rule)) {
|
||||
err = PTR_ERR(rule->rule);
|
||||
rule->rule = NULL;
|
||||
@@ -430,7 +531,8 @@ del_rules:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int mlx5_create_inner_ttc_table_groups(struct mlx5_ttc_table *ttc)
|
||||
static int mlx5_create_inner_ttc_table_groups(struct mlx5_ttc_table *ttc,
|
||||
const struct mlx5_fs_ttc_groups *groups)
|
||||
{
|
||||
int inlen = MLX5_ST_SZ_BYTES(create_flow_group_in);
|
||||
int ix = 0;
|
||||
@@ -438,8 +540,7 @@ static int mlx5_create_inner_ttc_table_groups(struct mlx5_ttc_table *ttc)
|
||||
int err;
|
||||
u8 *mc;
|
||||
|
||||
ttc->g = kcalloc(MLX5_INNER_TTC_NUM_GROUPS, sizeof(*ttc->g),
|
||||
GFP_KERNEL);
|
||||
ttc->g = kcalloc(groups->num_groups, sizeof(*ttc->g), GFP_KERNEL);
|
||||
if (!ttc->g)
|
||||
return -ENOMEM;
|
||||
in = kvzalloc(inlen, GFP_KERNEL);
|
||||
@@ -449,13 +550,28 @@ static int mlx5_create_inner_ttc_table_groups(struct mlx5_ttc_table *ttc)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* L4 Group */
|
||||
mc = MLX5_ADDR_OF(create_flow_group_in, in, match_criteria);
|
||||
MLX5_SET_TO_ONES(fte_match_param, mc, inner_headers.ip_protocol);
|
||||
MLX5_SET_TO_ONES(fte_match_param, mc, inner_headers.ip_version);
|
||||
MLX5_SET_CFG(in, match_criteria_enable, MLX5_MATCH_INNER_HEADERS);
|
||||
|
||||
/* TCP UDP group */
|
||||
if (groups->use_l4_type) {
|
||||
MLX5_SET_TO_ONES(fte_match_param, mc, inner_headers.l4_type);
|
||||
MLX5_SET_CFG(in, start_flow_index, ix);
|
||||
ix += groups->group_size[ttc->num_groups];
|
||||
MLX5_SET_CFG(in, end_flow_index, ix - 1);
|
||||
ttc->g[ttc->num_groups] = mlx5_create_flow_group(ttc->t, in);
|
||||
if (IS_ERR(ttc->g[ttc->num_groups]))
|
||||
goto err;
|
||||
ttc->num_groups++;
|
||||
|
||||
MLX5_SET(fte_match_param, mc, inner_headers.l4_type, 0);
|
||||
}
|
||||
|
||||
/* L4 Group */
|
||||
MLX5_SET_TO_ONES(fte_match_param, mc, inner_headers.ip_protocol);
|
||||
MLX5_SET_CFG(in, start_flow_index, ix);
|
||||
ix += MLX5_INNER_TTC_GROUP1_SIZE;
|
||||
ix += groups->group_size[ttc->num_groups];
|
||||
MLX5_SET_CFG(in, end_flow_index, ix - 1);
|
||||
ttc->g[ttc->num_groups] = mlx5_create_flow_group(ttc->t, in);
|
||||
if (IS_ERR(ttc->g[ttc->num_groups]))
|
||||
@@ -465,7 +581,7 @@ static int mlx5_create_inner_ttc_table_groups(struct mlx5_ttc_table *ttc)
|
||||
/* L3 Group */
|
||||
MLX5_SET(fte_match_param, mc, inner_headers.ip_protocol, 0);
|
||||
MLX5_SET_CFG(in, start_flow_index, ix);
|
||||
ix += MLX5_INNER_TTC_GROUP2_SIZE;
|
||||
ix += groups->group_size[ttc->num_groups];
|
||||
MLX5_SET_CFG(in, end_flow_index, ix - 1);
|
||||
ttc->g[ttc->num_groups] = mlx5_create_flow_group(ttc->t, in);
|
||||
if (IS_ERR(ttc->g[ttc->num_groups]))
|
||||
@@ -475,7 +591,7 @@ static int mlx5_create_inner_ttc_table_groups(struct mlx5_ttc_table *ttc)
|
||||
/* Any Group */
|
||||
memset(in, 0, inlen);
|
||||
MLX5_SET_CFG(in, start_flow_index, ix);
|
||||
ix += MLX5_INNER_TTC_GROUP3_SIZE;
|
||||
ix += groups->group_size[ttc->num_groups];
|
||||
MLX5_SET_CFG(in, end_flow_index, ix - 1);
|
||||
ttc->g[ttc->num_groups] = mlx5_create_flow_group(ttc->t, in);
|
||||
if (IS_ERR(ttc->g[ttc->num_groups]))
|
||||
@@ -496,27 +612,47 @@ err:
|
||||
struct mlx5_ttc_table *mlx5_create_inner_ttc_table(struct mlx5_core_dev *dev,
|
||||
struct ttc_params *params)
|
||||
{
|
||||
const struct mlx5_fs_ttc_groups *groups;
|
||||
struct mlx5_flow_namespace *ns;
|
||||
struct mlx5_ttc_table *ttc;
|
||||
bool use_l4_type;
|
||||
int err;
|
||||
|
||||
ttc = kvzalloc(sizeof(*ttc), GFP_KERNEL);
|
||||
if (!ttc)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
switch (params->ns_type) {
|
||||
case MLX5_FLOW_NAMESPACE_PORT_SEL:
|
||||
use_l4_type = MLX5_CAP_GEN_2(dev, pcc_ifa2) &&
|
||||
MLX5_CAP_PORT_SELECTION_FT_FIELD_SUPPORT_2(dev, inner_l4_type);
|
||||
break;
|
||||
case MLX5_FLOW_NAMESPACE_KERNEL:
|
||||
use_l4_type = MLX5_CAP_GEN_2(dev, pcc_ifa2) &&
|
||||
MLX5_CAP_NIC_RX_FT_FIELD_SUPPORT_2(dev, inner_l4_type);
|
||||
break;
|
||||
default:
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
ns = mlx5_get_flow_namespace(dev, params->ns_type);
|
||||
groups = use_l4_type ? &inner_ttc_groups[TTC_GROUPS_USE_L4_TYPE] :
|
||||
&inner_ttc_groups[TTC_GROUPS_DEFAULT];
|
||||
|
||||
WARN_ON_ONCE(params->ft_attr.max_fte);
|
||||
params->ft_attr.max_fte = MLX5_INNER_TTC_TABLE_SIZE;
|
||||
ttc->t = mlx5_create_flow_table(params->ns, ¶ms->ft_attr);
|
||||
params->ft_attr.max_fte = mlx5_fs_ttc_table_size(groups);
|
||||
ttc->t = mlx5_create_flow_table(ns, ¶ms->ft_attr);
|
||||
if (IS_ERR(ttc->t)) {
|
||||
err = PTR_ERR(ttc->t);
|
||||
kvfree(ttc);
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
|
||||
err = mlx5_create_inner_ttc_table_groups(ttc);
|
||||
err = mlx5_create_inner_ttc_table_groups(ttc, groups);
|
||||
if (err)
|
||||
goto destroy_ft;
|
||||
|
||||
err = mlx5_generate_inner_ttc_table_rules(dev, params, ttc);
|
||||
err = mlx5_generate_inner_ttc_table_rules(dev, params, ttc, use_l4_type);
|
||||
if (err)
|
||||
goto destroy_ft;
|
||||
|
||||
@@ -549,27 +685,47 @@ struct mlx5_ttc_table *mlx5_create_ttc_table(struct mlx5_core_dev *dev,
|
||||
bool match_ipv_outer =
|
||||
MLX5_CAP_FLOWTABLE_NIC_RX(dev,
|
||||
ft_field_support.outer_ip_version);
|
||||
const struct mlx5_fs_ttc_groups *groups;
|
||||
struct mlx5_flow_namespace *ns;
|
||||
struct mlx5_ttc_table *ttc;
|
||||
bool use_l4_type;
|
||||
int err;
|
||||
|
||||
ttc = kvzalloc(sizeof(*ttc), GFP_KERNEL);
|
||||
if (!ttc)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
switch (params->ns_type) {
|
||||
case MLX5_FLOW_NAMESPACE_PORT_SEL:
|
||||
use_l4_type = MLX5_CAP_GEN_2(dev, pcc_ifa2) &&
|
||||
MLX5_CAP_PORT_SELECTION_FT_FIELD_SUPPORT_2(dev, outer_l4_type);
|
||||
break;
|
||||
case MLX5_FLOW_NAMESPACE_KERNEL:
|
||||
use_l4_type = MLX5_CAP_GEN_2(dev, pcc_ifa2) &&
|
||||
MLX5_CAP_NIC_RX_FT_FIELD_SUPPORT_2(dev, outer_l4_type);
|
||||
break;
|
||||
default:
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
ns = mlx5_get_flow_namespace(dev, params->ns_type);
|
||||
groups = use_l4_type ? &ttc_groups[TTC_GROUPS_USE_L4_TYPE] :
|
||||
&ttc_groups[TTC_GROUPS_DEFAULT];
|
||||
|
||||
WARN_ON_ONCE(params->ft_attr.max_fte);
|
||||
params->ft_attr.max_fte = MLX5_TTC_TABLE_SIZE;
|
||||
ttc->t = mlx5_create_flow_table(params->ns, ¶ms->ft_attr);
|
||||
params->ft_attr.max_fte = mlx5_fs_ttc_table_size(groups);
|
||||
ttc->t = mlx5_create_flow_table(ns, ¶ms->ft_attr);
|
||||
if (IS_ERR(ttc->t)) {
|
||||
err = PTR_ERR(ttc->t);
|
||||
kvfree(ttc);
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
|
||||
err = mlx5_create_ttc_table_groups(ttc, match_ipv_outer);
|
||||
err = mlx5_create_ttc_table_groups(ttc, match_ipv_outer, groups);
|
||||
if (err)
|
||||
goto destroy_ft;
|
||||
|
||||
err = mlx5_generate_ttc_table_rules(dev, params, ttc);
|
||||
err = mlx5_generate_ttc_table_rules(dev, params, ttc, use_l4_type);
|
||||
if (err)
|
||||
goto destroy_ft;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ struct mlx5_ttc_rule {
|
||||
struct mlx5_ttc_table;
|
||||
|
||||
struct ttc_params {
|
||||
struct mlx5_flow_namespace *ns;
|
||||
enum mlx5_flow_namespace_type ns_type;
|
||||
struct mlx5_flow_table_attr ft_attr;
|
||||
struct mlx5_flow_destination dests[MLX5_NUM_TT];
|
||||
DECLARE_BITMAP(ignore_dests, MLX5_NUM_TT);
|
||||
|
||||
@@ -205,7 +205,7 @@ int mlx5_cmd_enable(struct mlx5_core_dev *dev);
|
||||
void mlx5_cmd_disable(struct mlx5_core_dev *dev);
|
||||
void mlx5_cmd_set_state(struct mlx5_core_dev *dev,
|
||||
enum mlx5_cmdif_state cmdif_state);
|
||||
int mlx5_cmd_init_hca(struct mlx5_core_dev *dev, uint32_t *sw_owner_id);
|
||||
int mlx5_cmd_init_hca(struct mlx5_core_dev *dev, u32 *sw_owner_id);
|
||||
int mlx5_cmd_teardown_hca(struct mlx5_core_dev *dev);
|
||||
int mlx5_cmd_force_teardown_hca(struct mlx5_core_dev *dev);
|
||||
int mlx5_cmd_fast_teardown_hca(struct mlx5_core_dev *dev);
|
||||
|
||||
@@ -660,6 +660,9 @@ int mlx5_satisfy_startup_pages(struct mlx5_core_dev *dev, int boot)
|
||||
mlx5_core_dbg(dev, "requested %d %s pages for func_id 0x%x\n",
|
||||
npages, boot ? "boot" : "init", func_id);
|
||||
|
||||
if (!npages)
|
||||
return 0;
|
||||
|
||||
return give_pages(dev, func_id, npages, 0, mlx5_core_is_ecpf(dev));
|
||||
}
|
||||
|
||||
|
||||
@@ -1883,7 +1883,7 @@ dr_ste_v0_build_tnl_gtpu_flex_parser_1_init(struct mlx5dr_ste_build *sb,
|
||||
|
||||
static int dr_ste_v0_build_tnl_header_0_1_tag(struct mlx5dr_match_param *value,
|
||||
struct mlx5dr_ste_build *sb,
|
||||
uint8_t *tag)
|
||||
u8 *tag)
|
||||
{
|
||||
struct mlx5dr_match_misc5 *misc5 = &value->misc5;
|
||||
|
||||
|
||||
@@ -1897,7 +1897,7 @@ void dr_ste_v1_build_flex_parser_tnl_geneve_init(struct mlx5dr_ste_build *sb,
|
||||
|
||||
static int dr_ste_v1_build_tnl_header_0_1_tag(struct mlx5dr_match_param *value,
|
||||
struct mlx5dr_ste_build *sb,
|
||||
uint8_t *tag)
|
||||
u8 *tag)
|
||||
{
|
||||
struct mlx5dr_match_misc5 *misc5 = &value->misc5;
|
||||
|
||||
@@ -2129,7 +2129,7 @@ dr_ste_v1_build_flex_parser_tnl_geneve_tlv_opt_init(struct mlx5dr_ste_build *sb,
|
||||
static int
|
||||
dr_ste_v1_build_flex_parser_tnl_geneve_tlv_opt_exist_tag(struct mlx5dr_match_param *value,
|
||||
struct mlx5dr_ste_build *sb,
|
||||
uint8_t *tag)
|
||||
u8 *tag)
|
||||
{
|
||||
u8 parser_id = sb->caps->flex_parser_id_geneve_tlv_option_0;
|
||||
struct mlx5dr_match_misc *misc = &value->misc;
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <linux/device.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/wait.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/if_vlan.h>
|
||||
@@ -36,6 +35,11 @@ enum mlxsw_pci_queue_type {
|
||||
|
||||
#define MLXSW_PCI_QUEUE_TYPE_COUNT 4
|
||||
|
||||
enum mlxsw_pci_cq_type {
|
||||
MLXSW_PCI_CQ_SDQ,
|
||||
MLXSW_PCI_CQ_RDQ,
|
||||
};
|
||||
|
||||
static const u16 mlxsw_pci_doorbell_type_offset[] = {
|
||||
MLXSW_PCI_DOORBELL_SDQ_OFFSET, /* for type MLXSW_PCI_QUEUE_TYPE_SDQ */
|
||||
MLXSW_PCI_DOORBELL_RDQ_OFFSET, /* for type MLXSW_PCI_QUEUE_TYPE_RDQ */
|
||||
@@ -80,18 +84,10 @@ struct mlxsw_pci_queue {
|
||||
enum mlxsw_pci_queue_type type;
|
||||
struct tasklet_struct tasklet; /* queue processing tasklet */
|
||||
struct mlxsw_pci *pci;
|
||||
union {
|
||||
struct {
|
||||
u32 comp_sdq_count;
|
||||
u32 comp_rdq_count;
|
||||
enum mlxsw_pci_cqe_v v;
|
||||
} cq;
|
||||
struct {
|
||||
u32 ev_cmd_count;
|
||||
u32 ev_comp_count;
|
||||
u32 ev_other_count;
|
||||
} eq;
|
||||
} u;
|
||||
struct {
|
||||
enum mlxsw_pci_cqe_v v;
|
||||
struct mlxsw_pci_queue *dq;
|
||||
} cq;
|
||||
};
|
||||
|
||||
struct mlxsw_pci_queue_type_group {
|
||||
@@ -120,9 +116,6 @@ struct mlxsw_pci {
|
||||
struct mlxsw_pci_mem_item out_mbox;
|
||||
struct mlxsw_pci_mem_item in_mbox;
|
||||
struct mutex lock; /* Lock access to command registers */
|
||||
bool nopoll;
|
||||
wait_queue_head_t wait;
|
||||
bool wait_done;
|
||||
struct {
|
||||
u8 status;
|
||||
u64 out_param;
|
||||
@@ -131,7 +124,8 @@ struct mlxsw_pci {
|
||||
struct mlxsw_bus_info bus_info;
|
||||
const struct pci_device_id *id;
|
||||
enum mlxsw_pci_cqe_v max_cqe_ver; /* Maximal supported CQE version */
|
||||
u8 num_sdq_cqs; /* Number of CQs used for SDQs */
|
||||
u8 num_cqs; /* Number of CQs */
|
||||
u8 num_sdqs; /* Number of SDQs */
|
||||
bool skip_reset;
|
||||
};
|
||||
|
||||
@@ -187,25 +181,6 @@ mlxsw_pci_queue_type_group_get(struct mlxsw_pci *mlxsw_pci,
|
||||
return &mlxsw_pci->queues[q_type];
|
||||
}
|
||||
|
||||
static u8 __mlxsw_pci_queue_count(struct mlxsw_pci *mlxsw_pci,
|
||||
enum mlxsw_pci_queue_type q_type)
|
||||
{
|
||||
struct mlxsw_pci_queue_type_group *queue_group;
|
||||
|
||||
queue_group = mlxsw_pci_queue_type_group_get(mlxsw_pci, q_type);
|
||||
return queue_group->count;
|
||||
}
|
||||
|
||||
static u8 mlxsw_pci_sdq_count(struct mlxsw_pci *mlxsw_pci)
|
||||
{
|
||||
return __mlxsw_pci_queue_count(mlxsw_pci, MLXSW_PCI_QUEUE_TYPE_SDQ);
|
||||
}
|
||||
|
||||
static u8 mlxsw_pci_cq_count(struct mlxsw_pci *mlxsw_pci)
|
||||
{
|
||||
return __mlxsw_pci_queue_count(mlxsw_pci, MLXSW_PCI_QUEUE_TYPE_CQ);
|
||||
}
|
||||
|
||||
static struct mlxsw_pci_queue *
|
||||
__mlxsw_pci_queue_get(struct mlxsw_pci *mlxsw_pci,
|
||||
enum mlxsw_pci_queue_type q_type, u8 q_num)
|
||||
@@ -220,23 +195,16 @@ static struct mlxsw_pci_queue *mlxsw_pci_sdq_get(struct mlxsw_pci *mlxsw_pci,
|
||||
MLXSW_PCI_QUEUE_TYPE_SDQ, q_num);
|
||||
}
|
||||
|
||||
static struct mlxsw_pci_queue *mlxsw_pci_rdq_get(struct mlxsw_pci *mlxsw_pci,
|
||||
u8 q_num)
|
||||
{
|
||||
return __mlxsw_pci_queue_get(mlxsw_pci,
|
||||
MLXSW_PCI_QUEUE_TYPE_RDQ, q_num);
|
||||
}
|
||||
|
||||
static struct mlxsw_pci_queue *mlxsw_pci_cq_get(struct mlxsw_pci *mlxsw_pci,
|
||||
u8 q_num)
|
||||
{
|
||||
return __mlxsw_pci_queue_get(mlxsw_pci, MLXSW_PCI_QUEUE_TYPE_CQ, q_num);
|
||||
}
|
||||
|
||||
static struct mlxsw_pci_queue *mlxsw_pci_eq_get(struct mlxsw_pci *mlxsw_pci,
|
||||
u8 q_num)
|
||||
static struct mlxsw_pci_queue *mlxsw_pci_eq_get(struct mlxsw_pci *mlxsw_pci)
|
||||
{
|
||||
return __mlxsw_pci_queue_get(mlxsw_pci, MLXSW_PCI_QUEUE_TYPE_EQ, q_num);
|
||||
/* There is only one EQ at index 0. */
|
||||
return __mlxsw_pci_queue_get(mlxsw_pci, MLXSW_PCI_QUEUE_TYPE_EQ, 0);
|
||||
}
|
||||
|
||||
static void __mlxsw_pci_queue_doorbell_set(struct mlxsw_pci *mlxsw_pci,
|
||||
@@ -291,7 +259,9 @@ static dma_addr_t __mlxsw_pci_queue_page_get(struct mlxsw_pci_queue *q,
|
||||
static int mlxsw_pci_sdq_init(struct mlxsw_pci *mlxsw_pci, char *mbox,
|
||||
struct mlxsw_pci_queue *q)
|
||||
{
|
||||
struct mlxsw_pci_queue *cq;
|
||||
int tclass;
|
||||
u8 cq_num;
|
||||
int lp;
|
||||
int i;
|
||||
int err;
|
||||
@@ -304,7 +274,8 @@ static int mlxsw_pci_sdq_init(struct mlxsw_pci *mlxsw_pci, char *mbox,
|
||||
MLXSW_CMD_MBOX_SW2HW_DQ_SDQ_LP_WQE;
|
||||
|
||||
/* Set CQ of same number of this SDQ. */
|
||||
mlxsw_cmd_mbox_sw2hw_dq_cq_set(mbox, q->num);
|
||||
cq_num = q->num;
|
||||
mlxsw_cmd_mbox_sw2hw_dq_cq_set(mbox, cq_num);
|
||||
mlxsw_cmd_mbox_sw2hw_dq_sdq_lp_set(mbox, lp);
|
||||
mlxsw_cmd_mbox_sw2hw_dq_sdq_tclass_set(mbox, tclass);
|
||||
mlxsw_cmd_mbox_sw2hw_dq_log2_dq_sz_set(mbox, 3); /* 8 pages */
|
||||
@@ -317,6 +288,9 @@ static int mlxsw_pci_sdq_init(struct mlxsw_pci *mlxsw_pci, char *mbox,
|
||||
err = mlxsw_cmd_sw2hw_sdq(mlxsw_pci->core, mbox, q->num);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
cq = mlxsw_pci_cq_get(mlxsw_pci, cq_num);
|
||||
cq->cq.dq = q;
|
||||
mlxsw_pci_queue_doorbell_producer_ring(mlxsw_pci, q);
|
||||
return 0;
|
||||
}
|
||||
@@ -399,7 +373,9 @@ static int mlxsw_pci_rdq_init(struct mlxsw_pci *mlxsw_pci, char *mbox,
|
||||
struct mlxsw_pci_queue *q)
|
||||
{
|
||||
struct mlxsw_pci_queue_elem_info *elem_info;
|
||||
u8 sdq_count = mlxsw_pci_sdq_count(mlxsw_pci);
|
||||
u8 sdq_count = mlxsw_pci->num_sdqs;
|
||||
struct mlxsw_pci_queue *cq;
|
||||
u8 cq_num;
|
||||
int i;
|
||||
int err;
|
||||
|
||||
@@ -409,7 +385,8 @@ static int mlxsw_pci_rdq_init(struct mlxsw_pci *mlxsw_pci, char *mbox,
|
||||
/* Set CQ of same number of this RDQ with base
|
||||
* above SDQ count as the lower ones are assigned to SDQs.
|
||||
*/
|
||||
mlxsw_cmd_mbox_sw2hw_dq_cq_set(mbox, sdq_count + q->num);
|
||||
cq_num = sdq_count + q->num;
|
||||
mlxsw_cmd_mbox_sw2hw_dq_cq_set(mbox, cq_num);
|
||||
mlxsw_cmd_mbox_sw2hw_dq_log2_dq_sz_set(mbox, 3); /* 8 pages */
|
||||
for (i = 0; i < MLXSW_PCI_AQ_PAGES; i++) {
|
||||
dma_addr_t mapaddr = __mlxsw_pci_queue_page_get(q, i);
|
||||
@@ -421,6 +398,9 @@ static int mlxsw_pci_rdq_init(struct mlxsw_pci *mlxsw_pci, char *mbox,
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
cq = mlxsw_pci_cq_get(mlxsw_pci, cq_num);
|
||||
cq->cq.dq = q;
|
||||
|
||||
mlxsw_pci_queue_doorbell_producer_ring(mlxsw_pci, q);
|
||||
|
||||
for (i = 0; i < q->count; i++) {
|
||||
@@ -441,6 +421,7 @@ rollback:
|
||||
elem_info = mlxsw_pci_queue_elem_info_get(q, i);
|
||||
mlxsw_pci_rdq_skb_free(mlxsw_pci, elem_info);
|
||||
}
|
||||
cq->cq.dq = NULL;
|
||||
mlxsw_cmd_hw2sw_rdq(mlxsw_pci->core, q->num);
|
||||
|
||||
return err;
|
||||
@@ -462,55 +443,12 @@ static void mlxsw_pci_rdq_fini(struct mlxsw_pci *mlxsw_pci,
|
||||
static void mlxsw_pci_cq_pre_init(struct mlxsw_pci *mlxsw_pci,
|
||||
struct mlxsw_pci_queue *q)
|
||||
{
|
||||
q->u.cq.v = mlxsw_pci->max_cqe_ver;
|
||||
q->cq.v = mlxsw_pci->max_cqe_ver;
|
||||
|
||||
if (q->u.cq.v == MLXSW_PCI_CQE_V2 &&
|
||||
q->num < mlxsw_pci->num_sdq_cqs &&
|
||||
if (q->cq.v == MLXSW_PCI_CQE_V2 &&
|
||||
q->num < mlxsw_pci->num_sdqs &&
|
||||
!mlxsw_core_sdq_supports_cqe_v2(mlxsw_pci->core))
|
||||
q->u.cq.v = MLXSW_PCI_CQE_V1;
|
||||
}
|
||||
|
||||
static int mlxsw_pci_cq_init(struct mlxsw_pci *mlxsw_pci, char *mbox,
|
||||
struct mlxsw_pci_queue *q)
|
||||
{
|
||||
int i;
|
||||
int err;
|
||||
|
||||
q->consumer_counter = 0;
|
||||
|
||||
for (i = 0; i < q->count; i++) {
|
||||
char *elem = mlxsw_pci_queue_elem_get(q, i);
|
||||
|
||||
mlxsw_pci_cqe_owner_set(q->u.cq.v, elem, 1);
|
||||
}
|
||||
|
||||
if (q->u.cq.v == MLXSW_PCI_CQE_V1)
|
||||
mlxsw_cmd_mbox_sw2hw_cq_cqe_ver_set(mbox,
|
||||
MLXSW_CMD_MBOX_SW2HW_CQ_CQE_VER_1);
|
||||
else if (q->u.cq.v == MLXSW_PCI_CQE_V2)
|
||||
mlxsw_cmd_mbox_sw2hw_cq_cqe_ver_set(mbox,
|
||||
MLXSW_CMD_MBOX_SW2HW_CQ_CQE_VER_2);
|
||||
|
||||
mlxsw_cmd_mbox_sw2hw_cq_c_eqn_set(mbox, MLXSW_PCI_EQ_COMP_NUM);
|
||||
mlxsw_cmd_mbox_sw2hw_cq_st_set(mbox, 0);
|
||||
mlxsw_cmd_mbox_sw2hw_cq_log_cq_size_set(mbox, ilog2(q->count));
|
||||
for (i = 0; i < MLXSW_PCI_AQ_PAGES; i++) {
|
||||
dma_addr_t mapaddr = __mlxsw_pci_queue_page_get(q, i);
|
||||
|
||||
mlxsw_cmd_mbox_sw2hw_cq_pa_set(mbox, i, mapaddr);
|
||||
}
|
||||
err = mlxsw_cmd_sw2hw_cq(mlxsw_pci->core, mbox, q->num);
|
||||
if (err)
|
||||
return err;
|
||||
mlxsw_pci_queue_doorbell_consumer_ring(mlxsw_pci, q);
|
||||
mlxsw_pci_queue_doorbell_arm_consumer_ring(mlxsw_pci, q);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mlxsw_pci_cq_fini(struct mlxsw_pci *mlxsw_pci,
|
||||
struct mlxsw_pci_queue *q)
|
||||
{
|
||||
mlxsw_cmd_hw2sw_cq(mlxsw_pci->core, q->num);
|
||||
q->cq.v = MLXSW_PCI_CQE_V1;
|
||||
}
|
||||
|
||||
static unsigned int mlxsw_pci_read32_off(struct mlxsw_pci *mlxsw_pci,
|
||||
@@ -706,7 +644,7 @@ static char *mlxsw_pci_cq_sw_cqe_get(struct mlxsw_pci_queue *q)
|
||||
|
||||
elem_info = mlxsw_pci_queue_elem_info_consumer_get(q);
|
||||
elem = elem_info->elem;
|
||||
owner_bit = mlxsw_pci_cqe_owner_get(q->u.cq.v, elem);
|
||||
owner_bit = mlxsw_pci_cqe_owner_get(q->cq.v, elem);
|
||||
if (mlxsw_pci_elem_hw_owned(q, owner_bit))
|
||||
return NULL;
|
||||
q->consumer_counter++;
|
||||
@@ -714,58 +652,109 @@ static char *mlxsw_pci_cq_sw_cqe_get(struct mlxsw_pci_queue *q)
|
||||
return elem;
|
||||
}
|
||||
|
||||
static void mlxsw_pci_cq_tasklet(struct tasklet_struct *t)
|
||||
static void mlxsw_pci_cq_rx_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
struct mlxsw_pci_queue *q = from_tasklet(q, t, tasklet);
|
||||
struct mlxsw_pci_queue *rdq = q->cq.dq;
|
||||
struct mlxsw_pci *mlxsw_pci = q->pci;
|
||||
char *cqe;
|
||||
int items = 0;
|
||||
int credits = q->count >> 1;
|
||||
int items = 0;
|
||||
char *cqe;
|
||||
|
||||
while ((cqe = mlxsw_pci_cq_sw_cqe_get(q))) {
|
||||
u16 wqe_counter = mlxsw_pci_cqe_wqe_counter_get(cqe);
|
||||
u8 sendq = mlxsw_pci_cqe_sr_get(q->u.cq.v, cqe);
|
||||
u8 dqn = mlxsw_pci_cqe_dqn_get(q->u.cq.v, cqe);
|
||||
u8 sendq = mlxsw_pci_cqe_sr_get(q->cq.v, cqe);
|
||||
u8 dqn = mlxsw_pci_cqe_dqn_get(q->cq.v, cqe);
|
||||
char ncqe[MLXSW_PCI_CQE_SIZE_MAX];
|
||||
|
||||
if (unlikely(sendq)) {
|
||||
WARN_ON_ONCE(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (unlikely(dqn != rdq->num)) {
|
||||
WARN_ON_ONCE(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
memcpy(ncqe, cqe, q->elem_size);
|
||||
mlxsw_pci_queue_doorbell_consumer_ring(mlxsw_pci, q);
|
||||
|
||||
if (sendq) {
|
||||
struct mlxsw_pci_queue *sdq;
|
||||
mlxsw_pci_cqe_rdq_handle(mlxsw_pci, rdq,
|
||||
wqe_counter, q->cq.v, ncqe);
|
||||
|
||||
sdq = mlxsw_pci_sdq_get(mlxsw_pci, dqn);
|
||||
mlxsw_pci_cqe_sdq_handle(mlxsw_pci, sdq,
|
||||
wqe_counter, q->u.cq.v, ncqe);
|
||||
q->u.cq.comp_sdq_count++;
|
||||
} else {
|
||||
struct mlxsw_pci_queue *rdq;
|
||||
|
||||
rdq = mlxsw_pci_rdq_get(mlxsw_pci, dqn);
|
||||
mlxsw_pci_cqe_rdq_handle(mlxsw_pci, rdq,
|
||||
wqe_counter, q->u.cq.v, ncqe);
|
||||
q->u.cq.comp_rdq_count++;
|
||||
}
|
||||
if (++items == credits)
|
||||
break;
|
||||
}
|
||||
if (items)
|
||||
mlxsw_pci_queue_doorbell_arm_consumer_ring(mlxsw_pci, q);
|
||||
|
||||
mlxsw_pci_queue_doorbell_arm_consumer_ring(mlxsw_pci, q);
|
||||
}
|
||||
|
||||
static u16 mlxsw_pci_cq_elem_count(const struct mlxsw_pci_queue *q)
|
||||
static void mlxsw_pci_cq_tx_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
return q->u.cq.v == MLXSW_PCI_CQE_V2 ? MLXSW_PCI_CQE2_COUNT :
|
||||
MLXSW_PCI_CQE01_COUNT;
|
||||
struct mlxsw_pci_queue *q = from_tasklet(q, t, tasklet);
|
||||
struct mlxsw_pci_queue *sdq = q->cq.dq;
|
||||
struct mlxsw_pci *mlxsw_pci = q->pci;
|
||||
int credits = q->count >> 1;
|
||||
int items = 0;
|
||||
char *cqe;
|
||||
|
||||
while ((cqe = mlxsw_pci_cq_sw_cqe_get(q))) {
|
||||
u16 wqe_counter = mlxsw_pci_cqe_wqe_counter_get(cqe);
|
||||
u8 sendq = mlxsw_pci_cqe_sr_get(q->cq.v, cqe);
|
||||
u8 dqn = mlxsw_pci_cqe_dqn_get(q->cq.v, cqe);
|
||||
char ncqe[MLXSW_PCI_CQE_SIZE_MAX];
|
||||
|
||||
if (unlikely(!sendq)) {
|
||||
WARN_ON_ONCE(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (unlikely(dqn != sdq->num)) {
|
||||
WARN_ON_ONCE(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
memcpy(ncqe, cqe, q->elem_size);
|
||||
mlxsw_pci_queue_doorbell_consumer_ring(mlxsw_pci, q);
|
||||
|
||||
mlxsw_pci_cqe_sdq_handle(mlxsw_pci, sdq,
|
||||
wqe_counter, q->cq.v, ncqe);
|
||||
|
||||
if (++items == credits)
|
||||
break;
|
||||
}
|
||||
|
||||
mlxsw_pci_queue_doorbell_arm_consumer_ring(mlxsw_pci, q);
|
||||
}
|
||||
|
||||
static u8 mlxsw_pci_cq_elem_size(const struct mlxsw_pci_queue *q)
|
||||
static enum mlxsw_pci_cq_type
|
||||
mlxsw_pci_cq_type(const struct mlxsw_pci *mlxsw_pci,
|
||||
const struct mlxsw_pci_queue *q)
|
||||
{
|
||||
return q->u.cq.v == MLXSW_PCI_CQE_V2 ? MLXSW_PCI_CQE2_SIZE :
|
||||
MLXSW_PCI_CQE01_SIZE;
|
||||
/* Each CQ is mapped to one DQ. The first 'num_sdqs' queues are used
|
||||
* for SDQs and the rest are used for RDQs.
|
||||
*/
|
||||
if (q->num < mlxsw_pci->num_sdqs)
|
||||
return MLXSW_PCI_CQ_SDQ;
|
||||
|
||||
return MLXSW_PCI_CQ_RDQ;
|
||||
}
|
||||
|
||||
static int mlxsw_pci_eq_init(struct mlxsw_pci *mlxsw_pci, char *mbox,
|
||||
static void mlxsw_pci_cq_tasklet_setup(struct mlxsw_pci_queue *q,
|
||||
enum mlxsw_pci_cq_type cq_type)
|
||||
{
|
||||
switch (cq_type) {
|
||||
case MLXSW_PCI_CQ_SDQ:
|
||||
tasklet_setup(&q->tasklet, mlxsw_pci_cq_tx_tasklet);
|
||||
break;
|
||||
case MLXSW_PCI_CQ_RDQ:
|
||||
tasklet_setup(&q->tasklet, mlxsw_pci_cq_rx_tasklet);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int mlxsw_pci_cq_init(struct mlxsw_pci *mlxsw_pci, char *mbox,
|
||||
struct mlxsw_pci_queue *q)
|
||||
{
|
||||
int i;
|
||||
@@ -776,39 +765,49 @@ static int mlxsw_pci_eq_init(struct mlxsw_pci *mlxsw_pci, char *mbox,
|
||||
for (i = 0; i < q->count; i++) {
|
||||
char *elem = mlxsw_pci_queue_elem_get(q, i);
|
||||
|
||||
mlxsw_pci_eqe_owner_set(elem, 1);
|
||||
mlxsw_pci_cqe_owner_set(q->cq.v, elem, 1);
|
||||
}
|
||||
|
||||
mlxsw_cmd_mbox_sw2hw_eq_int_msix_set(mbox, 1); /* MSI-X used */
|
||||
mlxsw_cmd_mbox_sw2hw_eq_st_set(mbox, 1); /* armed */
|
||||
mlxsw_cmd_mbox_sw2hw_eq_log_eq_size_set(mbox, ilog2(q->count));
|
||||
if (q->cq.v == MLXSW_PCI_CQE_V1)
|
||||
mlxsw_cmd_mbox_sw2hw_cq_cqe_ver_set(mbox,
|
||||
MLXSW_CMD_MBOX_SW2HW_CQ_CQE_VER_1);
|
||||
else if (q->cq.v == MLXSW_PCI_CQE_V2)
|
||||
mlxsw_cmd_mbox_sw2hw_cq_cqe_ver_set(mbox,
|
||||
MLXSW_CMD_MBOX_SW2HW_CQ_CQE_VER_2);
|
||||
|
||||
mlxsw_cmd_mbox_sw2hw_cq_c_eqn_set(mbox, MLXSW_PCI_EQ_COMP_NUM);
|
||||
mlxsw_cmd_mbox_sw2hw_cq_st_set(mbox, 0);
|
||||
mlxsw_cmd_mbox_sw2hw_cq_log_cq_size_set(mbox, ilog2(q->count));
|
||||
for (i = 0; i < MLXSW_PCI_AQ_PAGES; i++) {
|
||||
dma_addr_t mapaddr = __mlxsw_pci_queue_page_get(q, i);
|
||||
|
||||
mlxsw_cmd_mbox_sw2hw_eq_pa_set(mbox, i, mapaddr);
|
||||
mlxsw_cmd_mbox_sw2hw_cq_pa_set(mbox, i, mapaddr);
|
||||
}
|
||||
err = mlxsw_cmd_sw2hw_eq(mlxsw_pci->core, mbox, q->num);
|
||||
err = mlxsw_cmd_sw2hw_cq(mlxsw_pci->core, mbox, q->num);
|
||||
if (err)
|
||||
return err;
|
||||
mlxsw_pci_cq_tasklet_setup(q, mlxsw_pci_cq_type(mlxsw_pci, q));
|
||||
mlxsw_pci_queue_doorbell_consumer_ring(mlxsw_pci, q);
|
||||
mlxsw_pci_queue_doorbell_arm_consumer_ring(mlxsw_pci, q);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mlxsw_pci_eq_fini(struct mlxsw_pci *mlxsw_pci,
|
||||
static void mlxsw_pci_cq_fini(struct mlxsw_pci *mlxsw_pci,
|
||||
struct mlxsw_pci_queue *q)
|
||||
{
|
||||
mlxsw_cmd_hw2sw_eq(mlxsw_pci->core, q->num);
|
||||
mlxsw_cmd_hw2sw_cq(mlxsw_pci->core, q->num);
|
||||
}
|
||||
|
||||
static void mlxsw_pci_eq_cmd_event(struct mlxsw_pci *mlxsw_pci, char *eqe)
|
||||
static u16 mlxsw_pci_cq_elem_count(const struct mlxsw_pci_queue *q)
|
||||
{
|
||||
mlxsw_pci->cmd.comp.status = mlxsw_pci_eqe_cmd_status_get(eqe);
|
||||
mlxsw_pci->cmd.comp.out_param =
|
||||
((u64) mlxsw_pci_eqe_cmd_out_param_h_get(eqe)) << 32 |
|
||||
mlxsw_pci_eqe_cmd_out_param_l_get(eqe);
|
||||
mlxsw_pci->cmd.wait_done = true;
|
||||
wake_up(&mlxsw_pci->cmd.wait);
|
||||
return q->cq.v == MLXSW_PCI_CQE_V2 ? MLXSW_PCI_CQE2_COUNT :
|
||||
MLXSW_PCI_CQE01_COUNT;
|
||||
}
|
||||
|
||||
static u8 mlxsw_pci_cq_elem_size(const struct mlxsw_pci_queue *q)
|
||||
{
|
||||
return q->cq.v == MLXSW_PCI_CQE_V2 ? MLXSW_PCI_CQE2_SIZE :
|
||||
MLXSW_PCI_CQE01_SIZE;
|
||||
}
|
||||
|
||||
static char *mlxsw_pci_eq_sw_eqe_get(struct mlxsw_pci_queue *q)
|
||||
@@ -829,54 +828,81 @@ static char *mlxsw_pci_eq_sw_eqe_get(struct mlxsw_pci_queue *q)
|
||||
|
||||
static void mlxsw_pci_eq_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
unsigned long active_cqns[BITS_TO_LONGS(MLXSW_PCI_CQS_MAX)];
|
||||
struct mlxsw_pci_queue *q = from_tasklet(q, t, tasklet);
|
||||
struct mlxsw_pci *mlxsw_pci = q->pci;
|
||||
u8 cq_count = mlxsw_pci_cq_count(mlxsw_pci);
|
||||
unsigned long active_cqns[BITS_TO_LONGS(MLXSW_PCI_CQS_MAX)];
|
||||
char *eqe;
|
||||
u8 cqn;
|
||||
bool cq_handle = false;
|
||||
int items = 0;
|
||||
int credits = q->count >> 1;
|
||||
u8 cqn, cq_count;
|
||||
int items = 0;
|
||||
char *eqe;
|
||||
|
||||
memset(&active_cqns, 0, sizeof(active_cqns));
|
||||
|
||||
while ((eqe = mlxsw_pci_eq_sw_eqe_get(q))) {
|
||||
cqn = mlxsw_pci_eqe_cqn_get(eqe);
|
||||
set_bit(cqn, active_cqns);
|
||||
|
||||
/* Command interface completion events are always received on
|
||||
* queue MLXSW_PCI_EQ_ASYNC_NUM (EQ0) and completion events
|
||||
* are mapped to queue MLXSW_PCI_EQ_COMP_NUM (EQ1).
|
||||
*/
|
||||
switch (q->num) {
|
||||
case MLXSW_PCI_EQ_ASYNC_NUM:
|
||||
mlxsw_pci_eq_cmd_event(mlxsw_pci, eqe);
|
||||
q->u.eq.ev_cmd_count++;
|
||||
break;
|
||||
case MLXSW_PCI_EQ_COMP_NUM:
|
||||
cqn = mlxsw_pci_eqe_cqn_get(eqe);
|
||||
set_bit(cqn, active_cqns);
|
||||
cq_handle = true;
|
||||
q->u.eq.ev_comp_count++;
|
||||
break;
|
||||
default:
|
||||
q->u.eq.ev_other_count++;
|
||||
}
|
||||
if (++items == credits)
|
||||
break;
|
||||
}
|
||||
if (items) {
|
||||
mlxsw_pci_queue_doorbell_consumer_ring(mlxsw_pci, q);
|
||||
mlxsw_pci_queue_doorbell_arm_consumer_ring(mlxsw_pci, q);
|
||||
}
|
||||
|
||||
if (!cq_handle)
|
||||
if (!items)
|
||||
return;
|
||||
|
||||
mlxsw_pci_queue_doorbell_consumer_ring(mlxsw_pci, q);
|
||||
mlxsw_pci_queue_doorbell_arm_consumer_ring(mlxsw_pci, q);
|
||||
|
||||
cq_count = mlxsw_pci->num_cqs;
|
||||
for_each_set_bit(cqn, active_cqns, cq_count) {
|
||||
q = mlxsw_pci_cq_get(mlxsw_pci, cqn);
|
||||
mlxsw_pci_queue_tasklet_schedule(q);
|
||||
}
|
||||
}
|
||||
|
||||
static int mlxsw_pci_eq_init(struct mlxsw_pci *mlxsw_pci, char *mbox,
|
||||
struct mlxsw_pci_queue *q)
|
||||
{
|
||||
int i;
|
||||
int err;
|
||||
|
||||
/* We expect to initialize only one EQ, which gets num=0 as it is
|
||||
* located at index zero. We use the EQ as EQ1, so set the number for
|
||||
* future use.
|
||||
*/
|
||||
WARN_ON_ONCE(q->num);
|
||||
q->num = MLXSW_PCI_EQ_COMP_NUM;
|
||||
|
||||
q->consumer_counter = 0;
|
||||
|
||||
for (i = 0; i < q->count; i++) {
|
||||
char *elem = mlxsw_pci_queue_elem_get(q, i);
|
||||
|
||||
mlxsw_pci_eqe_owner_set(elem, 1);
|
||||
}
|
||||
|
||||
mlxsw_cmd_mbox_sw2hw_eq_int_msix_set(mbox, 1); /* MSI-X used */
|
||||
mlxsw_cmd_mbox_sw2hw_eq_st_set(mbox, 1); /* armed */
|
||||
mlxsw_cmd_mbox_sw2hw_eq_log_eq_size_set(mbox, ilog2(q->count));
|
||||
for (i = 0; i < MLXSW_PCI_AQ_PAGES; i++) {
|
||||
dma_addr_t mapaddr = __mlxsw_pci_queue_page_get(q, i);
|
||||
|
||||
mlxsw_cmd_mbox_sw2hw_eq_pa_set(mbox, i, mapaddr);
|
||||
}
|
||||
err = mlxsw_cmd_sw2hw_eq(mlxsw_pci->core, mbox, q->num);
|
||||
if (err)
|
||||
return err;
|
||||
tasklet_setup(&q->tasklet, mlxsw_pci_eq_tasklet);
|
||||
mlxsw_pci_queue_doorbell_consumer_ring(mlxsw_pci, q);
|
||||
mlxsw_pci_queue_doorbell_arm_consumer_ring(mlxsw_pci, q);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mlxsw_pci_eq_fini(struct mlxsw_pci *mlxsw_pci,
|
||||
struct mlxsw_pci_queue *q)
|
||||
{
|
||||
mlxsw_cmd_hw2sw_eq(mlxsw_pci->core, q->num);
|
||||
}
|
||||
|
||||
struct mlxsw_pci_queue_ops {
|
||||
const char *name;
|
||||
enum mlxsw_pci_queue_type type;
|
||||
@@ -886,7 +912,6 @@ struct mlxsw_pci_queue_ops {
|
||||
struct mlxsw_pci_queue *q);
|
||||
void (*fini)(struct mlxsw_pci *mlxsw_pci,
|
||||
struct mlxsw_pci_queue *q);
|
||||
void (*tasklet)(struct tasklet_struct *t);
|
||||
u16 (*elem_count_f)(const struct mlxsw_pci_queue *q);
|
||||
u8 (*elem_size_f)(const struct mlxsw_pci_queue *q);
|
||||
u16 elem_count;
|
||||
@@ -914,7 +939,6 @@ static const struct mlxsw_pci_queue_ops mlxsw_pci_cq_ops = {
|
||||
.pre_init = mlxsw_pci_cq_pre_init,
|
||||
.init = mlxsw_pci_cq_init,
|
||||
.fini = mlxsw_pci_cq_fini,
|
||||
.tasklet = mlxsw_pci_cq_tasklet,
|
||||
.elem_count_f = mlxsw_pci_cq_elem_count,
|
||||
.elem_size_f = mlxsw_pci_cq_elem_size
|
||||
};
|
||||
@@ -923,7 +947,6 @@ static const struct mlxsw_pci_queue_ops mlxsw_pci_eq_ops = {
|
||||
.type = MLXSW_PCI_QUEUE_TYPE_EQ,
|
||||
.init = mlxsw_pci_eq_init,
|
||||
.fini = mlxsw_pci_eq_fini,
|
||||
.tasklet = mlxsw_pci_eq_tasklet,
|
||||
.elem_count = MLXSW_PCI_EQE_COUNT,
|
||||
.elem_size = MLXSW_PCI_EQE_SIZE
|
||||
};
|
||||
@@ -948,9 +971,6 @@ static int mlxsw_pci_queue_init(struct mlxsw_pci *mlxsw_pci, char *mbox,
|
||||
q->type = q_ops->type;
|
||||
q->pci = mlxsw_pci;
|
||||
|
||||
if (q_ops->tasklet)
|
||||
tasklet_setup(&q->tasklet, q_ops->tasklet);
|
||||
|
||||
mem_item->size = MLXSW_PCI_AQ_SIZE;
|
||||
mem_item->buf = dma_alloc_coherent(&mlxsw_pci->pdev->dev,
|
||||
mem_item->size, &mem_item->mapaddr,
|
||||
@@ -1074,7 +1094,7 @@ static int mlxsw_pci_aqs_init(struct mlxsw_pci *mlxsw_pci, char *mbox)
|
||||
|
||||
if (num_sdqs + num_rdqs > num_cqs ||
|
||||
num_sdqs < MLXSW_PCI_SDQS_MIN ||
|
||||
num_cqs > MLXSW_PCI_CQS_MAX || num_eqs != MLXSW_PCI_EQS_COUNT) {
|
||||
num_cqs > MLXSW_PCI_CQS_MAX || num_eqs != MLXSW_PCI_EQS_MAX) {
|
||||
dev_err(&pdev->dev, "Unsupported number of queues\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1089,10 +1109,11 @@ static int mlxsw_pci_aqs_init(struct mlxsw_pci *mlxsw_pci, char *mbox)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
mlxsw_pci->num_sdq_cqs = num_sdqs;
|
||||
mlxsw_pci->num_cqs = num_cqs;
|
||||
mlxsw_pci->num_sdqs = num_sdqs;
|
||||
|
||||
err = mlxsw_pci_queue_group_init(mlxsw_pci, mbox, &mlxsw_pci_eq_ops,
|
||||
num_eqs);
|
||||
MLXSW_PCI_EQS_COUNT);
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "Failed to initialize event queues\n");
|
||||
return err;
|
||||
@@ -1119,8 +1140,6 @@ static int mlxsw_pci_aqs_init(struct mlxsw_pci *mlxsw_pci, char *mbox)
|
||||
goto err_rdqs_init;
|
||||
}
|
||||
|
||||
/* We have to poll in command interface until queues are initialized */
|
||||
mlxsw_pci->cmd.nopoll = true;
|
||||
return 0;
|
||||
|
||||
err_rdqs_init:
|
||||
@@ -1134,7 +1153,6 @@ err_cqs_init:
|
||||
|
||||
static void mlxsw_pci_aqs_fini(struct mlxsw_pci *mlxsw_pci)
|
||||
{
|
||||
mlxsw_pci->cmd.nopoll = false;
|
||||
mlxsw_pci_queue_group_fini(mlxsw_pci, &mlxsw_pci_rdq_ops);
|
||||
mlxsw_pci_queue_group_fini(mlxsw_pci, &mlxsw_pci_sdq_ops);
|
||||
mlxsw_pci_queue_group_fini(mlxsw_pci, &mlxsw_pci_cq_ops);
|
||||
@@ -1432,12 +1450,9 @@ static irqreturn_t mlxsw_pci_eq_irq_handler(int irq, void *dev_id)
|
||||
{
|
||||
struct mlxsw_pci *mlxsw_pci = dev_id;
|
||||
struct mlxsw_pci_queue *q;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MLXSW_PCI_EQS_COUNT; i++) {
|
||||
q = mlxsw_pci_eq_get(mlxsw_pci, i);
|
||||
mlxsw_pci_queue_tasklet_schedule(q);
|
||||
}
|
||||
q = mlxsw_pci_eq_get(mlxsw_pci);
|
||||
mlxsw_pci_queue_tasklet_schedule(q);
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
@@ -1761,7 +1776,7 @@ static struct mlxsw_pci_queue *
|
||||
mlxsw_pci_sdq_pick(struct mlxsw_pci *mlxsw_pci,
|
||||
const struct mlxsw_tx_info *tx_info)
|
||||
{
|
||||
u8 ctl_sdq_count = mlxsw_pci_sdq_count(mlxsw_pci) - 1;
|
||||
u8 ctl_sdq_count = mlxsw_pci->num_sdqs - 1;
|
||||
u8 sdqn;
|
||||
|
||||
if (tx_info->is_emad) {
|
||||
@@ -1860,9 +1875,9 @@ static int mlxsw_pci_cmd_exec(void *bus_priv, u16 opcode, u8 opcode_mod,
|
||||
{
|
||||
struct mlxsw_pci *mlxsw_pci = bus_priv;
|
||||
dma_addr_t in_mapaddr = 0, out_mapaddr = 0;
|
||||
bool evreq = mlxsw_pci->cmd.nopoll;
|
||||
unsigned long timeout = msecs_to_jiffies(MLXSW_PCI_CIR_TIMEOUT_MSECS);
|
||||
bool *p_wait_done = &mlxsw_pci->cmd.wait_done;
|
||||
unsigned long end;
|
||||
bool wait_done;
|
||||
int err;
|
||||
|
||||
*p_status = MLXSW_CMD_STATUS_OK;
|
||||
@@ -1886,36 +1901,28 @@ static int mlxsw_pci_cmd_exec(void *bus_priv, u16 opcode, u8 opcode_mod,
|
||||
mlxsw_pci_write32(mlxsw_pci, CIR_IN_MODIFIER, in_mod);
|
||||
mlxsw_pci_write32(mlxsw_pci, CIR_TOKEN, 0);
|
||||
|
||||
*p_wait_done = false;
|
||||
wait_done = false;
|
||||
|
||||
wmb(); /* all needs to be written before we write control register */
|
||||
mlxsw_pci_write32(mlxsw_pci, CIR_CTRL,
|
||||
MLXSW_PCI_CIR_CTRL_GO_BIT |
|
||||
(evreq ? MLXSW_PCI_CIR_CTRL_EVREQ_BIT : 0) |
|
||||
(opcode_mod << MLXSW_PCI_CIR_CTRL_OPCODE_MOD_SHIFT) |
|
||||
opcode);
|
||||
|
||||
if (!evreq) {
|
||||
unsigned long end;
|
||||
end = jiffies + timeout;
|
||||
do {
|
||||
u32 ctrl = mlxsw_pci_read32(mlxsw_pci, CIR_CTRL);
|
||||
|
||||
end = jiffies + timeout;
|
||||
do {
|
||||
u32 ctrl = mlxsw_pci_read32(mlxsw_pci, CIR_CTRL);
|
||||
|
||||
if (!(ctrl & MLXSW_PCI_CIR_CTRL_GO_BIT)) {
|
||||
*p_wait_done = true;
|
||||
*p_status = ctrl >> MLXSW_PCI_CIR_CTRL_STATUS_SHIFT;
|
||||
break;
|
||||
}
|
||||
cond_resched();
|
||||
} while (time_before(jiffies, end));
|
||||
} else {
|
||||
wait_event_timeout(mlxsw_pci->cmd.wait, *p_wait_done, timeout);
|
||||
*p_status = mlxsw_pci->cmd.comp.status;
|
||||
}
|
||||
if (!(ctrl & MLXSW_PCI_CIR_CTRL_GO_BIT)) {
|
||||
wait_done = true;
|
||||
*p_status = ctrl >> MLXSW_PCI_CIR_CTRL_STATUS_SHIFT;
|
||||
break;
|
||||
}
|
||||
cond_resched();
|
||||
} while (time_before(jiffies, end));
|
||||
|
||||
err = 0;
|
||||
if (*p_wait_done) {
|
||||
if (wait_done) {
|
||||
if (*p_status)
|
||||
err = -EIO;
|
||||
} else {
|
||||
@@ -1929,14 +1936,12 @@ static int mlxsw_pci_cmd_exec(void *bus_priv, u16 opcode, u8 opcode_mod,
|
||||
*/
|
||||
__be32 tmp;
|
||||
|
||||
if (!evreq) {
|
||||
tmp = cpu_to_be32(mlxsw_pci_read32(mlxsw_pci,
|
||||
CIR_OUT_PARAM_HI));
|
||||
memcpy(out_mbox, &tmp, sizeof(tmp));
|
||||
tmp = cpu_to_be32(mlxsw_pci_read32(mlxsw_pci,
|
||||
CIR_OUT_PARAM_LO));
|
||||
memcpy(out_mbox + sizeof(tmp), &tmp, sizeof(tmp));
|
||||
}
|
||||
tmp = cpu_to_be32(mlxsw_pci_read32(mlxsw_pci,
|
||||
CIR_OUT_PARAM_HI));
|
||||
memcpy(out_mbox, &tmp, sizeof(tmp));
|
||||
tmp = cpu_to_be32(mlxsw_pci_read32(mlxsw_pci,
|
||||
CIR_OUT_PARAM_LO));
|
||||
memcpy(out_mbox + sizeof(tmp), &tmp, sizeof(tmp));
|
||||
} else if (!err && out_mbox) {
|
||||
memcpy(out_mbox, mlxsw_pci->cmd.out_mbox.buf, out_mbox_size);
|
||||
}
|
||||
@@ -2015,7 +2020,6 @@ static int mlxsw_pci_cmd_init(struct mlxsw_pci *mlxsw_pci)
|
||||
int err;
|
||||
|
||||
mutex_init(&mlxsw_pci->cmd.lock);
|
||||
init_waitqueue_head(&mlxsw_pci->cmd.wait);
|
||||
|
||||
err = mlxsw_pci_mbox_alloc(mlxsw_pci, &mlxsw_pci->cmd.in_mbox);
|
||||
if (err)
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
((offset) + (type_offset) + (num) * 4)
|
||||
|
||||
#define MLXSW_PCI_CQS_MAX 96
|
||||
#define MLXSW_PCI_EQS_COUNT 2
|
||||
#define MLXSW_PCI_EQ_ASYNC_NUM 0
|
||||
#define MLXSW_PCI_EQS_MAX 2
|
||||
#define MLXSW_PCI_EQS_COUNT 1
|
||||
#define MLXSW_PCI_EQ_COMP_NUM 1
|
||||
|
||||
#define MLXSW_PCI_SDQS_MIN 2 /* EMAD and control traffic */
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
#define MLX5_UN_SZ_BYTES(typ) (sizeof(union mlx5_ifc_##typ##_bits) / 8)
|
||||
#define MLX5_UN_SZ_DW(typ) (sizeof(union mlx5_ifc_##typ##_bits) / 32)
|
||||
#define MLX5_BYTE_OFF(typ, fld) (__mlx5_bit_off(typ, fld) / 8)
|
||||
#define MLX5_ADDR_OF(typ, p, fld) ((void *)((uint8_t *)(p) + MLX5_BYTE_OFF(typ, fld)))
|
||||
#define MLX5_ADDR_OF(typ, p, fld) ((void *)((u8 *)(p) + MLX5_BYTE_OFF(typ, fld)))
|
||||
|
||||
/* insert a value to a struct */
|
||||
#define MLX5_SET(typ, p, fld, v) do { \
|
||||
@@ -1336,6 +1336,9 @@ enum mlx5_qcam_feature_groups {
|
||||
#define MLX5_CAP_ESW_FT_FIELD_SUPPORT_2(mdev, cap) \
|
||||
MLX5_CAP_ESW_FLOWTABLE(mdev, ft_field_support_2_esw_fdb.cap)
|
||||
|
||||
#define MLX5_CAP_NIC_RX_FT_FIELD_SUPPORT_2(mdev, cap) \
|
||||
MLX5_CAP_FLOWTABLE(mdev, ft_field_support_2_nic_receive.cap)
|
||||
|
||||
#define MLX5_CAP_ESW(mdev, cap) \
|
||||
MLX5_GET(e_switch_cap, \
|
||||
mdev->caps.hca[MLX5_CAP_ESWITCH]->cur, cap)
|
||||
@@ -1359,6 +1362,9 @@ enum mlx5_qcam_feature_groups {
|
||||
#define MLX5_CAP_FLOWTABLE_PORT_SELECTION(mdev, cap) \
|
||||
MLX5_CAP_PORT_SELECTION(mdev, flow_table_properties_port_selection.cap)
|
||||
|
||||
#define MLX5_CAP_PORT_SELECTION_FT_FIELD_SUPPORT_2(mdev, cap) \
|
||||
MLX5_CAP_PORT_SELECTION(mdev, ft_field_support_2_port_selection.cap)
|
||||
|
||||
#define MLX5_CAP_ODP(mdev, cap)\
|
||||
MLX5_GET(odp_cap, mdev->caps.hca[MLX5_CAP_ODP]->cur, cap)
|
||||
|
||||
|
||||
@@ -416,7 +416,10 @@ struct mlx5_ifc_flow_table_fields_supported_bits {
|
||||
|
||||
/* Table 2170 - Flow Table Fields Supported 2 Format */
|
||||
struct mlx5_ifc_flow_table_fields_supported_2_bits {
|
||||
u8 reserved_at_0[0xe];
|
||||
u8 reserved_at_0[0x2];
|
||||
u8 inner_l4_type[0x1];
|
||||
u8 outer_l4_type[0x1];
|
||||
u8 reserved_at_4[0xa];
|
||||
u8 bth_opcode[0x1];
|
||||
u8 reserved_at_f[0x1];
|
||||
u8 tunnel_header_0_1[0x1];
|
||||
@@ -525,6 +528,12 @@ union mlx5_ifc_ipv6_layout_ipv4_layout_auto_bits {
|
||||
u8 reserved_at_0[0x80];
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX5_PACKET_L4_TYPE_NONE,
|
||||
MLX5_PACKET_L4_TYPE_TCP,
|
||||
MLX5_PACKET_L4_TYPE_UDP,
|
||||
};
|
||||
|
||||
struct mlx5_ifc_fte_match_set_lyr_2_4_bits {
|
||||
u8 smac_47_16[0x20];
|
||||
|
||||
@@ -550,7 +559,8 @@ struct mlx5_ifc_fte_match_set_lyr_2_4_bits {
|
||||
u8 tcp_sport[0x10];
|
||||
u8 tcp_dport[0x10];
|
||||
|
||||
u8 reserved_at_c0[0x10];
|
||||
u8 l4_type[0x2];
|
||||
u8 reserved_at_c2[0xe];
|
||||
u8 ipv4_ihl[0x4];
|
||||
u8 reserved_at_c4[0x4];
|
||||
|
||||
@@ -846,7 +856,11 @@ struct mlx5_ifc_flow_table_nic_cap_bits {
|
||||
|
||||
struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_nic_transmit_sniffer;
|
||||
|
||||
u8 reserved_at_e00[0x700];
|
||||
u8 reserved_at_e00[0x600];
|
||||
|
||||
struct mlx5_ifc_flow_table_fields_supported_2_bits ft_field_support_2_nic_receive;
|
||||
|
||||
u8 reserved_at_1480[0x80];
|
||||
|
||||
struct mlx5_ifc_flow_table_fields_supported_2_bits ft_field_support_2_nic_receive_rdma;
|
||||
|
||||
@@ -876,7 +890,9 @@ struct mlx5_ifc_port_selection_cap_bits {
|
||||
|
||||
struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_port_selection;
|
||||
|
||||
u8 reserved_at_400[0x7c00];
|
||||
struct mlx5_ifc_flow_table_fields_supported_2_bits ft_field_support_2_port_selection;
|
||||
|
||||
u8 reserved_at_480[0x7b80];
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -1469,7 +1485,9 @@ enum {
|
||||
};
|
||||
|
||||
struct mlx5_ifc_cmd_hca_cap_bits {
|
||||
u8 reserved_at_0[0x10];
|
||||
u8 reserved_at_0[0x6];
|
||||
u8 page_request_disable[0x1];
|
||||
u8 reserved_at_7[0x9];
|
||||
u8 shared_object_to_user_object_allowed[0x1];
|
||||
u8 reserved_at_13[0xe];
|
||||
u8 vhca_resource_manager[0x1];
|
||||
@@ -2004,7 +2022,13 @@ struct mlx5_ifc_cmd_hca_cap_2_bits {
|
||||
u8 reserved_at_3a0[0x10];
|
||||
u8 max_rqt_vhca_id[0x10];
|
||||
|
||||
u8 reserved_at_3c0[0x440];
|
||||
u8 reserved_at_3c0[0x20];
|
||||
|
||||
u8 reserved_at_3e0[0x10];
|
||||
u8 pcc_ifa2[0x1];
|
||||
u8 reserved_at_3f1[0xf];
|
||||
|
||||
u8 reserved_at_400[0x400];
|
||||
};
|
||||
|
||||
enum mlx5_ifc_flow_destination_type {
|
||||
|
||||
@@ -100,9 +100,10 @@ class Netlink:
|
||||
class NlError(Exception):
|
||||
def __init__(self, nl_msg):
|
||||
self.nl_msg = nl_msg
|
||||
self.error = -nl_msg.error
|
||||
|
||||
def __str__(self):
|
||||
return f"Netlink error: {os.strerror(-self.nl_msg.error)}\n{self.nl_msg}"
|
||||
return f"Netlink error: {os.strerror(self.error)}\n{self.nl_msg}"
|
||||
|
||||
|
||||
class ConfigError(Exception):
|
||||
|
||||
Reference in New Issue
Block a user