Re: [v4, net-next 4/7] bng_en: Add TX support

From: Bhargava Chenna Marreddy

Date: Fri Jan 16 2026 - 13:43:52 EST


On Tue, Jan 13, 2026 at 2:46 AM Bhargava Chenna Marreddy
<bhargava.marreddy@xxxxxxxxxxxx> wrote:
>
> On Thu, Jan 8, 2026 at 3:39 PM Paolo Abeni <pabeni@xxxxxxxxxx> 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

>
> >

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature