RE: [PATCH net-next 1/3] ibmvnic: Enable scatter-gather support

2017-10-27 Thread David Laight
From: Thomas Falcon
> Sent: 26 October 2017 18:52
...
> >>memset(dst, 0, adapter->req_mtu);
> > Seems unnecessary.
> 
> I removed that bit, and so far you seem to be right :) .

I'd check that short frames are padded with zeros.

David



Re: [PATCH net-next 1/3] ibmvnic: Enable scatter-gather support

2017-10-26 Thread Thomas Falcon
On 10/18/2017 06:04 AM, David Laight wrote:
> From: Thomas Falcon
>> Sent: 17 October 2017 18:37
>> This patch enables scatter gather support. Since there is no
>> HW/FW scatter-gather support at this time, the driver needs to
>> loop through each fragment and copy it to a contiguous, pre-mapped
>> buffer entry.
> ...
>>  offset = index * adapter->req_mtu;
>>  dst = tx_pool->long_term_buff.buff + offset;
> You should be able to treat the pre-allocated data area as a
> big ring buffer.
> So it can hold a lot of small frames or a few big ones.
> This slightly complicates the 'is there enough space for
> this packet' check since you need buffer space as well
> as a ring entry.
>
> You also really want to align each tx buffer on a 4n+2
> boundary so that most of the copy is aligned.

Thanks for your comments. I'll try to address that in a future patch.

>
>>  memset(dst, 0, adapter->req_mtu);
> Seems unnecessary.

I removed that bit, and so far you seem to be right :) .

Thanks,
Tom
>
>   David
>



RE: [PATCH net-next 1/3] ibmvnic: Enable scatter-gather support

2017-10-18 Thread David Laight
From: Thomas Falcon
> Sent: 17 October 2017 18:37
> This patch enables scatter gather support. Since there is no
> HW/FW scatter-gather support at this time, the driver needs to
> loop through each fragment and copy it to a contiguous, pre-mapped
> buffer entry.
...
>   offset = index * adapter->req_mtu;
>   dst = tx_pool->long_term_buff.buff + offset;

You should be able to treat the pre-allocated data area as a
big ring buffer.
So it can hold a lot of small frames or a few big ones.
This slightly complicates the 'is there enough space for
this packet' check since you need buffer space as well
as a ring entry.

You also really want to align each tx buffer on a 4n+2
boundary so that most of the copy is aligned.

>   memset(dst, 0, adapter->req_mtu);
Seems unnecessary.

David