> -----Original Message----- > From: Jerin Jacob Kollanukkaran <jer...@marvell.com> > Sent: Wednesday, July 17, 2019 6:21 PM > To: Hyong Youb Kim (hyonkim) <hyon...@cisco.com>; Nithin Kumar > Dabilpuram <ndabilpu...@marvell.com>; David Marchand > <david.march...@redhat.com>; Thomas Monjalon > <tho...@monjalon.net>; Ferruh Yigit <ferruh.yi...@intel.com>; Bruce > Richardson <bruce.richard...@intel.com> > Cc: John Daley (johndale) <johnd...@cisco.com>; Shahed Shaikh > <shsha...@marvell.com>; dev@dpdk.org > Subject: RE: [RFC PATCH v3 2/3] eal: add mask and unmask interrupt APIs > > > > > Not sure. I do not have a good suggestion here :-) Like to hear from > > > > David when he comes back, as he spent most time on this issue.. > > > > > > Sure. He is on vacation. > > > Any reason for thinking, rte_intr_ack() may not be semantically correct? > > > I think, it is very much correct if there are no better suggestions. > > > Anyway it the name, From VFIO perspective, we know what is expected > so > > > I think it is fine. > > > > > > > > > > > Why not return -1 and let the caller deal with it? > > > > > > If we make it as rte_intr_ack() no need to return -1 for > > > MSIX-VFIO+Linux as it is semantically correct. > > > > > > > Ack can be ambiguous. For INTx, ack usually means PIO to a NIC register, > > saying "I got your interrupt, please de-assert irq". > > I think, it vary from the perspective of IRQ Chip(or controller) vs NIC > register(Source) PoV. > Since the API starts from rte_intr_* it is more of controller so _ack_ make > sense > Other reason for ack: > 1) It will enforce that it needs to be called form ISR > 2) It would be have been really correct to unmask if VFIO+MSIx+Linux > supports > it > 3) if it is ack, no need to add unmask counterpart, the _mask_ API >
Just curious, what you mean by irq controller? Ack/mask/unmask PIOs all go to the NIC. It is the NIC that asserts/de-asserts irq.. > > > > Besides the name, are we agreeing that we want these? > > - Unmask if INTx > > Yes > > > - Nothing if MSI/MSI-X > Yes for MSI over VFIO > No for MSI over UIO/igb_uio > I guess I was not clear. For MSI/MSI-X, we do not want to do mask/unmask regardless of vfio-pci/igb_uio. Below is my comment about linux/windows/freebsd from an earlier email. Do you disagree? I am sure there are plenty of kernel NIC driver guys here. Please correct me if I am mistaken... --- Masking is useful only for INTx, IMO... Masking MSI/MSI-X via PCI-defined mechanisms (e.g. Mask bit in MSI-X Table) has no practical use for drivers. Handshaking/masking/unmasking is done via device/vendor specific ways, as needed. See all those ack/block/unblock/credit/... mechanisms used in various drivers/NICs to control interrupts their own way. A long time ago in early PCIe days, the linux kernel did auto-masking for MSI/MSI-X (i.e. mask before calling netdev irq handler). It was soon removed as it was unnecessary overhead (expensive PIOs to NIC for every interrupt). Windows and FreeBSD do not do auto-masking either. --- Most drivers have a single irq callback. handler() { do_action() rte_intr_umask/ack() } Suppose MSI/MSI-X is used (super likely since it is the default). With igb_uio, rte_intr_umask/ack() will actually do PIO writes to the NIC to unmask. This is unnecessary overhead. > I don't have very strong opinion unmask vs ack. I prefer to have ack due the > reasons stated above. > If you really have strong opinion on using unmask, we will stick with that to > make forward progress. > Let us know. > I have no strong opinion either. Thanks.. -Hyong