DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/memif: default to physical socket
@ 2022-10-10 10:40 Nathan Skrzypczak
  2022-10-17 12:12 ` [PATCH v2] " Nathan Skrzypczak
  0 siblings, 1 reply; 9+ messages in thread
From: Nathan Skrzypczak @ 2022-10-10 10:40 UTC (permalink / raw)
  To: dev; +Cc: jgrajcia

This patch changes the default value of the memif abstract
socket flag to false. The implementation of memif with
abstract sockets made abstract-socket=yes the
default in [0] which might confuse users.

This patches makes 'socket-abstract=no' the new default,
and adds warnings mentionning the nature of the socket
concerned in an attempt to avoid future foot-gunning.

[0] commit 2f865ed07bb6 ("net/memif: use abstract socket address")

Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
---
 doc/guides/nics/memif.rst         | 2 +-
 drivers/net/memif/memif_socket.c  | 7 +++++--
 drivers/net/memif/rte_eth_memif.c | 3 ---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/guides/nics/memif.rst b/doc/guides/nics/memif.rst
index aca843640b..43d1cd1b38 100644
--- a/doc/guides/nics/memif.rst
+++ b/doc/guides/nics/memif.rst
@@ -43,7 +43,7 @@ client.
    "bsize=1024", "Size of single packet buffer", "2048", "uint16_t"
    "rsize=11", "Log2 of ring size. If rsize is 10, actual ring size is 1024", "10", "1-14"
    "socket=/tmp/memif.sock", "Socket filename", "/tmp/memif.sock", "string len 108"
-   "socket-abstract=no", "Set usage of abstract socket address", "yes", "yes|no"
+   "socket-abstract=no", "Is the socket an abstract socket", "no", "yes|no"
    "mac=01:23:45:ab:cd:ef", "Mac address", "01:ab:23:cd:45:ef", ""
    "secret=abc123", "Secret is an optional security option, which if specified, must be matched by peer", "", "string len 24"
    "zero-copy=yes", "Enable/disable zero-copy client mode. Only relevant to client, requires '--single-file-segments' eal argument", "no", "yes|no"
diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c
index 4700ce2e77..5344e60147 100644
--- a/drivers/net/memif/memif_socket.c
+++ b/drivers/net/memif/memif_socket.c
@@ -939,7 +939,8 @@ memif_socket_create(char *key, uint8_t listener, bool is_abstract)
 		if (ret < 0)
 			goto error;
 
-		MIF_LOG(DEBUG, "Memif listener socket %s created.", sock->filename);
+		MIF_LOG(DEBUG, "Memif listener %s socket %s created.",
+			is_abstract ? "abstract" : "", sock->filename);
 
 		/* Allocate interrupt instance */
 		sock->intr_handle =
@@ -1139,7 +1140,9 @@ memif_connect_client(struct rte_eth_dev *dev)
 
 	ret = connect(sockfd, (struct sockaddr *)&sun, sunlen);
 	if (ret < 0) {
-		MIF_LOG(ERR, "Failed to connect socket: %s.", pmd->socket_filename);
+		MIF_LOG(ERR, "Failed to connect %s socket: %s.",
+		    pmd->flags & ETH_MEMIF_FLAG_SOCKET_ABSTRACT ? "abstract" : "",
+		    pmd->socket_filename);
 		goto error;
 	}
 
diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index 5b5cae34ea..81e502ccaf 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -1823,9 +1823,6 @@ rte_pmd_memif_probe(struct rte_vdev_device *vdev)
 		MIF_LOG(WARNING, "Failed to register mp action callback: %s",
 			strerror(rte_errno));
 
-	/* use abstract address by default */
-	flags |= ETH_MEMIF_FLAG_SOCKET_ABSTRACT;
-
 	kvlist = rte_kvargs_parse(rte_vdev_device_args(vdev), valid_arguments);
 
 	/* parse parameters */
-- 
2.37.3


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2] net/memif: default to physical socket
  2022-10-10 10:40 [PATCH] net/memif: default to physical socket Nathan Skrzypczak
@ 2022-10-17 12:12 ` Nathan Skrzypczak
  2022-12-07 15:14   ` Ferruh Yigit
  0 siblings, 1 reply; 9+ messages in thread
From: Nathan Skrzypczak @ 2022-10-17 12:12 UTC (permalink / raw)
  To: dev; +Cc: andrew.rybchenko, Jakub Grajciar

This patch changes the default value of the memif abstract
socket flag to false. The implementation of memif with
abstract sockets made abstract-socket=yes the
default in [0] which might confuse users.

This patches makes 'socket-abstract=no' the new default,
and adds warnings mentioning the nature of the socket
concerned in an attempt to avoid future foot-gunning.

[0] commit 2f865ed07bb6 ("net/memif: use abstract socket address")

Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
---
 doc/guides/nics/memif.rst         | 2 +-
 drivers/net/memif/memif_socket.c  | 7 +++++--
 drivers/net/memif/rte_eth_memif.c | 3 ---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/guides/nics/memif.rst b/doc/guides/nics/memif.rst
index aca843640b..43d1cd1b38 100644
--- a/doc/guides/nics/memif.rst
+++ b/doc/guides/nics/memif.rst
@@ -43,7 +43,7 @@ client.
    "bsize=1024", "Size of single packet buffer", "2048", "uint16_t"
    "rsize=11", "Log2 of ring size. If rsize is 10, actual ring size is 1024", "10", "1-14"
    "socket=/tmp/memif.sock", "Socket filename", "/tmp/memif.sock", "string len 108"
-   "socket-abstract=no", "Set usage of abstract socket address", "yes", "yes|no"
+   "socket-abstract=no", "Is the socket an abstract socket", "no", "yes|no"
    "mac=01:23:45:ab:cd:ef", "Mac address", "01:ab:23:cd:45:ef", ""
    "secret=abc123", "Secret is an optional security option, which if specified, must be matched by peer", "", "string len 24"
    "zero-copy=yes", "Enable/disable zero-copy client mode. Only relevant to client, requires '--single-file-segments' eal argument", "no", "yes|no"
diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c
index 4700ce2e77..5344e60147 100644
--- a/drivers/net/memif/memif_socket.c
+++ b/drivers/net/memif/memif_socket.c
@@ -939,7 +939,8 @@ memif_socket_create(char *key, uint8_t listener, bool is_abstract)
 		if (ret < 0)
 			goto error;
 
-		MIF_LOG(DEBUG, "Memif listener socket %s created.", sock->filename);
+		MIF_LOG(DEBUG, "Memif listener %s socket %s created.",
+			is_abstract ? "abstract" : "", sock->filename);
 
 		/* Allocate interrupt instance */
 		sock->intr_handle =
@@ -1139,7 +1140,9 @@ memif_connect_client(struct rte_eth_dev *dev)
 
 	ret = connect(sockfd, (struct sockaddr *)&sun, sunlen);
 	if (ret < 0) {
-		MIF_LOG(ERR, "Failed to connect socket: %s.", pmd->socket_filename);
+		MIF_LOG(ERR, "Failed to connect %s socket: %s.",
+		    pmd->flags & ETH_MEMIF_FLAG_SOCKET_ABSTRACT ? "abstract" : "",
+		    pmd->socket_filename);
 		goto error;
 	}
 
diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index 5b5cae34ea..81e502ccaf 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -1823,9 +1823,6 @@ rte_pmd_memif_probe(struct rte_vdev_device *vdev)
 		MIF_LOG(WARNING, "Failed to register mp action callback: %s",
 			strerror(rte_errno));
 
-	/* use abstract address by default */
-	flags |= ETH_MEMIF_FLAG_SOCKET_ABSTRACT;
-
 	kvlist = rte_kvargs_parse(rte_vdev_device_args(vdev), valid_arguments);
 
 	/* parse parameters */
-- 
2.38.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] net/memif: default to physical socket
  2022-10-17 12:12 ` [PATCH v2] " Nathan Skrzypczak
