diff mbox

Intel I350 mini-PCIe card (igb) on Mirabox (mvebu / Armada 370)

Message ID 20140405180416.GB29787@1wt.eu (mailing list archive)
State New, archived
Headers show

Commit Message

Willy Tarreau April 5, 2014, 6:04 p.m. UTC
Hi Thomas,

On Sat, Apr 05, 2014 at 07:34:35PM +0200, Thomas Petazzoni wrote:
> Also, can you detail how you tested with just one port?

OK I just found this ugly method, I'm not sure it's the best one but it
does the job :-) It simply refuses to configure any controller but the
first one on the chip.


Best regards,
Willy

Comments

Neil Greatorex April 5, 2014, 6:55 p.m. UTC | #1
Willy, Thomas,  

I have the igb module blacklisted so that it doesn’t get loaded during boot. Then I simply did:

# echo 1 > /sys/bus/pci/devices/0000\:01\:00.1/remove
# modprobe igb  

and it only fires up the first port. I have tried the reverse (and removed 0000:01:00.0 instead) but that gives the oops.

Cheers,
Neil


On Saturday, 5 April 2014 at 7:04pm, Willy Tarreau wrote:

> Hi Thomas,
>  
> On Sat, Apr 05, 2014 at 07:34:35PM +0200, Thomas Petazzoni wrote:
> > Also, can you detail how you tested with just one port?
>  
>  
>  
> OK I just found this ugly method, I'm not sure it's the best one but it
> does the job :-) It simply refuses to configure any controller but the
> first one on the chip.
>  
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index 46d31a4..88bf1d5 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -2208,6 +2208,9 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> return -EINVAL;
> }
>  
> + if (PCI_FUNC(pdev->devfn) != 0)
> + return -ENODEV;
> +
> err = pci_enable_device_mem(pdev);
> if (err)
> return err;
>  
> Best regards,
> Willy
Willy Tarreau April 5, 2014, 7:03 p.m. UTC | #2
On Sat, Apr 05, 2014 at 07:55:03PM +0100, Neil Greatorex wrote:
> Willy, Thomas,  
> 
> I have the igb module blacklisted so that it doesn???t get loaded during
> boot. Then I simply did:
> 
> # echo 1 > /sys/bus/pci/devices/0000\:01\:00.1/remove
> # modprobe igb  

Hehe feeling stupid now :-)
Thanks for the trick, that's really useful.

> and it only fires up the first port. I have tried the reverse (and removed
> 0000:01:00.0 instead) but that gives the oops.

Quite interesting indeed.

Thanks,
Willy
diff mbox

Patch

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 46d31a4..88bf1d5 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2208,6 +2208,9 @@  static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		return -EINVAL;
 	}
 
+	if (PCI_FUNC(pdev->devfn) != 0)
+		return -ENODEV;
+
 	err = pci_enable_device_mem(pdev);
 	if (err)
 		return err;