Commit b51bdfb9 authored by Sudarsana Reddy Kalluru's avatar Sudarsana Reddy Kalluru Committed by David S. Miller

qed: Add support for multi function mode with 802.1ad tagging.

The patch adds support for new Multi function mode wherein the traffic
classification is done based on the 802.1ad tagging and the outer vlan tag
provided by the management firmware.
Signed-off-by: default avatarSudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: default avatarAriel Elior <ariel.elior@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 27bf96e3
...@@ -1668,6 +1668,18 @@ int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params) ...@@ -1668,6 +1668,18 @@ int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params)
if (rc) if (rc)
return rc; return rc;
if (IS_PF(cdev) && test_bit(QED_MF_8021AD_TAGGING,
&cdev->mf_bits)) {
STORE_RT_REG(p_hwfn, PRS_REG_TAG_ETHERTYPE_0_RT_OFFSET,
ETH_P_8021AD);
STORE_RT_REG(p_hwfn, NIG_REG_TAG_ETHERTYPE_0_RT_OFFSET,
ETH_P_8021AD);
STORE_RT_REG(p_hwfn, PBF_REG_TAG_ETHERTYPE_0_RT_OFFSET,
ETH_P_8021AD);
STORE_RT_REG(p_hwfn, DORQ_REG_TAG1_ETHERTYPE_RT_OFFSET,
ETH_P_8021AD);
}
qed_fill_load_req_params(&load_req_params, qed_fill_load_req_params(&load_req_params,
p_params->p_drv_load_params); p_params->p_drv_load_params);
rc = qed_mcp_load_req(p_hwfn, p_hwfn->p_main_ptt, rc = qed_mcp_load_req(p_hwfn, p_hwfn->p_main_ptt,
...@@ -2630,6 +2642,9 @@ static int qed_hw_get_nvm_info(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) ...@@ -2630,6 +2642,9 @@ static int qed_hw_get_nvm_info(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
link->pause.autoneg, link->pause.autoneg,
p_caps->default_eee, p_caps->eee_lpi_timer); p_caps->default_eee, p_caps->eee_lpi_timer);
if (IS_LEAD_HWFN(p_hwfn)) {
struct qed_dev *cdev = p_hwfn->cdev;
/* Read Multi-function information from shmem */ /* Read Multi-function information from shmem */
addr = MCP_REG_SCRATCH + nvm_cfg1_offset + addr = MCP_REG_SCRATCH + nvm_cfg1_offset +
offsetof(struct nvm_cfg1, glob) + offsetof(struct nvm_cfg1, glob) +
...@@ -2642,27 +2657,36 @@ static int qed_hw_get_nvm_info(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) ...@@ -2642,27 +2657,36 @@ static int qed_hw_get_nvm_info(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
switch (mf_mode) { switch (mf_mode) {
case NVM_CFG1_GLOB_MF_MODE_MF_ALLOWED: case NVM_CFG1_GLOB_MF_MODE_MF_ALLOWED:
p_hwfn->cdev->mf_bits = BIT(QED_MF_OVLAN_CLSS); cdev->mf_bits = BIT(QED_MF_OVLAN_CLSS);
break;
case NVM_CFG1_GLOB_MF_MODE_BD:
cdev->mf_bits = BIT(QED_MF_OVLAN_CLSS) |
BIT(QED_MF_LLH_PROTO_CLSS) |
BIT(QED_MF_8021AD_TAGGING);
break; break;
case NVM_CFG1_GLOB_MF_MODE_NPAR1_0: case NVM_CFG1_GLOB_MF_MODE_NPAR1_0:
p_hwfn->cdev->mf_bits = BIT(QED_MF_LLH_MAC_CLSS) | cdev->mf_bits = BIT(QED_MF_LLH_MAC_CLSS) |
BIT(QED_MF_LLH_PROTO_CLSS) | BIT(QED_MF_LLH_PROTO_CLSS) |
BIT(QED_MF_LL2_NON_UNICAST) | BIT(QED_MF_LL2_NON_UNICAST) |
BIT(QED_MF_INTER_PF_SWITCH); BIT(QED_MF_INTER_PF_SWITCH);
break; break;
case NVM_CFG1_GLOB_MF_MODE_DEFAULT: case NVM_CFG1_GLOB_MF_MODE_DEFAULT:
p_hwfn->cdev->mf_bits = BIT(QED_MF_LLH_MAC_CLSS) | cdev->mf_bits = BIT(QED_MF_LLH_MAC_CLSS) |
BIT(QED_MF_LLH_PROTO_CLSS) | BIT(QED_MF_LLH_PROTO_CLSS) |
BIT(QED_MF_LL2_NON_UNICAST); BIT(QED_MF_LL2_NON_UNICAST);
if (QED_IS_BB(p_hwfn->cdev)) if (QED_IS_BB(p_hwfn->cdev))
p_hwfn->cdev->mf_bits |= BIT(QED_MF_NEED_DEF_PF); cdev->mf_bits |= BIT(QED_MF_NEED_DEF_PF);
break; break;
} }
DP_INFO(p_hwfn, "Multi function mode is 0x%lx\n",
cdev->mf_bits);
}
DP_INFO(p_hwfn, "Multi function mode is 0x%lx\n", DP_INFO(p_hwfn, "Multi function mode is 0x%lx\n",
p_hwfn->cdev->mf_bits); p_hwfn->cdev->mf_bits);
/* Read Multi-function information from shmem */ /* Read device capabilities information from shmem */
addr = MCP_REG_SCRATCH + nvm_cfg1_offset + addr = MCP_REG_SCRATCH + nvm_cfg1_offset +
offsetof(struct nvm_cfg1, glob) + offsetof(struct nvm_cfg1, glob) +
offsetof(struct nvm_cfg1_glob, device_capabilities); offsetof(struct nvm_cfg1_glob, device_capabilities);
......
...@@ -346,6 +346,11 @@ int qed_sp_pf_start(struct qed_hwfn *p_hwfn, ...@@ -346,6 +346,11 @@ int qed_sp_pf_start(struct qed_hwfn *p_hwfn,
p_ramrod->outer_tag_config.outer_tag.tci = p_ramrod->outer_tag_config.outer_tag.tci =
cpu_to_le16(p_hwfn->hw_info.ovlan); cpu_to_le16(p_hwfn->hw_info.ovlan);
if (test_bit(QED_MF_8021AD_TAGGING, &p_hwfn->cdev->mf_bits)) {
p_ramrod->outer_tag_config.outer_tag.tpid = ETH_P_8021AD;
p_ramrod->outer_tag_config.enable_stag_pri_change = 1;
}
/* Place EQ address in RAMROD */ /* Place EQ address in RAMROD */
DMA_REGPAIR_LE(p_ramrod->event_ring_pbl_addr, DMA_REGPAIR_LE(p_ramrod->event_ring_pbl_addr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment