diff mbox

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

Message ID 20140923153744.GB11042@oracle.com
State Accepted
Delegated to: David Miller
Headers show

Commit Message

Sowmini Varadhan Sept. 23, 2014, 3:37 p.m. UTC
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.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
---
 arch/sparc/include/asm/vio.h |  2 ++
 arch/sparc/kernel/vio.c      | 13 ++++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

Comments

Sowmini Varadhan Sept. 27, 2014, 9:19 p.m. UTC | #1
> On 09/23/2014 09:37 AM, Sowmini Varadhan wrote:
> >
> >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

--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Sept. 27, 2014, 10:59 p.m. UTC | #2
From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Date: Sat, 27 Sep 2014 17:19:58 -0400

> what was the feedback on this patch?  

I'm busy working on Bob Picco's MM changes and have had zero
time to look at this series.

Please be patient.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Sept. 30, 2014, 9:41 p.m. UTC | #3
From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Date: Tue, 23 Sep 2014 11:37:44 -0400

> 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.
> 
> Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sowmini Varadhan Oct. 1, 2014, 4:23 p.m. UTC | #4
On (09/30/14 17:41), David Miller wrote:
> 
> > 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.
> > 
> > Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
> 
> 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

--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Oct. 1, 2014, 7:40 p.m. UTC | #5
From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Date: Wed, 1 Oct 2014 12:23:54 -0400

> On (09/30/14 17:41), David Miller wrote:
>> 
>> > 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.
>> > 
>> > Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
>> 
>> 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.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/sparc/include/asm/vio.h b/arch/sparc/include/asm/vio.h
index e0f6c39..0847b11 100644
--- a/arch/sparc/include/asm/vio.h
+++ b/arch/sparc/include/asm/vio.h
@@ -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 */
diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
index 8647fcc..cb5789c 100644
--- a/arch/sparc/kernel/vio.c
+++ b/arch/sparc/kernel/vio.c
@@ -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)
 {