From: Ding Tianhong <dingtianhong@huawei.com>
To: Weidong Wang <wangweidong1@huawei.com>,
David Miller <davem@davemloft.net>, <arnd@arndb.de>,
<zhangfei.gao@linaro.org>, <dan.carpenter@oracle.com>,
<tglx@linutronix.de>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next] hip04_eth: fix missing error handle for build_skb failed
Date: Wed, 13 Jan 2016 11:48:41 +0800 [thread overview]
Message-ID: <5695C919.8070203@huawei.com> (raw)
In-Reply-To: <5695C04D.1070709@huawei.com>
On 2016/1/13 11:11, Weidong Wang wrote:
> when build_skb failed, we should goto refill the buffer.
>
> Signed-off-by: Weidong Wang <wangweidong1@huawei.com>
> ---
Acked-by: Ding Tainhong <dingtianhong@huawei.com>
> drivers/net/ethernet/hisilicon/hip04_eth.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c
> index 3b39fdd..417f131 100644
> --- a/drivers/net/ethernet/hisilicon/hip04_eth.c
> +++ b/drivers/net/ethernet/hisilicon/hip04_eth.c
> @@ -500,8 +500,10 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget)
> while (cnt && !last) {
> buf = priv->rx_buf[priv->rx_head];
> skb = build_skb(buf, priv->rx_buf_size);
> - if (unlikely(!skb))
> + if (unlikely(!skb)) {
> net_dbg_ratelimited("build_skb failed\n");
> + goto refill;
> + }
>
> dma_unmap_single(&ndev->dev, priv->rx_phys[priv->rx_head],
> RX_BUF_SIZE, DMA_FROM_DEVICE);
> @@ -528,6 +530,7 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget)
> rx++;
> }
>
> +refill:
> buf = netdev_alloc_frag(priv->rx_buf_size);
> if (!buf)
> goto done;
>
next prev parent reply other threads:[~2016-01-13 3:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-13 3:11 [PATCH net-next] hip04_eth: fix missing error handle for build_skb failed Weidong Wang
2016-01-13 3:48 ` Ding Tianhong [this message]
2016-01-13 20:48 ` 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=5695C919.8070203@huawei.com \
--to=dingtianhong@huawei.com \
--cc=arnd@arndb.de \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=wangweidong1@huawei.com \
--cc=zhangfei.gao@linaro.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).