@ 2022-12-07 15:14   ` Ferruh Yigit
  2022-12-07 15:56     ` Nathan Skrzypczak
  0 siblings, 1 reply; 9+ messages in thread
From: Ferruh Yigit @ 2022-12-07 15:14 UTC (permalink / raw)
  To: Nathan Skrzypczak; +Cc: andrew.rybchenko, Jakub Grajciar, dev

On 10/17/2022 1:12 PM, Nathan Skrzypczak wrote:
> This patch changes the default value of the memif abstract
> socket flag to false. The implementation of memif with
> abstract sockets made abstract-socket=yes the
> default in [0] which might confuse users.
> 

Hi Nathan,

OK to update logs to clarify nature of the socket,

but why do you think making abstract socket default socket type confuses
the users?

> This patches makes 'socket-abstract=no' the new default,
> and adds warnings mentioning the nature of the socket
> concerned in an attempt to avoid future foot-gunning.
> 
> [0] commit 2f865ed07bb6 ("net/memif: use abstract socket address")
> 
> Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
> ---
>  doc/guides/nics/memif.rst         | 2 +-
>  drivers/net/memif/memif_socket.c  | 7 +++++--
>  drivers/net/memif/rte_eth_memif.c | 3 ---
>  3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/doc/guides/nics/memif.rst b/doc/guides/nics/memif.rst
> index aca843640b..43d1cd1b38 100644
> --- a/doc/guides/nics/memif.rst
> +++ b/doc/guides/nics/memif.rst
> @@ -43,7 +43,7 @@ client.
>     "bsize=1024", "Size of single packet buffer", "2048", "uint16_t"
>     "rsize=11", "Log2 of ring size. If rsize is 10, actual ring size is 1024", "10", "1-14"
>     "socket=/tmp/memif.sock", "Socket filename", "/tmp/memif.sock", "string len 108"
> -   "socket-abstract=no", "Set usage of abstract socket address", "yes", "yes|no"
> +   "socket-abstract=no", "Is the socket an abstract socket", "no", "yes|no"
>     "mac=01:23:45:ab:cd:ef", "Mac address", "01:ab:23:cd:45:ef", ""
>     "secret=abc123", "Secret is an optional security option, which if specified, must be matched by peer", "", "string len 24"
>     "zero-copy=yes", "Enable/disable zero-copy client mode. Only relevant to client, requires '--single-file-segments' eal argument", "no", "yes|no"
> diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c
> index 4700ce2e77..5344e60147 100644
> --- a/drivers/net/memif/memif_socket.c
> +++ b/drivers/net/memif/memif_socket.c
> @@ -939,7 +939,8 @@ memif_socket_create(char *key, uint8_t listener, bool is_abstract)
>  		if (ret < 0)
>  			goto error;
>  
> -		MIF_LOG(DEBUG, "Memif listener socket %s created.", sock->filename);
> +		MIF_LOG(DEBUG, "Memif listener %s socket %s created.",
> +			is_abstract ? "abstract" : "", sock->filename);
>  
>  		/* Allocate interrupt instance */
>  		sock->intr_handle =
> @@ -1139,7 +1140,9 @@ memif_connect_client(struct rte_eth_dev *dev)
>  
>  	ret = connect(sockfd, (struct sockaddr *)&sun, sunlen);
>  	if (ret < 0) {
> -		MIF_LOG(ERR, "Failed to connect socket: %s.", pmd->socket_filename);
> +		MIF_LOG(ERR, "Failed to connect %s socket: %s.",
> +		    pmd->flags & ETH_MEMIF_FLAG_SOCKET_ABSTRACT ? "abstract" : "",
> +		    pmd->socket_filename);
>  		goto error;
>  	}
>  
> diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
> index 5b5cae34ea..81e502ccaf 100644
> --- a/drivers/net/memif/rte_eth_memif.c
> +++ b/drivers/net/memif/rte_eth_memif.c
> @@ -1823,9 +1823,6 @@ rte_pmd_memif_probe(struct rte_vdev_device *vdev)
>  		MIF_LOG(WARNING, "Failed to register mp action callback: %s",
>  			strerror(rte_errno));
>  
> -	/* use abstract address by default */
> -	flags |= ETH_MEMIF_FLAG_SOCKET_ABSTRACT;
> -
>  	kvlist = rte_kvargs_parse(rte_vdev_device_args(vdev), valid_arguments);
>  
>  	/* parse parameters */


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] net/memif: default to physical socket
  2022-12-07 15:14   ` Ferruh Yigit
@ 2022-12-07 15:56     ` Nathan Skrzypczak
  2022-12-07 17:15       ` Ferruh Yigit
  0 siblings, 1 reply; 9+ messages in thread
From: Nathan Skrzypczak @ 2022-12-07 15:56 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: andrew.rybchenko, Jakub Grajciar, dev

[-- Attachment #1: Type: text/plain, Size: 4674 bytes --]

Hi Ferruh,

Thank you for your reply,

On the potential confusion for users of the DPDK memif PMD : when
defaulting to abstract sockets was added in [0] (v20.10 release)
it did change the existing behavior, so reverting it would restore the old
behavior.
Also abstract sockets are quite a unusual feature in linux (a 0byte
prefixed string...), so I'm expecting most users of memif to just use
regular sockets because they're way easier to handle.

Also my guess is it will probably bug people if the way to use regular
sockets is to pass `abstract-socket=false` to the PMD config.
What do you think ?

Cheers
-Nathan

[0] 2f865ed07b

Le mer. 7 déc. 2022 à 16:14, Ferruh Yigit <ferruh.yigit@amd.com> a écrit :

> On 10/17/2022 1:12 PM, Nathan Skrzypczak wrote:
> > This patch changes the default value of the memif abstract
> > socket flag to false. The implementation of memif with
> > abstract sockets made abstract-socket=yes the
> > default in [0] which might confuse users.
> >
>
> Hi Nathan,
>
> OK to update logs to clarify nature of the socket,
>
> but why do you think making abstract socket default socket type confuses
> the users?
>
> > This patches makes 'socket-abstract=no' the new default,
> > and adds warnings mentioning the nature of the socket
> > concerned in an attempt to avoid future foot-gunning.
> >
> > [0] commit 2f865ed07bb6 ("net/memif: use abstract socket address")
> >
> > Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
> > ---
> >  doc/guides/nics/memif.rst         | 2 +-
> >  drivers/net/memif/memif_socket.c  | 7 +++++--
> >  drivers/net/memif/rte_eth_memif.c | 3 ---
> >  3 files changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/doc/guides/nics/memif.rst b/doc/guides/nics/memif.rst
> > index aca843640b..43d1cd1b38 100644
> > --- a/doc/guides/nics/memif.rst
> > +++ b/doc/guides/nics/memif.rst
> > @@ -43,7 +43,7 @@ client.
> >     "bsize=1024", "Size of single packet buffer", "2048", "uint16_t"
> >     "rsize=11", "Log2 of ring size. If rsize is 10, actual ring size is
> 1024", "10", "1-14"
> >     "socket=/tmp/memif.sock", "Socket filename", "/tmp/memif.sock",
> "string len 108"
> > -   "socket-abstract=no", "Set usage of abstract socket address", "yes",
> "yes|no"
> > +   "socket-abstract=no", "Is the socket an abstract socket", "no",
> "yes|no"
> >     "mac=01:23:45:ab:cd:ef", "Mac address", "01:ab:23:cd:45:ef", ""
> >     "secret=abc123", "Secret is an optional security option, which if
> specified, must be matched by peer", "", "string len 24"
> >     "zero-copy=yes", "Enable/disable zero-copy client mode. Only
> relevant to client, requires '--single-file-segments' eal argument", "no",
> "yes|no"
> > diff --git a/drivers/net/memif/memif_socket.c
> b/drivers/net/memif/memif_socket.c
> > index 4700ce2e77..5344e60147 100644
> > --- a/drivers/net/memif/memif_socket.c
> > +++ b/drivers/net/memif/memif_socket.c
> > @@ -939,7 +939,8 @@ memif_socket_create(char *key, uint8_t listener,
> bool is_abstract)
> >               if (ret < 0)
> >                       goto error;
> >
> > -             MIF_LOG(DEBUG, "Memif listener socket %s created.",
> sock->filename);
> > +             MIF_LOG(DEBUG, "Memif listener %s socket %s created.",
> > +                     is_abstract ? "abstract" : "", sock->filename);
> >
> >               /* Allocate interrupt instance */
> >               sock->intr_handle =
> > @@ -1139,7 +1140,9 @@ memif_connect_client(struct rte_eth_dev *dev)
> >
> >       ret = connect(sockfd, (struct sockaddr *)&sun, sunlen);
> >       if (ret < 0) {
> > -             MIF_LOG(ERR, "Failed to connect socket: %s.",
> pmd->socket_filename);
> > +             MIF_LOG(ERR, "Failed to connect %s socket: %s.",
> > +                 pmd->flags & ETH_MEMIF_FLAG_SOCKET_ABSTRACT ?
> "abstract" : "",
> > +                 pmd->socket_filename);
> >               goto error;
> >       }
> >
> > diff --git a/drivers/net/memif/rte_eth_memif.c
> b/drivers/net/memif/rte_eth_memif.c
> > index 5b5cae34ea..81e502ccaf 100644
> > --- a/drivers/net/memif/rte_eth_memif.c
> > +++ b/drivers/net/memif/rte_eth_memif.c
> > @@ -1823,9 +1823,6 @@ rte_pmd_memif_probe(struct rte_vdev_device *vdev)
> >               MIF_LOG(WARNING, "Failed to register mp action callback:
> %s",
> >                       strerror(rte_errno));
> >
> > -     /* use abstract address by default */
> > -     flags |= ETH_MEMIF_FLAG_SOCKET_ABSTRACT;
> > -
> >       kvlist = rte_kvargs_parse(rte_vdev_device_args(vdev),
> valid_arguments);
> >
> >       /* parse parameters */
>
>

[-- Attachment #2: Type: text/html, Size: 6210 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] net/memif: default to physical socket
  2022-12-07 15:56     ` Nathan Skrzypczak
