]> git.droids-corp.org - dpdk.git/commitdiff
net/qede/base: allow MTU change
authorHarish Patil <harish.patil@qlogic.com>
Wed, 19 Oct 2016 04:11:31 +0000 (21:11 -0700)
committerBruce Richardson <bruce.richardson@intel.com>
Wed, 26 Oct 2016 17:42:22 +0000 (19:42 +0200)
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 <harish.patil@qlogic.com>
drivers/net/qede/base/ecore_l2.c
drivers/net/qede/base/ecore_l2_api.h
drivers/net/qede/qede_eth_if.c
drivers/net/qede/qede_eth_if.h
drivers/net/qede/qede_rxtx.c

index 5a38ad2eb37627283d27a4106a6068220d48325d..83a62e091a57f1981c84a4f713097501759f29c4 100644 (file)
@@ -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);
 }
 
index 09688eb122b9681859c7c1b1e93c23ab95ae1864..447d1fb0a37152101704e3855f716119d119e860 100644 (file)
@@ -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;
 };
 
 /**
index e108af1f7b50bf00526beb071ab430242a5f2bb8..9855d0e12e37502b04ae0a2733e86ed15384284a 100644 (file)
@@ -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.
index 299a2aa245bd0803940ad435ec21106e6e09efeb..7840a3702e79b1a3f8d44700117c178a7062c69a 100644 (file)
@@ -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 {
index e3409a935e06a1ceee46a4ad1a26b52daed47aec..6973d1c58792592fce5d5b02c6b2c6640b06ead0 100644 (file)
@@ -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;