diff mbox series

[net-next,1/2] net: ethtool: Support setting ntuple rule count

Message ID 1623847882-16744-2-git-send-email-sgoutham@marvell.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series Support ethtool ntuple rule count change | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 15 maintainers not CCed: gustavoars@kernel.org trix@redhat.com petr.vorel@gmail.com andrew@lunn.ch ecree@solarflare.com amitc@mellanox.com danieller@nvidia.com saeedm@mellanox.com magnus.karlsson@intel.com dmurphy@ti.com bjorn@kernel.org meirl@mellanox.com f.fainelli@gmail.com irusskikh@marvell.com alexanderduyck@fb.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 2339 this patch: 2339
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 2327 this patch: 2327
netdev/header_inline success Link

Commit Message

Sunil Kovvuri Goutham June 16, 2021, 12:51 p.m. UTC
From: Sunil Goutham <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(+)

Comments

Jakub Kicinski June 16, 2021, 5:57 p.m. UTC | #1
On Wed, 16 Jun 2021 18:21:21 +0530 sgoutham@marvell.com wrote:
> From: Sunil Goutham <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

man devlink-resource ?
Sunil Kovvuri Goutham June 17, 2021, 1:16 p.m. UTC | #2
> -----Original Message-----
> From: Jakub Kicinski <kuba@kernel.org>
> Sent: Wednesday, June 16, 2021 11:28 PM
> To: Sunil Kovvuri Goutham <sgoutham@marvell.com>
> Cc: davem@davemloft.net; netdev@vger.kernel.org
> Subject: [EXT] Re: [PATCH net-next 1/2] net: ethtool: Support setting ntuple
> rule count
> 
> External Email
> 
> ----------------------------------------------------------------------
> On Wed, 16 Jun 2021 18:21:21 +0530 sgoutham@marvell.com wrote:
> > From: Sunil Goutham <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
> 
> man devlink-resource ?

Since ntuple rule insert and delete are part of ethtool, I thought having this config also in
ethtool will make user life easy ie all ntuple related stuff within one tool.

Thanks,
Sunil.
Sunil Kovvuri Goutham June 22, 2021, 5:34 p.m. UTC | #3
> -----Original Message-----
> From: Sunil Kovvuri Goutham
> Sent: Thursday, June 17, 2021 6:46 PM
> To: Jakub Kicinski <kuba@kernel.org>
> Cc: davem@davemloft.net; netdev@vger.kernel.org
> Subject: RE: [EXT] Re: [PATCH net-next 1/2] net: ethtool: Support setting
> ntuple rule count
> 
> 
> 
> > -----Original Message-----
> > From: Jakub Kicinski <kuba@kernel.org>
> > Sent: Wednesday, June 16, 2021 11:28 PM
> > To: Sunil Kovvuri Goutham <sgoutham@marvell.com>
> > Cc: davem@davemloft.net; netdev@vger.kernel.org
> > Subject: [EXT] Re: [PATCH net-next 1/2] net: ethtool: Support setting
> > ntuple rule count
> >
> > External Email
> >
> > ----------------------------------------------------------------------
> > On Wed, 16 Jun 2021 18:21:21 +0530 sgoutham@marvell.com wrote:
> > > From: Sunil Goutham <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
> >
> > man devlink-resource ?
> 
> Since ntuple rule insert and delete are part of ethtool, I thought having this
> config also in ethtool will make user life easy ie all ntuple related stuff within
> one tool.
> 
> Thanks,
> Sunil.

Any further feedback or objections to these change ?

Thanks,
Sunil.
diff mbox series

Patch

diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index cfef6b0..2f16a07 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 3fa7a39..ced4a02 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -2759,6 +2759,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: