From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpbg65.qq.com (smtpbg65.qq.com [103.7.28.233]) by dpdk.org (Postfix) with ESMTP id E0E6F1B025 for ; Mon, 21 May 2018 14:58:24 +0200 (CEST) X-QQ-mid: bizesmtp5t1526907498t0a56xwpd Received: from air5005.lan (unknown [113.116.53.132]) by esmtp4.qq.com (ESMTP) with id ; Mon, 21 May 2018 20:58:17 +0800 (CST) X-QQ-SSF: 01100000002000F0F560000A0000000 X-QQ-FEAT: lm51M56XDGwqqfIC7wOV+EFc30Ej0b1lkAtaVH0vEgbrlHI/7T4FikCRIrJdR PckdLf0n51WToe+CKOKIy+zBNZQ78YQgz69kUcsoUMDEGGda008L2f1jTGTUk5V3ON09Rpu HkhyY7gUEHXJdEj7MGQqXQO/iXdrgJGnGCBsOTbLIQp2zMa5RrHmQaex/iQLL4aOU9qg/2g 8t6HRKK0DOAubU/WF09w9acOVHJaF67cyMwBOq31ciSjy3Nb694fv3A/GTpfHGh05gamV7Y RsapyJP38vxdbIIKYMo4XoKMrLjIl+zH0u0UFh2J6bCbNQtVvyzmOZZMQ= X-QQ-GoodBg: 0 From: yaochuhong To: shijith.thotton@cavium.com Cc: dev@dpdk.org, yaochuhong Date: Mon, 21 May 2018 20:58:15 +0800 Message-Id: <1526907495-120095-1-git-send-email-ych@panath.cn> X-Mailer: git-send-email 1.8.3.1 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:panath.cn:qybgforeign:qybgforeign4 X-QQ-Bgrelay: 1 Subject: [dpdk-dev] [PATCH] net/liquidio:Fix Unable to update lio_dev->linfo.link var X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2018 12:58:28 -0000 When I was using VPP +dpdk-18.02+liqudio CN23xx, I encountered such a bug. \n When VPP called dpdk_device_start to initialize DPDK liqudio drive, I found that initialization failed. \n The reason for the failure is that VF MTU > PF MTU, but PF MTU has been modified to 9600 (> VF MTU). \n Finally, I am location that DPDK liqudio drive cannot get the correct PF driver to liqudio network card. \n It is due to the fact that when VPP calls dpdk_device_start to initialize DPDK liqudio drive, \n this time, lio_dev->linfo. Link var already exists in the old value, not empty. \n Cause lio_dev - > linfo. Link. Link_status64 != 0 statement is set up, \n and the link info is stopped directly to liqudio card, resulting in no get accurate pf mtu. \n I did a test model to reproduce the bug, which is to add rte_eth_dev_set_mtu(portid, vf_mtu) \n to the rte_eth_dev_start function when using dpdk-18.02+liqudio CN23xx+l2fwd. \n You need to make sure that 1500 < vf_mtu < pf_mtu will be available. \n At this time, you will have net_liovf[04:00.3]ERROR: lio_dev_mtu_set() VF MTU should be >= 68 and <= 1500. Such a mistake. \n ps:I am a novice git. Please understand the trouble caused by this. Signed-off-by: yaochuhong --- drivers/net/liquidio/lio_ethdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index 0e0b5d8..50743c7 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -1405,6 +1405,9 @@ struct rte_lio_xstats_name_off { /* Configure RSS if device configured with multiple RX queues. */ lio_dev_mq_rx_configure(eth_dev); + /* Before update the link info, must set linfo.link.link_status64 to 0. */ + lio_dev->linfo.link.link_status64 = 0; + /* start polling for lsc */ ret = rte_eal_alarm_set(LIO_LSC_TIMEOUT, lio_sync_link_state_check, -- 1.8.3.1