All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas, Ramesh <ramesh.thomas at intel.com>
To: accel-config@lists.01.org
Subject: [Accel-config] Re: [PATCH] accel-config: Replicate driver error codes in idxd.h in library
Date: Mon, 19 Jul 2021 17:34:00 +0000	[thread overview]
Message-ID: <BYAPR11MB25355C87D8BD8FD52535C35DEDE19@BYAPR11MB2535.namprd11.prod.outlook.com> (raw)
In-Reply-To: 468042b8-a327-b98a-4075-ca31f83041b7@intel.com

[-- Attachment #1: Type: text/plain, Size: 2536 bytes --]

I think copying will have the problem of compiler picking different
ones. Library may use the copied version while the app may get the one
in /usr/include. Do you think defining new constants would be safer?

On Mon, Jul 19, 2021 at 08:17:28AM -0700, Dave Jiang wrote:
> 
> On 7/16/2021 6:46 PM, ramesh.thomas(a)intel.com wrote:
> > From: Ramesh Thomas <ramesh.thomas(a)intel.com>
> >
> > Duplicate the driver error code related constants defined in idxd.h in
> > library to avoid dependency on kernel versions.
> 
> I think instead of replicating certain defines, the suggestion by Vishal
> was to make a copy of the latest kernel uapi idxd.h in accel-config.
> This is probably the best. Otherwise you'll have conflicts if this is
> build with the latest idxd.h having those defines as well.
> 
> 
> >
> > Signed-off-by: Ramesh Thomas <ramesh.thomas(a)intel.com>
> > ---
> >   accfg/lib/libaccfg.c | 24 +++++++++++++++++++++++-
> >   1 file changed, 23 insertions(+), 1 deletion(-)
> >
> > diff --git a/accfg/lib/libaccfg.c b/accfg/lib/libaccfg.c
> > index f21cab5..1a06d9c 100644
> > --- a/accfg/lib/libaccfg.c
> > +++ b/accfg/lib/libaccfg.c
> > @@ -27,7 +27,6 @@
> >   #include <accfg/libaccel_config.h>
> >   #include <fnmatch.h>
> >   #include "private.h"
> > -#include <linux/idxd.h>
> >
> >   #define MDEV_POSTFIX "mdev_supported_types"
> >   #define IDXD_DRIVER_BIND_PATH "/sys/bus/dsa/drivers/idxd"
> > @@ -74,6 +73,29 @@ enum {
> >   	ACCFG_CMD_STATUS_ERROR = 0x80010000,
> >   };
> >
> > +/* driver error codes from kernel idxd.h */
> > +enum idxd_scmd_stat {
> > +	IDXD_SCMD_DEV_ENABLED = 0x80000010,
> > +	IDXD_SCMD_DEV_NOT_ENABLED = 0x80000020,
> > +	IDXD_SCMD_WQ_ENABLED = 0x80000021,
> > +	IDXD_SCMD_DEV_DMA_ERR = 0x80020000,
> > +	IDXD_SCMD_WQ_NO_GRP = 0x80030000,
> > +	IDXD_SCMD_WQ_NO_NAME = 0x80040000,
> > +	IDXD_SCMD_WQ_NO_SVM = 0x80050000,
> > +	IDXD_SCMD_WQ_NO_THRESH = 0x80060000,
> > +	IDXD_SCMD_WQ_PORTAL_ERR = 0x80070000,
> > +	IDXD_SCMD_WQ_RES_ALLOC_ERR = 0x80080000,
> > +	IDXD_SCMD_PERCPU_ERR = 0x80090000,
> > +	IDXD_SCMD_DMA_CHAN_ERR = 0x800a0000,
> > +	IDXD_SCMD_CDEV_ERR = 0x800b0000,
> > +	IDXD_SCMD_WQ_NO_SWQ_SUPPORT = 0x800c0000,
> > +	IDXD_SCMD_WQ_NONE_CONFIGURED = 0x800d0000,
> > +	IDXD_SCMD_WQ_NO_SIZE = 0x800e0000,
> > +};
> > +
> > +#define IDXD_SCMD_SOFTERR_MASK	0x80000000
> > +#define IDXD_SCMD_SOFTERR_SHIFT	16
> > +
> >   #define SCMD_STAT(x) (((x) & ~IDXD_SCMD_SOFTERR_MASK) >> \
> >   		IDXD_SCMD_SOFTERR_SHIFT)
> >


             reply	other threads:[~2021-07-19 17:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19 17:34 Thomas, Ramesh [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-07-20  0:24 [Accel-config] Re: [PATCH] accel-config: Replicate driver error codes in idxd.h in library Dave Jiang
2021-07-20  0:16 Thomas, Ramesh
2021-07-19 22:14 Dave Jiang
2021-07-19 21:13 Thomas, Ramesh
2021-07-19 20:00 Dave Jiang
2021-07-19 19:35 Thomas, Ramesh
2021-07-19 17:50 Dave Jiang
2021-07-19 15:17 Dave Jiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BYAPR11MB25355C87D8BD8FD52535C35DEDE19@BYAPR11MB2535.namprd11.prod.outlook.com \
    --to=accel-config@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.