From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Alexander Duyck <alexander.h.duyck@redhat.com>, netdev@vger.kernel.org
Cc: Hyong-Youb Kim <hykim@myri.com>, davem@davemloft.net
Subject: Re: [PATCH v2 5/6] myri10ge: use eth_skb_pad helper
Date: Wed, 03 Dec 2014 21:56:54 +0300 [thread overview]
Message-ID: <547F5CF6.9010904@cogentembedded.com> (raw)
In-Reply-To: <20141203161758.9223.85476.stgit@ahduyck-vm-fedora20>
Hello.
On 12/03/2014 07:17 PM, Alexander Duyck wrote:
> Update myri10ge to use eth_skb_pad helper. This also corrects a minor
> issue as the driver was updating length without updating the tail pointer.
> Cc: Hyong-Youb Kim <hykim@myri.com>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
> ---
> drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 15 +++++----------
> 1 file changed, 5 insertions(+), 10 deletions(-)
> diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> index 9e7e3f1..af09905 100644
> --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> @@ -2913,16 +2913,11 @@ again:
> flags |= MXGEFW_FLAGS_SMALL;
>
> /* pad frames to at least ETH_ZLEN bytes */
> - if (unlikely(skb->len < ETH_ZLEN)) {
> - if (skb_padto(skb, ETH_ZLEN)) {
> - /* The packet is gone, so we must
> - * return 0 */
> - ss->stats.tx_dropped += 1;
> - return NETDEV_TX_OK;
> - }
> - /* adjust the len to account for the zero pad
> - * so that the nic can know how long it is */
> - skb->len = ETH_ZLEN;
> + if (eth_skb_pad(skb)) {
> + /* The packet is gone, so we must
> + * return 0 */
Time to fix the comment style, perhaps? The preferred one for the
networking code is:
/* bla
* bla
*/
> + ss->stats.tx_dropped += 1;
Hm, why not 'ss->stats.tx_dropped++'?
> + return NETDEV_TX_OK;
> }
> }
WBR, Sergei
next prev parent reply other threads:[~2014-12-03 18:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-03 16:17 [PATCH v2 0/6] net: Add helper for padding short Ethernet frames Alexander Duyck
2014-12-03 16:17 ` [PATCH v2 1/6] net: Add functions for handling padding frame and adding to length Alexander Duyck
2014-12-03 16:17 ` [PATCH v2 2/6] ethernet/intel: Use eth_skb_pad and skb_put_padto helpers Alexander Duyck
2014-12-03 19:25 ` Jeff Kirsher
2014-12-03 16:17 ` [PATCH v2 3/6] emulex: Use skb_put_padto instead of skb_padto() and skb->len assignment Alexander Duyck
2014-12-03 16:17 ` [PATCH v2 4/6] niu: Use eth_skb_pad helper Alexander Duyck
2014-12-03 16:17 ` [PATCH v2 5/6] myri10ge: use " Alexander Duyck
2014-12-03 18:56 ` Sergei Shtylyov [this message]
2014-12-03 16:18 ` [PATCH v2 6/6] r8169: Use eth_skb_pad function Alexander Duyck
2014-12-09 1:48 ` [PATCH v2 0/6] net: Add helper for padding short Ethernet frames David Miller
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=547F5CF6.9010904@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=alexander.h.duyck@redhat.com \
--cc=davem@davemloft.net \
--cc=hykim@myri.com \
--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;
as well as URLs for NNTP newsgroup(s).