MC firmware is the core component of FSLMC bus and net/DPAA2 devices.
Prior to this patch, MC firmware supported 10.14.x version. This
patch bumps the min supported version to 10.18.x.
Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
}
/*Attach buffer pool to the network interface as described by the user*/
+ memset(&bpool_cfg, 0, sizeof(struct dpni_pools_cfg));
bpool_cfg.num_dpbp = 1;
bpool_cfg.pools[0].dpbp_id = bp_list->buf_pool.dpbp_node->dpbp_id;
bpool_cfg.pools[0].backup_pool = 0;
}
if (on)
- ret = dpni_add_vlan_id(dpni, CMD_PRI_LOW,
- priv->token, vlan_id);
+ ret = dpni_add_vlan_id(dpni, CMD_PRI_LOW, priv->token,
+ vlan_id, 0, 0, 0);
else
ret = dpni_remove_vlan_id(dpni, CMD_PRI_LOW,
priv->token, vlan_id);
return -1;
}
- ret = dpni_add_mac_addr(dpni, CMD_PRI_LOW,
- priv->token, addr->addr_bytes);
+ ret = dpni_add_mac_addr(dpni, CMD_PRI_LOW, priv->token,
+ addr->addr_bytes, 0, 0, 0);
if (ret)
DPAA2_PMD_ERR(
"error: Adding the MAC ADDR failed: err = %d", ret);
index = flow->index + (flow->tc_id * nic_attr.fs_entries);
ret = dpni_add_qos_entry(dpni, CMD_PRI_LOW,
priv->token, &flow->rule,
- flow->tc_id, index);
+ flow->tc_id, index,
+ 0, 0);
if (ret < 0) {
DPAA2_PMD_ERR(
"Error in addnig entry to QoS table(%d)", ret);
index = flow->index + (flow->tc_id * nic_attr.fs_entries);
ret = dpni_add_qos_entry(dpni, CMD_PRI_LOW, priv->token,
&flow->rule, flow->tc_id,
- index);
+ index, 0, 0);
if (ret < 0) {
DPAA2_PMD_ERR(
"Error in entry addition in QoS table(%d)",
token);
cmd_params = (struct dpni_cmd_set_pools *)cmd.params;
cmd_params->num_dpbp = cfg->num_dpbp;
+ cmd_params->pool_options = cfg->pool_options;
for (i = 0; i < cmd_params->num_dpbp; i++) {
cmd_params->pool[i].dpbp_id =
cpu_to_le16(cfg->pools[i].dpbp_id);
* @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @mac_addr: MAC address to add
- *
+ * @flags : 0 - tc_id and flow_id will be ignored.
+ * Pkt with this mac_id will be passed to the next
+ * classification stages
+ * DPNI_MAC_SET_QUEUE_ACTION
+ * Pkt with this mac will be forward directly to
+ * queue defined by the tc_id and flow_id
+ * @tc_id : Traffic class selection (0-7)
+ * @flow_id : Selects the specific queue out of the set allocated for the
+ * same as tc_id. Value must be in range 0 to NUM_QUEUES - 1
* Return: '0' on Success; Error code otherwise.
*/
int dpni_add_mac_addr(struct fsl_mc_io *mc_io,
uint32_t cmd_flags,
uint16_t token,
- const uint8_t mac_addr[6])
+ const uint8_t mac_addr[6],
+ uint8_t flags,
+ uint8_t tc_id,
+ uint8_t flow_id)
{
struct mc_command cmd = { 0 };
struct dpni_cmd_add_mac_addr *cmd_params;
cmd_flags,
token);
cmd_params = (struct dpni_cmd_add_mac_addr *)cmd.params;
+ cmd_params->flags = flags;
+ cmd_params->tc_id = tc_id;
+ cmd_params->fq_id = flow_id;
+
for (i = 0; i < 6; i++)
cmd_params->mac_addr[i] = mac_addr[5 - i];
* @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @vlan_id: VLAN ID to add
+ * @flags: 0 - tc_id and flow_id will be ignored.
+ * Pkt with this vlan_id will be passed to the next
+ * classification stages
+ * DPNI_VLAN_SET_QUEUE_ACTION
+ * Pkt with this vlan_id will be forward directly to
+ * queue defined by the tc_id and flow_id
+ *
+ * @tc_id: Traffic class selection (0-7)
+ * @flow_id: Selects the specific queue out of the set allocated for the
+ * same as tc_id. Value must be in range 0 to NUM_QUEUES - 1
*
* Return: '0' on Success; Error code otherwise.
*/
int dpni_add_vlan_id(struct fsl_mc_io *mc_io,
uint32_t cmd_flags,
uint16_t token,
- uint16_t vlan_id)
+ uint16_t vlan_id,
+ uint8_t flags,
+ uint8_t tc_id,
+ uint8_t flow_id)
{
struct dpni_cmd_vlan_id *cmd_params;
struct mc_command cmd = { 0 };
cmd_flags,
token);
cmd_params = (struct dpni_cmd_vlan_id *)cmd.params;
+ cmd_params->flags = flags;
+ cmd_params->tc_id = tc_id;
+ cmd_params->flow_id = flow_id;
cmd_params->vlan_id = cpu_to_le16(vlan_id);
/* send command to mc*/
uint16_t token,
const struct dpni_rule_cfg *cfg,
uint8_t tc_id,
- uint16_t index)
+ uint16_t index,
+ uint8_t flags,
+ uint8_t flow_id)
{
struct dpni_cmd_add_qos_entry *cmd_params;
struct mc_command cmd = { 0 };
cmd_flags,
token);
cmd_params = (struct dpni_cmd_add_qos_entry *)cmd.params;
+ cmd_params->flags = flags;
+ cmd_params->flow_id = flow_id;
cmd_params->tc_id = tc_id;
cmd_params->key_size = cfg->key_size;
cmd_params->index = cpu_to_le16(index);
* @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPNI object
* @page: Selects the statistics page to retrieve, see
- * DPNI_GET_STATISTICS output. Pages are numbered 0 to 3.
+ * DPNI_GET_STATISTICS output. Pages are numbered 0 to 6.
* @param: Custom parameter for some pages used to select
* a certain statistic source, for example the TC.
* @stat: Structure containing the statistics
/**
* struct dpni_pools_cfg - Structure representing buffer pools configuration
* @num_dpbp: Number of DPBPs
+ * @pool_options: Buffer assignment options
+ * This field is a combination of DPNI_POOL_ASSOC_flags
* @pools: Array of buffer pools parameters; The number of valid entries
* must match 'num_dpbp' value
* @pools.dpbp_id: DPBP object ID
* @pools.buffer_size: Buffer size
* @pools.backup_pool: Backup pool
*/
+
+#define DPNI_POOL_ASSOC_QPRI 0
+#define DPNI_POOL_ASSOC_QDBIN 1
+
struct dpni_pools_cfg {
uint8_t num_dpbp;
+ uint8_t pool_options;
struct {
int dpbp_id;
uint8_t priority_mask;
* @page_5.policer_cnt_green: number of green colored frames
* @page_5.policer_cnt_re_red: number of recolored red frames
* @page_5.policer_cnt_re_yellow: number of recolored yellow frames
+ * @page_6.tx_pending_frames_cnt: total number of frames pending in Tx queues
* @raw: raw statistics structure, used to index counters
*/
union dpni_statistics {
uint64_t policer_cnt_re_red;
uint64_t policer_cnt_re_yellow;
} page_5;
+ struct {
+ uint64_t tx_pending_frames_cnt;
+ } page_6;
struct {
uint64_t counter[DPNI_STATISTICS_CNT];
} raw;
int dpni_add_mac_addr(struct fsl_mc_io *mc_io,
uint32_t cmd_flags,
uint16_t token,
- const uint8_t mac_addr[6]);
+ const uint8_t mac_addr[6],
+ uint8_t flags,
+ uint8_t tc_id,
+ uint8_t flow_id);
int dpni_remove_mac_addr(struct fsl_mc_io *mc_io,
uint32_t cmd_flags,
uint16_t token,
int en);
+/**
+ * Set vlan filter queue action
+ */
+#define DPNI_VLAN_SET_QUEUE_ACTION 1
+
int dpni_add_vlan_id(struct fsl_mc_io *mc_io,
uint32_t cmd_flags,
uint16_t token,
- uint16_t vlan_id);
+ uint16_t vlan_id,
+ uint8_t flags,
+ uint8_t tc_id,
+ uint8_t flow_id);
int dpni_remove_vlan_id(struct fsl_mc_io *mc_io,
uint32_t cmd_flags,
uint16_t token,
const struct dpni_rule_cfg *cfg,
uint8_t tc_id,
- uint16_t index);
+ uint16_t index,
+ uint8_t flags,
+ uint8_t flow_id);
int dpni_remove_qos_entry(struct fsl_mc_io *mc_io,
uint32_t cmd_flags,
/* DPNI Version */
#define DPNI_VER_MAJOR 7
-#define DPNI_VER_MINOR 9
+#define DPNI_VER_MINOR 13
#define DPNI_CMD_BASE_VERSION 1
#define DPNI_CMD_VERSION_2 2
#define DPNI_CMDID_GET_IRQ_STATUS DPNI_CMD(0x016)
#define DPNI_CMDID_CLEAR_IRQ_STATUS DPNI_CMD(0x017)
-#define DPNI_CMDID_SET_POOLS DPNI_CMD_V2(0x200)
+#define DPNI_CMDID_SET_POOLS DPNI_CMD_V3(0x200)
#define DPNI_CMDID_SET_ERRORS_BEHAVIOR DPNI_CMD(0x20B)
#define DPNI_CMDID_GET_QDID DPNI_CMD(0x210)
#define DPNI_CMDID_GET_UNICAST_PROMISC DPNI_CMD(0x223)
#define DPNI_CMDID_SET_PRIM_MAC DPNI_CMD(0x224)
#define DPNI_CMDID_GET_PRIM_MAC DPNI_CMD(0x225)
-#define DPNI_CMDID_ADD_MAC_ADDR DPNI_CMD(0x226)
+#define DPNI_CMDID_ADD_MAC_ADDR DPNI_CMD_V2(0x226)
#define DPNI_CMDID_REMOVE_MAC_ADDR DPNI_CMD(0x227)
#define DPNI_CMDID_CLR_MAC_FILTERS DPNI_CMD(0x228)
#define DPNI_CMDID_ENABLE_VLAN_FILTER DPNI_CMD(0x230)
-#define DPNI_CMDID_ADD_VLAN_ID DPNI_CMD(0x231)
+#define DPNI_CMDID_ADD_VLAN_ID DPNI_CMD_V2(0x231)
#define DPNI_CMDID_REMOVE_VLAN_ID DPNI_CMD(0x232)
#define DPNI_CMDID_CLR_VLAN_FILTERS DPNI_CMD(0x233)
#define DPNI_CMDID_SET_RX_TC_DIST DPNI_CMD_V3(0x235)
#define DPNI_CMDID_SET_QOS_TBL DPNI_CMD_V2(0x240)
-#define DPNI_CMDID_ADD_QOS_ENT DPNI_CMD(0x241)
+#define DPNI_CMDID_ADD_QOS_ENT DPNI_CMD_V2(0x241)
#define DPNI_CMDID_REMOVE_QOS_ENT DPNI_CMD(0x242)
#define DPNI_CMDID_CLR_QOS_TBL DPNI_CMD(0x243)
#define DPNI_CMDID_ADD_FS_ENT DPNI_CMD(0x244)
struct dpni_cmd_set_pools {
uint8_t num_dpbp;
uint8_t backup_pool_mask;
- uint16_t pad;
+ uint8_t pad;
+ uint8_t pool_options;
struct dpni_cmd_pool pool[8];
uint16_t buffer_size[8];
};
uint8_t mac_addr[6];
};
+#define DPNI_MAC_SET_QUEUE_ACTION 1
+
struct dpni_cmd_add_mac_addr {
- uint16_t pad;
+ uint8_t flags;
+ uint8_t pad;
uint8_t mac_addr[6];
+ uint8_t tc_id;
+ uint8_t fq_id;
};
struct dpni_cmd_remove_mac_addr {
uint8_t en;
};
+#define DPNI_VLAN_SET_QUEUE_ACTION 1
+
struct dpni_cmd_vlan_id {
- uint32_t pad;
+ uint8_t flags;
+ uint8_t tc_id;
+ uint8_t flow_id;
+ uint8_t pad;
uint16_t vlan_id;
};
uint64_t key_cfg_iova;
};
+#define DPNI_QOS_OPT_SET_TC_ONLY 0x0
+#define DPNI_QOS_OPT_SET_FLOW_ID 0x1
+
struct dpni_cmd_add_qos_entry {
- uint16_t pad;
+ uint8_t flags;
+ uint8_t flow_id;
uint8_t tc_id;
uint8_t key_size;
uint16_t index;
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
*
* Copyright 2013-2015 Freescale Semiconductor Inc.
+ * Copyright 2018-2019 NXP
*
*/
+
#ifndef __FSL_NET_H
#define __FSL_NET_H