Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1210100 > unrolled thread

Exporting obscene amounts of data in rtnl_link_ops->fill_info()

Started by"Jason A. Donenfeld" <Jason@zx2c4.com>
First post2015-08-20 02:50 +0200
Last post2015-08-20 17:00 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  Exporting obscene amounts of data in rtnl_link_ops->fill_info() "Jason A. Donenfeld" <Jason@zx2c4.com> - 2015-08-20 02:50 +0200
    Re: Exporting obscene amounts of data in rtnl_link_ops->fill_info() Scott Feldman <sfeldma@gmail.com> - 2015-08-20 08:00 +0200
      Re: Exporting obscene amounts of data in rtnl_link_ops->fill_info() "Jason A. Donenfeld" <Jason@zx2c4.com> - 2015-08-20 17:00 +0200

#1210100 — Exporting obscene amounts of data in rtnl_link_ops->fill_info()

From"Jason A. Donenfeld" <Jason@zx2c4.com>
Date2015-08-20 02:50 +0200
SubjectExporting obscene amounts of data in rtnl_link_ops->fill_info()
Message-ID<pZmdk-5xL-13@gated-at.bofh.it>
Hi guys,

I have a new link driver that registers a rtnl_link_ops. For many
things, the rtnl interfaces are perfectly suited: I can use netlink in
userspace to check out packet counts, adjust interface parameters, and
all sorts of things. There is even the "fill_info" function exporting
interface-specific types of data to userspace through the standard
netlink interfaces. I'm glad this is here, because it's exactly what I
want.

Problem: sometimes I want to export a *lot* of data to userspace. When
this happens, even if I make the netlink socket receive buffer really
huge, this code path is still reached in rtnetlink.c:

                        err = rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK,
                                               NETLINK_CB(cb->skb).portid,
                                               cb->nlh->nlmsg_seq, 0,
                                               NLM_F_MULTI,
                                               ext_filter_mask);
                        /* If we ran out of room on the first message,
                         * we're in trouble
                         */
                        WARN_ON((err == -EMSGSIZE) && (skb->len == 0));

That is -- it tries to fill the skb (for sending it back to
userspace), but doesn't have enough room, so it returns -EMSGSIZE.
That seems like reasonable behavior, but it doesn't really help me
obtain my goal. I'd like to send quite a bit of data back to userspace
for a network interface, and I'd like to do it using the standard
netlink APIs. Is this possible?

Thanks,
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1210158

FromScott Feldman <sfeldma@gmail.com>
Date2015-08-20 08:00 +0200
Message-ID<pZr3k-4jD-9@gated-at.bofh.it>
In reply to#1210100
On Wed, Aug 19, 2015 at 5:47 PM, Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> Hi guys,
>
> I have a new link driver that registers a rtnl_link_ops. For many
> things, the rtnl interfaces are perfectly suited: I can use netlink in
> userspace to check out packet counts, adjust interface parameters, and
> all sorts of things. There is even the "fill_info" function exporting
> interface-specific types of data to userspace through the standard
> netlink interfaces. I'm glad this is here, because it's exactly what I
> want.
>
> Problem: sometimes I want to export a *lot* of data to userspace. When
> this happens, even if I make the netlink socket receive buffer really
> huge, this code path is still reached in rtnetlink.c:
>
>                         err = rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK,
>                                                NETLINK_CB(cb->skb).portid,
>                                                cb->nlh->nlmsg_seq, 0,
>                                                NLM_F_MULTI,
>                                                ext_filter_mask);
>                         /* If we ran out of room on the first message,
>                          * we're in trouble
>                          */
>                         WARN_ON((err == -EMSGSIZE) && (skb->len == 0));
>
> That is -- it tries to fill the skb (for sending it back to
> userspace), but doesn't have enough room, so it returns -EMSGSIZE.
> That seems like reasonable behavior, but it doesn't really help me
> obtain my goal. I'd like to send quite a bit of data back to userspace
> for a network interface, and I'd like to do it using the standard
> netlink APIs. Is this possible?



What kind of data are you sending up?  Maybe there is an alternate interface.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1210569

From"Jason A. Donenfeld" <Jason@zx2c4.com>
Date2015-08-20 17:00 +0200
Message-ID<pZztU-850-3@gated-at.bofh.it>
In reply to#1210158
On Thu, Aug 20, 2015 at 7:59 AM, Scott Feldman <sfeldma@gmail.com> wrote:
>
> What kind of data are you sending up?  Maybe there is an alternate interface.

This is what I'm wondering about: alternative interfaces, that are
still kosher in the netlink/rtnl world. Each interface is associated
with a certain set of "peers". I want to get a list of all these
peers. Sometimes there are lots of them. It's structured data that
fits well into netlink messages, but it's just that there are
potentially a lot of entries.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web