@ 2022-12-07 17:15       ` Ferruh Yigit
  2022-12-07 21:01         ` Stephen Hemminger
  0 siblings, 1 reply; 9+ messages in thread
From: Ferruh Yigit @ 2022-12-07 17:15 UTC (permalink / raw)
  To: Nathan Skrzypczak; +Cc: andrew.rybchenko, Jakub Grajciar, dev

On 12/7/2022 3:56 PM, Nathan Skrzypczak wrote:
> Hi Ferruh,
> 

Hi Nathan,

> Thank you for your reply, 
> 
> On the potential confusion for users of the DPDK memif PMD : when
> defaulting to abstract sockets was added in [0] (v20.10 release)
> it did change the existing behavior, so reverting it would restore the
> old behavior.> Also abstract sockets are quite a unusual feature in linux (a 0byte
> prefixed string...), so I'm expecting most users of memif to just use
> regular sockets because they're way easier to handle.
> 

Not sure if regular socket is easier to handle, or users prefer regular
sockets, we need more input on these.

> Also my guess is it will probably bug people if the way to use regular
> sockets is to pass `abstract-socket=false` to the PMD config.
> What do you think ?
> 

I don't have a preference about the default config, but I also don't
have enough justification for changing the current behavior.


@Jakub, as driver maintainer, do you have any preference?


