[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANXQDta1rEDvzAH2akvOHOO=J5SKeYefrigiqx7YGBwv-VF7Dw@mail.gmail.com>
Date: Sat, 17 Jan 2026 00:13:33 +0530
From: Bhargava Chenna Marreddy <bhargava.marreddy@...adcom.com>
To: Paolo Abeni <pabeni@...hat.com>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
andrew+netdev@...n.ch, horms@...nel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, michael.chan@...adcom.com,
pavan.chebbi@...adcom.com, vsrama-krishna.nemani@...adcom.com,
vikas.gupta@...adcom.com,
Rajashekar Hudumula <rajashekar.hudumula@...adcom.com>
Subject: Re: [v4, net-next 4/7] bng_en: Add TX support
On Tue, Jan 13, 2026 at 2:46 AM Bhargava Chenna Marreddy
<bhargava.marreddy@...adcom.com> wrote:
>
> On Thu, Jan 8, 2026 at 3:39 PM Paolo Abeni <pabeni@...hat.com> wrote:
> >
> > On 1/5/26 8:21 AM, Bhargava Marreddy wrote:
> > > +static void __bnge_tx_int(struct bnge_net *bn, struct bnge_tx_ring_info *txr,
> > > + int budget)
> > > +{
> > > + u16 hw_cons = txr->tx_hw_cons;
> > > + struct bnge_dev *bd = bn->bd;
> > > + unsigned int tx_bytes = 0;
> > > + unsigned int tx_pkts = 0;
> > > + struct netdev_queue *txq;
> > > + u16 cons = txr->tx_cons;
> > > + skb_frag_t *frag;
> > > +
> > > + txq = netdev_get_tx_queue(bn->netdev, txr->txq_index);
> > > +
> > > + while (RING_TX(bn, cons) != hw_cons) {
> > > + struct bnge_sw_tx_bd *tx_buf;
> > > + struct sk_buff *skb;
> > > + int j, last;
> > > +
> > > + tx_buf = &txr->tx_buf_ring[RING_TX(bn, cons)];
> > > + skb = tx_buf->skb;
> > > + if (unlikely(!skb)) {
> > > + bnge_sched_reset_txr(bn, txr, cons);
> > > + return;
> > > + }
> > > +
> > > + cons = NEXT_TX(cons);
> > > + tx_pkts++;
> > > + tx_bytes += skb->len;
> > > + tx_buf->skb = NULL;
> > > +
> > > + dma_unmap_single(bd->dev, dma_unmap_addr(tx_buf, mapping),
> > > + skb_headlen(skb), DMA_TO_DEVICE);
> > > + last = tx_buf->nr_frags;
> > > +
> > > + for (j = 0; j < last; j++) {
> > > + frag = &skb_shinfo(skb)->frags[j];
> > > + cons = NEXT_TX(cons);
> > > + tx_buf = &txr->tx_buf_ring[RING_TX(bn, cons)];
> > > + netmem_dma_unmap_page_attrs(bd->dev,
> > > + dma_unmap_addr(tx_buf,
> > > + mapping),
> > > + skb_frag_size(frag),
> > > + DMA_TO_DEVICE, 0);
> > > + }
> >
> > There is a similar chunk in bnge_free_tx_skbs(), you could avoid
> > douplication factoring that out in common helper.
>
> Agreed. I'll address this in the next revision.
Hi Paolo,
Re-thinking this: the refactoring is non-trivial and we need to
restructure this part for
PTP/XDP soon anyway. I'll skip it for this series and include it in
the future updates instead.
Thanks,
Bhargava Marreddy
>
> >
Download attachment "smime.p7s" of type "application/pkcs7-signature" (5496 bytes)
Powered by blists - more mailing lists