Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Sunil Goutham <sgoutham@marvell.com>
To: <netdev@vger.kernel.org>, <davem@davemloft.net>, <kuba@kernel.org>
Cc: Sunil Goutham <sgoutham@marvell.com>
Subject: [PATCH v2 1/2] net: ethtool: Support setting ntuple rule count
Date: Fri, 23 Jul 2021 23:46:45 +0530	[thread overview]
Message-ID: <1627064206-16032-2-git-send-email-sgoutham@marvell.com> (raw)
In-Reply-To: <1627064206-16032-1-git-send-email-sgoutham@marvell.com>

Some NICs share resources like packet filters across
multiple interfaces they support. From HW point of view
it is possible to use all filters for a single interface.
Currently ethtool doesn't support modifying filter count so
that user can allocate more filters to a interface and less
to others. This patch adds ETHTOOL_SRXCLSRLCNT ioctl command
for modifying filter count.

example command:
./ethtool -U eth0 rule-count 256

Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
---
 include/uapi/linux/ethtool.h | 1 +
 net/ethtool/ioctl.c          | 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index 67aa713..178f346 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -1552,6 +1552,7 @@ enum ethtool_fec_config_bits {
 #define ETHTOOL_PHY_STUNABLE	0x0000004f /* Set PHY tunable configuration */
 #define ETHTOOL_GFECPARAM	0x00000050 /* Get FEC settings */
 #define ETHTOOL_SFECPARAM	0x00000051 /* Set FEC settings */
+#define ETHTOOL_SRXCLSRLCNT	0x00000052 /* Set RX class rule count */
 
 /* compatibility with older code */
 #define SPARC_ETH_GSET		ETHTOOL_GSET
diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index 6134b18..ca0f75e 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -2863,6 +2863,7 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
 	case ETHTOOL_SRXFH:
 	case ETHTOOL_SRXCLSRLDEL:
 	case ETHTOOL_SRXCLSRLINS:
+	case ETHTOOL_SRXCLSRLCNT:
 		rc = ethtool_set_rxnfc(dev, ethcmd, useraddr);
 		break;
 	case ETHTOOL_FLASHDEV:
-- 
2.7.4


  reply	other threads:[~2021-07-23 18:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23 18:16 [PATCH v2 0/2] Support ethtool ntuple rule count change Sunil Goutham
2021-07-23 18:16 ` Sunil Goutham [this message]
2021-07-24 17:23   ` [PATCH v2 1/2] net: ethtool: Support setting ntuple rule count Andrew Lunn
2021-07-26 22:29     ` Saeed Mahameed
2021-07-23 18:16 ` [PATCH v2 2/2] octeontx2-pf: " Sunil Goutham

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=1627064206-16032-2-git-send-email-sgoutham@marvell.com \
    --to=sgoutham@marvell.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [PATCH v2 1/2] net: ethtool: Support setting ntuple rule count' \
    /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).