On Thu, Nov 19, 2020 at 04:22:24PM -0800, David Awogbemila wrote: > On Thu, Nov 19, 2020 at 12:21 PM Saeed Mahameed <sa...@kernel.org> wrote: > > > > On Wed, 2020-11-18 at 15:20 -0800, David Awogbemila wrote: > > > From: Catherine Sullivan <csu...@google.com> > > > > > > Add support to describe device for parsing device options. As > > > the first device option, add raw addressing. > > > > > > "Raw Addressing" mode (as opposed to the current "qpl" mode) is an > > > operational mode which allows the driver avoid bounce buffer copies > > > which it currently performs using pre-allocated qpls > > > (queue_page_lists) > > > when sending and receiving packets. > > > For egress packets, the provided skb data addresses will be > > > dma_map'ed and > > > passed to the device, allowing the NIC can perform DMA directly - the > > > driver will not have to copy the buffer content into pre-allocated > > > buffers/qpls (as in qpl mode). > > > For ingress packets, copies are also eliminated as buffers are handed > > > to > > > the networking stack and then recycled or re-allocated as > > > necessary, avoiding the use of skb_copy_to_linear_data(). > > > > > > This patch only introduces the option to the driver. > > > Subsequent patches will add the ingress and egress functionality. > > > > > > Reviewed-by: Yangchun Fu <yangc...@google.com> > > > Signed-off-by: Catherine Sullivan <csu...@google.com> > > > Signed-off-by: David Awogbemila <awogbem...@google.com> > > > --- > > > > > ... > > > diff --git a/drivers/net/ethernet/google/gve/gve_adminq.c > > > b/drivers/net/ethernet/google/gve/gve_adminq.c > > > index 24ae6a28a806..1e2d407cb9d2 100644 > > > --- a/drivers/net/ethernet/google/gve/gve_adminq.c > > > +++ b/drivers/net/ethernet/google/gve/gve_adminq.c > > > @@ -14,6 +14,57 @@ > > > #define GVE_ADMINQ_SLEEP_LEN 20 > > > #define GVE_MAX_ADMINQ_EVENT_COUNTER_CHECK 100 > > > > > > +#define GVE_DEVICE_OPTION_ERROR_FMT "%s option error:\n" \ > > > +"Expected: length=%d, feature_mask=%x.\n" \ > > > +"Actual: length=%d, feature_mask=%x.\n" > > > + > > > +static inline > > > +struct gve_device_option *gve_get_next_option(struct > > > > > > > Following Dave's policy, no static inline functions in C files. > > This is control path so you don't really need the inline here. > > Okay, I'll move it to a header file.
That's not what Saeed meant I suppose. Policy says that we let the compiler to make the decision whether or not such static function should be inlined. And since it's not a performance critical path as Saeed says then drop the inline and keep the rest as-is. > > > > > > >