Content-Type: multipart/mixed; boundary="===============5415827481753584947==" MIME-Version: 1.0 From: Dave Jiang Subject: [Accel-config] Re: [PATCH] accel-config: Replicate driver error codes in idxd.h in library Date: Mon, 19 Jul 2021 08:17:28 -0700 Message-ID: <468042b8-a327-b98a-4075-ca31f83041b7@intel.com> In-Reply-To: 20210717014623.1108847-1-ramesh.thomas@intel.com To: accel-config@lists.01.org List-ID: --===============5415827481753584947== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 7/16/2021 6:46 PM, ramesh.thomas(a)intel.com wrote: > From: Ramesh Thomas > > 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 > --- > 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 > #include > #include "private.h" > -#include > = > #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 =3D 0x80010000, > }; > = > +/* driver error codes from kernel idxd.h */ > +enum idxd_scmd_stat { > + IDXD_SCMD_DEV_ENABLED =3D 0x80000010, > + IDXD_SCMD_DEV_NOT_ENABLED =3D 0x80000020, > + IDXD_SCMD_WQ_ENABLED =3D 0x80000021, > + IDXD_SCMD_DEV_DMA_ERR =3D 0x80020000, > + IDXD_SCMD_WQ_NO_GRP =3D 0x80030000, > + IDXD_SCMD_WQ_NO_NAME =3D 0x80040000, > + IDXD_SCMD_WQ_NO_SVM =3D 0x80050000, > + IDXD_SCMD_WQ_NO_THRESH =3D 0x80060000, > + IDXD_SCMD_WQ_PORTAL_ERR =3D 0x80070000, > + IDXD_SCMD_WQ_RES_ALLOC_ERR =3D 0x80080000, > + IDXD_SCMD_PERCPU_ERR =3D 0x80090000, > + IDXD_SCMD_DMA_CHAN_ERR =3D 0x800a0000, > + IDXD_SCMD_CDEV_ERR =3D 0x800b0000, > + IDXD_SCMD_WQ_NO_SWQ_SUPPORT =3D 0x800c0000, > + IDXD_SCMD_WQ_NONE_CONFIGURED =3D 0x800d0000, > + IDXD_SCMD_WQ_NO_SIZE =3D 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) > =20 --===============5415827481753584947==--