diff mbox series

[2/4] ndctl/libndctl: Add bus_prefix for cxl

Message ID 166379416797.433612.11380777795382753298.stgit@djiang5-desk3.ch.intel.com
State Superseded
Headers show
Series ndctl: Add security test for cxl devices through nvdimm | expand

Commit Message

Dave Jiang Sept. 21, 2022, 9:02 p.m. UTC
With support of being able to detect the cxl bus, setup the bus_prefix
for cxl bus.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 ndctl/lib/libndctl.c |    6 ++++++
 1 file changed, 6 insertions(+)

Comments

Verma, Vishal L Dec. 13, 2022, 11:10 p.m. UTC | #1
On Wed, 2022-09-21 at 14:02 -0700, Dave Jiang wrote:
> With support of being able to detect the cxl bus, setup the bus_prefix
> for cxl bus.

Same comment as patch 1 about 'CXL'. This might also be reworded as:

When the 'ndbus' is backed by CXL, set up the bus_prefix for the dimm
object appropriately.

> 
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  ndctl/lib/libndctl.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
> index 10422e24d38b..d2e800bc840a 100644
> --- a/ndctl/lib/libndctl.c
> +++ b/ndctl/lib/libndctl.c
> @@ -2012,6 +2012,12 @@ static void *add_dimm(void *parent, int id,
> const char *dimm_base)
>                         goto out;
>                 }
>                 rc =  add_papr_dimm(dimm, dimm_base);
> +       } else if (ndctl_bus_has_cxl(bus)) {
> +               dimm->bus_prefix = strdup("cxl");
> +               if (!dimm->bus_prefix) {
> +                       rc = -ENOMEM;
> +                       goto out;
> +               }
>         }
>  
>         if (rc == -ENODEV) {
> 
>
diff mbox series

Patch

diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
index 10422e24d38b..d2e800bc840a 100644
--- a/ndctl/lib/libndctl.c
+++ b/ndctl/lib/libndctl.c
@@ -2012,6 +2012,12 @@  static void *add_dimm(void *parent, int id, const char *dimm_base)
 			goto out;
 		}
 		rc =  add_papr_dimm(dimm, dimm_base);
+	} else if (ndctl_bus_has_cxl(bus)) {
+		dimm->bus_prefix = strdup("cxl");
+		if (!dimm->bus_prefix) {
+			rc = -ENOMEM;
+			goto out;
+		}
 	}
 
 	if (rc == -ENODEV) {