Skip to contentSkip to conversation

Phonet: add to MAINTAINERS and add myself

PATCH Applied Rémi Denis-Courmont 3 participants 13 messages Oct 8, 2010 – Oct 11, 2010

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 Phonet: add to MAINTAINERS and add myself

From: Rémi Denis-Courmont <[email protected]>

---
 MAINTAINERS |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
MAINTAINERS +8 -0
index 9ddb5ac..1fd58ef 100644
@@ -4541,6 +4541,14 @@ L:	[email protected]
 S:	Maintained
 F:	include/linux/personality.h
 
+PHONET PROTOCOL
+M:	Remi Denis-Courmont <[email protected]>
+S:	Supported
+F:	Documentation/networking/phonet.txt
+F:	include/linux/phonet.h
+F:	include/net/phonet/
+F:	net/phonet/
+
 PHRAM MTD DRIVER
 M:	Joern Engel <[email protected]>
 L:	[email protected]
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 2/4 Phonet: advise against enabling the pipe controller

From: Rémi Denis-Courmont <[email protected]>

As it currently is, the new code path is not compatible with existing Nokia modems. This would break existing userspace for Nokia modem, such as the existing oFono ISI driver.

---
 net/phonet/Kconfig |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/phonet/Kconfig +2 -1
index 901956a..a4fceb8 100644
@@ -24,4 +24,5 @@ config PHONET_PIPECTRLR
 	  data with Nokia Slim modems like WG2.5 used on ST-Ericsson U8500
 	  platform.
 
-	  If unsure, say N.
+	  This option is incompatible with older Nokia modems.
+	  Say N here unless you really know what you are doing.
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH 3/4 Phonet: cleanup pipe enable socket option

From: Rémi Denis-Courmont <[email protected]>

The current code works like this:

  int garbage, status;
  socklen_t len = sizeof(status);

  /* enable pipe */
  setsockopt(fd, SOL_PNPIPE, PNPIPE_ENABLE, &garbage, sizeof(garbage));
  /* disable pipe */
  setsockopt(fd, SOL_PNPIPE, PNPIPE_DISABLE, &garbage, sizeof(garbage));
  /* get status */
  getsockopt(fd, SOL_PNPIPE, PNPIPE_INQ, &status, &len);

...which does not follow the usual socket option pattern. This patch merges all three "options" into a single gettable&settable option, before Linux 2.6.37 gets out:

  int status;
  socklen_t len = sizeof(status);

  /* enable pipe */
  status = 1;
  setsockopt(fd, SOL_PNPIPE, PNPIPE_ENABLE, &status, sizeof(status));
  /* disable pipe */
  status = 0;
  setsockopt(fd, SOL_PNPIPE, PNPIPE_ENABLE, &status, sizeof(status));
  /* get status */
  getsockopt(fd, SOL_PNPIPE, PNPIPE_ENABLE, &status, &len);

This also fixes the error code from EFAULT to ENOTCONN.

---
 Documentation/networking/phonet.txt |   15 +------
 include/linux/phonet.h              |    3 +-
 net/phonet/pep.c                    |   72 ++++++++++++++--------------------
 3 files changed, 34 insertions(+), 56 deletions(-)
Documentation/networking/phonet.txt +3 -12
index cccf5ff..2d9bc2b 100644
@@ -213,12 +213,9 @@ The implementation adds socket options at SOL_PNPIPE level:
 	It then updates the pipe state associated with the sequenced socket to
 	be PIPE_DISABLED.
 
-  PNPIPE_ENABLE
-	It follows the same sequence as above for enabling a pipe by sending
-	PNS_PEP_ENABLE_REQ initially and then sending PNS_PEP_ENABLED_IND after
-	getting responses from sequenced socket and remote-pep.
-	It will also update the pipe state associated with the sequenced socket
-	to PIPE_ENABLED.
+  PNPIPE_ENABLE accepts one integer value (int). If set to zero, the pipe
+    is disabled. If the value is non-zero, the pipe is enabled. If the pipe
+    is not (yet) connected, ENOTCONN is error is returned.
 
    PNPIPE_DESTROY
 	This will send out PNS_PEP_DISCONNECT_REQ on the sequenced socket and
@@ -226,12 +223,6 @@ The implementation adds socket options at SOL_PNPIPE level:
 	It will also update the pipe state associated with the sequenced socket
 	to PIPE_IDLE
 
