netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Magnus Karlsson <magnus.karlsson@gmail.com>
Cc: bpf <bpf@vger.kernel.org>,
	"Network Development" <netdev@vger.kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Björn Töpel" <bjorn.topel@intel.com>,
	"Karlsson, Magnus" <magnus.karlsson@intel.com>,
	"Ciara Loftus" <ciara.loftus@intel.com>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"Toke Høiland-Jørgensen" <toke@redhat.com>
Subject: Re: [PATCH v2 bpf-next 13/17] veth: implement ethtool's get_channels() callback
Date: Mon, 22 Mar 2021 21:10:06 +0100	[thread overview]
Message-ID: <20210322201006.GB56104@ranger.igk.intel.com> (raw)
In-Reply-To: <CAJ8uoz0+Ofu32-QmX1mYka2f52ym=zG_OPyz3wto=pv-brOi-w@mail.gmail.com>

On Tue, Mar 16, 2021 at 09:44:38AM +0100, Magnus Karlsson wrote:
> On Thu, Mar 11, 2021 at 4:43 PM Maciej Fijalkowski
> <maciej.fijalkowski@intel.com> wrote:
> >
> > Libbpf's xsk part calls get_channels() API to retrieve the queue count
> > of the underlying driver so that XSKMAP is sized accordingly.
> >
> > Implement that in veth so multi queue scenarios can work properly.
> >
> > Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> > ---
> >  drivers/net/veth.c | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> >
> > diff --git a/drivers/net/veth.c b/drivers/net/veth.c
> > index aa1a66ad2ce5..efca3d45f5c2 100644
> > --- a/drivers/net/veth.c
> > +++ b/drivers/net/veth.c
> > @@ -218,6 +218,17 @@ static void veth_get_ethtool_stats(struct net_device *dev,
> >         }
> >  }
> >
> > +static void veth_get_channels(struct net_device *dev,
> > +                             struct ethtool_channels *channels)
> > +{
> > +       channels->tx_count = dev->real_num_tx_queues;
> > +       channels->rx_count = dev->real_num_rx_queues;
> > +       channels->max_tx = dev->real_num_tx_queues;
> > +       channels->max_rx = dev->real_num_rx_queues;
> > +       channels->combined_count = min(dev->real_num_rx_queues, dev->real_num_rx_queues);
> > +       channels->max_combined = min(dev->real_num_rx_queues, dev->real_num_rx_queues);
> 
> Copy and paste error in the above two lines. One of the min entries
> should be dev->real_num_tx_queues. Kind of pointless otherwise ;-).

Geez. Embarrassing :)

> 
> > +}
> > +
> >  static const struct ethtool_ops veth_ethtool_ops = {
> >         .get_drvinfo            = veth_get_drvinfo,
> >         .get_link               = ethtool_op_get_link,
> > @@ -226,6 +237,7 @@ static const struct ethtool_ops veth_ethtool_ops = {
> >         .get_ethtool_stats      = veth_get_ethtool_stats,
> >         .get_link_ksettings     = veth_get_link_ksettings,
> >         .get_ts_info            = ethtool_op_get_ts_info,
> > +       .get_channels           = veth_get_channels,
> >  };
> >
> >  /* general routines */
> > --
> > 2.20.1
> >

  reply	other threads:[~2021-03-22 20:21 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11 15:28 [PATCH v2 bpf-next 00/17] AF_XDP selftests improvements & bpf_link Maciej Fijalkowski
2021-03-11 15:28 ` [PATCH v2 bpf-next 01/17] selftests: xsk: don't call worker_pkt_dump() for stats test Maciej Fijalkowski
2021-03-11 15:28 ` [PATCH v2 bpf-next 02/17] selftests: xsk: remove struct ifaceconfigobj Maciej Fijalkowski
2021-03-11 15:28 ` [PATCH v2 bpf-next 03/17] selftests: xsk: remove unused function Maciej Fijalkowski
2021-03-11 15:28 ` [PATCH v2 bpf-next 04/17] selftests: xsk: remove inline keyword from source file Maciej Fijalkowski
2021-03-11 15:28 ` [PATCH v2 bpf-next 05/17] selftests: xsk: simplify frame traversal in dumping thread Maciej Fijalkowski
2021-03-11 15:28 ` [PATCH v2 bpf-next 06/17] libbpf: xsk: use bpf_link Maciej Fijalkowski
2021-03-16  5:34   ` Andrii Nakryiko
2021-03-22 20:09     ` Maciej Fijalkowski
2021-03-11 15:29 ` [PATCH v2 bpf-next 07/17] samples: bpf: do not unload prog within xdpsock Maciej Fijalkowski
2021-03-16  5:35   ` Andrii Nakryiko
2021-03-11 15:29 ` [PATCH v2 bpf-next 08/17] selftests: xsk: remove thread for netns switch Maciej Fijalkowski
2021-03-11 15:29 ` [PATCH v2 bpf-next 09/17] selftests: xsk: split worker thread Maciej Fijalkowski
2021-03-11 15:29 ` [PATCH v2 bpf-next 10/17] selftests: xsk: remove Tx synchronization resources Maciej Fijalkowski
2021-03-11 15:29 ` [PATCH v2 bpf-next 11/17] selftests: xsk: refactor teardown/bidi test cases and testapp_validate Maciej Fijalkowski
2021-03-11 15:29 ` [PATCH v2 bpf-next 12/17] selftests: xsk: remove sync_mutex_tx and atomic var Maciej Fijalkowski
2021-03-11 15:29 ` [PATCH v2 bpf-next 13/17] veth: implement ethtool's get_channels() callback Maciej Fijalkowski
2021-03-16  8:44   ` Magnus Karlsson
2021-03-22 20:10     ` Maciej Fijalkowski [this message]
2021-03-11 15:29 ` [PATCH v2 bpf-next 14/17] selftests: xsk: implement bpf_link test Maciej Fijalkowski
2021-03-16  5:39   ` Andrii Nakryiko
2021-03-22 20:11     ` Maciej Fijalkowski
2021-03-11 15:29 ` [PATCH v2 bpf-next 15/17] selftests: xsk: remove thread attribute Maciej Fijalkowski
2021-03-11 15:29 ` [PATCH v2 bpf-next 16/17] selftest: xsk: Remove mutex and condition variable Maciej Fijalkowski
2021-03-11 15:29 ` [PATCH v2 bpf-next 17/17] selftests: xsk: Remove unused defines Maciej Fijalkowski

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=20210322201006.GB56104@ranger.igk.intel.com \
    --to=maciej.fijalkowski@intel.com \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=ciara.loftus@intel.com \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=magnus.karlsson@gmail.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=toke@redhat.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).