linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Furong Xu <0x1207@gmail.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: "David S. Miller" <davem@davemloft.net>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Joao Pinto <jpinto@synopsys.com>,
	Corinna Vinschen <vinschen@redhat.com>,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, xfr@outlook.com, rock.xu@nio.com
Subject: Re: [PATCH net-next v1] net: stmmac: Enable TSO on VLANs
Date: Fri, 14 Jun 2024 13:28:35 +0800	[thread overview]
Message-ID: <20240614132835.000025bb@gmail.com> (raw)
In-Reply-To: <ZmrN2W8Fye450TKs@shell.armlinux.org.uk>

On Thu, 13 Jun 2024 11:45:45 +0100
"Russell King (Oracle)" <linux@armlinux.org.uk> wrote:

> On Thu, Jun 13, 2024 at 10:38:08AM +0800, Furong Xu wrote:
> > @@ -4239,16 +4239,32 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
> >  	struct stmmac_txq_stats *txq_stats;
> >  	int tmp_pay_len = 0, first_tx;
> >  	struct stmmac_tx_queue *tx_q;
> > -	bool has_vlan, set_ic;
> > +	bool set_ic;
> >  	u8 proto_hdr_len, hdr;
> >  	u32 pay_len, mss;
> >  	dma_addr_t des;
> >  	int i;
> > +	struct vlan_ethhdr *veth;
> >  
> >  	tx_q = &priv->dma_conf.tx_queue[queue];
> >  	txq_stats = &priv->xstats.txq_stats[queue];
> >  	first_tx = tx_q->cur_tx;
> >  
> > +	if (skb_vlan_tag_present(skb)) {
> > +		/* Always insert VLAN tag to SKB payload for TSO frames.
> > +		 *
> > +		 * Never insert VLAN tag by HW, since segments splited by
> > +		 * TSO engine will be un-tagged by mistake.
> > +		 */
> > +		skb_push(skb, VLAN_HLEN);
> > +		memmove(skb->data, skb->data + VLAN_HLEN, ETH_ALEN * 2);
> > +
> > +		veth = skb_vlan_eth_hdr(skb);
> > +		veth->h_vlan_proto = skb->vlan_proto;
> > +		veth->h_vlan_TCI = htons(skb_vlan_tag_get(skb));
> > +		__vlan_hwaccel_clear_tag(skb);
> > +	}  
> 
> I think drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c::
> otx2_sq_append_skb() does something similar, but uses a helper
> instead:
> 
>         if (skb_shinfo(skb)->gso_size && !is_hw_tso_supported(pfvf, skb)) {
>                 /* Insert vlan tag before giving pkt to tso */
>                 if (skb_vlan_tag_present(skb))
>                         skb = __vlan_hwaccel_push_inside(skb);
>                 otx2_sq_append_tso(pfvf, sq, skb, qidx);
>                 return true;
>         }
> 
> Maybe __vlan_hwaccel_push_inside() should be used here?
> 

Yes, it should. Thanks for your comments.
I will send a new patch.


      reply	other threads:[~2024-06-14  5:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-13  2:38 [PATCH net-next v1] net: stmmac: Enable TSO on VLANs Furong Xu
2024-06-13 10:45 ` Russell King (Oracle)
2024-06-14  5:28   ` Furong Xu [this message]

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=20240614132835.000025bb@gmail.com \
    --to=0x1207@gmail.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=joabreu@synopsys.com \
    --cc=jpinto@synopsys.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux@armlinux.org.uk \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rock.xu@nio.com \
    --cc=vinschen@redhat.com \
    --cc=xfr@outlook.com \
    /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).