From: Coiby Xu <coiby.xu@gmail.com>
To: Benjamin Poirier <benjamin.poirier@gmail.com>
Cc: linux-staging@lists.linux.dev, netdev@vger.kernel.org
Subject: Re: About improving the qlge Ethernet driver by following drivers/staging/qlge/TODO
Date: Sun, 9 May 2021 07:27:05 +0800 [thread overview]
Message-ID: <20210508232705.6v6otnlphabfsgz7@Rk> (raw)
In-Reply-To: <20210507013239.4kmzsxtxnrpdqhuk@Rk>
On Fri, May 07, 2021 at 09:32:39AM +0800, Coiby Xu wrote:
>On Wed, May 05, 2021 at 05:59:46PM +0900, Benjamin Poirier wrote:
>>On 2021-05-04 21:14 +0800, Coiby Xu wrote:
>>>Hi Benjamin,
>>>
>>>As you have known, I'm working on improving drivers/staging/qlge. I'm
>>>not sure if I correctly understand some TODO items. Since you wrote the TODO
>>>list, could you explain some of the items or comment on the
>>>corresponding fix for me?
>>>
[...]
>>
>>However, in the same area, there is also
>> skb = netdev_alloc_skb(qdev->ndev, length);
>> [...]
>> skb_fill_page_desc(skb, 0, lbq_desc->p.pg_chunk.page,
>> lbq_desc->p.pg_chunk.offset,
>> length);
>>
>>Why is the skb allocated with "length" size? Something like
>> skb = napi_alloc_skb(&rx_ring->napi, SMALL_BUFFER_SIZE);
>>would be better I think. The head only needs enough space for the
>>subsequent hlen pull.
>
>Thanks for the explanation! I think this place needs to modified. I'll
>try to figure out how to reach this part of code so I can make sure the
>change wouldn't introduce an issue.
After failing to reach to this part of code, it occurred to me this
may be what the first TODO item meant by "dead code" that handle
non-split case,
> * commit 7c734359d350 ("qlge: Size RX buffers based on MTU.", v2.6.33-rc1)
> introduced dead code in the receive routines, which should be rewritten
> anyways by the admission of the author himself, see the comment above
> ql_build_rx_skb(). That function is now used exclusively to handle packets
> that underwent header splitting but it still contains code to handle non
> split cases.
Do you think so? Btw, I think you meant commit 4f848c0a9c265cb3457fbf842dbffd28e82a44fd
("qlge: Add RX frame handlers for non-split frames") here. Because it was in this
commit where the ql_process_mac_split_rx_intr was first introduced,
-static void ql_process_mac_rx_intr(struct ql_adapter *qdev,
+static void ql_process_mac_split_rx_intr(struct ql_adapter *qdev,
struct rx_ring *rx_ring,
- struct ib_mac_iocb_rsp *ib_mac_rsp)
+ struct ib_mac_iocb_rsp *ib_mac_rsp,
+ u16 vlan_id)
Another TODO item I don't understand is as follows,
> * the driver has a habit of using runtime checks where compile time checks are
> possible (ex. ql_free_rx_buffers(), ql_alloc_rx_buffers())
Could be more specific about which runtime checks are used in ql_free_rx_buffers
and ql_alloc_rx_buffers?
--
Best regards,
Coiby
next prev parent reply other threads:[~2021-05-08 23:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-04 13:14 About improving the qlge Ethernet driver by following drivers/staging/qlge/TODO Coiby Xu
2021-05-05 8:59 ` Benjamin Poirier
2021-05-07 1:32 ` Coiby Xu
2021-05-07 12:16 ` Benjamin Poirier
2021-05-07 13:25 ` Coiby Xu
2021-05-08 23:27 ` Coiby Xu [this message]
2021-05-09 7:51 ` Benjamin Poirier
2021-05-09 23:54 ` Coiby Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210508232705.6v6otnlphabfsgz7@Rk \
--to=coiby.xu@gmail.com \
--cc=benjamin.poirier@gmail.com \
--cc=linux-staging@lists.linux.dev \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox