From: "Andrzej Ostruszka [C]" <aostruszka@marvell.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] Common netlink parsing?
Date: Mon, 27 Apr 2020 11:43:58 +0000 [thread overview]
Message-ID: <296ee88f-8a49-3620-dd33-d8e442a11a35@marvell.com> (raw)
In-Reply-To: <20200425122426.351675d7@hermes.lan>
On 25/04/2020 21:24, Stephen Hemminger wrote:
> While adding error handling to tap device, I noticed we already have two
> places rolling their own netlink message handling (tap and mlx5) and now
> with proposed IF proxy there is a third.
>
> Netlink is non-trivial and easy to get wrong and doing error handling
> also requires work. There should be a common library for this.
Right. I was looking at this but eventually decided to go with
implementation using macros defined in system headers. However some of
these macros are there with "backward compatibility" notes e.g.:
/* backwards compatibility for userspace */
#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + ...
#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
So I'm not that sure what will be their fate (possible removal?).
There is some considerable overlap between these macros and libmnl when
it comes to handling of messages/attributes, so I decided to go with
macros instead of introducing external dependency. However I'm open to
change if that would be the general consensus.
With regards
Andrzej Ostruszka
prev parent reply other threads:[~2020-04-27 11:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-25 19:24 Stephen Hemminger
2020-04-25 19:37 ` Thomas Monjalon
2020-04-27 11:43 ` Andrzej Ostruszka [C] [this message]
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=296ee88f-8a49-3620-dd33-d8e442a11a35@marvell.com \
--to=aostruszka@marvell.com \
--cc=dev@dpdk.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 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).