From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6EF11A0542 for ; Fri, 7 Feb 2020 16:14:00 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 46CB71C130; Fri, 7 Feb 2020 16:14:00 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 359E21C197 for ; Fri, 7 Feb 2020 16:13:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581088437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QTfss0k/Grx4+s4cdnzIfoIaSfThJL3k3Qwfxw3xzIA=; b=YNGkkT9mwPePETbVppeyRPp8gbn1BikgH8IO+UxVJzvByI07SQ2J/U9rVG65+Ksxsa4T4a t77YqC/uy4I4EaIcp6wRqzoxet+qdsC7F9ZjEprbIi+jZFRqXE/6eo/brzcUZhDkiWsdDJ 59QPWlojEfXYgd4fW7eAdX+FatK943Q= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-8-gMFtxqyLPk2a9TQbF7RPFQ-1; Fri, 07 Feb 2020 10:13:41 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C79171005F73; Fri, 7 Feb 2020 15:13:39 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7172F10016DA; Fri, 7 Feb 2020 15:13:38 +0000 (UTC) From: Kevin Traynor To: Lunyuan Cui Cc: Xiaolong Ye , Konstantin Ananyev , dpdk stable Date: Fri, 7 Feb 2020 15:12:30 +0000 Message-Id: <20200207151248.29804-18-ktraynor@redhat.com> In-Reply-To: <20200207151248.29804-1-ktraynor@redhat.com> References: <20200207151248.29804-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: gMFtxqyLPk2a9TQbF7RPFQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/ixgbe: fix link up in FreeBSD' has been queued to LTS release 18.11.7 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/13/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasi= ng (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/7224d8b173a814aedf= a59fa4fcd17479c7de739f Thanks. Kevin. --- >From 7224d8b173a814aedfa59fa4fcd17479c7de739f Mon Sep 17 00:00:00 2001 From: Lunyuan Cui Date: Mon, 16 Dec 2019 02:24:18 +0000 Subject: [PATCH] net/ixgbe: fix link up in FreeBSD [ upstream commit ba7b12dd64e4e08f52ce9dd62f7c52f6fc455e10 ] In FreeBSD environment, nic_uio drivers do not support interrupts, rte_intr_callback_register() will fail to register interrupts. We cannot make link status to change from down to up by interrupt callback. So we need to wait for the controller to acquire link when ports start. Through multiple tests, 5s should be enough. Fixes: b9bd0f09fa15 ("ethdev: fix link status query") Signed-off-by: Lunyuan Cui Acked-by: Xiaolong Ye Acked-by: Konstantin Ananyev --- drivers/net/ixgbe/ixgbe_ethdev.c | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_eth= dev.c index 2092051940..fc7fc68120 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -375,4 +375,5 @@ static int ixgbe_dev_udp_tunnel_port_del(struct rte_eth= _dev *dev, static int ixgbe_filter_restore(struct rte_eth_dev *dev); static void ixgbe_l2_tunnel_conf(struct rte_eth_dev *dev); +static int ixgbe_wait_for_link_up(struct ixgbe_hw *hw); =20 /* @@ -2832,4 +2833,9 @@ skip_link_setup: =09=09=09 "before starting the port"); =20 +=09/* wait for the controller to acquire link */ +=09err =3D ixgbe_wait_for_link_up(hw); +=09if (err) +=09=09goto error; + =09/* =09 * Update link status right before return, because it may @@ -4079,4 +4085,34 @@ ixgbe_dev_setup_link_alarm_handler(void *param) } =20 +/* + * In freebsd environment, nic_uio drivers do not support interrupts, + * rte_intr_callback_register() will fail to register interrupts. + * We can not make link status to change from down to up by interrupt + * callback. So we need to wait for the controller to acquire link + * when ports start. + * It returns 0 on link up. + */ +static int +ixgbe_wait_for_link_up(struct ixgbe_hw *hw) +{ +#ifdef RTE_EXEC_ENV_FREEBSD +=09const int nb_iter =3D 25; +#else +=09const int nb_iter =3D 0; +#endif +=09int err, i, link_up =3D 0; +=09uint32_t speed =3D 0; + +=09for (i =3D 0; i < nb_iter; i++) { +=09=09err =3D ixgbe_check_link(hw, &speed, &link_up, 0); +=09=09if (err) +=09=09=09return err; +=09=09if (link_up) +=09=09=09return 0; +=09=09msec_delay(200); +=09} +=09return 0; +} + /* return 0 means link status changed, -1 means not changed */ int --=20 2.21.1 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092020-02-07 15:08:18.460363007 +0000 +++ 0018-net-ixgbe-fix-link-up-in-FreeBSD.patch=092020-02-07 15:08:17.52606= 2790 +0000 @@ -1 +1 @@ -From ba7b12dd64e4e08f52ce9dd62f7c52f6fc455e10 Mon Sep 17 00:00:00 2001 +From 7224d8b173a814aedfa59fa4fcd17479c7de739f Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit ba7b12dd64e4e08f52ce9dd62f7c52f6fc455e10 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index a3f550c534..fba8c51595 100644 +index 2092051940..fc7fc68120 100644 @@ -26 +27 @@ -@@ -379,4 +379,5 @@ static int ixgbe_dev_udp_tunnel_port_del(struct rte_et= h_dev *dev, +@@ -375,4 +375,5 @@ static int ixgbe_dev_udp_tunnel_port_del(struct rte_et= h_dev *dev, @@ -32 +33 @@ -@@ -2802,4 +2803,9 @@ skip_link_setup: +@@ -2832,4 +2833,9 @@ skip_link_setup: @@ -42 +43 @@ -@@ -4115,4 +4121,34 @@ ixgbe_dev_setup_link_alarm_handler(void *param) +@@ -4079,4 +4085,34 @@ ixgbe_dev_setup_link_alarm_handler(void *param)