DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Jakub Grajciar <jgrajcia@cisco.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] net/memif: use abstract socket address
Date: Mon, 5 Oct 2020 14:09:20 +0100	[thread overview]
Message-ID: <5b874482-baaa-1a65-b101-983aa3bff5ee@intel.com> (raw)
In-Reply-To: <20201005123900.32723-1-jgrajcia@cisco.com>

On 10/5/2020 1:39 PM, Jakub Grajciar wrote:
> Abstract socket address has no connection with
> filesystem pathnames and the socket dissapears
> once all open references are closed.
> 
> Memif pmd will use abstract socket address by default.
> For backwards compatibility use new argument
> 'socket-abstract=no'
> 

Why this backward compatibility is required? How the end user affected from 
swithching to abstract sockets?
Since when linux supports abstract sockets, does this switch will cause problem 
with old kernel versions?

Is there any benefit of the abstract sockets other than socket cleaned 
automatically (I assume for unix sockets it is done when file filesystem 
reference removed)?

> Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
> ---
>   doc/guides/nics/memif.rst         |  1 +
>   drivers/net/memif/memif_socket.c  | 25 +++++++++++++++--------
>   drivers/net/memif/rte_eth_memif.c | 34 ++++++++++++++++++++++++++++++-
>   drivers/net/memif/rte_eth_memif.h | 10 +++++----
>   4 files changed, 57 insertions(+), 13 deletions(-)
> 
> diff --git a/doc/guides/nics/memif.rst b/doc/guides/nics/memif.rst
> index ddeebed25..8e80105a4 100644
> --- a/doc/guides/nics/memif.rst
> +++ b/doc/guides/nics/memif.rst
> @@ -43,6 +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"
>      "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 slave mode. Only relevant to slave, 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 67794cb6f..4b0b12ead 100644
> --- a/drivers/net/memif/memif_socket.c
> +++ b/drivers/net/memif/memif_socket.c
> @@ -862,10 +862,10 @@ memif_listener_handler(void *arg)
>   }
>   
>   static struct memif_socket *
> -memif_socket_create(char *key, uint8_t listener)
> +memif_socket_create(char *key, uint8_t listener, bool is_abstract)
>   {
>   	struct memif_socket *sock;
> -	struct sockaddr_un un;
> +	struct sockaddr_un un = { 0 };
>   	int sockfd;
>   	int ret;
>   	int on = 1;
> @@ -886,7 +886,12 @@ memif_socket_create(char *key, uint8_t listener)
>   			goto error;
>   
>   		un.sun_family = AF_UNIX;
> -		strlcpy(un.sun_path, sock->filename, MEMIF_SOCKET_UN_SIZE);
> +		if (is_abstract) {
> +			// abstract address

Please don't prefer c99 comment sytle, there are a few occurrences below.


  reply	other threads:[~2020-10-05 13:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-05 12:39 Jakub Grajciar
2020-10-05 13:09 ` Ferruh Yigit [this message]
2020-10-05 15:23   ` Jakub Grajciar -X (jgrajcia - PANTHEON TECH SRO at Cisco)
2020-10-05 18:17   ` Stephen Hemminger
2020-10-06  8:59     ` Ferruh Yigit
2020-10-07 10:00 ` [dpdk-dev] [PATCH v2] " Jakub Grajciar
2020-10-09 16:58   ` [dpdk-dev] [PATCH v3] " Jakub Grajciar
2020-10-09 17:17     ` Ferruh Yigit
2020-10-12  8:28     ` [dpdk-dev] [PATCH v4] " Jakub Grajciar
2020-10-12 14:57       ` Ferruh Yigit
2020-10-12 15:17       ` Stephen Hemminger
2020-10-07 15:03 ` [dpdk-dev] [PATCH] " Stephen Hemminger
2020-10-09 15:09   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5b874482-baaa-1a65-b101-983aa3bff5ee@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=jgrajcia@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).