-   PNPIPE_INQ
-	This getsocktopt allows the user-space running on the sequenced socket
-	to examine the pipe state associated with that socket ie. whether the
-	pipe is created (PIPE_DISABLED) or enabled (PIPE_ENABLED) or disabled
-	(PIPE_DISABLED) or no pipe exists (PIPE_IDLE).
-
 After a pipe has been created and enabled successfully, the Pipe data can be
 exchanged between the host-pep and remote-pep (modem).
 
include/linux/phonet.h +1 -2
index 96f5625..e27cbf9 100644
@@ -38,9 +38,8 @@
 #define PNPIPE_IFINDEX		2
 #define PNPIPE_CREATE           3
 #define PNPIPE_ENABLE           4
-#define PNPIPE_DISABLE          5
+/* unused slot */
 #define PNPIPE_DESTROY          6
-#define PNPIPE_INQ              7
 
 #define PNADDR_ANY		0
 #define PNADDR_BROADCAST	0xFC
net/phonet/pep.c +30 -42

103 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#3 lore raw

PATCH 4/4 Phonet: mark the pipe controller as EXPERIMENTAL

From: Rémi Denis-Courmont <[email protected]>

There are a bunch of issues that need to be fixed, including:
- GFP_KERNEL allocations from atomic context
(and GFP_ATOMIC in process context),
- abuse of the setsockopt() call convention,
- unprotected/unlocked static variables...

IMHO, we will need to alter the userspace ABI when we fix it. So mark the configuration option as EXPERIMENTAL for the time being (or should it be BROKEN instead?).

---
 net/phonet/Kconfig |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
net/phonet/Kconfig +2 -2
index a4fceb8..0d9b8a2 100644
@@ -16,8 +16,8 @@ config PHONET
 	  will be called phonet. If unsure, say N.
 
 config PHONET_PIPECTRLR
-	bool "Phonet Pipe Controller"
-	depends on PHONET
+	bool "Phonet Pipe Controller (EXPERIMENTAL)"
+	depends on PHONET && EXPERIMENTAL
 	default N
 	help
 	  The Pipe Controller implementation in Phonet stack to support Pipe
Signature · 1 line
1.7.0.4
maintainer Applied
#4 lore raw

Re: [PATCH 4/4] Phonet: mark the pipe controller as EXPERIMENTAL

From: Rémi Denis-Courmont <[email protected]>
Date: Fri, 8 Oct 2010 17:02:03 +0300

Quoted 8 lines

From: Rémi Denis-Courmont <[email protected]>

There are a bunch of issues that need to be fixed, including:
- GFP_KERNEL allocations from atomic context
(and GFP_ATOMIC in process context),
- abuse of the setsockopt() call convention,
- unprotected/unlocked static variables...

Quoted 5 lines

IMHO, we will need to alter the userspace ABI when we fix it. So mark the configuration option as EXPERIMENTAL for the time being (or should it be BROKEN instead?).

Applied.

#5 lore raw

Re: [PATCH 4/4] Phonet: mark the pipe controller as EXPERIMENTAL

In reply to Rémi Denis-Courmont
Quoted 8 lines · Rémi Denis-Courmont

From: Rémi Denis-Courmont <[email protected]>

There are a bunch of issues that need to be fixed, including:
- GFP_KERNEL allocations from atomic context
(and GFP_ATOMIC in process context),
- abuse of the setsockopt() call convention,
- unprotected/unlocked static variables...

Quoted 5 lines

IMHO, we will need to alter the userspace ABI when we fix it. So mark the configuration option as EXPERIMENTAL for the time being (or should it be BROKEN instead?).

Thank you for this patch.
I have already started implementing 'connect()' socket call for Pipe controller logic, as per advise of Rémi Denis-Courmontt. I will upload this patch for review once I have validated GPRS/3G path (control/data) to be working fine.

Hopefully, with all the reviews and suggestions shared on the mailing list, existing abuse can be removed and new abuses can be avoided.

The only intention of submitting is to make Linux work smoothly with newer devices. If there is some improper code getting introduced unknowingly, then I will surely work on the review comments to fix it.

Thank you all!

Best regards,
Kumar.

#6 lore raw

Re: [PATCH 4/4] Phonet: mark the pipe controller as EXPERIMENTAL

Quoted 11 lines · Kumar SANGHVI

I have already started implementing 'connect()' socket call for Pipe controller logic, as per advise of Rémi Denis-Courmontt. I will upload this patch for review once I have validated GPRS/3G path (control/data) to be working fine.

Hopefully, with all the reviews and suggestions shared on the mailing list, existing abuse can be removed and new abuses can be avoided.

The only intention of submitting is to make Linux work smoothly with newer devices. If there is some improper code getting introduced unknowingly, then I will surely work on the review comments to fix it.

