History log of /netbsd-src/sys/rump/net/lib/libvirtif/if_virt.c (Results 1 – 25 of 59)
Revision Date Author Comments
# 076e3579 16-Jun-2021 riastradh <riastradh@NetBSD.org>

if_attach and if_initialize cannot fail, don't test return value

These were originally made failable back in 2017 when if_initialize
allocated a softint in every interface for link state changes, so

if_attach and if_initialize cannot fail, don't test return value

These were originally made failable back in 2017 when if_initialize
allocated a softint in every interface for link state changes, so
that it could fail gracefully instead of panicking:

https://mail-index.NetBSD.org/source-changes/2017/10/23/msg089053.html

However, this spawned many seldom- or never-tested error branches,
which are risky to have around. And that softint in every interface
has since been replaced by a single global workqueue, because link
state changes require thread context but not low latency or high
throughput:

https://mail-index.NetBSD.org/source-changes/2020/02/06/msg113759.html

So there is no longer any reason for if_initialize to fail. (The
subroutine if_stats_init can't fail because percpu_alloc can't fail
either.)

There is a snag: the softint_establish in if_percpuq_create could
fail, potentially leading to bad consequences later on trying to use
the softint. This change doesn't introduce any new bugs because of
the snag -- if_percpuq_attach was already broken. However, the snag
can be better addressed without spawning error branches, either by
using a single softint or making softints less scarce.

(Separate commit will change the signatures of if_attach and
if_initialize to return void, scheduled to ride whatever is the next
convenient kernel bump.)

Patch and testing on amd64 and evbmips64-eb by maya@; commit message
soliloquy, and compile-testing on evbppc/i386/earmv7hf, by me.

show more ...


# c85e2f36 01-Feb-2020 thorpej <thorpej@NetBSD.org>

Adopt <net/if_stats.h>.


# 3cd62456 26-Jun-2018 msaitoh <msaitoh@NetBSD.org>

Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug th

Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.

show more ...


# 8afd0f4c 23-Oct-2017 msaitoh <msaitoh@NetBSD.org>

Fix compile error.


# 35096a90 23-Oct-2017 msaitoh <msaitoh@NetBSD.org>

If error occured in the attach function, free resources and return.


# dd8638ee 15-Dec-2016 ozaki-r <ozaki-r@NetBSD.org>

Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input

The benefits of the change are:
- We can reduce codes
- We can provide the same behavior between drivers
- Where/When if_ip

Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input

The benefits of the change are:
- We can reduce codes
- We can provide the same behavior between drivers
- Where/When if_ipackets is counted up
- Note that some drivers still update packet statistics in their own
way (periodical update)
- Moved bpf_mtap run in softint
- This makes it easy to MP-ify bpf

Proposed on tech-kern and tech-net

show more ...


# e1135cd9 16-Jun-2016 ozaki-r <ozaki-r@NetBSD.org>

Use curlwp_bind and curlwp_bindx instead of open-coding LP_BOUND


# d938d837 10-Jun-2016 ozaki-r <ozaki-r@NetBSD.org>

Introduce m_set_rcvif and m_reset_rcvif

The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcv

Introduce m_set_rcvif and m_reset_rcvif

The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcvif operation, and reduce the diff of
the upcoming change.

No functional change.

show more ...


# 220ff4e7 19-Apr-2016 ozaki-r <ozaki-r@NetBSD.org>

Prevent LWP migrations between CPUs during upper layer processing

This is a contract of psref(9) that is used by upper layer componenets,
e.g., bridge(4).


# 9c4cd063 09-Feb-2016 ozaki-r <ozaki-r@NetBSD.org>

Introduce softint-based if_input

This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this

Introduce softint-based if_input

This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!

show more ...


# b4d5024b 06-Nov-2014 pooka <pooka@NetBSD.org>

Ensure that no two VIRTIF's have the same modname, therefore
allowing them to coexist in the same rump kernel.

from Alexander Guy, via github


# c07b99a1 09-Aug-2014 ozaki-r <ozaki-r@NetBSD.org>

Count packets in if_virt


# 271d5dd1 02-Apr-2014 pooka <pooka@NetBSD.org>

use if_initname() instead of homegrown sprintf


# c1ae06ab 20-Mar-2014 christos <christos@NetBSD.org>

kill sprintf


# c310bd10 18-Mar-2014 pooka <pooka@NetBSD.org>

Trim alignment out of packet length before passing it up.


# bfdd7f7d 13-Mar-2014 pooka <pooka@NetBSD.org>

No reason to attach if_virt as a RUMP_COMPONENT(), simply use MODULE().


# 253367bf 13-Mar-2014 pooka <pooka@NetBSD.org>

remove unnecessary header inclusions


# c2849206 13-Mar-2014 pooka <pooka@NetBSD.org>

allow VIF_DYING() implementation to protest


# be1e2f2a 13-Mar-2014 pooka <pooka@NetBSD.org>

Rename rumpcomp_user.c -> virtif_user.c
Convert to new-style RUMPCOMP_USER_SRCS in Makefile.


# 30baf09a 12-Mar-2014 pooka <pooka@NetBSD.org>

When sending, only load mbufs which have a length. This is especially
useful for fragmented datagrams where the tail of the first packet is
full of nothing.


# c40bbed4 03-Mar-2014 pooka <pooka@NetBSD.org>

Pull in the changes from the dpdk, netmap and snabb switch repos.
There are two major changes:

1) All thread context policy is pushed down to the hypercalls.
This is meant to help performance-mon

Pull in the changes from the dpdk, netmap and snabb switch repos.
There are two major changes:

1) All thread context policy is pushed down to the hypercalls.
This is meant to help performance-mongering implementations be
able to control packet scheduling better (e.g. pin down packet
reception to certain physical cores).
2) Generalize linkstr, meaning that the interface can now take an
arbitrary string which is passed to the create() hypercall. This can
be used to map backend device characteristics to the rump kernel
interface instance.

show more ...


# d44a8024 21-Feb-2014 skrll <skrll@NetBSD.org>

Fix typo in fix for PR/48606


# 7d843710 21-Feb-2014 christos <christos@NetBSD.org>

PR/48606: Lloyd Parkes: Drivers not using ifp->if_input but using ether_input
directly.


# be1e0a38 04-Jul-2013 pooka <pooka@NetBSD.org>

Determine the interface name and the names of exported symbols based
on VIRTIF_BASE. This allows using various different packet-shoveling
backends in the same rump kernel.


# d9c4c208 03-Jul-2013 pooka <pooka@NetBSD.org>

fix parameter name


123