All of lore.kernel.org
 help / color / mirror / Atom feed
From: <ecree@xilinx.com>
To: <davem@davemloft.net>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<linux-net-drivers@amd.com>
Cc: <netdev@vger.kernel.org>, Edward Cree <ecree.xilinx@gmail.com>
Subject: [PATCH net-next v3 10/10] sfc: implement ethtool get/set RX ring size for EF100 reps
Date: Thu, 28 Jul 2022 19:57:52 +0100	[thread overview]
Message-ID: <294be9ed0dd09b800f764a7801ae929169009def.1659034549.git.ecree.xilinx@gmail.com> (raw)
In-Reply-To: <cover.1659034549.git.ecree.xilinx@gmail.com>

From: Edward Cree <ecree.xilinx@gmail.com>

It's not truly a ring, but the maximum length of the list of queued RX
 SKBs is analogous to an RX ring size, so use that API to configure it.

Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
---
 drivers/net/ethernet/sfc/ef100_rep.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/drivers/net/ethernet/sfc/ef100_rep.c b/drivers/net/ethernet/sfc/ef100_rep.c
index eac932710c63..73ae4656a6e7 100644
--- a/drivers/net/ethernet/sfc/ef100_rep.c
+++ b/drivers/net/ethernet/sfc/ef100_rep.c
@@ -150,10 +150,37 @@ static void efx_ef100_rep_ethtool_set_msglevel(struct net_device *net_dev,
 	efv->msg_enable = msg_enable;
 }
 
+static void efx_ef100_rep_ethtool_get_ringparam(struct net_device *net_dev,
+						struct ethtool_ringparam *ring,
+						struct kernel_ethtool_ringparam *kring,
+						struct netlink_ext_ack *ext_ack)
+{
+	struct efx_rep *efv = netdev_priv(net_dev);
+
+	ring->rx_max_pending = U32_MAX;
+	ring->rx_pending = efv->rx_pring_size;
+}
+
+static int efx_ef100_rep_ethtool_set_ringparam(struct net_device *net_dev,
+					       struct ethtool_ringparam *ring,
+					       struct kernel_ethtool_ringparam *kring,
+					       struct netlink_ext_ack *ext_ack)
+{
+	struct efx_rep *efv = netdev_priv(net_dev);
+
+	if (ring->rx_mini_pending || ring->rx_jumbo_pending || ring->tx_pending)
+		return -EINVAL;
+
+	efv->rx_pring_size = ring->rx_pending;
+	return 0;
+}
+
 static const struct ethtool_ops efx_ef100_rep_ethtool_ops = {
 	.get_drvinfo		= efx_ef100_rep_get_drvinfo,
 	.get_msglevel		= efx_ef100_rep_ethtool_get_msglevel,
 	.set_msglevel		= efx_ef100_rep_ethtool_set_msglevel,
+	.get_ringparam		= efx_ef100_rep_ethtool_get_ringparam,
+	.set_ringparam		= efx_ef100_rep_ethtool_set_ringparam,
 };
 
 static struct efx_rep *efx_ef100_rep_create_netdev(struct efx_nic *efx,

  parent reply	other threads:[~2022-07-28 18:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-28 18:57 [PATCH net-next v3 00/10] sfc: VF representors for EF100 - RX side ecree
2022-07-28 18:57 ` [PATCH net-next v3 01/10] sfc: plumb ef100 representor stats ecree
2022-07-28 18:57 ` [PATCH net-next v3 02/10] sfc: ef100 representor RX NAPI poll ecree
2022-07-28 18:57 ` [PATCH net-next v3 03/10] sfc: ef100 representor RX top half ecree
2022-07-28 18:57 ` [PATCH net-next v3 04/10] sfc: determine wire m-port at EF100 PF probe time ecree
2022-07-28 18:57 ` [PATCH net-next v3 05/10] sfc: check ef100 RX packets are from the wire ecree
2022-07-28 18:57 ` [PATCH net-next v3 06/10] sfc: receive packets from EF100 VFs into representors ecree
2022-07-28 18:57 ` [PATCH net-next v3 07/10] sfc: insert default MAE rules to connect VFs to representors ecree
2022-07-28 18:57 ` [PATCH net-next v3 08/10] sfc: move table locking into filter_table_{probe,remove} methods ecree
2022-07-28 18:57 ` [PATCH net-next v3 09/10] sfc: use a dynamic m-port for representor RX and set it promisc ecree
2022-07-28 18:57 ` ecree [this message]
2022-07-30  4:30 ` [PATCH net-next v3 00/10] sfc: VF representors for EF100 - RX side patchwork-bot+netdevbpf

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=294be9ed0dd09b800f764a7801ae929169009def.1659034549.git.ecree.xilinx@gmail.com \
    --to=ecree@xilinx.com \
    --cc=davem@davemloft.net \
    --cc=ecree.xilinx@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-net-drivers@amd.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@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 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.