> Cheers
> -Nathan
> 
> [0] 2f865ed07b
> 
> Le mer. 7 déc. 2022 à 16:14, Ferruh Yigit <ferruh.yigit@amd.com
> <mailto:ferruh.yigit@amd.com>> a écrit :
> 
>     On 10/17/2022 1:12 PM, Nathan Skrzypczak wrote:
>     > This patch changes the default value of the memif abstract
>     > socket flag to false. The implementation of memif with
>     > abstract sockets made abstract-socket=yes the
>     > default in [0] which might confuse users.
>     >
> 
>     Hi Nathan,
> 
>     OK to update logs to clarify nature of the socket,
> 
>     but why do you think making abstract socket default socket type confuses
>     the users?
> 
>     > This patches makes 'socket-abstract=no' the new default,
>     > and adds warnings mentioning the nature of the socket
>     > concerned in an attempt to avoid future foot-gunning.
>     >
>     > [0] commit 2f865ed07bb6 ("net/memif: use abstract socket address")
>     >
>     > Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com
>     <mailto:nathan.skrzypczak@gmail.com>>
>     > ---
>     >  doc/guides/nics/memif.rst         | 2 +-
>     >  drivers/net/memif/memif_socket.c  | 7 +++++--
>     >  drivers/net/memif/rte_eth_memif.c | 3 ---
>     >  3 files changed, 6 insertions(+), 6 deletions(-)
>     >
>     > diff --git a/doc/guides/nics/memif.rst b/doc/guides/nics/memif.rst
>     > index aca843640b..43d1cd1b38 100644
>     > --- a/doc/guides/nics/memif.rst
>     > +++ b/doc/guides/nics/memif.rst
>     > @@ -43,7 +43,7 @@ client.
>     >     "bsize=1024", "Size of single packet buffer", "2048", "uint16_t"
>     >     "rsize=11", "Log2 of ring size. If rsize is 10, actual ring
>     size is 1024", "10", "1-14"
>     >     "socket=/tmp/memif.sock", "Socket filename",
>     "/tmp/memif.sock", "string len 108"
>     > -   "socket-abstract=no", "Set usage of abstract socket address",
>     "yes", "yes|no"
>     > +   "socket-abstract=no", "Is the socket an abstract socket",
>     "no", "yes|no"
>     >     "mac=01:23:45:ab:cd:ef", "Mac address", "01:ab:23:cd:45:ef", ""
>     >     "secret=abc123", "Secret is an optional security option, which
>     if specified, must be matched by peer", "", "string len 24"
>     >     "zero-copy=yes", "Enable/disable zero-copy client mode. Only
>     relevant to client, requires '--single-file-segments' eal argument",
>     "no", "yes|no"
>     > diff --git a/drivers/net/memif/memif_socket.c
>     b/drivers/net/memif/memif_socket.c
>     > index 4700ce2e77..5344e60147 100644
>     > --- a/drivers/net/memif/memif_socket.c
>     > +++ b/drivers/net/memif/memif_socket.c
>     > @@ -939,7 +939,8 @@ memif_socket_create(char *key, uint8_t
>     listener, bool is_abstract)
>     >               if (ret < 0)
>     >                       goto error;
>     > 
>     > -             MIF_LOG(DEBUG, "Memif listener socket %s created.",
>     sock->filename);
>     > +             MIF_LOG(DEBUG, "Memif listener %s socket %s created.",
>     > +                     is_abstract ? "abstract" : "", sock->filename);
>     > 
>     >               /* Allocate interrupt instance */
>     >               sock->intr_handle =
>     > @@ -1139,7 +1140,9 @@ memif_connect_client(struct rte_eth_dev *dev)
>     > 
>     >       ret = connect(sockfd, (struct sockaddr *)&sun, sunlen);
>     >       if (ret < 0) {
>     > -             MIF_LOG(ERR, "Failed to connect socket: %s.",
>     pmd->socket_filename);
>     > +             MIF_LOG(ERR, "Failed to connect %s socket: %s.",
>     > +                 pmd->flags & ETH_MEMIF_FLAG_SOCKET_ABSTRACT ?
>     "abstract" : "",
>     > +                 pmd->socket_filename);
>     >               goto error;
>     >       }
>     > 
>     > diff --git a/drivers/net/memif/rte_eth_memif.c
>     b/drivers/net/memif/rte_eth_memif.c
>     > index 5b5cae34ea..81e502ccaf 100644
>     > --- a/drivers/net/memif/rte_eth_memif.c
>     > +++ b/drivers/net/memif/rte_eth_memif.c
>     > @@ -1823,9 +1823,6 @@ rte_pmd_memif_probe(struct rte_vdev_device
>     *vdev)
>     >               MIF_LOG(WARNING, "Failed to register mp action
>     callback: %s",
>     >                       strerror(rte_errno));
>     > 
>     > -     /* use abstract address by default */
>     > -     flags |= ETH_MEMIF_FLAG_SOCKET_ABSTRACT;
>     > -
>     >       kvlist = rte_kvargs_parse(rte_vdev_device_args(vdev),
>     valid_arguments);
>     > 
>     >       /* parse parameters */
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] net/memif: default to physical socket
  2022-12-07 17:15       ` Ferruh Yigit
@ 2022-12-07 21:01         ` Stephen Hemminger
  2022-12-08 11:24           ` Nathan Skrzypczak
  0 siblings, 1 reply; 9+ messages in thread
From: Stephen Hemminger @ 2022-12-07 21:01 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Nathan Skrzypczak, andrew.rybchenko, Jakub Grajciar, dev

On Wed, 7 Dec 2022 17:15:06 +0000
Ferruh Yigit <ferruh.yigit@amd.com> wrote:

> On 12/7/2022 3:56 PM, Nathan Skrzypczak wrote:
> > Hi Ferruh,
> >   
> 
> Hi Nathan,
> 
> > Thank you for your reply, 
> > 
> > On the potential confusion for users of the DPDK memif PMD : when
> > defaulting to abstract sockets was added in [0] (v20.10 release)
> > it did change the existing behavior, so reverting it would restore the
> > old behavior.> Also abstract sockets are quite a unusual feature in linux (a 0byte
> > prefixed string...), so I'm expecting most users of memif to just use
> > regular sockets because they're way easier to handle.
> >   
> 
> Not sure if regular socket is easier to handle, or users prefer regular
> sockets, we need more input on these.

Regular sockets are actually harder handle, it is more that users
are less familiar with them! Regular sockets have to go through
file permission checks which makes dealing with containers and SELinux
hard.  Regular sockets persist when application crashes which makes
recovery harder.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] net/memif: default to physical socket
  2022-12-07 21:01         ` Stephen Hemminger
