From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 7CF964C57; Mon, 10 Apr 2017 03:10:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491786651; x=1523322651; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=LfrIMAzGnuj+wD69/VPOS44LgbCv5IXY71mIzuULrL4=; b=RC8aKBOZZnZVCw6hGw43Oq/ZVE6z+d9X6R1w3bxs+iVkpVzIzV8ojQu1 dPBtaNb9SfrOTMq+VJzPO9MvyttX8w==; Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Apr 2017 18:10:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,179,1488873600"; d="scan'208";a="1117581982" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.239.129.189]) by orsmga001.jf.intel.com with ESMTP; 09 Apr 2017 18:10:49 -0700 From: Qi Zhang To: ferruh.yigit@intel.com Cc: jingjing.wu@intel.com, helin.zhang@intel.com, dev@dpdk.org, Qi Zhang , stable@dpdk.org Date: Sun, 9 Apr 2017 14:05:05 -0400 Message-Id: <1491761106-26883-3-git-send-email-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491761106-26883-1-git-send-email-qi.z.zhang@intel.com> References: <1491433937-36182-1-git-send-email-qi.z.zhang@intel.com> <1491761106-26883-1-git-send-email-qi.z.zhang@intel.com> Subject: [dpdk-stable] [PATCH v2 2/3] net/i40e: fix wrong VF link speed X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 01:10:52 -0000 When PF notify link speed to VF, encode of link speed need to be converted from ETH_SPEED_XXX to I40E_LINK_SPEED_XXX. Fixes: bb6722fb5c0e ("net/i40e: fix VF bonded device link down") Cc: stable@dpdk.org Signed-off-by: Qi Zhang --- v2: - fix checkpatch warning. drivers/net/i40e/i40e_pf.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index 5dcda4d..1db1f25 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -1188,8 +1188,33 @@ i40e_notify_vf_link_status(struct rte_eth_dev *dev, struct i40e_pf_vf *vf) event.event = I40E_VIRTCHNL_EVENT_LINK_CHANGE; event.event_data.link_event.link_status = dev->data->dev_link.link_status; - event.event_data.link_event.link_speed = - (enum i40e_aq_link_speed)dev->data->dev_link.link_speed; + + /* need to convert the ETH_SPEED_xxx into I40E_LINK_SPEED_xxx */ + switch (dev->data->dev_link.link_speed) { + case ETH_SPEED_NUM_100M: + event.event_data.link_event.link_speed = I40E_LINK_SPEED_100MB; + break; + case ETH_SPEED_NUM_1G: + event.event_data.link_event.link_speed = I40E_LINK_SPEED_1GB; + break; + case ETH_SPEED_NUM_10G: + event.event_data.link_event.link_speed = I40E_LINK_SPEED_10GB; + break; + case ETH_SPEED_NUM_20G: + event.event_data.link_event.link_speed = I40E_LINK_SPEED_20GB; + break; + case ETH_SPEED_NUM_25G: + event.event_data.link_event.link_speed = I40E_LINK_SPEED_25GB; + break; + case ETH_SPEED_NUM_40G: + event.event_data.link_event.link_speed = I40E_LINK_SPEED_40GB; + break; + default: + event.event_data.link_event.link_speed = + I40E_LINK_SPEED_UNKNOWN; + break; + } + i40e_pf_host_send_msg_to_vf(vf, I40E_VIRTCHNL_OP_EVENT, I40E_SUCCESS, (uint8_t *)&event, sizeof(event)); } -- 2.7.4