From: "Xia, Chenbo" <chenbo.xia@intel.com>
To: "Wu, Jingjing" <jingjing.wu@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"thomas@monjalon.net" <thomas@monjalon.net>,
"david.marchand@redhat.com" <david.marchand@redhat.com>
Cc: "stephen@networkplumber.org" <stephen@networkplumber.org>,
"Liang, Cunming" <cunming.liang@intel.com>,
"Lu, Xiuchun" <xiuchun.lu@intel.com>,
"Li, Miao" <miao.li@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2 5/8] emu/iavf: add resource management and internal logic of iavf
Date: Wed, 30 Dec 2020 01:59:56 +0000 [thread overview]
Message-ID: <MN2PR11MB406349D0CA29E356616E60EE9CD70@MN2PR11MB4063.namprd11.prod.outlook.com> (raw)
In-Reply-To: <BN6PR11MB4052B2E2CAC3555D7ED6E2D2E3D80@BN6PR11MB4052.namprd11.prod.outlook.com>
Hi Jingjing,
> -----Original Message-----
> From: Wu, Jingjing <jingjing.wu@intel.com>
> Sent: Tuesday, December 29, 2020 2:05 PM
> To: Xia, Chenbo <chenbo.xia@intel.com>; dev@dpdk.org; thomas@monjalon.net;
> david.marchand@redhat.com
> Cc: stephen@networkplumber.org; Liang, Cunming <cunming.liang@intel.com>; Lu,
> Xiuchun <xiuchun.lu@intel.com>; Li, Miao <miao.li@intel.com>
> Subject: RE: [PATCH v2 5/8] emu/iavf: add resource management and internal
> logic of iavf
>
> > +static ssize_t iavf_emu_bar0_rw(struct rte_vfio_user_reg_info *reg, char
> > *buf,
> > + size_t count, loff_t pos, bool iswrite) {
> > + struct iavf_emudev *dev = (struct iavf_emudev *)reg->priv;
> > + char *reg_pos;
> > +
> > + if (!reg->base) {
> > + EMU_IAVF_LOG(ERR, "BAR 0 does not exist\n");
> > + return -EFAULT;
> > + }
> > +
> > + if (pos + count > reg->info->size) {
> > + EMU_IAVF_LOG(ERR, "Access exceeds BAR 0 size\n");
> > + return -EINVAL;
> > + }
> > +
> > + reg_pos = (char *)reg->base + pos;
> > +
> > + if (!iswrite) {
> > + rte_memcpy(buf, reg_pos, count);
> > + } else {
> > + int tmp;
> > + uint32_t val;
> > + int idx = -1;
> > +
> > + if (count != 4)
> > + return -EINVAL;
> > +
> > + val = *(uint32_t *)buf;
> > + /* Only handle interrupt enable/disable for now */
> > + if (pos == IAVF_VFINT_DYN_CTL01) {
> > + tmp = val & IAVF_VFINT_DYN_CTL01_INTENA_MASK;
> > + idx = 0;
> > + } else if ((pos >= IAVF_VFINT_DYN_CTLN1(0)) && pos <=
> > +
> > IAVF_VFINT_DYN_CTLN1(RTE_IAVF_EMU_MAX_INTR - 1)) {
> > + tmp = val & IAVF_VFINT_DYN_CTLN1_INTENA_MASK;
> > + idx = pos - IAVF_VFINT_DYN_CTLN1(0);
> > + if (idx % 4)
> > + return -EINVAL;
> > + idx = idx / 4;
> Should be idx = idx / 4 + 1; ?
Yes! Will fix in v3.
>
> > + }
> > +
> > + if (idx != -1 &&
> > + tmp != dev->intr->info[idx].enable && dev->ready) {
> > + dev->ops->update_status(dev->edev);
> > + dev->intr->info[idx].enable = tmp;
> dev->intr->info[idx].enable need to be set before update_status callback is
> called.
Yes. Will fix this too.
Thanks!
Chenbo
>
> > + }
> > +
> > + rte_memcpy(reg_pos, buf, count);
> > + }
> > +
> > + return count;
> > +}
next prev parent reply other threads:[~2020-12-30 2:00 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-18 7:47 [dpdk-dev] [PATCH 0/8] Introduce emudev library and iavf emudev driver Chenbo Xia
2020-12-18 7:47 ` [dpdk-dev] [PATCH 1/8] lib: introduce emudev library Chenbo Xia
2020-12-18 7:47 ` [dpdk-dev] [PATCH 2/8] doc: add emudev library guide Chenbo Xia
2020-12-18 7:47 ` [dpdk-dev] [PATCH 3/8] emu: introduce emulated iavf driver Chenbo Xia
2020-12-18 7:47 ` [dpdk-dev] [PATCH 4/8] emu/iavf: add vfio-user device register and unregister Chenbo Xia
2021-01-07 7:18 ` Xing, Beilei
2021-01-07 8:41 ` Xia, Chenbo
2020-12-18 7:47 ` [dpdk-dev] [PATCH 5/8] emu/iavf: add resource management and internal logic of iavf Chenbo Xia
2020-12-18 7:47 ` [dpdk-dev] [PATCH 6/8] emu/iavf: add emudev operations to fit in emudev framework Chenbo Xia
2020-12-18 7:47 ` [dpdk-dev] [PATCH 7/8] test/emudev: introduce functional test Chenbo Xia
2020-12-18 7:47 ` [dpdk-dev] [PATCH 8/8] doc: update release notes for iavf emudev driver Chenbo Xia
2020-12-18 9:53 ` [dpdk-dev] [PATCH 0/8] Introduce emudev library and " David Marchand
2020-12-19 6:11 ` Xia, Chenbo
2020-12-21 9:52 ` Maxime Coquelin
2020-12-21 12:01 ` Maxime Coquelin
2020-12-22 3:09 ` Xia, Chenbo
2020-12-22 8:48 ` Maxime Coquelin
2020-12-23 5:28 ` Xia, Chenbo
2020-12-19 6:27 ` [dpdk-dev] [PATCH v2 " Chenbo Xia
2020-12-19 6:27 ` [dpdk-dev] [PATCH v2 1/8] lib: introduce emudev library Chenbo Xia
2020-12-19 6:28 ` [dpdk-dev] [PATCH v2 2/8] doc: add emudev library guide Chenbo Xia
2020-12-19 6:28 ` [dpdk-dev] [PATCH v2 3/8] emu: introduce emulated iavf driver Chenbo Xia
2020-12-19 6:28 ` [dpdk-dev] [PATCH v2 4/8] emu/iavf: add vfio-user device register and unregister Chenbo Xia
2021-01-04 6:45 ` Wu, Jingjing
2021-01-05 1:26 ` Xia, Chenbo
2021-01-05 13:41 ` Wu, Jingjing
2021-01-06 7:41 ` Xia, Chenbo
2020-12-19 6:28 ` [dpdk-dev] [PATCH v2 5/8] emu/iavf: add resource management and internal logic of iavf Chenbo Xia
2020-12-29 6:05 ` Wu, Jingjing
2020-12-30 1:59 ` Xia, Chenbo [this message]
2020-12-19 6:28 ` [dpdk-dev] [PATCH v2 6/8] emu/iavf: add emudev operations to fit in emudev framework Chenbo Xia
2020-12-19 6:28 ` [dpdk-dev] [PATCH v2 7/8] test/emudev: introduce functional test Chenbo Xia
2020-12-19 6:28 ` [dpdk-dev] [PATCH v2 8/8] doc: update release notes for iavf emudev driver Chenbo Xia
2021-01-13 16:52 ` [dpdk-dev] [PATCH v2 0/8] Introduce emudev library and " Thomas Monjalon
2021-01-14 1:35 ` Xia, Chenbo
2021-01-14 6:25 ` [dpdk-dev] [PATCH v3 " Chenbo Xia
2021-01-14 6:25 ` [dpdk-dev] [PATCH v3 1/8] lib: introduce emudev library Chenbo Xia
2021-01-14 6:25 ` [dpdk-dev] [PATCH v3 2/8] doc: add emudev library guide Chenbo Xia
2021-01-14 6:25 ` [dpdk-dev] [PATCH v3 3/8] emu: introduce emulated iavf driver Chenbo Xia
2021-01-14 6:25 ` [dpdk-dev] [PATCH v3 4/8] emu/iavf: add vfio-user device register and unregister Chenbo Xia
2021-01-14 6:25 ` [dpdk-dev] [PATCH v3 5/8] emu/iavf: add resource management and internal logic of iavf Chenbo Xia
2021-01-14 6:25 ` [dpdk-dev] [PATCH v3 6/8] emu/iavf: add emudev operations to fit in emudev framework Chenbo Xia
2021-01-14 6:25 ` [dpdk-dev] [PATCH v3 7/8] test/emudev: introduce functional test Chenbo Xia
2021-01-14 6:25 ` [dpdk-dev] [PATCH v3 8/8] doc: update release notes for iavf emudev driver Chenbo Xia
2024-02-12 22:49 ` [dpdk-dev] [PATCH v3 0/8] Introduce emudev library and " Stephen Hemminger
2023-06-14 19:47 ` [dpdk-dev] [PATCH " Stephen Hemminger
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=MN2PR11MB406349D0CA29E356616E60EE9CD70@MN2PR11MB4063.namprd11.prod.outlook.com \
--to=chenbo.xia@intel.com \
--cc=cunming.liang@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=miao.li@intel.com \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
--cc=xiuchun.lu@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).