@ 2022-12-08 11:24           ` Nathan Skrzypczak
  2022-12-09 15:13             ` Ferruh Yigit
  0 siblings, 1 reply; 9+ messages in thread
From: Nathan Skrzypczak @ 2022-12-08 11:24 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Ferruh Yigit, andrew.rybchenko, Jakub Grajciar, dev

[-- Attachment #1: Type: text/plain, Size: 2205 bytes --]

Hi Stephen, Hi Ferruh,

I don't have a strong opinion on usage of regular sockets vs abstract
sockets. My point is that most existing memif implementations
either don't yet properly support abstract sockets or require extra flags
to be passed by users (iirc VPP, gomemif, libmemif, etc...).
As a matter of fact, abstract socket support in dpdk was broken until quite
recently. So I expect most users to be somewhat
constrained by their implementation to use regular sockets.

Also, as a user when you come with a filesystem path, understanding you
need to pass the following is not really straightforward
--vdev=net_memif,socket=/tmp/memif.sock,socket-abstract=no

A better solution might be to use the '@' prefix which seems the usual
representation and remove the socket-abstract=no altogether
--vdev=net_memif,socket=@memif
--vdev=net_memif,socket=/tmp/memif.sock

What do you think ?

(Also iirc Jakub is not receiving emails on this address)

Cheers
-Nathan

Le mer. 7 déc. 2022 à 22:01, Stephen Hemminger <stephen@networkplumber.org>
a écrit :

> On Wed, 7 Dec 2022 17:15:06 +0000
> Ferruh Yigit <ferruh.yigit@amd.com> wrote:
>
> > On 12/7/2022 3:56 PM, Nathan Skrzypczak wrote:
> > > Hi Ferruh,
> > >
> >
> > Hi Nathan,
> >
> > > Thank you for your reply,
> > >
> > > On the potential confusion for users of the DPDK memif PMD : when
> > > defaulting to abstract sockets was added in [0] (v20.10 release)
> > > it did change the existing behavior, so reverting it would restore the
> > > old behavior.> Also abstract sockets are quite a unusual feature in
> linux (a 0byte
> > > prefixed string...), so I'm expecting most users of memif to just use
> > > regular sockets because they're way easier to handle.
> > >
> >
> > Not sure if regular socket is easier to handle, or users prefer regular
> > sockets, we need more input on these.
>
> Regular sockets are actually harder handle, it is more that users
> are less familiar with them! Regular sockets have to go through
> file permission checks which makes dealing with containers and SELinux
> hard.  Regular sockets persist when application crashes which makes
> recovery harder.
>

[-- Attachment #2: Type: text/html, Size: 2967 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] net/memif: default to physical socket
  2022-12-08 11:24           ` Nathan Skrzypczak
@ 2022-12-09 15:13             ` Ferruh Yigit
  2023-02-07 17:26               ` Nathan Skrzypczak
  0 siblings, 1 reply; 9+ messages in thread
From: Ferruh Yigit @ 2022-12-09 15:13 UTC (permalink / raw)
  To: Nathan Skrzypczak, Stephen Hemminger
  Cc: andrew.rybchenko, Jakub Grajciar, dev

On 12/8/2022 11:24 AM, Nathan Skrzypczak wrote:
> Hi Stephen, Hi Ferruh,
> 
> I don't have a strong opinion on usage of regular sockets vs abstract
> sockets. My point is that most existing memif implementations
> either don't yet properly support abstract sockets or require extra
> flags to be passed by users (iirc VPP, gomemif, libmemif, etc...).
> As a matter of fact, abstract socket support in dpdk was broken until
> quite recently. So I expect most users to be somewhat
> constrained by their implementation to use regular sockets.
> 
> Also, as a user when you come with a filesystem path, understanding you
> need to pass the following is not really straightforward
> --vdev=net_memif,socket=/tmp/memif.sock,socket-abstract=no
> 
> A better solution might be to use the '@' prefix which seems the usual
> representation and remove the socket-abstract=no altogether
> --vdev=net_memif,socket=@memif
> --vdev=net_memif,socket=/tmp/memif.sock
> 

There is a default socket value ('/run/memif.sock'), that is why
additional 'socket-abstract' parameter is required:

abstract socket:
--vdev=net_memif0

regular socket ('/run/memif.sock'):
--vdev=net_memif0,socket-abstract=no


Using '@memif' syntax an option to *replace* 'socket-abstract=no'
syntax, but this will break existing user interface.

And if intentions is NOT replace usage, but add '@memif' syntax, it
doesn't add much value since abstract socket is already default option,
although it doesn't hurt.



Instead, by keeping existing user interface, we can say if user
explicitly set a socket value, regular socket is implied, like:

abstract:
--vdev=net_memif0
--vdev=net_memif0,socket-abstract=yes
--vdev=net_memif0,socket=/tmp/memif.sock,socket-abstract=yes
[socket-abstract overrides]

regular:
--vdev=net_memif0,socket=/tmp/memif.sock
--vdev=net_memif0,socket-abstract=no
--vdev=net_memif0,socket=/tmp/memif.sock,socket-abstract=no


Does this improve user experience for regular sockets?



> What do you think ?
> 
> (Also iirc Jakub is not receiving emails on this address)
> 
> Cheers
> -Nathan
> 
> Le mer. 7 déc. 2022 à 22:01, Stephen Hemminger
> <stephen@networkplumber.org <mailto:stephen@networkplumber.org>> a écrit :
> 
>     On Wed, 7 Dec 2022 17:15:06 +0000
>     Ferruh Yigit <ferruh.yigit@amd.com <mailto:ferruh.yigit@amd.com>> wrote:
> 
>     > On 12/7/2022 3:56 PM, Nathan Skrzypczak wrote:
>     > > Hi Ferruh,
>     > >   
>     >
>     > Hi Nathan,
>     >
>     > > Thank you for your reply, 
>     > >
>     > > On the potential confusion for users of the DPDK memif PMD : when
>     > > defaulting to abstract sockets was added in [0] (v20.10 release)
>     > > it did change the existing behavior, so reverting it would
>     restore the
>     > > old behavior.> Also abstract sockets are quite a unusual feature
>     in linux (a 0byte
>     > > prefixed string...), so I'm expecting most users of memif to
>     just use
>     > > regular sockets because they're way easier to handle.
>     > >   
>     >
>     > Not sure if regular socket is easier to handle, or users prefer
>     regular
>     > sockets, we need more input on these.
> 
>     Regular sockets are actually harder handle, it is more that users
>     are less familiar with them! Regular sockets have to go through
>     file permission checks which makes dealing with containers and SELinux
>     hard.  Regular sockets persist when application crashes which makes
>     recovery harder.
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] net/memif: default to physical socket
  2022-12-09 15:13             ` Ferruh Yigit
@ 2023-02-07 17:26               ` Nathan Skrzypczak
  0 siblings, 0 replies; 9+ messages in thread
From: Nathan Skrzypczak @ 2023-02-07 17:26 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Stephen Hemminger, andrew.rybchenko, Jakub Grajciar, dev

[-- Attachment #1: Type: text/plain, Size: 3931 bytes --]

Hi Ferruh,

Sorry for the late reply,
You can probably drop this patch.

Kind regards,
-Nathan

Le ven. 9 déc. 2022 à 16:13, Ferruh Yigit <ferruh.yigit@amd.com> a écrit :

> On 12/8/2022 11:24 AM, Nathan Skrzypczak wrote:
> > Hi Stephen, Hi Ferruh,
> >
> > I don't have a strong opinion on usage of regular sockets vs abstract
> > sockets. My point is that most existing memif implementations
> > either don't yet properly support abstract sockets or require extra
> > flags to be passed by users (iirc VPP, gomemif, libmemif, etc...).
> > As a matter of fact, abstract socket support in dpdk was broken until
> > quite recently. So I expect most users to be somewhat
> > constrained by their implementation to use regular sockets.
> >
> > Also, as a user when you come with a filesystem path, understanding you
> > need to pass the following is not really straightforward
> > --vdev=net_memif,socket=/tmp/memif.sock,socket-abstract=no
> >
> > A better solution might be to use the '@' prefix which seems the usual
> > representation and remove the socket-abstract=no altogether
> > --vdev=net_memif,socket=@memif
> > --vdev=net_memif,socket=/tmp/memif.sock
> >
>
> There is a default socket value ('/run/memif.sock'), that is why
> additional 'socket-abstract' parameter is required:
>
> abstract socket:
> --vdev=net_memif0
>
> regular socket ('/run/memif.sock'):
> --vdev=net_memif0,socket-abstract=no
>
>
> Using '@memif' syntax an option to *replace* 'socket-abstract=no'
> syntax, but this will break existing user interface.
>
> And if intentions is NOT replace usage, but add '@memif' syntax, it
> doesn't add much value since abstract socket is already default option,
> although it doesn't hurt.
>
>
>
> Instead, by keeping existing user interface, we can say if user
> explicitly set a socket value, regular socket is implied, like:
>
> abstract:
> --vdev=net_memif0
> --vdev=net_memif0,socket-abstract=yes
> --vdev=net_memif0,socket=/tmp/memif.sock,socket-abstract=yes
> [socket-abstract overrides]
>
> regular:
> --vdev=net_memif0,socket=/tmp/memif.sock
> --vdev=net_memif0,socket-abstract=no
> --vdev=net_memif0,socket=/tmp/memif.sock,socket-abstract=no
>
>
> Does this improve user experience for regular sockets?
>
>
>
> > What do you think ?
> >
> > (Also iirc Jakub is not receiving emails on this address)
> >
> > Cheers
> > -Nathan
> >
> > Le mer. 7 déc. 2022 à 22:01, Stephen Hemminger
> > <stephen@networkplumber.org <mailto:stephen@networkplumber.org>> a
> écrit :
> >
> >     On Wed, 7 Dec 2022 17:15:06 +0000
> >     Ferruh Yigit <ferruh.yigit@amd.com <mailto:ferruh.yigit@amd.com>>
> wrote:
> >
> >     > On 12/7/2022 3:56 PM, Nathan Skrzypczak wrote:
> >     > > Hi Ferruh,
> >     > >
> >     >
> >     > Hi Nathan,
> >     >
> >     > > Thank you for your reply,
> >     > >
> >     > > On the potential confusion for users of the DPDK memif PMD : when
> >     > > defaulting to abstract sockets was added in [0] (v20.10 release)
> >     > > it did change the existing behavior, so reverting it would
> >     restore the
> >     > > old behavior.> Also abstract sockets are quite a unusual feature
> >     in linux (a 0byte
> >     > > prefixed string...), so I'm expecting most users of memif to
> >     just use
> >     > > regular sockets because they're way easier to handle.
> >     > >
> >     >
> >     > Not sure if regular socket is easier to handle, or users prefer
> >     regular
> >     > sockets, we need more input on these.
> >
> >     Regular sockets are actually harder handle, it is more that users
> >     are less familiar with them! Regular sockets have to go through
> >     file permission checks which makes dealing with containers and
> SELinux
> >     hard.  Regular sockets persist when application crashes which makes
> >     recovery harder.
> >
>
>

[-- Attachment #2: Type: text/html, Size: 5231 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-02-08 13:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-10 10:40 [PATCH] net/memif: default to physical socket Nathan Skrzypczak
2022-10-17 12:12 ` [PATCH v2] " Nathan Skrzypczak
2022-12-07 15:14   ` Ferruh Yigit
2022-12-07 15:56     ` Nathan Skrzypczak
2022-12-07 17:15       ` Ferruh Yigit
2022-12-07 21:01         ` Stephen Hemminger
2022-12-08 11:24           ` Nathan Skrzypczak
2022-12-09 15:13             ` Ferruh Yigit
2023-02-07 17:26               ` Nathan Skrzypczak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).