* [Accel-config] Re: [PATCH] accel-config: Provide compatibility for legacy mode driver names
@ 2021-07-15 15:51 Dave Jiang
0 siblings, 0 replies; 3+ messages in thread
From: Dave Jiang @ 2021-07-15 15:51 UTC (permalink / raw)
To: accel-config
[-- Attachment #1: Type: text/plain, Size: 1854 bytes --]
On 7/14/2021 6:18 PM, ramesh.thomas(a)intel.com wrote:
> From: Ramesh Thomas <ramesh.thomas(a)intel.com>
>
> Check for presence of /sys/bus/dsa/drivers/idxd and use legacy driver
> names if not present.
>
> Signed-off-by: Ramesh Thomas <ramesh.thomas(a)intel.com>
> ---
> accfg/lib/libaccfg.c | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/accfg/lib/libaccfg.c b/accfg/lib/libaccfg.c
> index f21cab5..592c22c 100644
> --- a/accfg/lib/libaccfg.c
> +++ b/accfg/lib/libaccfg.c
> @@ -36,6 +36,13 @@
> #define IDXD_WQ_DEVICE_PORTAL(d, w) ((d)->ctx->compat ? \
> (d)->bus_type_str : accfg_wq_device_portals[(w)->type])
>
> +char *accfg_wq_device_portals_legacy[] = {
> + [ACCFG_WQT_KERNEL] = "idxd-kernel-portal",
> + [ACCFG_WQT_USER] = "idxd-user-portal",
> + [ACCFG_WQT_MDEV] = "idxd-mdev-portal",
> + NULL
> +};
> +
I don't think this version exists upstream. It was an internal thing
during transition that we can drop. I believe legacy is just
/sys/bus/dsa/drivers/dsa only for everything.
> char *accfg_wq_device_portals[] = {
> [ACCFG_WQT_KERNEL] = "dmaengine",
> [ACCFG_WQT_USER] = "user",
> @@ -398,8 +405,15 @@ ACCFG_EXPORT int accfg_new(struct accfg_ctx **ctx)
> c->refcount = 1;
> log_init(&c->ctx, "libaccfg", "ACCFG_LOG");
> c->timeout = 5000;
> - if (access(IDXD_DRIVER_BIND_PATH, R_OK))
> + if (access(IDXD_DRIVER_BIND_PATH, R_OK)) {
> c->compat = true;
> + accfg_wq_device_portals[ACCFG_WQT_KERNEL] =
> + accfg_wq_device_portals_legacy[ACCFG_WQT_KERNEL];
> + accfg_wq_device_portals[ACCFG_WQT_USER] =
> + accfg_wq_device_portals_legacy[ACCFG_WQT_USER];
> + accfg_wq_device_portals[ACCFG_WQT_MDEV] =
> + accfg_wq_device_portals_legacy[ACCFG_WQT_MDEV];
> + }
>
> list_head_init(&c->devices);
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Accel-config] Re: [PATCH] accel-config: Provide compatibility for legacy mode driver names
@ 2021-07-15 23:47 Dave Jiang
0 siblings, 0 replies; 3+ messages in thread
From: Dave Jiang @ 2021-07-15 23:47 UTC (permalink / raw)
To: accel-config
[-- Attachment #1: Type: text/plain, Size: 2309 bytes --]
On 7/15/2021 4:38 PM, Thomas, Ramesh wrote:
> On Thu, Jul 15, 2021 at 08:51:47AM -0700, Dave Jiang wrote:
>> On 7/14/2021 6:18 PM, ramesh.thomas(a)intel.com wrote:
>>> From: Ramesh Thomas <ramesh.thomas(a)intel.com>
>>>
>>> Check for presence of /sys/bus/dsa/drivers/idxd and use legacy driver
>>> names if not present.
>>>
>>> Signed-off-by: Ramesh Thomas <ramesh.thomas(a)intel.com>
>>> ---
>>> accfg/lib/libaccfg.c | 16 +++++++++++++++-
>>> 1 file changed, 15 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/accfg/lib/libaccfg.c b/accfg/lib/libaccfg.c
>>> index f21cab5..592c22c 100644
>>> --- a/accfg/lib/libaccfg.c
>>> +++ b/accfg/lib/libaccfg.c
>>> @@ -36,6 +36,13 @@
>>> #define IDXD_WQ_DEVICE_PORTAL(d, w) ((d)->ctx->compat ? \
>>> (d)->bus_type_str : accfg_wq_device_portals[(w)->type])
>>>
>>> +char *accfg_wq_device_portals_legacy[] = {
>>> + [ACCFG_WQT_KERNEL] = "idxd-kernel-portal",
>>> + [ACCFG_WQT_USER] = "idxd-user-portal",
>>> + [ACCFG_WQT_MDEV] = "idxd-mdev-portal",
>>> + NULL
>>> +};
>>> +
>> I don't think this version exists upstream. It was an internal thing
>> during transition that we can drop. I believe legacy is just
>> /sys/bus/dsa/drivers/dsa only for everything.
> /sys/bus/dsa/drivers/dsa compatibility is already there so we don't need
> this patch.
Ok then I think we are good. Thanks!
>>
>>> char *accfg_wq_device_portals[] = {
>>> [ACCFG_WQT_KERNEL] = "dmaengine",
>>> [ACCFG_WQT_USER] = "user",
>>> @@ -398,8 +405,15 @@ ACCFG_EXPORT int accfg_new(struct accfg_ctx **ctx)
>>> c->refcount = 1;
>>> log_init(&c->ctx, "libaccfg", "ACCFG_LOG");
>>> c->timeout = 5000;
>>> - if (access(IDXD_DRIVER_BIND_PATH, R_OK))
>>> + if (access(IDXD_DRIVER_BIND_PATH, R_OK)) {
>>> c->compat = true;
>>> + accfg_wq_device_portals[ACCFG_WQT_KERNEL] =
>>> + accfg_wq_device_portals_legacy[ACCFG_WQT_KERNEL];
>>> + accfg_wq_device_portals[ACCFG_WQT_USER] =
>>> + accfg_wq_device_portals_legacy[ACCFG_WQT_USER];
>>> + accfg_wq_device_portals[ACCFG_WQT_MDEV] =
>>> + accfg_wq_device_portals_legacy[ACCFG_WQT_MDEV];
>>> + }
>>>
>>> list_head_init(&c->devices);
>>>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Accel-config] Re: [PATCH] accel-config: Provide compatibility for legacy mode driver names
@ 2021-07-15 23:38 Thomas, Ramesh
0 siblings, 0 replies; 3+ messages in thread
From: Thomas, Ramesh @ 2021-07-15 23:38 UTC (permalink / raw)
To: accel-config
[-- Attachment #1: Type: text/plain, Size: 2105 bytes --]
On Thu, Jul 15, 2021 at 08:51:47AM -0700, Dave Jiang wrote:
>
> On 7/14/2021 6:18 PM, ramesh.thomas(a)intel.com wrote:
> > From: Ramesh Thomas <ramesh.thomas(a)intel.com>
> >
> > Check for presence of /sys/bus/dsa/drivers/idxd and use legacy driver
> > names if not present.
> >
> > Signed-off-by: Ramesh Thomas <ramesh.thomas(a)intel.com>
> > ---
> > accfg/lib/libaccfg.c | 16 +++++++++++++++-
> > 1 file changed, 15 insertions(+), 1 deletion(-)
> >
> > diff --git a/accfg/lib/libaccfg.c b/accfg/lib/libaccfg.c
> > index f21cab5..592c22c 100644
> > --- a/accfg/lib/libaccfg.c
> > +++ b/accfg/lib/libaccfg.c
> > @@ -36,6 +36,13 @@
> > #define IDXD_WQ_DEVICE_PORTAL(d, w) ((d)->ctx->compat ? \
> > (d)->bus_type_str : accfg_wq_device_portals[(w)->type])
> >
> > +char *accfg_wq_device_portals_legacy[] = {
> > + [ACCFG_WQT_KERNEL] = "idxd-kernel-portal",
> > + [ACCFG_WQT_USER] = "idxd-user-portal",
> > + [ACCFG_WQT_MDEV] = "idxd-mdev-portal",
> > + NULL
> > +};
> > +
>
> I don't think this version exists upstream. It was an internal thing
> during transition that we can drop. I believe legacy is just
> /sys/bus/dsa/drivers/dsa only for everything.
/sys/bus/dsa/drivers/dsa compatibility is already there so we don't need
this patch.
>
>
> > char *accfg_wq_device_portals[] = {
> > [ACCFG_WQT_KERNEL] = "dmaengine",
> > [ACCFG_WQT_USER] = "user",
> > @@ -398,8 +405,15 @@ ACCFG_EXPORT int accfg_new(struct accfg_ctx **ctx)
> > c->refcount = 1;
> > log_init(&c->ctx, "libaccfg", "ACCFG_LOG");
> > c->timeout = 5000;
> > - if (access(IDXD_DRIVER_BIND_PATH, R_OK))
> > + if (access(IDXD_DRIVER_BIND_PATH, R_OK)) {
> > c->compat = true;
> > + accfg_wq_device_portals[ACCFG_WQT_KERNEL] =
> > + accfg_wq_device_portals_legacy[ACCFG_WQT_KERNEL];
> > + accfg_wq_device_portals[ACCFG_WQT_USER] =
> > + accfg_wq_device_portals_legacy[ACCFG_WQT_USER];
> > + accfg_wq_device_portals[ACCFG_WQT_MDEV] =
> > + accfg_wq_device_portals_legacy[ACCFG_WQT_MDEV];
> > + }
> >
> > list_head_init(&c->devices);
> >
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-07-15 23:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 15:51 [Accel-config] Re: [PATCH] accel-config: Provide compatibility for legacy mode driver names Dave Jiang
2021-07-15 23:38 Thomas, Ramesh
2021-07-15 23:47 Dave Jiang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.