Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1308006 > unrolled thread

[PATCH net-next] hip04_eth: fix missing error handle for build_skb failed

Started byWeidong Wang <wangweidong1@huawei.com>
First post2016-01-13 04:20 +0100
Last post2016-01-13 21:50 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH net-next] hip04_eth: fix missing error handle for build_skb  failed Weidong Wang <wangweidong1@huawei.com> - 2016-01-13 04:20 +0100
    Re: [PATCH net-next] hip04_eth: fix missing error handle for build_skb  failed Ding Tianhong <dingtianhong@huawei.com> - 2016-01-13 04:50 +0100
    Re: [PATCH net-next] hip04_eth: fix missing error handle for  build_skb failed David Miller <davem@davemloft.net> - 2016-01-13 21:50 +0100

#1308006 — [PATCH net-next] hip04_eth: fix missing error handle for build_skb failed

FromWeidong Wang <wangweidong1@huawei.com>
Date2016-01-13 04:20 +0100
Subject[PATCH net-next] hip04_eth: fix missing error handle for build_skb failed
Message-ID<qQk8x-24N-1@gated-at.bofh.it>
when build_skb failed, we should goto refill the buffer.

Signed-off-by: Weidong Wang <wangweidong1@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;
-- 
1.9.0

[toc] | [next] | [standalone]


#1308022

FromDing Tianhong <dingtianhong@huawei.com>
Date2016-01-13 04:50 +0100
Message-ID<qQkBB-2i0-25@gated-at.bofh.it>
In reply to#1308006
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;
> 

[toc] | [prev] | [next] | [standalone]


#1308800 — Re: [PATCH net-next] hip04_eth: fix missing error handle for build_skb failed

FromDavid Miller <davem@davemloft.net>
Date2016-01-13 21:50 +0100
SubjectRe: [PATCH net-next] hip04_eth: fix missing error handle for build_skb failed
Message-ID<qQAwG-50b-17@gated-at.bofh.it>
In reply to#1308006
From: Weidong Wang <wangweidong1@huawei.com>
Date: Wed, 13 Jan 2016 11:11:09 +0800

> when build_skb failed, we should goto refill the buffer.
> 
> Signed-off-by: Weidong Wang <wangweidong1@huawei.com>

Applied, thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web