[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20240305052421.1180221-1-rkannoth@marvell.com>
Date: Tue, 5 Mar 2024 10:54:21 +0530
From: Ratheesh Kannoth <rkannoth@...vell.com>
To: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: Ratheesh Kannoth <rkannoth@...vell.com>
Subject: Re: [PATCH v1] ps3_gelic_net: Use napi routines for RX SKB
On 2024-03-01 at 13:50:11, Geoff Levand (geoff@...radead.org) wrote:
> + if (unlikely(!napi_buff))
> + return -ENOMEM;
>
> - descr->skb = netdev_alloc_skb(*card->netdev, rx_skb_size);
> - if (!descr->skb) {
> - descr->hw_regs.payload.dev_addr = 0; /* tell DMAC don't touch memory */
> + descr->skb = napi_build_skb(napi_buff, napi_buff_size);
> +
> + if (unlikely(!descr->skb)) {
> + skb_free_frag(napi_buff);
> return -ENOMEM;
> }
>
> - offset = ((unsigned long)descr->skb->data) &
> - (GELIC_NET_RXBUF_ALIGN - 1);
> - if (offset)
> - skb_reserve(descr->skb, GELIC_NET_RXBUF_ALIGN - offset);
> - /* io-mmu-map the skb */
> - cpu_addr = dma_map_single(ctodev(card), descr->skb->data,
> - GELIC_NET_MAX_FRAME, DMA_FROM_DEVICE);
> - descr->hw_regs.payload.dev_addr = cpu_to_be32(cpu_addr);
> - if (dma_mapping_error(ctodev(card), cpu_addr)) {
> - dev_kfree_skb_any(descr->skb);
> + cpu_addr = dma_map_single(dev, napi_buff, napi_buff_size,
> + DMA_FROM_DEVICE);
> +
> + if (dma_mapping_error(dev, cpu_addr)) {
> + skb_free_frag(napi_buff);
skb->head is freed; dont you need to free skb as well ?
> descr->skb = NULL;
Powered by blists - more mailing lists