Message ID | 1418372303-31565-1-git-send-email-ssujith@cisco.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id CE89C8057; Fri, 12 Dec 2014 09:19:59 +0100 (CET) Received: from bgl-iport-1.cisco.com (bgl-iport-1.cisco.com [72.163.197.25]) by dpdk.org (Postfix) with ESMTP id 4657F8052 for <dev@dpdk.org>; Fri, 12 Dec 2014 09:19:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3178; q=dns/txt; s=iport; t=1418372399; x=1419581999; h=from:to:cc:subject:date:message-id; bh=EdHy/BrkeKD9HHC3ta7YZ72kMrJlXDiEn6lpy+nCOHk=; b=LThBginc++b2mVetp2KQyvXohcVlV802sfX8ppVohWJqwb3UPSWiU2ng um+xkvueNXyJT46d8/BPv5oe/IpdjdtYpRx8jKcejo+nbi6h9CeyVUvgs wlnoU8ezdDNqw8UYlqXOH/qCkmDhluIiWz6ecT5SaPHhujEfZn2Ds63zi I=; X-IronPort-AV: E=Sophos;i="5.07,561,1413244800"; d="scan'208";a="48380776" Received: from vla196-nat.cisco.com (HELO bgl-core-2.cisco.com) ([72.163.197.24]) by bgl-iport-1.cisco.com with ESMTP; 12 Dec 2014 08:19:58 +0000 Received: from localhost ([10.106.186.168]) (authenticated bits=0) by bgl-core-2.cisco.com (8.14.5/8.14.5) with ESMTP id sBC8Je9V009954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 12 Dec 2014 08:19:48 GMT From: Sujith Sankar <ssujith@cisco.com> To: dev@dpdk.org Date: Fri, 12 Dec 2014 13:48:23 +0530 Message-Id: <1418372303-31565-1-git-send-email-ssujith@cisco.com> X-Mailer: git-send-email 1.9.1 X-Authenticated-User: ssujith@cisco.com Subject: [dpdk-dev] [PATCH] enic: corrected the usage of VFIO_PRESENT X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Sujith Sankar
Dec. 12, 2014, 8:18 a.m. UTC
This patch corrects the usage of the flag VFIO_PRESENT in enic driver.
This has uncovered a few warnings, and this patch corrects those too.
Signed-off-by: Sujith Sankar <ssujith@cisco.com>
---
lib/librte_pmd_enic/Makefile | 1 +
lib/librte_pmd_enic/enic.h | 1 +
lib/librte_pmd_enic/enic_main.c | 12 ++++++++----
3 files changed, 10 insertions(+), 4 deletions(-)
Comments
2014-12-12 13:48, Sujith Sankar: > This patch corrects the usage of the flag VFIO_PRESENT in enic driver. Please, could you explain why the flag VFIO_PRESENT was not well used? > This has uncovered a few warnings, and this patch corrects those too. [...] > --- a/lib/librte_pmd_enic/enic_main.c > +++ b/lib/librte_pmd_enic/enic_main.c > @@ -39,6 +39,7 @@ > #include <sys/mman.h> > #include <fcntl.h> > #include <libgen.h> > +#include <sys/ioctl.h> > > #include <rte_pci.h> > #include <rte_memzone.h> > @@ -46,6 +47,7 @@ > #include <rte_mbuf.h> > #include <rte_string_fns.h> > #include <rte_ethdev.h> > +#include <eal_vfio.h> This header was not designed to be included by PMDs. It will break compilation on BSD. > #include "enic_compat.h" > #include "enic.h" > @@ -561,6 +563,7 @@ enic_free_consistent(__rte_unused struct rte_pci_device *hwdev, > /* Nothing to be done */ > } > > +#ifndef VFIO_PRESENT > static void > enic_intr_handler(__rte_unused struct rte_intr_handle *handle, > void *arg) > @@ -572,6 +575,7 @@ enic_intr_handler(__rte_unused struct rte_intr_handle *handle, > > enic_log_q_error(enic); > } > +#endif
On 16/12/14 4:54 am, "Thomas Monjalon" <thomas.monjalon@6wind.com> wrote: >2014-12-12 13:48, Sujith Sankar: >> This patch corrects the usage of the flag VFIO_PRESENT in enic driver. > >Please, could you explain why the flag VFIO_PRESENT was not well used? Without including eal_vfio.h, VFIO_PRESENT is not available in enic. Hence VFIO specific code in enic was not getting compiled and some errors were generated during run-time. > >> This has uncovered a few warnings, and this patch corrects those too. >[...] >> --- a/lib/librte_pmd_enic/enic_main.c >> +++ b/lib/librte_pmd_enic/enic_main.c >> @@ -39,6 +39,7 @@ >> #include <sys/mman.h> >> #include <fcntl.h> >> #include <libgen.h> >> +#include <sys/ioctl.h> >> >> #include <rte_pci.h> >> #include <rte_memzone.h> >> @@ -46,6 +47,7 @@ >> #include <rte_mbuf.h> >> #include <rte_string_fns.h> >> #include <rte_ethdev.h> >> +#include <eal_vfio.h> > >This header was not designed to be included by PMDs. >It will break compilation on BSD. Is there an alternative to make VFIO_PRESENT available in enic? Please advise. Thanks, -Sujith > >> #include "enic_compat.h" >> #include "enic.h" >> @@ -561,6 +563,7 @@ enic_free_consistent(__rte_unused struct >>rte_pci_device *hwdev, >> /* Nothing to be done */ >> } >> >> +#ifndef VFIO_PRESENT >> static void >> enic_intr_handler(__rte_unused struct rte_intr_handle *handle, >> void *arg) >> @@ -572,6 +575,7 @@ enic_intr_handler(__rte_unused struct >>rte_intr_handle *handle, >> >> enic_log_q_error(enic); >> } >> +#endif > >-- >Thomas
On 12/16/2014 12:13 PM, Sujith Sankar (ssujith) wrote: > On 16/12/14 4:54 am, "Thomas Monjalon" <thomas.monjalon@6wind.com> wrote: > >> 2014-12-12 13:48, Sujith Sankar: >>> This patch corrects the usage of the flag VFIO_PRESENT in enic driver. >> Please, could you explain why the flag VFIO_PRESENT was not well used? > Without including eal_vfio.h, VFIO_PRESENT is not available in enic. > Hence VFIO specific code in enic was not getting compiled and some errors > were generated during run-time. > >>> This has uncovered a few warnings, and this patch corrects those too. >> [...] >>> --- a/lib/librte_pmd_enic/enic_main.c >>> +++ b/lib/librte_pmd_enic/enic_main.c >>> @@ -39,6 +39,7 @@ >>> #include <sys/mman.h> >>> #include <fcntl.h> >>> #include <libgen.h> >>> +#include <sys/ioctl.h> >>> >>> #include <rte_pci.h> >>> #include <rte_memzone.h> >>> @@ -46,6 +47,7 @@ >>> #include <rte_mbuf.h> >>> #include <rte_string_fns.h> >>> #include <rte_ethdev.h> >>> +#include <eal_vfio.h> >> This header was not designed to be included by PMDs. >> It will break compilation on BSD. > Is there an alternative to make VFIO_PRESENT available in enic? Please > advise. You can remove VFIO_PRESENT check, it all been done in eal, you can check other nic pmds for reference. And seems you done the interrupt logic all by your self? Thanks, Michael > > Thanks, > -Sujith > >>> #include "enic_compat.h" >>> #include "enic.h" >>> @@ -561,6 +563,7 @@ enic_free_consistent(__rte_unused struct >>> rte_pci_device *hwdev, >>> /* Nothing to be done */ >>> } >>> >>> +#ifndef VFIO_PRESENT >>> static void >>> enic_intr_handler(__rte_unused struct rte_intr_handle *handle, >>> void *arg) >>> @@ -572,6 +575,7 @@ enic_intr_handler(__rte_unused struct >>> rte_intr_handle *handle, >>> >>> enic_log_q_error(enic); >>> } >>> +#endif >> -- >> Thomas >
On 16/12/14 1:21 pm, "Qiu, Michael" <michael.qiu@intel.com> wrote: >On 12/16/2014 12:13 PM, Sujith Sankar (ssujith) wrote: >> On 16/12/14 4:54 am, "Thomas Monjalon" <thomas.monjalon@6wind.com> >>wrote: >> >>> 2014-12-12 13:48, Sujith Sankar: >>>> This patch corrects the usage of the flag VFIO_PRESENT in enic driver. >>> Please, could you explain why the flag VFIO_PRESENT was not well used? >> Without including eal_vfio.h, VFIO_PRESENT is not available in enic. >> Hence VFIO specific code in enic was not getting compiled and some >>errors >> were generated during run-time. >> >>>> This has uncovered a few warnings, and this patch corrects those too. >>> [...] >>>> --- a/lib/librte_pmd_enic/enic_main.c >>>> +++ b/lib/librte_pmd_enic/enic_main.c >>>> @@ -39,6 +39,7 @@ >>>> #include <sys/mman.h> >>>> #include <fcntl.h> >>>> #include <libgen.h> >>>> +#include <sys/ioctl.h> >>>> >>>> #include <rte_pci.h> >>>> #include <rte_memzone.h> >>>> @@ -46,6 +47,7 @@ >>>> #include <rte_mbuf.h> >>>> #include <rte_string_fns.h> >>>> #include <rte_ethdev.h> >>>> +#include <eal_vfio.h> >>> This header was not designed to be included by PMDs. >>> It will break compilation on BSD. >> Is there an alternative to make VFIO_PRESENT available in enic? Please >> advise. > >You can remove VFIO_PRESENT check, it all been done in eal, you can >check other nic pmds for reference. >And seems you done the interrupt logic all by your self? > >Thanks, >Michael Thanks for the comment, Michael. Without the code under VFIO_PRESENT flag, I was getting false notification of interrupt at the beginning (cat /proc/interrupts showed all 0s). Let me try to root cause it. I shall get back after some debugging and testing. There was one more reason behind doing interrupt logic in enic. No matter how many interrupts the user configures, enic pmd needs only one. There is no way to communicate that to the EAL. I thought doing interrupt login in enic could avoid registering that many interrupts. Thanks, -Sujith >> >> Thanks, >> -Sujith >> >>>> #include "enic_compat.h" >>>> #include "enic.h" >>>> @@ -561,6 +563,7 @@ enic_free_consistent(__rte_unused struct >>>> rte_pci_device *hwdev, >>>> /* Nothing to be done */ >>>> } >>>> >>>> +#ifndef VFIO_PRESENT >>>> static void >>>> enic_intr_handler(__rte_unused struct rte_intr_handle *handle, >>>> void *arg) >>>> @@ -572,6 +575,7 @@ enic_intr_handler(__rte_unused struct >>>> rte_intr_handle *handle, >>>> >>>> enic_log_q_error(enic); >>>> } >>>> +#endif >>> -- >>> Thomas >> >
2014-12-16 10:00, Sujith Sankar: > On 16/12/14 1:21 pm, "Qiu, Michael" <michael.qiu@intel.com> wrote: > >On 12/16/2014 12:13 PM, Sujith Sankar (ssujith) wrote: > >> On 16/12/14 4:54 am, "Thomas Monjalon" <thomas.monjalon@6wind.com> wrote: > >>> 2014-12-12 13:48, Sujith Sankar: > >>>> This patch corrects the usage of the flag VFIO_PRESENT in enic driver. > >>> > >>> Please, could you explain why the flag VFIO_PRESENT was not well used? > >> > >> Without including eal_vfio.h, VFIO_PRESENT is not available in enic. > >> Hence VFIO specific code in enic was not getting compiled and some errors > >> were generated during run-time. > >> > >>>> This has uncovered a few warnings, and this patch corrects those too. > >>> [...] > >>>> --- a/lib/librte_pmd_enic/enic_main.c > >>>> +++ b/lib/librte_pmd_enic/enic_main.c > >>>> @@ -39,6 +39,7 @@ > >>>> #include <sys/mman.h> > >>>> #include <fcntl.h> > >>>> #include <libgen.h> > >>>> +#include <sys/ioctl.h> > >>>> > >>>> #include <rte_pci.h> > >>>> #include <rte_memzone.h> > >>>> @@ -46,6 +47,7 @@ > >>>> #include <rte_mbuf.h> > >>>> #include <rte_string_fns.h> > >>>> #include <rte_ethdev.h> > >>>> +#include <eal_vfio.h> > >>> > >>> This header was not designed to be included by PMDs. > >>> It will break compilation on BSD. > >> > >> Is there an alternative to make VFIO_PRESENT available in enic? Please > >> advise. > > > >You can remove VFIO_PRESENT check, it all been done in eal, you can > >check other nic pmds for reference. > >And seems you done the interrupt logic all by your self? > > > >Thanks, > >Michael > > Thanks for the comment, Michael. > > Without the code under VFIO_PRESENT flag, I was getting false notification > of interrupt at the beginning (cat /proc/interrupts showed all 0s). > Let me try to root cause it. I shall get back after some debugging and > testing. > > There was one more reason behind doing interrupt logic in enic. No matter > how many interrupts the user configures, enic pmd needs only one. > There is no way to communicate that to the EAL. I thought doing interrupt > login in enic could avoid registering that many interrupts. If you think something is wrong or could be improved in EAL, it's really better to patch it instead of workarounding in the PMD. Thanks
> On 16/12/14 4:54 am, "Thomas Monjalon" <thomas.monjalon@6wind.com> > wrote: > > >2014-12-12 13:48, Sujith Sankar: > >> This patch corrects the usage of the flag VFIO_PRESENT in enic driver. > > > >Please, could you explain why the flag VFIO_PRESENT was not well used? > > Without including eal_vfio.h, VFIO_PRESENT is not available in enic. > Hence VFIO specific code in enic was not getting compiled and some errors > were generated during run-time. > > > > >> This has uncovered a few warnings, and this patch corrects those too. > >[...] > >> --- a/lib/librte_pmd_enic/enic_main.c > >> +++ b/lib/librte_pmd_enic/enic_main.c > >> @@ -39,6 +39,7 @@ > >> #include <sys/mman.h> > >> #include <fcntl.h> > >> #include <libgen.h> > >> +#include <sys/ioctl.h> > >> > >> #include <rte_pci.h> > >> #include <rte_memzone.h> > >> @@ -46,6 +47,7 @@ > >> #include <rte_mbuf.h> > >> #include <rte_string_fns.h> > >> #include <rte_ethdev.h> > >> +#include <eal_vfio.h> > > > >This header was not designed to be included by PMDs. > >It will break compilation on BSD. > > Is there an alternative to make VFIO_PRESENT available in enic? Please > advise. > > Thanks, > -Sujith > > > > >> #include "enic_compat.h" > >> #include "enic.h" > >> @@ -561,6 +563,7 @@ enic_free_consistent(__rte_unused struct > >>rte_pci_device *hwdev, > >> /* Nothing to be done */ > >> } > >> > >> +#ifndef VFIO_PRESENT > >> static void > >> enic_intr_handler(__rte_unused struct rte_intr_handle *handle, > >> void *arg) > >> @@ -572,6 +575,7 @@ enic_intr_handler(__rte_unused struct > >>rte_intr_handle *handle, > >> > >> enic_log_q_error(enic); > >> } > >> +#endif > > > >-- > >Thomas Hi Sujith Thomas is correct, VFIO code is designed to be EAL-only (mainly because it's Linuxapp-specific, and PMD's are intended to be cross-platform at least when it comes to compilation). Whatever it is that you're working around is better fixed in the EAL itself rather than in the PMD. Thanks, Anatoly
On 16/12/14 3:52 pm, "Burakov, Anatoly" <anatoly.burakov@intel.com> wrote: >> On 16/12/14 4:54 am, "Thomas Monjalon" <thomas.monjalon@6wind.com> >> wrote: >> >> >2014-12-12 13:48, Sujith Sankar: >> >> This patch corrects the usage of the flag VFIO_PRESENT in enic >>driver. >> > >> >Please, could you explain why the flag VFIO_PRESENT was not well used? >> >> Without including eal_vfio.h, VFIO_PRESENT is not available in enic. >> Hence VFIO specific code in enic was not getting compiled and some >>errors >> were generated during run-time. >> >> > >> >> This has uncovered a few warnings, and this patch corrects those too. >> >[...] >> >> --- a/lib/librte_pmd_enic/enic_main.c >> >> +++ b/lib/librte_pmd_enic/enic_main.c >> >> @@ -39,6 +39,7 @@ >> >> #include <sys/mman.h> >> >> #include <fcntl.h> >> >> #include <libgen.h> >> >> +#include <sys/ioctl.h> >> >> >> >> #include <rte_pci.h> >> >> #include <rte_memzone.h> >> >> @@ -46,6 +47,7 @@ >> >> #include <rte_mbuf.h> >> >> #include <rte_string_fns.h> >> >> #include <rte_ethdev.h> >> >> +#include <eal_vfio.h> >> > >> >This header was not designed to be included by PMDs. >> >It will break compilation on BSD. >> >> Is there an alternative to make VFIO_PRESENT available in enic? Please >> advise. >> >> Thanks, >> -Sujith >> >> > >> >> #include "enic_compat.h" >> >> #include "enic.h" >> >> @@ -561,6 +563,7 @@ enic_free_consistent(__rte_unused struct >> >>rte_pci_device *hwdev, >> >> /* Nothing to be done */ >> >> } >> >> >> >> +#ifndef VFIO_PRESENT >> >> static void >> >> enic_intr_handler(__rte_unused struct rte_intr_handle *handle, >> >> void *arg) >> >> @@ -572,6 +575,7 @@ enic_intr_handler(__rte_unused struct >> >>rte_intr_handle *handle, >> >> >> >> enic_log_q_error(enic); >> >> } >> >> +#endif >> > >> >-- >> >Thomas > >Hi Sujith > >Thomas is correct, VFIO code is designed to be EAL-only (mainly because >it's Linuxapp-specific, and PMD's are intended to be cross-platform at >least when it comes to compilation). Whatever it is that you're working >around is better fixed in the EAL itself rather than in the PMD. I agree with you and Thomas. Let me find the root cause for the false trigger. Thanks, -Sujith > >Thanks, >Anatoly
> -----Original Message----- > From: Sujith Sankar (ssujith) [mailto:ssujith@cisco.com] > Sent: Tuesday, December 16, 2014 10:34 AM > To: Burakov, Anatoly; Thomas Monjalon > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] enic: corrected the usage of VFIO_PRESENT > > > > On 16/12/14 3:52 pm, "Burakov, Anatoly" <anatoly.burakov@intel.com> > wrote: > > >> On 16/12/14 4:54 am, "Thomas Monjalon" > <thomas.monjalon@6wind.com> > >> wrote: > >> > >> >2014-12-12 13:48, Sujith Sankar: > >> >> This patch corrects the usage of the flag VFIO_PRESENT in enic > >>driver. > >> > > >> >Please, could you explain why the flag VFIO_PRESENT was not well > used? > >> > >> Without including eal_vfio.h, VFIO_PRESENT is not available in enic. > >> Hence VFIO specific code in enic was not getting compiled and some > >>errors were generated during run-time. > >> > >> > > >> >> This has uncovered a few warnings, and this patch corrects those too. > >> >[...] > >> >> --- a/lib/librte_pmd_enic/enic_main.c > >> >> +++ b/lib/librte_pmd_enic/enic_main.c > >> >> @@ -39,6 +39,7 @@ > >> >> #include <sys/mman.h> > >> >> #include <fcntl.h> > >> >> #include <libgen.h> > >> >> +#include <sys/ioctl.h> > >> >> > >> >> #include <rte_pci.h> > >> >> #include <rte_memzone.h> > >> >> @@ -46,6 +47,7 @@ > >> >> #include <rte_mbuf.h> > >> >> #include <rte_string_fns.h> > >> >> #include <rte_ethdev.h> > >> >> +#include <eal_vfio.h> > >> > > >> >This header was not designed to be included by PMDs. > >> >It will break compilation on BSD. > >> > >> Is there an alternative to make VFIO_PRESENT available in enic? > >> Please advise. > >> > >> Thanks, > >> -Sujith > >> > >> > > >> >> #include "enic_compat.h" > >> >> #include "enic.h" > >> >> @@ -561,6 +563,7 @@ enic_free_consistent(__rte_unused struct > >> >>rte_pci_device *hwdev, > >> >> /* Nothing to be done */ > >> >> } > >> >> > >> >> +#ifndef VFIO_PRESENT > >> >> static void > >> >> enic_intr_handler(__rte_unused struct rte_intr_handle *handle, > >> >> void *arg) > >> >> @@ -572,6 +575,7 @@ enic_intr_handler(__rte_unused struct > >> >>rte_intr_handle *handle, > >> >> > >> >> enic_log_q_error(enic); > >> >> } > >> >> +#endif > >> > > >> >-- > >> >Thomas > > > >Hi Sujith > > > >Thomas is correct, VFIO code is designed to be EAL-only (mainly because > >it's Linuxapp-specific, and PMD's are intended to be cross-platform at > >least when it comes to compilation). Whatever it is that you're working > >around is better fixed in the EAL itself rather than in the PMD. > > I agree with you and Thomas. Let me find the root cause for the false trigger. > > Thanks, > -Sujith > You may find it in EAL VFIO interrupts code. When VFIO enables some interrupt types, it manually sends a trigger. Normally, this "trigger" just enables interrupts, but maybe for ENIC it's different. I therefore suggest you to look there first. Thanks, Anatoly
On 16/12/14 4:06 pm, "Burakov, Anatoly" <anatoly.burakov@intel.com> wrote: >> -----Original Message----- >> From: Sujith Sankar (ssujith) [mailto:ssujith@cisco.com] >> Sent: Tuesday, December 16, 2014 10:34 AM >> To: Burakov, Anatoly; Thomas Monjalon >> Cc: dev@dpdk.org >> Subject: Re: [dpdk-dev] [PATCH] enic: corrected the usage of >>VFIO_PRESENT >> >> >> >> On 16/12/14 3:52 pm, "Burakov, Anatoly" <anatoly.burakov@intel.com> >> wrote: >> >> >> On 16/12/14 4:54 am, "Thomas Monjalon" >> <thomas.monjalon@6wind.com> >> >> wrote: >> >> >> >> >2014-12-12 13:48, Sujith Sankar: >> >> >> This patch corrects the usage of the flag VFIO_PRESENT in enic >> >>driver. >> >> > >> >> >Please, could you explain why the flag VFIO_PRESENT was not well >> used? >> >> >> >> Without including eal_vfio.h, VFIO_PRESENT is not available in enic. >> >> Hence VFIO specific code in enic was not getting compiled and some >> >>errors were generated during run-time. >> >> >> >> > >> >> >> This has uncovered a few warnings, and this patch corrects those >>too. >> >> >[...] >> >> >> --- a/lib/librte_pmd_enic/enic_main.c >> >> >> +++ b/lib/librte_pmd_enic/enic_main.c >> >> >> @@ -39,6 +39,7 @@ >> >> >> #include <sys/mman.h> >> >> >> #include <fcntl.h> >> >> >> #include <libgen.h> >> >> >> +#include <sys/ioctl.h> >> >> >> >> >> >> #include <rte_pci.h> >> >> >> #include <rte_memzone.h> >> >> >> @@ -46,6 +47,7 @@ >> >> >> #include <rte_mbuf.h> >> >> >> #include <rte_string_fns.h> >> >> >> #include <rte_ethdev.h> >> >> >> +#include <eal_vfio.h> >> >> > >> >> >This header was not designed to be included by PMDs. >> >> >It will break compilation on BSD. >> >> >> >> Is there an alternative to make VFIO_PRESENT available in enic? >> >> Please advise. >> >> >> >> Thanks, >> >> -Sujith >> >> >> >> > >> >> >> #include "enic_compat.h" >> >> >> #include "enic.h" >> >> >> @@ -561,6 +563,7 @@ enic_free_consistent(__rte_unused struct >> >> >>rte_pci_device *hwdev, >> >> >> /* Nothing to be done */ >> >> >> } >> >> >> >> >> >> +#ifndef VFIO_PRESENT >> >> >> static void >> >> >> enic_intr_handler(__rte_unused struct rte_intr_handle *handle, >> >> >> void *arg) >> >> >> @@ -572,6 +575,7 @@ enic_intr_handler(__rte_unused struct >> >> >>rte_intr_handle *handle, >> >> >> >> >> >> enic_log_q_error(enic); >> >> >> } >> >> >> +#endif >> >> > >> >> >-- >> >> >Thomas >> > >> >Hi Sujith >> > >> >Thomas is correct, VFIO code is designed to be EAL-only (mainly because >> >it's Linuxapp-specific, and PMD's are intended to be cross-platform at >> >least when it comes to compilation). Whatever it is that you're working >> >around is better fixed in the EAL itself rather than in the PMD. >> >> I agree with you and Thomas. Let me find the root cause for the false >>trigger. >> >> Thanks, >> -Sujith >> > >You may find it in EAL VFIO interrupts code. When VFIO enables some >interrupt types, it manually sends a trigger. Normally, this "trigger" >just enables interrupts, but maybe for ENIC it's different. I therefore >suggest you to look there first. Ok. Thanks for the info, Anatoly. ENIC does not need that trigger. Let me take a look at that first. Thanks, -Sujith > >Thanks, >Anatoly
diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile index a2a623f..3271960 100644 --- a/lib/librte_pmd_enic/Makefile +++ b/lib/librte_pmd_enic/Makefile @@ -39,6 +39,7 @@ LIB = librte_pmd_enic.a CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/ CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/ +CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal/ CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) -Wno-strict-aliasing diff --git a/lib/librte_pmd_enic/enic.h b/lib/librte_pmd_enic/enic.h index c43417c..c692bab 100644 --- a/lib/librte_pmd_enic/enic.h +++ b/lib/librte_pmd_enic/enic.h @@ -182,6 +182,7 @@ extern void enic_dev_stats_get(struct enic *enic, struct rte_eth_stats *r_stats); extern void enic_dev_stats_clear(struct enic *enic); extern void enic_add_packet_filter(struct enic *enic); +extern void *enic_err_intr_handler(void *arg); extern void enic_set_mac_address(struct enic *enic, uint8_t *mac_addr); extern void enic_del_mac_address(struct enic *enic); extern unsigned int enic_cleanup_wq(struct enic *enic, struct vnic_wq *wq); diff --git a/lib/librte_pmd_enic/enic_main.c b/lib/librte_pmd_enic/enic_main.c index e4f43c5..469cb6c 100644 --- a/lib/librte_pmd_enic/enic_main.c +++ b/lib/librte_pmd_enic/enic_main.c @@ -39,6 +39,7 @@ #include <sys/mman.h> #include <fcntl.h> #include <libgen.h> +#include <sys/ioctl.h> #include <rte_pci.h> #include <rte_memzone.h> @@ -46,6 +47,7 @@ #include <rte_mbuf.h> #include <rte_string_fns.h> #include <rte_ethdev.h> +#include <eal_vfio.h> #include "enic_compat.h" #include "enic.h" @@ -561,6 +563,7 @@ enic_free_consistent(__rte_unused struct rte_pci_device *hwdev, /* Nothing to be done */ } +#ifndef VFIO_PRESENT static void enic_intr_handler(__rte_unused struct rte_intr_handle *handle, void *arg) @@ -572,6 +575,7 @@ enic_intr_handler(__rte_unused struct rte_intr_handle *handle, enic_log_q_error(enic); } +#endif int enic_enable(struct enic *enic) { @@ -978,12 +982,13 @@ static void enic_eventfd_init(struct enic *enic) void *enic_err_intr_handler(void *arg) { struct enic *enic = (struct enic *)arg; - unsigned int intr = enic_msix_err_intr(enic); - ssize_t size; uint64_t data; while (1) { - size = read(enic->eventfd, &data, sizeof(data)); + if (-1 == read(enic->eventfd, &data, sizeof(data))) { + dev_err(enic, "eventfd read failed with error %d\n", errno); + continue; + } dev_err(enic, "Err intr.\n"); vnic_intr_return_all_credits(&enic->intr); @@ -1035,7 +1040,6 @@ static int enic_set_intr_mode(struct enic *enic) int *fds; int size; int ret = -1; - int index; if (enic->intr_count < 1) { dev_err(enic, "Unsupported resource conf.\n");