From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id 9F170A00E6
	for <public@inbox.dpdk.org>; Thu, 18 Apr 2019 17:39:44 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 71B061BBF5;
	Thu, 18 Apr 2019 17:39:44 +0200 (CEST)
Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com
 [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 7EF041BBEA;
 Thu, 18 Apr 2019 17:39:40 +0200 (CEST)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailout.nyi.internal (Postfix) with ESMTP id 0D2D2281B6;
 Thu, 18 Apr 2019 11:39:40 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute1.internal (MEProxy); Thu, 18 Apr 2019 11:39:40 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding:content-type; s=mesmtp;
 bh=2WZUrdrsmerovarzUbp6Lct3FwnmS30Db1bK78OGbK0=; b=cmqBEKvtc9rA
 bO4bVcESNNVLjqtMj6Y/s5I941cw5sa/KUEsOcaTicg59bQIjW0JgEanjpDihGX9
 xDVYP5QO0Gn3SekKFYKdYNOAFC/F5cwlbUzbnzQ9Jcd9oLN6NDT7KS6+Nyg6sMQU
 xu/nlPZCT3/41wOQrF81E8kKF/2cAJo=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm2; bh=2WZUrdrsmerovarzUbp6Lct3FwnmS30Db1bK78OGb
 K0=; b=jPgqnMIsKRGuG4ju4EaZ0tBQR4+lHhovI9n9Si6THMZ6bIIRFEBw17YJ8
 g/gaWPlqxLjDsPhTibng7y+jj1TjIA83Sx0UsSYaFTa2JhNvL9ZWqEqHgdPV7Zd9
 5vbrTHA8gJ2H0zmfyHj9X/ianHWAitJttN6xB8fL7HojMA4Qf2wU/qWUS11Rp30q
 upcgVopZ6WgAi9ZwiBbmrG7bVT/i6GluGo14cHj/G0eLQOa+0IAqaNECiziw0sfg
 0x4H1bpAAKJu1A5Kbd+JW1bDgCTkd92peQajKG1IfPKc1uBN11ZiUkVYF3knqPpZ
 33TgkDEQUGT7z63BAJiFPRJ9/HrRw==
X-ME-Sender: <xms:O5q4XHvSFQH9VZ_20Lc0-LNxqoq-d1mM5Rwoc9s5D8ecqb0g8pdDRA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrfeehgdefiecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs
 ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph
 epjeejrddufeegrddvtdefrddukeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhho
 mhgrshesmhhonhhjrghlohhnrdhnvghtnecuvehluhhsthgvrhfuihiivgeptd
X-ME-Proxy: <xmx:O5q4XBgWOB78emkA2koFKuKo4qVRRgbzPLkb7grmi4ahTHhot2PxtQ>
 <xmx:O5q4XD1VR3Sv3F6s4hI96DowHg_N1-AK850GSVw0CBKidGqxR1l9Qw>
 <xmx:O5q4XB-YEjQVx9gaO-wbu0rcbJCQ8fR7zeSRfJ1cyYOlYFfg8RC8xw>
 <xmx:PJq4XMgv95ovFPgIFJ0r_jptZEiv9aRoWJBe3heObvogjaBsCWvFtA>
Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id 55215103D5;
 Thu, 18 Apr 2019 11:39:38 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Cc: dev@dpdk.org, Gaetan Rivet <gaetan.rivet@6wind.com>,
 Ferruh Yigit <ferruh.yigit@intel.com>,
 David Marchand <david.marchand@redhat.com>, stable@dpdk.org
Date: Thu, 18 Apr 2019 17:39:37 +0200
Message-ID: <8815526.EAVJVpUmGC@xps>
In-Reply-To: <20190418152229.13554-1-adrien.mazarguil@6wind.com>
References: <20190418130419.25675-1-adrien.mazarguil@6wind.com>
 <20190418152229.13554-1-adrien.mazarguil@6wind.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2] net/failsafe: fix source
	port ID in Rx packets
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org
Sender: "stable" <stable-bounces@dpdk.org>

18/04/2019 17:32, Adrien Mazarguil:
> When passed to the application, Rx packets retain the port ID value
> originally set by slave devices. Unfortunately these IDs have no meaning to
> applications, which are typically unaware of their existence.
> 
> This confuses those caring about the source port field in mbufs (m->port)
> which experience issues ranging from traffic drop to crashes.
> 
> Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> Reviewed-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
> --
> v2 changes:
> 
> Modified "rxq->priv->dev->data->port_id" (v18.11-style) to
> "rxq->priv->data->port_id" (since v19.05) and checked compilation against
> master this time.
> 
> Given the limited scope of that change, reviewed-by/acked-by lines were
> kept.
> ---
> +/*
> + * Override source port in Rx packets.
> + *
> + * Make Rx packets originate from this PMD instance instead of one of its
> + * slaves. This is mandatory to avoid breaking applications.

"slave" is a wording from bonding.
In failsafe, it is sub-device, isn't it?

> + */
> +static void
> +failsafe_rx_set_port(struct rte_mbuf **rx_pkts, uint16_t nb_pkts, uint16_t port)
> +{
> +	unsigned int i;
> +
> +	for (i = 0; i != nb_pkts; ++i)
> +		rx_pkts[i]->port = port;
> +}
> +
>  uint16_t
>  failsafe_rx_burst(void *queue,
>  		  struct rte_mbuf **rx_pkts,
> @@ -87,6 +102,9 @@ failsafe_rx_burst(void *queue,
>  		sdev = sdev->next;
>  	} while (nb_rx == 0 && sdev != rxq->sdev);
>  	rxq->sdev = sdev;
> +	if (nb_rx)
> +		failsafe_rx_set_port(rx_pkts, nb_rx,
> +				     rxq->priv->data->port_id);
>  	return nb_rx;
>  }

I'm afraid the performance drop to be hard.
How the port id in mbuf is used exactly? What crash are you seeing?