Skip to contentSkip to conversation

sparc64: Add vio_set_intr() to enable/disable Rx interrupts

PATCH Applied Sowmini Varadhan 2 participants 6 messages Sep 23, 2014 – Oct 1, 2014 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc64: Add vio_set_intr() to enable/disable Rx interrupts

The vio_set_intr() API should be used by VIO consumers to enable/disable Rx interrupts to facilitate deferred processing in softirq/bottom-half context.

---
 arch/sparc/include/asm/vio.h |  2 ++
 arch/sparc/kernel/vio.c      | 13 ++++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
arch/sparc/include/asm/vio.h +2 -0
index e0f6c39..0847b11 100644
@@ -279,6 +279,7 @@ struct vio_dev {
 
 	unsigned int		tx_irq;
 	unsigned int		rx_irq;
+	u64			rx_ino;
 
 	struct device		dev;
 };
@@ -407,5 +408,6 @@ int vio_driver_init(struct vio_driver_state *vio, struct vio_dev *vdev,
 		    char *name);
 
 void vio_port_up(struct vio_driver_state *vio);
+int vio_set_intr(unsigned long dev_ino, int state);
 
 #endif /* _SPARC64_VIO_H */
arch/sparc/kernel/vio.c +12 -1
index 8647fcc..cb5789c 100644
@@ -180,8 +180,10 @@ static void vio_fill_channel_info(struct mdesc_handle *hp, u64 mp,
 			vdev->tx_irq = sun4v_build_virq(cdev_cfg_handle, *irq);
 
 		irq = mdesc_get_property(hp, target, "rx-ino", NULL);
-		if (irq)
+		if (irq) {
 			vdev->rx_irq = sun4v_build_virq(cdev_cfg_handle, *irq);
+			vdev->rx_ino = *irq;
+		}
 
 		chan_id = mdesc_get_property(hp, target, "id", NULL);
 		if (chan_id)
@@ -189,6 +191,15 @@ static void vio_fill_channel_info(struct mdesc_handle *hp, u64 mp,
 	}
 }
 
+int vio_set_intr(unsigned long dev_ino, int state)
+{
+	int err;
+
+	err = sun4v_vintr_set_valid(cdev_cfg_handle, dev_ino, state);
+	return err;
+}
+EXPORT_SYMBOL(vio_set_intr);
+
 static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
 				      struct device *parent)
 {
Signature · 1 line
1.8.4.2
#1 lore raw
Quoted 5 lines · Sowmini Varadhan
Quoted 4 lines

The vio_set_intr() API should be used by VIO consumers to enable/disable Rx interrupts to facilitate deferred processing in softirq/bottom-half context.

Hello,

what was the feedback on this patch?

Some context for these new functions: I wanted to add these functions so that they could later be used by other enhancements in sunvnet that would be targetted at netdev. I wasn't sure how inter-dependant changes to separate repos/lists are orchestrated so I figured it would be safer to get these basic functions sorted out first.

--Sowmini

#4 lore raw
In reply to Sowmini Varadhan
Quoted 8 lines · David Miller
Quoted 6 lines

The vio_set_intr() API should be used by VIO consumers to enable/disable Rx interrupts to facilitate deferred processing in softirq/bottom-half context.

Applied, thanks.

I'm just getting ready to submit some sunvnet changes to net-next that use the above functions. Do I need to resend this patch to net-next at that time (I noticed that the Jumbo-mtu patch did that)?

I do plan to call out the dependancy in the cover-letter for the sunvnet series, of course.

--Sowmini

maintainer
#5 lore raw
In reply to Sowmini Varadhan

From: Sowmini Varadhan <[email protected]>
Date: Wed, 1 Oct 2014 12:23:54 -0400

Quoted 8 lines · David Miller
Quoted 7 lines
Quoted 6 lines

The vio_set_intr() API should be used by VIO consumers to enable/disable Rx interrupts to facilitate deferred processing in softirq/bottom-half context.

Quoted 8 lines
Quoted 1 line

Applied, thanks.

I'm just getting ready to submit some sunvnet changes to net-next that use the above functions. Do I need to resend this patch to net-next at that time (I noticed that the Jumbo-mtu patch did that)?

I do plan to call out the dependancy in the cover-letter for the sunvnet series, of course.

Simply ask me to cherry-pick that change from the sparc tree and I'll apply it to net-next before your submission, thanks.