public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Horatiu Vultur <horatiu.vultur@microchip.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Y.b. Lu" <yangbo.lu@nxp.com>,
	Xiaoliang Yang <xiaoliang.yang_1@nxp.com>,
	"UNGLinuxDriver@microchip.com" <UNGLinuxDriver@microchip.com>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	"alexandre.belloni@bootlin.com" <alexandre.belloni@bootlin.com>,
	"andrew@lunn.ch" <andrew@lunn.ch>,
	"vivien.didelot@gmail.com" <vivien.didelot@gmail.com>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"richardcochran@gmail.com" <richardcochran@gmail.com>
Subject: Re: [PATCH net-next] net: mscc: ocelot: always pass skb clone to ocelot_port_add_txtstamp_skb
Date: Wed, 23 Sep 2020 23:46:47 +0200	[thread overview]
Message-ID: <20200923214647.pdsymgavxyl5dixm@soft-dev3.localdomain> (raw)
In-Reply-To: <20200923204548.k2f44gjl7s4dwoim@skbuf>

The 09/23/2020 20:45, Vladimir Oltean wrote:
> 
> On Wed, Sep 23, 2020 at 10:35:30PM +0200, Horatiu Vultur wrote:
> > The 09/23/2020 20:22, Vladimir Oltean wrote:
> > > On Wed, Sep 23, 2020 at 10:08:00PM +0200, Horatiu Vultur wrote:
> > > > The 09/23/2020 14:24, Vladimir Oltean wrote:
> > > > > +               if (ocelot_port->ptp_cmd == IFH_REW_OP_TWO_STEP_PTP) {
> > > > > +                       struct sk_buff *clone;
> > > > > +
> > > > > +                       clone = skb_clone_sk(skb);
> > > > > +                       if (!clone) {
> > > > > +                               kfree_skb(skb);
> > > > > +                               return NETDEV_TX_OK;
> > > >
> > > > Why do you return NETDEV_TX_OK?
> > > > Because the frame is not sent yet.
> > >
> > > I suppose I _could_ increment the tx_dropped counters, if that's what
> > > you mean.
> >
> > Yeah, something like that I was thinking.
> >
> > Also I am just thinking, not sure if it is correct but, can you return
> > NETDEV_TX_BUSY and not free the skb?
> >
> 
> Do you have a use case for NETDEV_TX_BUSY instead of plain dropping the
> skb, some situation where it would be better?

Not really.

> 
> I admit I haven't tested this particular code path, but my intuition
> tells me that under OOM, the last thing you need is some networking
> driver just trying and trying again to send a packet.

Yes, I totally understand your point and I aggree with you.

> 
> Documentation/networking/driver.rst:

I looked also initially in this document, that is the reason why I was
not sure if it is correct to return NETDEV_TX_BUSY.

> 
> 1) The ndo_start_xmit method must not return NETDEV_TX_BUSY under
>    any normal circumstances.  It is considered a hard error unless
>    there is no way your device can tell ahead of time when it's
>    transmit function will become busy.
> 
> Looking up the uses of NETDEV_TX_BUSY, I see pretty much only congestion
> type of events.
> 
> Thanks,
> -Vladimir

-- 
/Horatiu

  reply	other threads:[~2020-09-23 21:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23 11:24 [PATCH net-next] net: mscc: ocelot: always pass skb clone to ocelot_port_add_txtstamp_skb Vladimir Oltean
2020-09-23 20:08 ` Horatiu Vultur
2020-09-23 20:17   ` David Miller
2020-09-23 20:22   ` Vladimir Oltean
2020-09-23 20:35     ` Horatiu Vultur
2020-09-23 20:45       ` Vladimir Oltean
2020-09-23 21:46         ` Horatiu Vultur [this message]
2020-09-24  2:18 ` Richard Cochran
2020-09-25  2:48 ` David Miller

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=20200923214647.pdsymgavxyl5dixm@soft-dev3.localdomain \
    --to=horatiu.vultur@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=vivien.didelot@gmail.com \
    --cc=vladimir.oltean@nxp.com \
    --cc=xiaoliang.yang_1@nxp.com \
    --cc=yangbo.lu@nxp.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