[dpdk-dev,12/61] net/qede/base: use default mtu from shared memory
Checks
Commit Message
Read and use the default mtu value from shared-memory.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/ecore.h | 2 ++
drivers/net/qede/base/ecore_dev.c | 3 +++
drivers/net/qede/base/ecore_mcp.c | 10 ++++++++++
drivers/net/qede/base/ecore_mcp_api.h | 2 ++
drivers/net/qede/qede_if.h | 1 +
drivers/net/qede/qede_main.c | 2 ++
6 files changed, 20 insertions(+)
@@ -377,6 +377,8 @@ struct ecore_hw_info {
/* Default DCBX mode */
u8 dcbx_mode;
+
+ u16 mtu;
};
struct ecore_hw_cid_data {
@@ -2887,6 +2887,9 @@ static void ecore_hw_info_port_num(struct ecore_hwfn *p_hwfn,
ecore_get_num_funcs(p_hwfn, p_ptt);
+ if (ecore_mcp_is_init(p_hwfn))
+ p_hwfn->hw_info.mtu = p_hwfn->mcp_info->func_info.mtu;
+
/* In case of forcing the driver's default resource allocation, calling
* ecore_hw_get_resc() should come after initializing the personality
* and after getting the number of functions, since the calculation of
@@ -1432,6 +1432,16 @@ enum _ecore_status_t ecore_mcp_fill_shmem_func_info(struct ecore_hwfn *p_hwfn,
info->ovlan = (u16)(shmem_info.ovlan_stag & FUNC_MF_CFG_OV_STAG_MASK);
+ info->mtu = (u16)shmem_info.mtu_size;
+
+ if (info->mtu == 0)
+ info->mtu = 1500;
+
+ info->mtu = (u16)shmem_info.mtu_size;
+
+ if (info->mtu == 0)
+ info->mtu = 1500;
+
DP_VERBOSE(p_hwfn, (ECORE_MSG_SP | ECORE_MSG_IFUP),
"Read configuration from shmem: pause_on_host %02x"
" protocol %02x BW [%02x - %02x]"
@@ -84,6 +84,8 @@ struct ecore_mcp_function_info {
#define ECORE_MCP_VLAN_UNSET (0xffff)
u16 ovlan;
+
+ u16 mtu;
};
struct ecore_mcp_nvm_common {
@@ -34,6 +34,7 @@ struct qed_dev_info {
uint32_t flash_size;
uint8_t mf_mode;
bool tx_switching;
+ u16 mtu;
/* To be added... */
};
@@ -365,6 +365,8 @@ static int qed_slowpath_start(struct ecore_dev *edev,
&dev_info->mfw_rev, NULL);
}
+ dev_info->mtu = ECORE_LEADING_HWFN(edev)->hw_info.mtu;
+
return 0;
}