From: Harish Patil Date: Wed, 19 Oct 2016 04:11:31 +0000 (-0700) Subject: net/qede/base: allow MTU change X-Git-Tag: spdx-start~5449 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=20e961bc9ec983d493c8bf37c64e2a74f10d99b1;p=dpdk.git net/qede/base: allow MTU change Add support to allow MTU change on a deactivated vport in the qede/base driver and the core driver shall utilize the same. Signed-off-by: Harish Patil --- diff --git a/drivers/net/qede/base/ecore_l2.c b/drivers/net/qede/base/ecore_l2.c index 5a38ad2eb3..83a62e091a 100644 --- a/drivers/net/qede/base/ecore_l2.c +++ b/drivers/net/qede/base/ecore_l2.c @@ -427,6 +427,11 @@ ecore_sp_vport_update(struct ecore_hwfn *p_hwfn, ecore_sp_update_accept_mode(p_hwfn, p_ramrod, p_params->accept_flags); ecore_sp_vport_update_sge_tpa(p_hwfn, p_ramrod, p_params->sge_tpa_params); + if (p_params->mtu) { + p_ramrod->common.update_mtu_flg = 1; + p_ramrod->common.mtu = OSAL_CPU_TO_LE16(p_params->mtu); + } + return ecore_spq_post(p_hwfn, p_ent, OSAL_NULL); } diff --git a/drivers/net/qede/base/ecore_l2_api.h b/drivers/net/qede/base/ecore_l2_api.h index 09688eb122..447d1fb0a3 100644 --- a/drivers/net/qede/base/ecore_l2_api.h +++ b/drivers/net/qede/base/ecore_l2_api.h @@ -322,6 +322,10 @@ struct ecore_sp_vport_update_params { struct ecore_rss_params *rss_params; struct ecore_filter_accept_flags accept_flags; struct ecore_sge_tpa_params *sge_tpa_params; + /* MTU change - notice this requires the vport to be disabled. + * If non-zero, value would be used. + */ + u16 mtu; }; /** diff --git a/drivers/net/qede/qede_eth_if.c b/drivers/net/qede/qede_eth_if.c index e108af1f7b..9855d0e12e 100644 --- a/drivers/net/qede/qede_eth_if.c +++ b/drivers/net/qede/qede_eth_if.c @@ -92,6 +92,7 @@ qed_update_vport(struct ecore_dev *edev, struct qed_update_vport_params *params) sp_params.accept_any_vlan = params->accept_any_vlan; sp_params.update_accept_any_vlan_flg = params->update_accept_any_vlan_flg; + sp_params.mtu = params->mtu; /* RSS - is a bit tricky, since upper-layer isn't familiar with hwfns. * We need to re-fix the rss values per engine for CMT. diff --git a/drivers/net/qede/qede_eth_if.h b/drivers/net/qede/qede_eth_if.h index 299a2aa245..7840a3702e 100644 --- a/drivers/net/qede/qede_eth_if.h +++ b/drivers/net/qede/qede_eth_if.h @@ -75,6 +75,7 @@ struct qed_update_vport_params { uint8_t accept_any_vlan; uint8_t update_rss_flg; struct qed_update_vport_rss_params rss_params; + uint16_t mtu; }; struct qed_start_vport_params { diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c index e3409a935e..6973d1c587 100644 --- a/drivers/net/qede/qede_rxtx.c +++ b/drivers/net/qede/qede_rxtx.c @@ -650,6 +650,8 @@ static int qede_start_queues(struct rte_eth_dev *eth_dev, bool clear_stats) /* Prepare and send the vport enable */ memset(&vport_update_params, 0, sizeof(vport_update_params)); + /* Update MTU via vport update */ + vport_update_params.mtu = qdev->mtu; vport_update_params.vport_id = 0; vport_update_params.update_vport_active_flg = 1; vport_update_params.vport_active_flg = 1;