Re: [net-next PATCH 1/2] igbvf: add new driver to support 82576 virtual functions

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alexander Duyck
Date: Tuesday, March 17, 2009 - 5:12 pm

Thanks for all the comments.  I tried to incorporate most of them into 
the igbvf driver and also ended up porting some over to our other 
drivers, specifically igb since the igbvf driver copies much of the code.

I have added my comments inline below.

Thanks,

Alex

Andrew Morton wrote:

I agree, the values have been changed to current and base.


It doesn't, it has been dropped and references to it replaced with 
IGBVF_GLOBAL_STATS_LEN.


This bit isn't set in interrupt context.  This is always used out of 
interrupt context and is just to prevent multiple setting changes at the 
same time.


This whole section has been redone.  The approach here didn't work well 
and so I redid it to match how we do this in igb.


Actually it has no effect on the driver if the sleep fails.  For the 
most part the only reason for having this is to allow enough time to 
guarantee that the link has recovered after the link test.


Actually I think the ugliness is due to the fact that it is doing the 
check itself twice.  The code below is what it will look like after 
being redone.

                 data[i] = ((igbvf_gstrings_stats[i].sizeof_stat ==
                             sizeof(u64)) ? (*(u64 *)p - *(u64 *)b) :
                             (*(u32 *)p - *(u32 *)b));


Actually that was already done and the macro was unused.  It has been 
dropped.


By switching these over to a typecast I can get away from some of the 
ugliness but it is still there.  Below are the changes I made to support 
what you suggested.

#define IGBVF_RX_DESC_ADV(R, i)     \
         (&((((R).desc))[i].rx_desc))
#define IGBVF_TX_DESC_ADV(R, i)     \
         (&((((R).desc))[i].tx_desc))
#define IGBVF_TX_CTXTDESC_ADV(R, i) \
         (&((((R).desc))[i].tx_context_desc))



union igbvf_desc {
         union e1000_adv_rx_desc rx_desc;
         union e1000_adv_tx_desc tx_desc;
         struct e1000_adv_tx_context_desc tx_context_desc;
};


For SR-IOV it is always possible that someone might decide to run some 
of the VFs in their DOM0 kernel so it is best to leave it in there to 
support it just in case.


This can get to be up to 4K * size of igbvf_buffer which int total comes 
to something like 32K or more.


Calling pci_disable_msix is safe since the first thing it checks for is 
to verify if msix is enabled.  If it isn't the function does nothing.


I agree, it has been fixed.


This is the coding convention we have been using this format for all of 
our functions for a long time.  If you check e1000 or igb you will see 
they all use this format for function comments.


I've added dev_err message if this fails, but other than that it is just 
a failure to set a receive filter so it isn't a showstopper.  Also the 
call itself is a void so I have no way of notifying the stack of the error.


I redid the entire section above.  This is one spot I missed when I was 
cleaning up all this code.


Once again this isn't called normally in interrupt context so it is safe 
here since if we set the bit we should clear it when we are done.


done.


I think we want to use flush_scheduled_work here since there is also the 
dev watchdog timer which could be in the middle of running while we are 
shutting down if we don't flush all work queues.


I know it is a lot of code, but it is a new driver so it can't really be 
helped.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [net-next PATCH 1/2] igbvf: add new driver to support ..., Alexander Duyck, (Tue Mar 17, 5:12 pm)