I am sure everybody wants to get things right eventually. That's not much of a concern to me.

However, I am concerned that Linux 2.6.37 ships with an unfinished implementation, or worse, an unfinished user-space interface.

Signature · 3 lines
Rémi Denis-Courmont
http://www.remlab.net
http://fi.linkedin.com/in/remidenis
maintainer Applied
#7 lore raw

Re: [PATCH 3/4] Phonet: cleanup pipe enable socket option

In reply to Rémi Denis-Courmont

From: Rémi Denis-Courmont <[email protected]>
Date: Fri, 8 Oct 2010 17:02:02 +0300

Quoted 3 lines

From: Rémi Denis-Courmont <[email protected]>

The current code works like this:

...

Quoted 3 lines

...which does not follow the usual socket option pattern. This patch merges all three "options" into a single gettable&settable option, before Linux 2.6.37 gets out:

...

Quoted 4 lines

This also fixes the error code from EFAULT to ENOTCONN.

Applied.

#8 lore raw

Re: [PATCH 3/4] Phonet: cleanup pipe enable socket option

In reply to Rémi Denis-Courmont

Hi,

Quoted 30 lines · Rémi Denis-Courmont

From: Rémi Denis-Courmont <[email protected]>

The current code works like this:

  int garbage, status;
  socklen_t len = sizeof(status);

  /* enable pipe */
  setsockopt(fd, SOL_PNPIPE, PNPIPE_ENABLE, &garbage, sizeof(garbage));
  /* disable pipe */
  setsockopt(fd, SOL_PNPIPE, PNPIPE_DISABLE, &garbage, sizeof(garbage));
  /* get status */
  getsockopt(fd, SOL_PNPIPE, PNPIPE_INQ, &status, &len);

...which does not follow the usual socket option pattern. This patch merges all three "options" into a single gettable&settable option, before Linux 2.6.37 gets out:

  int status;
  socklen_t len = sizeof(status);

  /* enable pipe */
  status = 1;
  setsockopt(fd, SOL_PNPIPE, PNPIPE_ENABLE, &status, sizeof(status));
  /* disable pipe */
  status = 0;
  setsockopt(fd, SOL_PNPIPE, PNPIPE_ENABLE, &status, sizeof(status));
  /* get status */
  getsockopt(fd, SOL_PNPIPE, PNPIPE_ENABLE, &status, &len);
Quoted 4 lines

This also fixes the error code from EFAULT to ENOTCONN.

Thank you!

BR,
Kumar.

maintainer Applied
#9 lore raw

Re: [PATCH 2/4] Phonet: advise against enabling the pipe controller

In reply to Rémi Denis-Courmont

From: Rémi Denis-Courmont <[email protected]>
Date: Fri, 8 Oct 2010 17:02:01 +0300

Quoted 7 lines

From: Rémi Denis-Courmont <[email protected]>

As it currently is, the new code path is not compatible with existing Nokia modems. This would break existing userspace for Nokia modem, such as the existing oFono ISI driver.

This really needs to be designed such that it can co-exist with current userland technology.

Applied.

#10 lore raw

Re: [PATCH 2/4] Phonet: advise against enabling the pipe controller

Le samedi 9 octobre 2010 00:17:30 David Miller, vous avez écrit :

Quoted 5 lines

From: Rémi Denis-Courmont <[email protected]>
Date: Fri, 8 Oct 2010 17:02:01 +0300

Quoted 2 lines

From: Rémi Denis-Courmont <[email protected]>

Quoted 8 lines
Quoted 5 lines

As it currently is, the new code path is not compatible with existing Nokia modems. This would break existing userspace for Nokia modem, such as the existing oFono ISI driver.

This really needs to be designed such that it can co-exist with current userland technology.

Yeah, don't tell me. This kinda static option works for Linux kernel on an embedded device like my employer. But it does not fly on the desktop.

This big patch came as a surprise, so did its merging. I don't when it can be improved.

Signature · 3 lines
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis
#11 lore raw

Re: [PATCH 2/4] Phonet: advise against enabling the pipe controller

In reply to Rémi Denis-Courmont

Hi,

Quoted 7 lines · Rémi Denis-Courmont

From: Rémi Denis-Courmont <[email protected]>

As it currently is, the new code path is not compatible with existing Nokia modems. This would break existing userspace for Nokia modem, such as the existing oFono ISI driver.

Yes, the pipe controller logic is not intended for existing Nokia modems that already implement pipe controller inside them.
Thank you for putting correct warning message.