From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrfeehgdefiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhho mhgrshesmhhonhhjrghlohhnrdhnvghtnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: 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 To: Adrien Mazarguil Cc: dev@dpdk.org, Gaetan Rivet , Ferruh Yigit , David Marchand , 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-dev] [PATCH v2] net/failsafe: fix source port ID in Rx packets 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: Thu, 18 Apr 2019 15:39:40 -0000 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 > Reviewed-by: David Marchand > Acked-by: Gaetan Rivet > -- > 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? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 2395DA00E6 for ; Thu, 18 Apr 2019 17:39:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 25ED11BBEC; Thu, 18 Apr 2019 17:39:42 +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: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrfeehgdefiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhho mhgrshesmhhonhhjrghlohhnrdhnvghtnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: 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 To: Adrien Mazarguil Cc: dev@dpdk.org, Gaetan Rivet , Ferruh Yigit , David Marchand , 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="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2] net/failsafe: fix source port ID in Rx packets 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190418153937.eqiAfaTXHgZD2mIJIQkExtB4Y7ifuSFAmm-8LTgbnv4@z> 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 > Reviewed-by: David Marchand > Acked-by: Gaetan Rivet > -- > 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?