Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: sundeep subbaraya <sundeep.lkml@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Subbaraya Sundeep <sbhatta@marvell.com>,
	David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org,
	Sunil Kovvuri Goutham <sgoutham@marvell.com>,
	hariprasad <hkelam@marvell.com>,
	Geetha sowjanya <gakula@marvell.com>
Subject: Re: [net-next PATCH 3/3] octeontx2-af: Introduce internal packet switching
Date: Tue, 20 Jul 2021 23:26:00 +0530	[thread overview]
Message-ID: <CALHRZuqqJgOz4NR1sAYYU+OJcze_x2Yg3bDuYrr8O4sFjEOOOg@mail.gmail.com> (raw)
In-Reply-To: <20210720135133.3873fb4e@cakuba>

Hi Jakub,

On Tue, Jul 20, 2021 at 5:26 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Mon, 19 Jul 2021 14:29:34 +0530, Subbaraya Sundeep wrote:
> > +static int rvu_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode,
> > +                                     struct netlink_ext_ack *extack)
> > +{
> > +     struct rvu_devlink *rvu_dl = devlink_priv(devlink);
> > +     struct rvu *rvu = rvu_dl->rvu;
> > +     struct rvu_switch *rswitch;
> > +
> > +     rswitch = &rvu->rswitch;
> > +     switch (mode) {
> > +     case DEVLINK_ESWITCH_MODE_LEGACY:
> > +     case DEVLINK_ESWITCH_MODE_SWITCHDEV:
> > +             if (rswitch->mode == mode)
> > +                     return 0;
> > +             rswitch->mode = mode;
> > +             if (mode == DEVLINK_ESWITCH_MODE_SWITCHDEV)
> > +                     rvu_switch_enable(rvu);
> > +             else
> > +                     rvu_switch_disable(rvu);
>
> I don't see the code handle creation and tearing down of representors.
>
> How do things work in this driver? Does AF have a representor netdev
> for each VF (that's separate from the VF netdev itself)? Those should
> only exist in switchdev mode, while legacy mode should use DMAC
> switching.
>
> I think what you want is a textbook VEPA vs VEB switch. Please take a
> look at drivers implementing .ndo_bridge_getlink/.ndo_bridge_setlink.

MCAM used for switching is present in AF and AF is not a netdev to
use ndo_bridge_setlink. Currently VF->VF/ PF->VF switching is possible
only with an external switch in hairpin mode (like VEPA), what we want to
achieve is switching based on DMAC in MCAM itself(internally).
We used DEVLINK_ESWITCH_MODE_SWITCHDEV as a trigger to
allocate MCAM rules. I understand now that it can be used to create
VF representors only. Can you please suggest any appropriate devlink
command we can use here so that new rules are created. Having these
rules by default will waste MCAM space.

Thanks,
Sundeep

      reply	other threads:[~2021-07-20 17:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19  8:59 [net-next PATCH 0/3] octeontx2-af: Introduce DMAC based switching Subbaraya Sundeep
2021-07-19  8:59 ` [net-next PATCH 1/3] octeontx2-af: Enable transmit side LBK link Subbaraya Sundeep
2021-07-19  8:59 ` [net-next PATCH 2/3] octeontx2-af: Prepare for allocating MCAM rules for AF Subbaraya Sundeep
2021-07-19  8:59 ` [net-next PATCH 3/3] octeontx2-af: Introduce internal packet switching Subbaraya Sundeep
2021-07-20 11:51   ` Jakub Kicinski
2021-07-20 17:56     ` sundeep subbaraya [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=CALHRZuqqJgOz4NR1sAYYU+OJcze_x2Yg3bDuYrr8O4sFjEOOOg@mail.gmail.com \
    --to=sundeep.lkml@gmail.com \
    --cc=davem@davemloft.net \
    --cc=gakula@marvell.com \
    --cc=hkelam@marvell.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@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 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).