From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3chas3@gmail.com> Received: from mail-it0-f53.google.com (mail-it0-f53.google.com [209.85.214.53]) by dpdk.org (Postfix) with ESMTP id 0C57E1C79B for ; Fri, 6 Apr 2018 16:59:02 +0200 (CEST) Received: by mail-it0-f53.google.com with SMTP id b5-v6so2346676itj.1 for ; Fri, 06 Apr 2018 07:59:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=pHTGjR8hcDT+EsKvc18V/+e+a6g7OtruoqmOyaIZaP4=; b=VKkyUHkiJ0CmYgoIVLikNIFT4nA7tQnRlYWxPjOGa8UOFiI4P2HUf8RGLAJmgmk9OX 4Ow8ZJ0W7Tb5gzWu3NmzRhA1+EsslGefDmIr7Lq9NJT0S9OnPKNr695RVz/73tWo1ZV+ lWqHkPc+MGUD7reWc6rvl0nTSCTgpZqJ5CmDvO4W8ga4AiU8pSTWpFc6cGFMXxFOAupu WaDqhG1zqw+FqwmZtB2zN+PSS52NDz7LCIf4143dCaKZT4MkwL85EkAcXJlPC8d4PQ5s YgvfmOaDaFuIFqErauaIqnhSWlQmmZ5Am3+u/vDeWlXaYNeo0g9EU6tkzaWLPVO/9xDZ euQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=pHTGjR8hcDT+EsKvc18V/+e+a6g7OtruoqmOyaIZaP4=; b=EClO3en22OTwLRnyW0h/ER9tfij0n55wYqDzsDy1WvEORzqHGqaKz+6cokkUAmGiKZ xqV+lfcwCgrqb0fUGlfCJDvkq3CIy+CSlwi3P4/3COuknNO4MFi7kH7nrRLPBm93VFc1 qj9qkvTdOh3XtdEFwly7CGbiIiJbgzZVOxgRPpjguAu9TDjGKbTv3P1LlMRGKywZLQGb NjtJmR3sS53+No07J/sg7HUsfP3LBnG+B2AhgQZSUu/hJD+EATJRvX/ZPI4TsPlUxyeP qzAp3mDlRyYx2m0t3rAFYfbTx9k3gmXeAImhigCOyUyCViPNQ1Lbgtha5REsMZmvpJJi NU8g== X-Gm-Message-State: ALQs6tCA+zLJUi3PP/QaquTZw0pGLZN4R2WawBWJ7qpgbo9ZWiYr1ayp gaDgQzD57hCUIs5KGRRqlI/nvhAkZ5yaVCVe/T4= X-Google-Smtp-Source: AIpwx4+cGOCScoUg/bAvyORrx21yrDbxkvCohA9AZOgo/++V0Hb1rdttXrtUd8BQtQWyR6c3oiIrJJe9lPNTqswE0m4= X-Received: by 2002:a24:2289:: with SMTP id o131-v6mr17623288ito.95.1523026741214; Fri, 06 Apr 2018 07:59:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.2.8 with HTTP; Fri, 6 Apr 2018 07:59:00 -0700 (PDT) In-Reply-To: References: <20180213225618.15693-1-3chas3@gmail.com> <039ED4275CED7440929022BC67E7061153177875@SHSMSX103.ccr.corp.intel.com> <039ED4275CED7440929022BC67E7061153177B93@SHSMSX103.ccr.corp.intel.com> From: Chas Williams <3chas3@gmail.com> Date: Fri, 6 Apr 2018 10:59:00 -0400 Message-ID: To: "Zhang, Helin" Cc: "Zhang, Qi Z" , "dev@dpdk.org" , "Lu, Wenzhuo" , "Ananyev, Konstantin" , "Charles (Chas) Williams" Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: update data->eth_link status on start 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: Fri, 06 Apr 2018 14:59:02 -0000 On Fri, Apr 6, 2018 at 10:52 AM, Zhang, Helin wrote: > > >> -----Original Message----- >> From: Chas Williams [mailto:3chas3@gmail.com] >> Sent: Monday, April 2, 2018 9:57 PM >> To: Zhang, Qi Z >> Cc: Zhang, Helin; dev@dpdk.org; Lu, Wenzhuo; Ananyev, Konstantin; Charles >> (Chas) Williams >> Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: update data->eth_link status on >> start >> >> On Mon, Apr 2, 2018 at 9:45 AM, Zhang, Qi Z wrote: >> > >> > >> >> -----Original Message----- >> >> From: Chas Williams [mailto:3chas3@gmail.com] >> >> Sent: Monday, April 2, 2018 9:38 PM >> >> To: Zhang, Qi Z >> >> Cc: Zhang, Helin ; dev@dpdk.org; Lu, Wenzhuo >> >> ; Ananyev, Konstantin >> >> ; Charles (Chas) Williams >> >> >> >> Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: update data->eth_link >> >> status on start >> >> >> >> On Mon, Apr 2, 2018 at 8:40 AM, Zhang, Qi Z wrote: >> >> > Hi Williams: >> >> > >> >> >> -----Original Message----- >> >> >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Chas Williams >> >> >> Sent: Saturday, March 31, 2018 1:22 AM >> >> >> To: Zhang, Helin >> >> >> Cc: dev@dpdk.org; Lu, Wenzhuo ; Ananyev, >> >> >> Konstantin ; Charles (Chas) Williams >> >> >> >> >> >> Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: update data->eth_link >> >> >> status on start >> >> >> >> >> >> On Fri, Mar 30, 2018 at 12:30 PM, Zhang, Helin >> >> >> >> >> >> wrote: >> >> >> > >> >> >> > >> >> >> >> -----Original Message----- >> >> >> >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Chas >> >> >> >> Williams >> >> >> >> Sent: Wednesday, February 14, 2018 6:56 AM >> >> >> >> To: dev@dpdk.org >> >> >> >> Cc: Lu, Wenzhuo; Ananyev, Konstantin; Charles (Chas) Williams >> >> >> >> Subject: [dpdk-dev] [PATCH] net/ixgbe: update data->eth_link >> >> >> >> status on start >> >> >> >> >> >> >> >> From: "Charles (Chas) Williams" >> >> >> >> >> >> >> >> dev->data->eth_link isn't updated until the first interrupt. >> >> >> >> dev->data->If a >> >> >> >> link is carrier down, then this interrupt may never happen. >> >> >> >> Before we finished starting the PMD, call >> >> >> >> ixgbe_dev_link_update() to ensure we >> >> >> have a valid status. >> >> >> >> >> >> >> >> Signed-off-by: Chas Williams >> >> >> >> --- >> >> >> >> drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++++ >> >> >> >> 1 file changed, 4 insertions(+) >> >> >> >> >> >> >> >> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c >> >> >> >> b/drivers/net/ixgbe/ixgbe_ethdev.c >> >> >> >> index 37eb668..27d29dc 100644 >> >> >> >> --- a/drivers/net/ixgbe/ixgbe_ethdev.c >> >> >> >> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c >> >> >> >> @@ -2666,6 +2666,8 @@ ixgbe_dev_start(struct rte_eth_dev *dev) >> >> >> >> if (err) >> >> >> >> goto error; >> >> >> >> >> >> >> >> + ixgbe_dev_link_update(dev, 0); >> >> >> > It is called in rte_eth_dev_start() if lsc is not enabled, and >> >> >> > it is not needed here to avoid any duplication. >> >> >> > BTW, did you see any issue or just check the code? Thanks! >> >> >> >> >> >> Yes, I see an issue with bonding. If LSC is enabled, then >> >> >> link_status isn't set until the first interrupt to update the link >> >> >> status. If a link is down, this interrupt may never happen result >> >> >> in >> >> link_status being somewhat undefined. >> >> > >> >> > Is your issue only happened on VF? >> >> > For PF, I saw ixgbe_check_link is called at ixgbe_dev_start, so >> >> > link status is >> >> assume be updated. >> >> > If you think it is just missed in VF, can you implemented this in >> >> > the similar way >> >> as PF? >> >> >> >> No, I don't believe it's isolated to VF. ixgbe_check_link() doesn't >> >> update (atomically write) the dev->data->dev_link. After >> >> .dev_start() finishes, I need the link_status of the adapter to be set. >> > >> > I saw dev_link.link_status does be updated. >> > err = ixgbe_check_link(hw, &speed, &link_up, 0); >> > if (err) >> > goto error; >> > dev->data->dev_link.link_status = link_up; >> >> That doesn't fill in link_duplex, link_speed, or link_autoneg. >> 802.3ad requires that all the ports of >> the same bonding group have the same speed and duplex. I need to be able to >> check the speed and the duplex at least (and autoneg as well). > I am thinking it might be a bit late to update the link status in dev_start(), and we > need to check if the full link update should be done in eth_ixgbe_dev_init() and > eth_ixgbevf_dev_init(). > @Qi, Chas, could you help to check if my idea is correct? > Also I think this applies to other PMDs, e.g. igb, i40e. At least we need to double check. I don't think link_status needs updated sooner unless you think there is some path in the PMDs that need to check the link status. I am not aware of anything like that in the Intel PMDs (but certainly not an expert in their behavior). Since the DPDK API is inherently single-threaded there's no external reason to have the link status updated until just before .dev_start() finishes. > > Regards, > Helin > >> >> > >> >> I can't wait until I hope the first >> >> interrupt has happened that would update >> >> dev->data->dev_link. How long would I wait? I don't really care if >> >> the link is down, >> >> or up, or whatever, but it can't be partially filled in. Bonding (in >> >> 802.3ad) wants the >> >> links to be similarly configured. >> >> >> >> > >> >> > Regards >> >> > Qi >> >> > >> >> >> >> >> >> > >> >> >> > /Helin >> >> >> > >> >> >> >> + >> >> >> >> skip_link_setup: >> >> >> >> >> >> >> >> if (rte_intr_allow_others(intr_handle)) { @@ -5033,6 >> >> >> >> +5035,8 @@ ixgbevf_dev_start(struct rte_eth_dev *dev) >> >> >> >> >> >> >> >> ixgbevf_dev_rxtx_start(dev); >> >> >> >> >> >> >> >> + ixgbevf_dev_link_update(dev, 0); >> >> >> >> + >> >> >> >> /* check and configure queue intr-vector mapping */ >> >> >> >> if (rte_intr_cap_multiple(intr_handle) && >> >> >> >> dev->data->dev_conf.intr_conf.rxq) { >> >> >> >> -- >> >> >> >> 2.9.5 >> >> >> >