From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 4CB981B5F9 for ; Thu, 2 Nov 2017 15:16:37 +0100 (CET) Received: by mail-wm0-f68.google.com with SMTP id p75so11434135wmg.3 for ; Thu, 02 Nov 2017 07:16:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=KS/DqSAZI+mT/2AFV3j2h5hPSBOHl9koE/qkflKqZEg=; b=PqhlNYcRoAoPpBX0EaUIGgUmUNEDuYqIaT9mB09GrCnNoAH4SapiLDqpWIJQulI0FZ wrZ/HvgsNJIxb3RJ46Rgt699zasItcbukOiXPDyMnde0HI4VWhNrOf47rS8+qBlmwxMJ Euq4x5LmtgdiIYoBa8IZ2rMKoqUgrsl7v0hq+p6momYO+ca1PEmH40Deg7pqaeHqqKBW +hb+5tLsfbwUVGnSRFvup0zpq0ilyGYemH7XuylbW10GFsUgisCdu/jzmCHZfgYgpMzk BjqP649SztE05APGitJbngBm/j/inXOSfBBZU6I1tYF+t80ltEkHSf7aA/lqqaJzhqL6 hsOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=KS/DqSAZI+mT/2AFV3j2h5hPSBOHl9koE/qkflKqZEg=; b=prYvZ1izqk3+hFxJVBA28KgtSDM+/ECttoXO9DyRsQGCzTZhfB3xopos7cvK8pmgbO CVFvVZZyyv2N3xJoCcZzQDTmVwM4BqZYCvP9zVzJY8JLfIVuNsiotT2XM7ehgqrjfZZD YnQC/PAYS6OCsEhYdvdazCLhEtR0V93/EheOgLPljQbbzuxn6u7rTkI4hNmGAaovIrQx fB8nTfDos7T9T/yNN5dp+0EtAKYK4OOztM7/Wbb5U9EJthl/DJ+vO0x8ksajMLjX1Ygl JxJSRcrOApr6WXrfDMTPxH4+fpTIgLSCrE/1rwGm08dIwco8i/IAkUg4zMn/SDO5q/eG N/Dw== X-Gm-Message-State: AMCzsaWxk39tzOSno4yCbEUTLJpqernM0TjrgMDW1QqETF+rMth3l8i3 IHhrqm8QB9jELNhiTk9bzmrzuQ== X-Google-Smtp-Source: ABhQp+RSAERlDV1RkKUXjuh5tBLe60UZzPbuFLvqp/8v/E3fv6idxQrGdBgvmo2ZyIbH70LiySilIg== X-Received: by 10.80.213.214 with SMTP id g22mr4579678edj.277.1509632196510; Thu, 02 Nov 2017 07:16:36 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id r1sm3209457edm.22.2017.11.02.07.16.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Nov 2017 07:16:35 -0700 (PDT) Date: Thu, 2 Nov 2017 15:16:23 +0100 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Ophir Munk Cc: dev@dpdk.org, Thomas Monjalon , Olga Shern , stable@dpdk.org Message-ID: <20171102141623.GL10890@bidouze.vm.6wind.com> References: <1509567158-15670-1-git-send-email-ophirmu@mellanox.com> <20171102135216.GK10890@bidouze.vm.6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171102135216.GK10890@bidouze.vm.6wind.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-stable] [PATCH v1] net/failsafe: fix VLAN stripping configuration 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: Thu, 02 Nov 2017 14:16:37 -0000 On Thu, Nov 02, 2017 at 02:52:16PM +0100, Gaëtan Rivet wrote: > On Wed, Nov 01, 2017 at 08:12:38PM +0000, Ophir Munk wrote: > > failsafe device has vlan stripping configured at startup however once > > a sub device is found as non-capable of vlan-stripping failsafe > > updates it configuration and removes vlan stripping from it. > > This update occurs only once at startup. Following a later plugin > > attempt and in case of vlan stripping mismatch between failsafe > > configuration and device capability - failsafe cannot recover and the > > device remains constantly in plug out state. > > > > The sequence of events leading to this situation is described as > > follows: > > 1. Start testpmd with failsafe where mlx4 is a sub device (not capable > > of vlan stripping). Expected printout: > > PMD: net_failsafe: Disabling VLAN stripping offload > > 2. Execute: > > testpmd> port stop all > > testpmd> port config all max-pkt-len 2048 > > testpmd> port start all > > 3. Do a plug out (e.g. disable sriov) > > 4. Do a plug in (e.g. enable sriov) > > 5. Expected result: failsafe successfully configures and starts its sub > > devices > > Actual result: failsafe is continuously failing with these messages: > > PMD: net_failsafe: VLAN stripping offload requested but not supported by > > sub_device 0 > > PMD: net_failsafe: device already configured, cannot fix live > > configuration > > PMD: net_failsafe: Unable to synchronize sub device state > > > > Root cause analysis: at startup failsafe removes vlan stripping from its > > configuration. After executing "port config all max-pkt-len 2048" > > testpmd marks failsafe in need for configuration update. > > After executing "port start all" testpmd overrides failsafe > > configuration with its own configuration which includes vlan stripping > > > > Have you tried launching testpmd with the option > > "--disable-hw-vlan" > > as your mlx4 port does not support it? > On a second thought, I think there is a simple solution: The fail-safe should stop trying to be clever with port configuration. On rte_eth_dev_configure, simply apply the user configuration (without trying to detect support and disabling flags on the fly). If a PMD has an issue, it should warn the user. If it has an issue but does not warn, it is a bug for this PMD. This is the case for MLX4: either the PMD changes its behavior, or not, as long as users are fine with it. So a proper fix would be to remove the checks (fs_port_offload_validate and fs_port_disable_offload) and depend on the sub-device for proper configuration vetting. Thoughts? > > During the plugin attempt failsafe refuses to update its configuration > > by removing vlan stripping since it has already updated its > > configuration at startup. > > > > The fix is to remove the limitation of one time configuration at > > startup and allow it during plugin attempts. > > > > Cc: stable@dpdk.org > > Fixes: bbc6a53dda44 ("net/failsafe: support Rx offload capabilities") > > > > Signed-off-by: Ophir Munk > > --- > > The commit message includes bug and fix descriptions > > --- > > drivers/net/failsafe/failsafe_ops.c | 10 ---------- > > 1 file changed, 10 deletions(-) > > > > diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c > > index f460551..953ee65 100644 > > --- a/drivers/net/failsafe/failsafe_ops.c > > +++ b/drivers/net/failsafe/failsafe_ops.c > > @@ -187,16 +187,6 @@ > > continue; > > DEBUG("Checking capabilities for sub_device %d", i); > > while ((capa_flag = fs_port_offload_validate(dev, sdev))) { > > - /* > > - * Refuse to change configuration if multiple devices > > - * are present and we already have configured at least > > - * some of them. > > - */ > > - if (PRIV(dev)->state >= DEV_ACTIVE && > > - PRIV(dev)->subs_tail > 1) { > > - ERROR("device already configured, cannot fix live configuration"); > > - return -1; > > - } > > ret = fs_port_disable_offload(&dev->data->dev_conf, > > capa_flag); > > if (ret) { > > -- > > 1.8.3.1 > > > > -- > Gaëtan Rivet > 6WIND -- Gaëtan Rivet 6WIND