lkml.org 
[lkml]   [2014]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH V3 0/6] Drivers: net: hyperv: Enable various offloads
From
From: "K. Y. Srinivasan" <kys@microsoft.com>
Date: Sat, 8 Mar 2014 19:22:42 -0800

> This patch set enables both checksum as well as segmentation offload.
> As part of this effort I have enabled scatter gather I/O a well.
>
> In version 2 of these patches, I addressed comments from David Miller and
> Dan Carpenter.
>
> In this version I have addressed the latest comments from David Miller.

Series applied, thanks.

I still think that fill_pg_buf() could be improved.

For example, it returns '1' if len is passed in as zero. Maybe that can't
happen, but if it does the page buffer array will be corrupted and the
driver will process garbage.

It seems so much more straightforward to me if you simply incremented
'j' in the loop when an array entry is actually filled in. Then just
return 'j'.

int j;
...
pb[j].pfn = page_to_pfn(page);
pb[j].offset = offset;
pb[j].len = bytes;
j++;
...
return j;


Then 'j' is unambiguously the number of pb array entries which were
filled in, no matter what.


\
 
 \ /
  Last update: 2014-03-10 21:41    [W:0.320 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site