All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Hariprasad Kelam <hkelam@marvell.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sunil Goutham <sgoutham@marvell.com>,
	Geetha sowjanya <gakula@marvell.com>,
	Subbaraya Sundeep <sbhatta@marvell.com>,
	Bharat Bhushan <bbhushan2@marvell.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Tomasz Duszynski <tduszynski@marvell.com>
Subject: Re: [net] Octeontx2-vf: Fix max packet length errors
Date: Fri, 4 Jul 2025 16:15:11 +0100	[thread overview]
Message-ID: <20250704151511.GE41770@horms.kernel.org> (raw)
In-Reply-To: <20250702110518.631532-1-hkelam@marvell.com>

On Wed, Jul 02, 2025 at 04:35:18PM +0530, Hariprasad Kelam wrote:
> Implement packet length validation before submitting packets to
> the hardware to prevent MAXLEN_ERR.
> 
> Fixes: 3184fb5ba96e ("octeontx2-vf: Virtual function driver support")
> Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
> ---
>  drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
> index 8a8b598bd389..766237cd86c3 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
> @@ -394,6 +394,13 @@ static netdev_tx_t otx2vf_xmit(struct sk_buff *skb, struct net_device *netdev)
>  	struct otx2_snd_queue *sq;
>  	struct netdev_queue *txq;
>  
> +	/* Check for minimum and maximum packet length */
> +	if (skb->len <= ETH_HLEN ||
> +	    (!skb_shinfo(skb)->gso_size && skb->len > vf->tx_max_pktlen)) {
> +		dev_kfree_skb(skb);
> +		return NETDEV_TX_OK;
> +	}

Hi Hariprasad,

I see the same check in otx2_xmit().
But I wonder if in that case and this one the rx drop counter for the
netdev should be incremented.

Also, do you need this check in rvu_rep_xmit() too?

> +
>  	sq = &vf->qset.sq[qidx];
>  	txq = netdev_get_tx_queue(netdev, qidx);
>  
> -- 
> 2.34.1
> 
> 

  reply	other threads:[~2025-07-04 15:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-02 11:05 [net] Octeontx2-vf: Fix max packet length errors Hariprasad Kelam
2025-07-04 15:15 ` Simon Horman [this message]
2025-07-08  9:37   ` Hariprasad Kelam
2025-07-08 16:33     ` Simon Horman

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=20250704151511.GE41770@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=bbhushan2@marvell.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=hkelam@marvell.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.com \
    --cc=tduszynski@marvell.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.