[2/3] rawdev: return NUMA socket id to the user

Message ID 20200706103132.7691-3-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series Minor rawdev fixes and enhancements |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Bruce Richardson July 6, 2020, 10:31 a.m. UTC
  The rawdev info struct has a socket_id field which was not filled in.

We can also omit the checks for the parameter struct being null, since
that is previously checked in the function.

Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_rawdev/rte_rawdev.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
  

Comments

Hemant Agrawal July 7, 2020, 3:40 a.m. UTC | #1
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
  
Thomas Monjalon July 7, 2020, 12:23 p.m. UTC | #2
06/07/2020 12:31, Bruce Richardson:
> The rawdev info struct has a socket_id field which was not filled in.
> 
> We can also omit the checks for the parameter struct being null, since
> that is previously checked in the function.
> 
> Cc: stable@dpdk.org

It looks to be a fix.
Which commit introduced this bug? The original one?
Fixes: c88b3f2558ed ("rawdev: introduce raw device library")
  
Bruce Richardson July 7, 2020, 12:33 p.m. UTC | #3
On Tue, Jul 07, 2020 at 02:23:04PM +0200, Thomas Monjalon wrote:
> 06/07/2020 12:31, Bruce Richardson:
> > The rawdev info struct has a socket_id field which was not filled in.
> > 
> > We can also omit the checks for the parameter struct being null, since
> > that is previously checked in the function.
> > 
> > Cc: stable@dpdk.org
> 
> It looks to be a fix.
> Which commit introduced this bug? The original one?
> Fixes: c88b3f2558ed ("rawdev: introduce raw device library")
>

Yes, it can be viewed as a fix and that is the commit introducing the
issue.

/Bruce
  

Patch

diff --git a/lib/librte_rawdev/rte_rawdev.c b/lib/librte_rawdev/rte_rawdev.c
index b18638435..9ee160455 100644
--- a/lib/librte_rawdev/rte_rawdev.c
+++ b/lib/librte_rawdev/rte_rawdev.c
@@ -95,11 +95,9 @@  rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info)
 		(*rawdev->dev_ops->dev_info_get)(rawdev, dev_info->dev_private);
 	}
 
-	if (dev_info) {
-
-		dev_info->driver_name = rawdev->driver_name;
-		dev_info->device = rawdev->device;
-	}
+	dev_info->driver_name = rawdev->driver_name;
+	dev_info->device = rawdev->device;
+	dev_info->socket_id = rawdev->socket_id;
 
 	return 0;
 }