Message ID | 20170316224056.19685-4-yskoh@mellanox.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Ferruh Yigit |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 8AE7269EC; Thu, 16 Mar 2017 23:42:08 +0100 (CET) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0079.outbound.protection.outlook.com [104.47.0.79]) by dpdk.org (Postfix) with ESMTP id 0B9E61396 for <dev@dpdk.org>; Thu, 16 Mar 2017 23:41:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=pBGpRQ1qE5YOq3IDFLf0i2pgJppy+Z8aOTEceECZh7w=; b=InMTcII0IPrk6VOuKb4ti/TfEK0IrlK12/oGYALzWe0qxh5mAsTh6iVFkZf7/HdnVnHnNc68vpJwvZVJVkKSaitYfVaZXXMrQGRCk2Oz4xX2nANqvNr8PcybpZGjuaaj7ynx1pK/iTFj99Ynrn0ryBjcAW/MU9aODgkJ/1wRCg8= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none; intel.com; dmarc=none action=none header.from=mellanox.com; Received: from mellanox.com (12.250.235.110) by VI1PR0501MB2462.eurprd05.prod.outlook.com (10.168.136.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.961.17; Thu, 16 Mar 2017 22:41:14 +0000 From: Yongseok Koh <yskoh@mellanox.com> To: <ferruh.yigit@intel.com> CC: <dev@dpdk.org>, <adrien.mazarguil@6wind.com>, <nelio.laranjeiro@6wind.com>, Yongseok Koh <yskoh@mellanox.com> Date: Thu, 16 Mar 2017 15:40:56 -0700 Message-ID: <20170316224056.19685-4-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170316224056.19685-1-yskoh@mellanox.com> References: <20170316224056.19685-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [12.250.235.110] X-ClientProxiedBy: MWHPR01CA0023.prod.exchangelabs.com (10.168.201.161) To VI1PR0501MB2462.eurprd05.prod.outlook.com (10.168.136.13) X-MS-Office365-Filtering-Correlation-Id: edb9165d-7df7-495f-67b9-08d46cbd8e37 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:VI1PR0501MB2462; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2462; 3:xFU/y0d9FK/hX5MIaH2GwdV+fbJFdpuJgIMdT8kpEw0rM0kCbssIJyewOeJXllXCH2Q5RO+pNkIvUZSWHrGfp0tMsfVg7nj/4/9SXDmCmanjvanztc1d91JGcngJ/Xj/sFe16K+ntdPD4v6/qy0UmhkTjZX9DJaPqvFGPd/vlfGOD58on5RWkLS76Ld+IF7QsK1ZJrE2FyPJ9vwAoMZUgSM4pNeuyGHBSGm7zW1EKrdWfwJvZk/uvEOpW+7Q//m+qEBKWOWwgATBweEzovmi9VCxjbPzNeVEZUhjhP3dVis=; 25:ceyPQW9Egy7mM3HTfyqwebuaBacOswQ9mAaRfj3P4MLPbQZ7CyuOIufnfu/OS7/tTgIZc8kf3PcP3OzL81Vp1LDmgqj5qq5gEU9LZIcitzURPO5Q/fON2KgSkxmA3AJ3FUhayF4al4R9Z+P4omrUvwZOzJ9OY2XAtllEm9P6VBPKEHBmttW+SnBybZrck49cns6x5Au9j0mf6wM9I0chW44utC0bGIN8M6LGpFMow9t2IYMSNfBLdhvJeaWm00D9NC8CB3V7D5aO1EYX/eVyB7/YkLptXTUFp1akY+MlyOXTFJp4D4QAnhAC+zsKLFSHDO28RQiQVi+Ej7p4yB7ylmb8s+EDVL/M+S69Uhz4xOdTqBmA3M/WVM3rHnqHl11q+LCc3FhT26AphVFfhjY5bp9isEmXs0zA/X0B/gINYWkunTTJBNHk4KkwP/0V8Fn+bNv2oGsNbw09rc57A3D7zg== X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2462; 31:mxV/gR7m985FYMkOi1DdyQTcG+4qnNmq5EWcEvOg9GdVTPACfdDYRaQSRoOGHZh93fXuvC3ChgOMk96u3IsQAHpvnO4VmMowX3mWzs4+20vmO0SrAPJMjTfgZPgRVjpnwohjCTIYa84PBslhv5Ex293wfC2FFPZ2zkQfxCnBJ5281h8F59qKFzHAnN4GXbI+eIFGrTksH0o0dudEXW7gMEpvAnMj3hXFtppiwXunVMzQfvdI7EDg7BIMtPuL7YCz; 20:Lp5ukCXPqFEKPz0BzyeKPYZ1w1IW/i0gSF+0kGg5Zh55hUz5OEwYtfnilUujOrqLOId9J425qnnAnZHh9m8owq7lZ4392aovUZwbSY9ZeUrN3EOwLU5CU9IH04N7V3OWvOO6Y8jupb91GjcrwY+ZVgLw9Z7w63xNglZpgz5psd9AMaAHSwvO8l6MEui6nVguR6sc5nRV96r98AAvLVFHs52JBrizxICP+TezABFtucUmi5eRTt7O1OsZIF221nxZBfRxGN1QpU8Lp4MavElGXz/+ZxDhUzjXGM2siAF1aWfLqX5+FMTRK0EuD+YVa43W9Kyq4AkXT6AkhllS2IuRab2hl5tySIUJQ51k8YZ0S8KWUu9kkaxM1w2reCA2vjLbNbJJXGMegcetfbkBLR/b1oLAmrIsfB+fWyI62E7fo0c33DOQJZ+wQ218k6TOHGUNUHSkWaJxPhHfnnY2cdqFa3L0X25PzG2k0bI+HALZZvisFFjGLYe2croJaV/o/Ms2 X-Microsoft-Antispam-PRVS: <VI1PR0501MB2462AEE42172B0F9428F0A2FC3260@VI1PR0501MB2462.eurprd05.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123558025)(20161123564025)(20161123560025)(20161123562025)(20161123555025)(6072148); SRVR:VI1PR0501MB2462; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2462; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2462; 4:ubolhtsdHt7Z9bHKxsheVY30cQsg+cKv4pnJ9u75XRwF9kph+gvpGqvSV/+br6zA0QBnEupDohbIFAVvFR2QbCyJBaObDiOhE/q/e82CJFThlHSeSabp3HKY1kk+FgMLNIHNXyyC24Nurs3AHy1ewbgzNz5GpausaIfs4bwLg8VT519qedRXqrYr/7Dfs38D1vEobrqKlvufZnHZuYPljzNTaKlPJCbaj8ikLxHGi4PqiZNGQCQcDR+oPaqziAGqmVytn/VJ7SwqdaMwyH+LFz2m1V7KSx8MV2O18qjfKZBux4dHtrooeJQy0FFZqfEC6BDjT1MkaYlcm+QBxjUjSfi6C11WuS88sJU6EqnGCu/4pKy1LKgSoLXzoeGkET0TJylDRLgyx6dT3wYOwr+FLz93QQSvI8nLuLlhvklfEIoB2ovzc6Ao9PV86fGkEYlTlvcJu2ODYdY25KxDBv88IvtIEdjNYvrxJ/7FvQwIyoaLL+mCLgSqqfKdXmhBjAAMlzM3rlL0IKCwWOl0wlhBDn49cxi/W/01+XVdd0pSsPArbD1ffgxJdIRhhZ73fxFNnQjXDY79EoVPZ5hzXT7q6oIIe6wFjc49HIsA1AUiLU+dNI/O9vdWujbpGsS2Lwux X-Forefront-PRVS: 024847EE92 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39860400002)(39450400003)(39840400002)(66066001)(6116002)(5660300001)(6666003)(4326008)(54906002)(107886003)(50466002)(110136004)(2906002)(38730400002)(53936002)(81166006)(33646002)(1076002)(55016002)(8676002)(86362001)(2950100002)(7736002)(33026002)(50226002)(76176999)(50986999)(189998001)(25786008)(42186005)(305945005)(47776003)(36756003)(6916009)(5003940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wPc5nXWHs55Bjaa/4HwDl5rAsYlFeXyilRSS6yYDARzpjw== X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2462; 6:yHYSuYsJ5Z0v9TDv8sKE1qjmiDwtXuNEBRnn+saAWv/21gURjue29OXhL64+F25q6FFC9KR4WJBfBSXqNPm/jewPIoXj4umuo8VDD9sXTkgDX2tAzLg2gGLeHg7f8sOnweYY8t/x5qvjhdtHyQPoXTK2m4IkEInJJxlHTw7e2elh9CYzuS1pdwuq+DbYruRAeVLoUZJyDj5pAP4RCdlSoxrj0QWuw3eHFjHaTufNSAKB50NNmnFr4jka74YNYQT7KFxrqigi8tFd9Db+F+QfMi2R+OCpJtdATjPT8//pmtlmxGk2tuC0FdOXKkjRGZincTtxKgAukv4aX8tGgsyFTSdiBX3VYighbSK5qOEMGgtE/k+nNnNHxVZKop4gGxYcqslBW/wTgPecYXZSaCfwPoQOSHewEoCkY38N7F3NrO8=; 5:oKw08LST0osbqrSGo6IVu53iBATd8r5vGA6JtmksdbbS+LwydPEO4zzGM+yKbDhJ1I5KklaZBBnnW/ysgKCTVSoGG3QWZTyiiAQp6Qi5/Ze2UQX9yBbTiXDPHclvMTHicNdv/EutOoJf/aEpfDcm1Q==; 24:U+QBQEAP3k3eOeQJiS6+6PcHoMTLWapsC5uVQnAV1zuzE/a33Hv1K0f0eGyrzkZGuNMyobQqrDTfYHhZoYoZpobKO9sY2sOVrdRoXPQRxVo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2462; 7:S+4cRGBdodmwG+9/e8DTglPyFKf/A07bzRcZdXmJfigSolG0HVRulu6rbAHbQzIeOU+19p0x9y7kd00Lh93w6yiHKszEgsalzFkw3CO6jNotwPlqWBE2k90JOABOSK2T6GcLKjcn+HgqDmN0Yc5lr09uVBcOJ+XdOngRMI7/VtwknnwiAwdPSSck5OWA+SgbSrn7EQ5KVXGgqhZA/MKLiL8TFoBprsWsYKpyQQglu2WEcNMGSM9HQe2VXiC93eE0Gq7g3xUO0WJ+yhfCTP0CQVS3hIpZhPbd0Gl/PlW0Tf8scLBh4CrPiYpiLSycyeQjueE9KFe2PnS0J0GV9pCFPA== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Mar 2017 22:41:14.3686 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2462 Subject: [dpdk-dev] [PATCH 3/3] net/mlx5: rebuild flows on updating RETA X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Checks
Context | Check | Description |
---|---|---|
ci/Intel-compilation | success | Compilation OK |
ci/checkpatch | success | coding style OK |
Commit Message
Yongseok Koh
March 16, 2017, 10:40 p.m. UTC
Currently mlx5_dev_rss_reta_update() just updates tables in the host,
therefore it isn't immediately effective until restarting the device by
calling mlx5_dev_stop()/mlx5_dev_start() to update the changes in the
device side. This patch adds rebuilding the device-specific datastructure
and applying it to the device right away.
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
---
drivers/net/mlx5/mlx5_rss.c | 3 +++
1 file changed, 3 insertions(+)
Comments
On Thu, Mar 16, 2017 at 03:40:56PM -0700, Yongseok Koh wrote: > Currently mlx5_dev_rss_reta_update() just updates tables in the host, > therefore it isn't immediately effective until restarting the device by > calling mlx5_dev_stop()/mlx5_dev_start() to update the changes in the > device side. This patch adds rebuilding the device-specific datastructure > and applying it to the device right away. > > Signed-off-by: Yongseok Koh <yskoh@mellanox.com> > --- > drivers/net/mlx5/mlx5_rss.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c > index 0702f1a63..30e59faa5 100644 > --- a/drivers/net/mlx5/mlx5_rss.c > +++ b/drivers/net/mlx5/mlx5_rss.c > @@ -357,8 +357,11 @@ mlx5_dev_rss_reta_update(struct rte_eth_dev *dev, > int ret; > struct priv *priv = dev->data->dev_private; > > + mlx5_dev_stop(dev); > priv_lock(priv); > ret = priv_dev_rss_reta_update(priv, reta_conf, reta_size); > priv_unlock(priv); > + if (!ret) > + ret = (unsigned int)mlx5_dev_start(dev); > return -ret; > } > -- > 2.11.0 > Hi Yongseok, I don't understand why you need the cast for the returned value of mlx5_dev_start() as it already returns an int and your final variable is also an int. Thanks,
Hi Nelio, On Fri, Mar 17, 2017 at 02:11:43AM -0700, Nélio Laranjeiro wrote: > On Thu, Mar 16, 2017 at 03:40:56PM -0700, Yongseok Koh wrote: > > Currently mlx5_dev_rss_reta_update() just updates tables in the host, > > therefore it isn't immediately effective until restarting the device by > > calling mlx5_dev_stop()/mlx5_dev_start() to update the changes in the > > device side. This patch adds rebuilding the device-specific datastructure > > and applying it to the device right away. > > > > Signed-off-by: Yongseok Koh <yskoh@mellanox.com> > > --- > > drivers/net/mlx5/mlx5_rss.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c > > index 0702f1a63..30e59faa5 100644 > > --- a/drivers/net/mlx5/mlx5_rss.c > > +++ b/drivers/net/mlx5/mlx5_rss.c > > @@ -357,8 +357,11 @@ mlx5_dev_rss_reta_update(struct rte_eth_dev *dev, > > int ret; > > struct priv *priv = dev->data->dev_private; > > > > + mlx5_dev_stop(dev); > > priv_lock(priv); > > ret = priv_dev_rss_reta_update(priv, reta_conf, reta_size); > > priv_unlock(priv); > > + if (!ret) > > + ret = (unsigned int)mlx5_dev_start(dev); > > return -ret; > > } > > -- > > 2.11.0 > > > > Hi Yongseok, > > I don't understand why you need the cast for the returned value of > mlx5_dev_start() as it already returns an int and your final variable is > also an int. For some reason, in mlx5 PMD code, priv_* calls return positive error numbers and corresponding mlx5_* APIs return negative values by adding (-) sign the the return value from priv_* calls. To follow this tacit rule in the existing code, I casted the return value to unsigned. Thanks, Yongseok
On Fri, Mar 17, 2017 at 10:14:56AM -0700, Yongseok Koh wrote: > Hi Nelio, > > On Fri, Mar 17, 2017 at 02:11:43AM -0700, Nélio Laranjeiro wrote: > > On Thu, Mar 16, 2017 at 03:40:56PM -0700, Yongseok Koh wrote: > > > Currently mlx5_dev_rss_reta_update() just updates tables in the host, > > > therefore it isn't immediately effective until restarting the device by > > > calling mlx5_dev_stop()/mlx5_dev_start() to update the changes in the > > > device side. This patch adds rebuilding the device-specific datastructure > > > and applying it to the device right away. > > > > > > Signed-off-by: Yongseok Koh <yskoh@mellanox.com> > > > --- > > > drivers/net/mlx5/mlx5_rss.c | 3 +++ > > > 1 file changed, 3 insertions(+) > > > > > > diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c > > > index 0702f1a63..30e59faa5 100644 > > > --- a/drivers/net/mlx5/mlx5_rss.c > > > +++ b/drivers/net/mlx5/mlx5_rss.c > > > @@ -357,8 +357,11 @@ mlx5_dev_rss_reta_update(struct rte_eth_dev *dev, > > > int ret; > > > struct priv *priv = dev->data->dev_private; > > > > > > + mlx5_dev_stop(dev); > > > priv_lock(priv); > > > ret = priv_dev_rss_reta_update(priv, reta_conf, reta_size); > > > priv_unlock(priv); > > > + if (!ret) > > > + ret = (unsigned int)mlx5_dev_start(dev); > > > return -ret; > > > } > > > -- > > > 2.11.0 > > > > > > > Hi Yongseok, > > > > I don't understand why you need the cast for the returned value of > > mlx5_dev_start() as it already returns an int and your final variable is > > also an int. > > For some reason, in mlx5 PMD code, priv_* calls return positive error numbers > and corresponding mlx5_* APIs return negative values by adding (-) sign the the > return value from priv_* calls. This is due to the IOCTL calls which returns only positives errno, we decided to keep only positives errors internally and negate them in when they are returned to DPDK. > To follow this tacit rule in the existing code, I casted the return value to > unsigned. I see more this cast as something confusing than helping, knowing that it could be avoided with something like: if (ret) return -ret; return mlx5_dev_start(dev); Regards,
diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c index 0702f1a63..30e59faa5 100644 --- a/drivers/net/mlx5/mlx5_rss.c +++ b/drivers/net/mlx5/mlx5_rss.c @@ -357,8 +357,11 @@ mlx5_dev_rss_reta_update(struct rte_eth_dev *dev, int ret; struct priv *priv = dev->data->dev_private; + mlx5_dev_stop(dev); priv_lock(priv); ret = priv_dev_rss_reta_update(priv, reta_conf, reta_size); priv_unlock(priv); + if (!ret) + ret = (unsigned int)mlx5_dev_start(dev); return -ret; }