* [PATCH] igb: fix misinterpreted return value of pci_enable_msix
@ 2009-11-24 10:31 Stefan Assmann
2009-11-24 10:40 ` Florian Westphal
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Assmann @ 2009-11-24 10:31 UTC (permalink / raw)
To: netdev; +Cc: Andy Gospodarek, alexander.h.duyck, davem
From: Stefan Assmann <sassmann@redhat.com>
In the igb driver a return value of 0 of function pci_enable_msix is
interpreted as an error case. The correct behaviour is to check < 0 for error
values.
Signed-off-by: Stefan Assmann <sassmann@redhat.com>
---
drivers/net/igb/igb_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index bb1a6ee..745481d 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -694,7 +694,7 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter)
err = pci_enable_msix(adapter->pdev,
adapter->msix_entries,
numvecs);
- if (err == 0)
+ if (err < 0)
goto out;
igb_reset_interrupt_capability(adapter);
--
1.6.5.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] igb: fix misinterpreted return value of pci_enable_msix
2009-11-24 10:31 [PATCH] igb: fix misinterpreted return value of pci_enable_msix Stefan Assmann
@ 2009-11-24 10:40 ` Florian Westphal
2009-11-24 10:51 ` Stefan Assmann
0 siblings, 1 reply; 3+ messages in thread
From: Florian Westphal @ 2009-11-24 10:40 UTC (permalink / raw)
To: Stefan Assmann; +Cc: netdev, Andy Gospodarek, alexander.h.duyck, davem
Stefan Assmann <sassmann@redhat.com> wrote:
> From: Stefan Assmann <sassmann@redhat.com>
>
> In the igb driver a return value of 0 of function pci_enable_msix is
> interpreted as an error case. The correct behaviour is to check < 0 for error
> values.
>
> Signed-off-by: Stefan Assmann <sassmann@redhat.com>
> ---
> drivers/net/igb/igb_main.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
> index bb1a6ee..745481d 100644
> --- a/drivers/net/igb/igb_main.c
> +++ b/drivers/net/igb/igb_main.c
> @@ -694,7 +694,7 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter)
> err = pci_enable_msix(adapter->pdev,
> adapter->msix_entries,
> numvecs);
> - if (err == 0)
> + if (err < 0)
> goto out;
>
The existing code looks correct to me:
if (err == 0)
goto out;
igb_reset_interrupt_capability(adapter);
/* If we can't do MSI-X, try MSI * */
msi_only:
so the "goto out" appears to be the "success" case.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] igb: fix misinterpreted return value of pci_enable_msix
2009-11-24 10:40 ` Florian Westphal
@ 2009-11-24 10:51 ` Stefan Assmann
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Assmann @ 2009-11-24 10:51 UTC (permalink / raw)
To: Florian Westphal; +Cc: netdev, Andy Gospodarek, alexander.h.duyck, davem
On 24.11.2009 11:40, Florian Westphal wrote:
> Stefan Assmann <sassmann@redhat.com> wrote:
>> From: Stefan Assmann <sassmann@redhat.com>
>>
>> In the igb driver a return value of 0 of function pci_enable_msix is
>> interpreted as an error case. The correct behaviour is to check < 0 for error
>> values.
>>
>> Signed-off-by: Stefan Assmann <sassmann@redhat.com>
>> ---
>> drivers/net/igb/igb_main.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
>> index bb1a6ee..745481d 100644
>> --- a/drivers/net/igb/igb_main.c
>> +++ b/drivers/net/igb/igb_main.c
>> @@ -694,7 +694,7 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter)
>> err = pci_enable_msix(adapter->pdev,
>> adapter->msix_entries,
>> numvecs);
>> - if (err == 0)
>> + if (err < 0)
>> goto out;
>>
>
> The existing code looks correct to me:
>
> if (err == 0)
> goto out;
>
> igb_reset_interrupt_capability(adapter);
>
> /* If we can't do MSI-X, try MSI * */
> msi_only:
>
>
> so the "goto out" appears to be the "success" case.
Hi Florian,
thanks for pointing this out. I've jumped to conclusions too fast.
There's a problem with igb MSI-X in RHEL5 in the kdump case and this
fixed it for me. But you're right, it's not the proper solution. I'll
report back when I have more information.
Stefan
--
Stefan Assmann | Red Hat GmbH
Software Engineer | Otto-Hahn-Strasse 20, 85609 Dornach
| HR: Amtsgericht Muenchen HRB 153243
| GF: Brendan Lane, Charlie Peters,
sassmann at redhat.com | Michael Cunningham, Charles Cachera
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-11-24 10:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-24 10:31 [PATCH] igb: fix misinterpreted return value of pci_enable_msix Stefan Assmann
2009-11-24 10:40 ` Florian Westphal
2009-11-24 10:51 ` Stefan Assmann
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).