From: David Laight <David.Laight@ACULAB.COM>
To: 'Jeremy Kerr' <jk@codeconstruct.com.au>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Matt Johnston <matt@codeconstruct.com.au>,
Eugene Syromiatnikov <esyr@redhat.com>
Subject: RE: [PATCH net-next v6] mctp: Implement extended addressing
Date: Tue, 26 Oct 2021 10:45:05 +0000 [thread overview]
Message-ID: <f5b11b52cf0644088a919fb2a1a07c18@AcuMS.aculab.com> (raw)
In-Reply-To: <20211026015728.3006286-1-jk@codeconstruct.com.au>
From: Jeremy Kerr
>
> This change allows an extended address struct - struct sockaddr_mctp_ext
> - to be passed to sendmsg/recvmsg. This allows userspace to specify
> output ifindex and physical address information (for sendmsg) or receive
> the input ifindex/physaddr for incoming messages (for recvmsg). This is
> typically used by userspace for MCTP address discovery and assignment
> operations.
>
...
> diff --git a/include/uapi/linux/mctp.h b/include/uapi/linux/mctp.h
> index 6acd4ccafbf7..07b0318716fc 100644
> --- a/include/uapi/linux/mctp.h
> +++ b/include/uapi/linux/mctp.h
> @@ -11,6 +11,7 @@
>
> #include <linux/types.h>
> #include <linux/socket.h>
> +#include <linux/netdevice.h>
>
> typedef __u8 mctp_eid_t;
>
> @@ -28,6 +29,14 @@ struct sockaddr_mctp {
> __u8 __smctp_pad1;
> };
>
> +struct sockaddr_mctp_ext {
> + struct sockaddr_mctp smctp_base;
> + int smctp_ifindex;
> + __u8 smctp_halen;
> + __u8 __smctp_pad0[3];
> + __u8 smctp_haddr[MAX_ADDR_LEN];
> +};
You'd be better off 8-byte aligning smctp_haddr.
I also suspect that always copying the 32 bytes will be faster
and generate less code than the memset() + memcpy().
Oh and how did MAX_ADDR_LEN ever get into a uapi header??
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2021-10-26 10:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-26 1:57 [PATCH net-next v6] mctp: Implement extended addressing Jeremy Kerr
2021-10-26 10:45 ` David Laight [this message]
2021-10-26 11:34 ` Jeremy Kerr
2021-10-26 12:19 ` Eugene Syromiatnikov
2021-10-26 14:10 ` patchwork-bot+netdevbpf
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=f5b11b52cf0644088a919fb2a1a07c18@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=davem@davemloft.net \
--cc=esyr@redhat.com \
--cc=jk@codeconstruct.com.au \
--cc=kuba@kernel.org \
--cc=matt@codeconstruct.com.au \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.