LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Joel Stanley <joel@jms.id.au>
To: "Gabriel L. Somlo" <gsomlo@gmail.com>,
	Florent Kermarrec <florent@enjoy-digital.fr>
Cc: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Karol Gugala <kgugala@antmicro.com>,
	Mateusz Holenko <mholenko@antmicro.com>,
	devicetree <devicetree@vger.kernel.org>,
	Networking <netdev@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	David Shah <dave@ds0.me>, Stafford Horne <shorne@gmail.com>
Subject: Re: [PATCH v2 2/2] net: Add driver for LiteX's LiteEth network interface
Date: Wed, 25 Aug 2021 06:41:16 +0000	[thread overview]
Message-ID: <CACPK8XdLp8Ue0vuGT8ALPDkoFCG-Pb4_fxvDk7kMpm-se_wECg@mail.gmail.com> (raw)
In-Reply-To: <CACPK8Xf9LGQBUHmS9sQ4zG1akk5SoQ-31MD-GMWVSRuByAT7KQ@mail.gmail.com>

On Wed, 25 Aug 2021 at 06:35, Joel Stanley <joel@jms.id.au> wrote:
>
> On Tue, 24 Aug 2021 at 19:43, Gabriel L. Somlo <gsomlo@gmail.com> wrote:
> > > diff --git a/drivers/net/ethernet/litex/Makefile b/drivers/net/ethernet/litex/Makefile
> > > new file mode 100644
> > > index 000000000000..9343b73b8e49
> > > --- /dev/null
> > > +++ b/drivers/net/ethernet/litex/Makefile
> > > +int liteeth_setup_slots(struct liteeth *priv)
> > > +{
> > > +     struct device_node *np = priv->dev->of_node;
> > > +     int err, depth;
> > > +
> > > +     err = of_property_read_u32(np, "rx-fifo-depth", &depth);
> > > +     if (err) {
> > > +             dev_err(priv->dev, "unable to get rx-fifo-depth\n");
> > > +             return err;
> > > +     }
> > > +     if (depth < LITEETH_BUFFER_SIZE) {
> >
> > If I set depth to be *equal* to LITEETH_BUFFER_SIZE (2048) in DTS,
> > no traffic makes it out of my network interface (linux-on-litex-rocket
> > on an ecpix5 board, see github.com/litex-hub/linux-on-litex-rocket).
> >
> > May I suggest rejecting if (depth / LITEETH_BUFFER_SIZE < 2) instead?
> > When that's enforced, the interface actually works fine for me.
>
> Yes, I was using BUFFER_SIZE as the slot size, which it is not. I'll
> rework it to use the slot size I think.
>
> I spent some time digging through the migen source and I couldn't work
> out where the 1024 length comes from. If anything it should be
> eth_mtu, which is 1530.
>
> Florent, can you clear that up?

Replying to myself, the 0x800 is the slot size. I will fix the maths
so the number of slots is calculated correctly.

  reply	other threads:[~2021-08-25  6:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-20  7:47 [PATCH v2 0/2] net: Add LiteETH network driver Joel Stanley
2021-08-20  7:47 ` [PATCH v2 1/2] dt-bindings: net: Add bindings for LiteETH Joel Stanley
2021-08-20 17:41   ` Andrew Lunn
2021-08-23 18:44   ` Rob Herring
2021-08-24  3:51     ` Joel Stanley
2021-08-24 11:52       ` Rob Herring
2021-08-25  3:00         ` Joel Stanley
2021-08-20  7:47 ` [PATCH v2 2/2] net: Add driver for LiteX's LiteEth network interface Joel Stanley
2021-08-20 11:50   ` kernel test robot
2021-08-24 19:43   ` Gabriel L. Somlo
2021-08-25  6:35     ` Joel Stanley
2021-08-25  6:41       ` Joel Stanley [this message]
2021-08-25 12:00       ` Gabriel L. Somlo
2021-08-27  2:11       ` Andrew Lunn

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=CACPK8XdLp8Ue0vuGT8ALPDkoFCG-Pb4_fxvDk7kMpm-se_wECg@mail.gmail.com \
    --to=joel@jms.id.au \
    --cc=dave@ds0.me \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=florent@enjoy-digital.fr \
    --cc=gsomlo@gmail.com \
    --cc=kgugala@antmicro.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mholenko@antmicro.com \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=shorne@gmail.com \
    --subject='Re: [PATCH v2 2/2] net: Add driver for LiteX'\''s LiteEth network interface' \
    /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

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).