[RFC,net-next,1/2] include: uapi: Add new ioctl definitions to support Frame Preemption

Message ID 20221103113348.17378-2-pranavi.somisetty@amd.com
State New
Headers
Series Add support for Frame preemption (IEEE |

Commit Message

Somisetty, Pranavi Nov. 3, 2022, 11:33 a.m. UTC
  Add new ioctl definitions, SIOC_PREEMPTION_EN, SIOC_PREEMPTION_CTRL,
SIOC_PREEMPTION_STS, SIOC_PREEMPTION_COUNTER, to support IEEE 802.3br.

Signed-off-by: Pranavi Somisetty <pranavi.somisetty@amd.com>
---
 include/uapi/linux/sockios.h | 6 ++++++
 net/core/dev_ioctl.c         | 6 +++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
  

Comments

Andrew Lunn Nov. 3, 2022, 10:11 p.m. UTC | #1
On Thu, Nov 03, 2022 at 05:33:47AM -0600, Pranavi Somisetty wrote:
> Add new ioctl definitions, SIOC_PREEMPTION_EN, SIOC_PREEMPTION_CTRL,
> SIOC_PREEMPTION_STS, SIOC_PREEMPTION_COUNTER, to support IEEE 802.3br.

Please justify using an IOCTL when everything else in the network
stack is configured using netlink.

      Andrew
  

Patch

diff --git a/include/uapi/linux/sockios.h b/include/uapi/linux/sockios.h
index 7d1bccbbef78..382f959fb371 100644
--- a/include/uapi/linux/sockios.h
+++ b/include/uapi/linux/sockios.h
@@ -153,6 +153,12 @@ 
 #define SIOCSHWTSTAMP	0x89b0		/* set and get config		*/
 #define SIOCGHWTSTAMP	0x89b1		/* get config			*/
 
+/* Frame Preemption, IEEE 802.3br */
+#define SIOC_PREEMPTION_EN	0x89b2	/* enable frame preemption		*/
+#define SIOC_PREEMPTION_CTRL	0x89b3	/* configure preemption parameters	*/
+#define SIOC_PREEMPTION_STS	0x89b4	/* get preemption status		*/
+#define SIOC_PREEMPTION_COUNTER	0x89b5	/* read preemption statistics		*/
+
 /* Device private ioctl calls */
 
 /*
diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
index 7674bb9f3076..46fb963cd13a 100644
--- a/net/core/dev_ioctl.c
+++ b/net/core/dev_ioctl.c
@@ -409,7 +409,11 @@  static int dev_ifsioc(struct net *net, struct ifreq *ifr, void __user *data,
 		    cmd == SIOCGMIIREG ||
 		    cmd == SIOCSMIIREG ||
 		    cmd == SIOCSHWTSTAMP ||
-		    cmd == SIOCGHWTSTAMP) {
+		    cmd == SIOCGHWTSTAMP ||
+		    cmd == SIOC_PREEMPTION_EN ||
+		    cmd == SIOC_PREEMPTION_CTRL ||
+		    cmd == SIOC_PREEMPTION_STS ||
+		    cmd == SIOC_PREEMPTION_COUNTER) {
 			err = dev_eth_ioctl(dev, ifr, cmd);
 		} else if (cmd == SIOCBONDENSLAVE ||
 		    cmd == SIOCBONDRELEASE ||