Re: Change the way we handle interface/connected networks

2015-02-09 Thread Martin Pieuchot
On 10/02/15(Tue) 03:04, Claudio Jeker wrote: There is no need to not allow the same network to be configured more then once. Instead just rely on the multipath and priority handling of the routing table to select the right route. Additionally this removes cloned routes (arp/npd cache) when the

USB Ethernet if_input(): axen(4), cdce(4), smsc(4)...

2015-03-18 Thread Martin Pieuchot
I'd love to hear from people using USB Ethernet adapters about the if_input() conversion diff below. Please make sure everything works as before, including tcpdump(8). I also take ok on a per-driver basis :) M Index: if_aue.c ===

Re: ARP mbuf queues

2015-03-19 Thread Martin Pieuchot
On 19/03/15(Thu) 14:11, Martin Pieuchot wrote: When a host want to send packets to a destination whose Ethernet address that has not been resolved yet, it puts such packet on a mbuf queue. Right now this queue, linked to the corresponding ARP data structure, is hand rolled. I wrote the diff

Re: ARP mbuf queues

2015-03-21 Thread Martin Pieuchot
On 21/03/15(Sat) 17:48, David Gwynne wrote: On 19 Mar 2015, at 11:11 pm, Martin Pieuchot m...@openbsd.org wrote: When a host want to send packets to a destination whose Ethernet address that has not been resolved yet, it puts such packet on a mbuf queue. Right now this queue

ARP mbuf queues

2015-03-19 Thread Martin Pieuchot
When a host want to send packets to a destination whose Ethernet address that has not been resolved yet, it puts such packet on a mbuf queue. Right now this queue, linked to the corresponding ARP data structure, is hand rolled. I wrote the diff below during s2k15 to make use of the mq_enqueue(9)

Re: Change the way we handle interface/connected networks

2015-03-17 Thread Martin Pieuchot
On 12/02/15(Thu) 12:35, Martin Pieuchot wrote: On 10/02/15(Tue) 03:04, Claudio Jeker wrote: There is no need to not allow the same network to be configured more then once. Instead just rely on the multipath and priority handling of the routing table to select the right route. Additionally

Re: A new batch of patches for ldpd(8)

2015-03-09 Thread Martin Pieuchot
Hi Renato, On 06/03/15(Fri) 15:03, Renato Westphal wrote: Hi all, I've done a lot of work on ldpd(8) a long time ago but only now I found time to organize my patches and send them to review. The patches can be found here: https://github.com/rwestphal/openbsd-ldpd/commits/renato-2015 The

Re: fix stuck cancelled ehci xfers (ehci_idone: ex=%p is done!)

2015-03-09 Thread Martin Pieuchot
On 26/02/15(Thu) 01:51, Martin Pieuchot wrote: On 22/02/15(Sun) 00:54, Martin Pieuchot wrote: On 20/02/15(Fri) 23:15, Stefan Sperling wrote: In the following configuration I can pretty easily trigger endless screenfulls of scrolling ehci_idone: ex=%p is done! messages, where %p

vlan+bridge stack integration

2015-03-12 Thread Martin Pieuchot
I'm progressively changing how pseudo-drivers are plugged into our network stack with the goal to turning them MP-safe. The diff below is a simple refactoring and should not introduce any behavior change. It moves a bridge-specific vlan-related chunk of code into the bridge(4) driver. I'd like

Re: Async upd(4)

2015-03-09 Thread Martin Pieuchot
On 05/03/15(Thu) 12:25, David Higgs wrote: On Mar 3, 2015, at 8:44 AM, David Higgs hig...@gmail.com wrote: With much help from mpi@, I have made a first big step towards improving upd(4). I’m not sure when tree lock ends, but I’m still happy to accept feedback if right now isn’t the

cdce(4), cue(4), kue(4) and mos(4)

2015-03-26 Thread Martin Pieuchot
This spring the new trend has a name: if_input() ! If you are the owner of one of these USB Ethernet dongle, please do me a favor a make sure they still work as expected with the diff below. Martin Index: if_cdce.c === RCS file:

ef(4), eg(4), el(4), ex(4) and ie(4)

2015-03-26 Thread Martin Pieuchot
Even our ISA Ethernet drivers can be converted to if_input(). If you still use some of these, I appreciate test reports. I'm asking here because Miod said everybody can test them... hum hum. Alternatively, if you think some drivers can go away, I'll summon tedu@. Index: isa/if_ef_isapnp.c

Re: ef(4), eg(4), el(4), ex(4) and ie(4)

2015-03-26 Thread Martin Pieuchot
On 26/03/15(Thu) 08:00, Ted Unangst wrote: Martin Pieuchot wrote: Even our ISA Ethernet drivers can be converted to if_input(). If you still use some of these, I appreciate test reports. I'm asking here because Miod said everybody can test them... hum hum. Alternatively, if you

Small ifconfig output tweak for inet6?

2015-03-26 Thread Martin Pieuchot
How do people feel about printing the prefixlen in CIDR notation? I'm annoyed about outputs not fitting in 80 chars when using autoconf magic: -inet6 fd00::f2de:f1ff:fe6a:15d1 prefixlen 64 autoconf pltime 3594 vltime 7194 +inet6 fd00::f2de:f1ff:fe6a:15d1/64 autoconf pltime 3594 vltime 7194

kernel with gif(4)

2015-04-01 Thread Martin Pieuchot
I'd like to be able to easily identify how deep are the tentacles of a pseudo-driver in your network stack. This diff takes the example of gif(4) and move all the remaining blocks checking for IFT_GIF under the appropriate #ifdef dance. The #ifdef I'm adding below are not strictly needed to

Re: Use LIST for upd(4) sensors

2015-04-01 Thread Martin Pieuchot
On 31/03/15(Tue) 23:06, David Higgs wrote: This was much more straightforward than expected. - Replace an array with a LIST of allocated sensors. - Remove or rescope variables counting sensors. - Allocated sensors are always attached. - Drop an unnecessary size calculation. Do you need

Re: add m_defrag to pcn driver

2015-04-01 Thread Martin Pieuchot
On 31/03/15(Tue) 21:56, Kimberley Manning wrote: Hi, This diff makes the pcn driver use m_defrag for fragmented mbuf chains, I like this kind of cleanups. As for vio(4) could you try the diff or are you looking for testers? Are you after something specific or are you changing the drivers

if_input() and `rcvif`

2015-04-01 Thread Martin Pieuchot
When if_input_process() will pass a mbuf to pseudo-interface handlers, they will change the `rcvif` pointer in the packet header. That's why we should not pass a ifp pointer to the handlers and instead let them look at the value of `rcvif`. Diff below change if_input() and ether_input() to no

Re: Small ifconfig output tweak for inet6?

2015-03-26 Thread Martin Pieuchot
On 26/03/15(Thu) 17:46, Henning Brauer wrote: * Mike Belopuhov m...@belopuhov.com [2015-03-26 14:36]: On 26 March 2015 at 14:27, Stuart Henderson st...@openbsd.org wrote: seems reasonable. (I'd quite like that for v4 too, though it wouldn't cope with non-contiguous netmask ;)

Re: ef(4), eg(4), el(4), ex(4) and ie(4)

2015-03-31 Thread Martin Pieuchot
On 31/03/15(Tue) 18:06, Miod Vallat wrote: What, no ec? No ep? Why play favorites??? You're asking for tricky ones! Enjoy :) I'm afraid my ISA ec(4) seems to no longer work. Blinks red during POST, doesn't get detected by the kernel (yes, it's jumped correctly). Does that mean we

Re: touchpad slight regression (snap: 20141121-20150217)

2015-02-28 Thread Martin Pieuchot
[moved to tech@] On 27/02/15(Fri) 11:40, patrick keshishian wrote: Hi, On 2/26/15, Ulf Brosziewski ulf.brosziew...@t-online.de wrote: On 02/27/2015 03:31 AM, Ulf Brosziewski wrote: ... It might be that the following patch to wsmouse.c solves the problem with the new version of

Re: USBD_NO_COPY problems

2015-02-28 Thread Martin Pieuchot
On 19/02/15(Thu) 21:49, David Higgs wrote: On Feb 13, 2015, at 7:29 AM, David Higgs hig...@gmail.com wrote: On Friday, February 13, 2015, Martin Pieuchot mpieuc...@nolizard.org wrote: On 13/02/15(Fri) 00:28, David Higgs wrote: I guess nobody else has tried calling

Re: fix stuck cancelled ehci xfers (ehci_idone: ex=%p is done!)

2015-02-27 Thread Martin Pieuchot
On 27/02/15(Fri) 12:07, Stefan Sperling wrote: On Thu, Feb 26, 2015 at 10:45:01PM +0100, Stefan Sperling wrote: There are other issues which are not fixed by this diff and which my diff did not fix either. But these are bugs we can investigate another day. Happy travels! I suppose

Re: fix stuck cancelled ehci xfers (ehci_idone: ex=%p is done!)

2015-02-27 Thread Martin Pieuchot
On 26/02/15(Thu) 22:45, Stefan Sperling wrote: On Thu, Feb 26, 2015 at 01:51:29AM +0100, Martin Pieuchot wrote: On 22/02/15(Sun) 00:54, Martin Pieuchot wrote: On 20/02/15(Fri) 23:15, Stefan Sperling wrote: In the following configuration I can pretty easily trigger endless screenfulls

Re: fix stuck cancelled ehci xfers (ehci_idone: ex=%p is done!)

2015-02-21 Thread Martin Pieuchot
On 20/02/15(Fri) 23:15, Stefan Sperling wrote: In the following configuration I can pretty easily trigger endless screenfulls of scrolling ehci_idone: ex=%p is done! messages, where %p is to a constant pointer value (same in each message). [ehci host]--[usb extension cable (hub 1)]--[usb

Re: fix stuck cancelled ehci xfers (ehci_idone: ex=%p is done!)

2015-02-25 Thread Martin Pieuchot
On 22/02/15(Sun) 00:54, Martin Pieuchot wrote: On 20/02/15(Fri) 23:15, Stefan Sperling wrote: In the following configuration I can pretty easily trigger endless screenfulls of scrolling ehci_idone: ex=%p is done! messages, where %p is to a constant pointer value (same in each message

Re: Small ifconfig output tweak for inet6?

2015-03-26 Thread Martin Pieuchot
On 26/03/15(Thu) 17:39, Florian Obser wrote: On Thu, Mar 26, 2015 at 01:48:03PM +0100, Martin Pieuchot wrote: How do people feel about printing the prefixlen in CIDR notation? I'm annoyed about outputs not fitting in 80 chars when using autoconf magic: -inet6 fd00::f2de:f1ff:fe6a:15d1

Re: Small ifconfig output tweak for inet6?

2015-03-26 Thread Martin Pieuchot
On 26/03/15(Thu) 17:35, Florian Obser wrote: On Thu, Mar 26, 2015 at 05:46:12PM +0100, Henning Brauer wrote: * Mike Belopuhov m...@belopuhov.com [2015-03-26 14:36]: however I agree that if we do this for ipv6 we should do it for ipv4 as well but then do we care about tons of stuff out

ehci(4) Full-speed isochronous transfers support

2015-03-28 Thread Martin Pieuchot
With the increasing number of machines shipping with rate-matching hubs instead of companion controllers to support USB Full and Low- speed devices, a number of people asked me if it was possible to add support for Full-speed isochronous transfers in order to use USB1.1 uaudio(4) devices with

Re: elantech-v4 clickpad support

2015-01-29 Thread Martin Pieuchot
On 30/01/15(Fri) 01:25, Ulf Brosziewski wrote: Probably I was too sceptical about synaptics.c. The bug I observed with the ALPS touchpad seems to be due to a kind of mismatch between the ALPS code in pms and the event handling in wsconscomm. The patch below contains the initial change as well

Re: [NEW] Driver for the Araneus Alea II USB TRNG

2015-04-14 Thread Martin Pieuchot
On 14/04/15(Tue) 07:40, attila wrote: [...] Feedback most welcome. See below. /* -*- mode:c; tab-width:8; indent-tabs-mode:t; c-basic-offset:8 -*- */ We do not include editor settings in files, the first line should contain: /* $OpenBSD$ */ Which will be expanded by CVS. /* *

Re: Change the way we handle interface/connected networks

2015-04-23 Thread Martin Pieuchot
On 15/04/15(Wed) 23:00, Claudio Jeker wrote: On Wed, Mar 18, 2015 at 05:46:34AM +0100, Claudio Jeker wrote: On Tue, Mar 17, 2015 at 05:35:21PM +0100, Martin Pieuchot wrote: On 12/02/15(Thu) 12:35, Martin Pieuchot wrote: On 10/02/15(Tue) 03:04, Claudio Jeker wrote: There is no need

Re: [PATCH] Disable USB bus probes

2015-04-22 Thread Martin Pieuchot
On 17/04/15(Fri) 16:47, Dimitris Papastamos wrote: Hi, This patch adds an option to usbdevs(8) to disable USB bus probing at runtime. The operation is restricted to the root user. It would be nice to show if probing is on or off, for example # usbdevs -p bus probing: on # usbdevs -p off

carp(4) ether_input_mbuf() take 2

2015-04-21 Thread Martin Pieuchot
Here's a new diff to convert carp_input() to use ether_input_mbuf() instead of ether_input(). This is a necessary step to be able to convert other pseudo-drivers to if_input() but it is just needed for the transition. This version only call M_PREPEND(9) on mbufs that will be passed to

bridge(4) and ether_input_mbuf()

2015-04-21 Thread Martin Pieuchot
This diff adds the necessary glue to bridge(4) to be able to convert other pseudo-drivers to if_input(). This will also help bridge(4)'s own conversion. Since bridge_input() already returns a mbuf, I believe this change is less error prone than the carp(4) one. But I appreciate reviews, tests

Re: bridge(4) and ether_input_mbuf()

2015-04-28 Thread Martin Pieuchot
On 21/04/15(Tue) 12:35, Martin Pieuchot wrote: This diff adds the necessary glue to bridge(4) to be able to convert other pseudo-drivers to if_input(). This will also help bridge(4)'s own conversion. Since bridge_input() already returns a mbuf, I believe this change is less error prone

Re: Async upd(4) - patch 7/7

2015-04-30 Thread Martin Pieuchot
On 24/04/15(Fri) 20:48, David Higgs wrote: This is the final patch in the series. Utilize the pending flags and report callback for their intended purpose - to process async behavior. Apply splusb() to ensure report callbacks can't fire before their data structures have been properly

Re: getsock() api modification

2015-04-30 Thread Martin Pieuchot
On 21/04/15(Tue) 17:15, Vitaliy Makkoveev wrote: Now fd_getfile() function returns unacquired struct file instance [...] It is unacceptable on multiprocessor machine because the instance referenced by fp can be destroyed between fd_getfile() and FREF() calls. So I want fd_getfile() returns

Re: [PATCH] Disable USB bus probes

2015-04-27 Thread Martin Pieuchot
On 22/04/15(Wed) 10:29, Dimitris Papastamos wrote: [...] On a side note, What do you think of using a sysctl instead of an ioctl? I guess an ioctl will do but it would make it easy for people to disable this at boot time by simply adding the relevant knob in /etc/sysctl.conf. Otherwise I

Re: carp backup becomes no carrier

2015-04-27 Thread Martin Pieuchot
On 24/04/15(Fri) 21:21, Johan Huldtgren wrote: a few hours after I sent the previous e-mail the backup (April 23rd snap) took over and became the master, at that point I could not reach the carp interfaces anymore. Reverting roles so the host running the April 12th snap became the master

Re: [PATCH] Man pages: usbd_open_pipe(9), usbd_close_pipe(9)

2015-05-04 Thread Martin Pieuchot
On 02/05/15(Sat) 08:44, attila wrote: Hi tech@, This patch adds man pages for usbd_open_pipe, usbd_open_pipe_intr, usbd_close_pipe and usbd_abort_pipe, done as two files: usbd_open_pipe.9 and usbd_close_pipe.9. It also adds these two new .9 files to the appropriate Makefile and tweaks

Re: carp backup becomes no carrier

2015-04-28 Thread Martin Pieuchot
Hello Johan and thanks for your great report! On 27/04/15(Mon) 11:54, Johan Huldtgren wrote: If you try 1.250 and 1.253 and tell me if you can reproduce the problem that would be really helpful. In case you see something weird, Could you include the routing table netstat -rnf inet in your

trunk is out, special offer with LACP included!

2015-05-05 Thread Martin Pieuchot
Now that the stack is ready, here's a diff to take the first victim, trunk(4), out of ether_input(). If you glanced over previous versions of this diff, the differences are mostly in sys/net/trunklacp.c and include some printf(9) fixes in bonus. Ok? Index: net/if_ethersubr.c

Re: tcp keep-alives sent without timestamps

2015-05-06 Thread Martin Pieuchot
On 20/04/15(Mon) 18:37, Mike Belopuhov wrote: On Tue, Apr 14, 2015 at 22:08 +0300, Lauri Tirkkonen wrote: On Tue, Apr 14 2015 20:40:58 +0200, Mike Belopuhov wrote: According to 3.2 in RFC 7323: Once TSopt has been successfully negotiated, that is both SYN and SYN,ACK contain

Introducing if_output()

2015-05-07 Thread Martin Pieuchot
This diff is a first step towards removing all pseudo-driver #ifdef in ether_output(). As for ether_input() the goal of this work is to provide an elegant design to make it easier to turn pseudo-drivers MP-safe. So instead of including some bridge(4), vlan(4) and carp(4) specific code in

Re: vfs_shutdown would like to do polled I/O at least on panic

2015-05-08 Thread Martin Pieuchot
On 07/05/15(Thu) 20:58, Mike Belopuhov wrote: As I've pointed out before, on panic we can be running on any CPU and our disk controller's interrupts can interrupt on the other one. Since we'll most likely be holding a kernel lock, dealing with unlocking it might get hairy very fast. Instead

Re: Async upd(4) - patch 7/7

2015-05-11 Thread Martin Pieuchot
On 2015-05-07 04:19, David Higgs wrote: On Apr 30, 2015, at 7:09 AM, Martin Pieuchot m...@openbsd.org wrote: [...] Your tweaks were good, so I tweaked it further: - When submit fails, invalidate affected sensors as described above. - When invalidating sensors, do it recursively. - When battery

Take vlan(4) out of ether_input()

2015-05-12 Thread Martin Pieuchot
Diff below convert vlan(4) to the new if_input() framework which means that vlan_input() will now be executed before ether_input(). Compared to trunk(4) multiple vlan(4)s can be attached to the same parent interface. When such thing happens only one input handler is added to keep the if_inputs

Re: Introducing if_output()

2015-05-12 Thread Martin Pieuchot
On 07/05/15(Thu) 11:50, Martin Pieuchot wrote: This diff is a first step towards removing all pseudo-driver #ifdef in ether_output(). As for ether_input() the goal of this work is to provide an elegant design to make it easier to turn pseudo-drivers MP-safe. So instead of including some

Kill NTRUNK

2015-05-12 Thread Martin Pieuchot
There's only one #if NTRUNK left in the tree, this diff gets rid of it by overwriting trunk ports' if_output(). ok? Index: net/if_ethersubr.c === RCS file: /cvs/src/sys/net/if_ethersubr.c,v retrieving revision 1.196 diff -u -p

Re: Small carp(4) diff

2015-05-14 Thread Martin Pieuchot
On 14/05/15(Thu) 08:20, sven falempin wrote: On Thu, May 14, 2015 at 6:27 AM, Martin Pieuchot m...@openbsd.org wrote: one level of indentation. pre if (X == null ) {dprintf(you broke this); return ;} unindented code; /pre Same gain, more dev ease and corner case check. I disagree

Small bridge(4) fix

2015-05-15 Thread Martin Pieuchot
If we change the rcvif pointer of a packet we need to run if_input() again otherwise we might skip the handlers on the new interface. Ultimately it would be nice to only assign rcvif in if_input(), but that's for another diff. This fix one case I left out in my previous conversion, ok? Index:

vlan+bridge fix

2015-05-15 Thread Martin Pieuchot
I have one setup with multiple interfaces in a bridge and on some of these interfaces some vlan(4)s. But there's currently a bug that prevent us to send (receive is fine) VLAN packets in such config. Diff below fixes that. The problem is that vlan_output() does not pass its parent interface to

Re: Introducing if_output()

2015-05-12 Thread Martin Pieuchot
On 12/05/15(Tue) 12:15, Martin Pieuchot wrote: On 07/05/15(Thu) 11:50, Martin Pieuchot wrote: This diff is a first step towards removing all pseudo-driver #ifdef in ether_output(). As for ether_input() the goal of this work is to provide an elegant design to make it easier to turn pseudo

Small carp(4) diff

2015-05-14 Thread Martin Pieuchot
ifp can never be NULL in carp_set_ifp(), so remove the check and gain one level of indentation. ok? Index: netinet/ip_carp.c === RCS file: /cvs/src/sys/netinet/ip_carp.c,v retrieving revision 1.254 diff -u -p -r1.254 ip_carp.c ---

Re: vlan+bridge fix

2015-05-19 Thread Martin Pieuchot
the situation. Can I have oks? On 15 maj 2015, at 13:14, Martin Pieuchot m...@openbsd.org wrote: I have one setup with multiple interfaces in a bridge and on some of these interfaces some vlan(4)s. But there's currently a bug that prevent us to send (receive is fine) VLAN packets in such config

Re: More if_output()

2015-05-19 Thread Martin Pieuchot
On 15/05/15(Fri) 15:53, Martin Pieuchot wrote: Some more if_output() conversion. The xl bits are here because I'd like to reduce the number of places where IFQ_ENQUEUE() is used. After applying this diff you should only have a couple left. Anyone? Ok? Index: dev/usb/if_upl.c

Re: xhci, thinkpad usb ports, uhub0: device problem

2015-04-14 Thread Martin Pieuchot
On 13/04/15(Mon) 22:39, Rafal Brodewicz wrote: Hi tech@ Enabling usb3 support in my ThinkPad T440s causes dock station usb ports to stop working. I see uhub0: device problem, disabling port 3 message in dmesg. dmesg with usb3 on and off included. Seems that the hub in your dock fails to

Re: [PATCH] Add support for dumping descriptors to usbdevs(8)

2015-04-16 Thread Martin Pieuchot
On 16/04/15(Thu) 10:02, Dimitris Papastamos wrote: ping A bit too soon to ping ;) You could wait at least a week!

Re: [NEW] Driver for the Araneus Alea II USB TRNG

2015-04-16 Thread Martin Pieuchot
On 15/04/15(Wed) 10:46, attila wrote: Martin Pieuchot m...@openbsd.org writes: On 14/04/15(Tue) 15:22, attila wrote: Martin Pieuchot m...@openbsd.org writes: static const struct usb_devno ualea_devs[] = { { USB_VENDOR_ARANEUS, USB_PRODUCT_ARANEUS_ALEA

Re: [PATCH] Add support for dumping descriptors to usbdevs(8)

2015-04-16 Thread Martin Pieuchot
On 13/04/15(Mon) 17:49, Dimitris Papastamos wrote: Hi, Attached below an updated patch that makes the layout a bit more sensible. It's nice it works. Now like various students that applied for the GSoC you've done the first step. The interesting part of that GSoC is also the boring part:

Re: [NEW] Driver for the Araneus Alea II USB TRNG

2015-04-17 Thread Martin Pieuchot
On 16/04/15(Thu) 16:06, attila wrote: [...] After this was committed I received a critique of the driver from the person behind the Alea II (Andreas Gustafsson) who made a few pretty good points. He felt trying to pull all the entropy off of the device that would theoretically be available

Re: File protection, second attempt

2015-04-12 Thread Martin Pieuchot
because most of it is run under the KERNEL_LOCK? From d7b381d438aa98a80e66c4aceeb905ef0a3ab9f3 Mon Sep 17 00:00:00 2001 From: Martin Pieuchot m...@openbsd.org Date: Mon, 2 Mar 2015 16:33:04 +0100 Subject: [PATCH 1/5] Check for flags inside fd_getfile(), will help for upcoming locking. --- sys/arch

Re: [NEW] Driver for the Araneus Alea II USB TRNG

2015-04-15 Thread Martin Pieuchot
On 14/04/15(Tue) 15:22, attila wrote: Martin Pieuchot m...@openbsd.org writes: static const struct usb_devno ualea_devs[] = { { USB_VENDOR_ARANEUS, USB_PRODUCT_ARANEUS_ALEA } }; Is it possible to match your device based on the content of the device descriptor instead

bce(4), lge(4), nge(4), vge(4), wb(4), malo(4) and hme(4/sparc)

2015-04-07 Thread Martin Pieuchot
Here's a diff to convert these drivers to if_input(). They all make use of m_devget(9) which takes an ifp as argument and I'd like to change that. But first I need to make sure all these drivers are converted. If you can try this diff on one or more chips, please let me know how it goes.

Re: bce(4), lge(4), nge(4), vge(4), wb(4), malo(4) and hme(4/sparc)

2015-04-08 Thread Martin Pieuchot
On 08/04/15(Wed) 10:03, David Gwynne wrote: On 8 Apr 2015, at 01:38, Martin Pieuchot m...@openbsd.org wrote: Here's a diff to convert these drivers to if_input(). They all make use of m_devget(9) which takes an ifp as argument and I'd like to change that. But first I need to make

Re: rename gettdbbyaddr to gettdbbydst

2015-04-08 Thread Martin Pieuchot
On 08/04/15(Wed) 12:15, Mike Belopuhov wrote: OK to rename gettdbbyaddr to gettdbbydst since that's what it does and it aligns well with gettdbbysrc? Makes sense to me. This is also coherent to the comments in ip_ipsp.h. One comment though, you're moving a splsoftnet() in tdb_delete() but it

m_devget(9), m_clget(9) and ifp

2015-04-08 Thread Martin Pieuchot
Now that all the drivers using m_devget(9) have been converted to if_input() we no longer need to pass an interface pointer to set `rcvif'. This is a small step towards the removal of an interface pointer in the mbuf header. While here, m_clget(9) also no longer needs an ifp. Ok? Index:

if_input() design and next step

2015-04-01 Thread Martin Pieuchot
One of the interesting things we've done during s2k15 was to redesign ether_input(). The name of this function is clearly misleading. Back in the old days [0] it was simply used to put a packet on a protocol queue. Today ether_input() still does that, but before it does a lot of different hacks

Re: add support for crc_enabled Elantech v3 touchpads

2015-04-02 Thread Martin Pieuchot
On 02/04/15(Thu) 18:43, Ulf Brosziewski wrote: On 04/02/2015 03:39 AM, Fasse wrote: On Wed, 01 Apr 2015 21:23:15 +0200 Ulf Brosziewskiulf.brosziew...@t-online.de wrote: Yes, without some refactoring there won't be an elegant way. pms_sync_elantech_v2 encodes some sync state in the 'flags'

carp(4) and Ethernet header

2015-04-09 Thread Martin Pieuchot
Same problem as with vlan(4). carp(4) also need to stop calling ether_input() directly and that implies having a mbuf with the correct Ethernet header prepended. Index: netinet/ip_carp.c === RCS file:

Run ifp detach hooks before ether_ifdetach()

2015-04-09 Thread Martin Pieuchot
Changes done by pseudo-driver *after* ether_ifattach() must be undone *before* ether_ifdetach(). Otherwise it is impossible to ensure we're leaving a stacked pseudo-interface in a correct state. Since I don't want to modify every single driver calling ether_ifdetach() I'm using a new function,

bridge(4) and Ethernet header

2015-04-09 Thread Martin Pieuchot
Like vlan(4) and carp(4), bridge(4) also need to be tweaked to still work during the if_input() transition. Removing the ether_input() calls in this driver was a bit tricky *because* bridge_input() is called after ether_input(). See how 3 M_PREPEND() are converted to 1? And soon none will be

vlan(4) and Ethernet header

2015-04-09 Thread Martin Pieuchot
Right now vlan_input() is called *after* ether_input(). More precisely it is called after the mbuf has been m_adj(9)'usted to skip the Ethernet header. This is not a problem in se but... To make sure vlan(4) keeps working during the if_input() transition, it has to stop calling ether_input()

Re: Brainy: Memory Leak in ICMP

2015-05-19 Thread Martin Pieuchot
On 19/05/15(Tue) 15:28, Maxime Villard wrote: -- netinet/ip_icmp.c -- 925 rt = rtalloc(sintosa(sin), RT_REPORT|RT_RESOLVE, rtableid); if (rt == NULL) return (NULL); /* Check if the route is actually usable */

Re: ospfd announces carp interface with physical link down

2015-05-20 Thread Martin Pieuchot
On 20/05/15(Wed) 07:40, Henning Brauer wrote: * Johan Ymerson johan.ymer...@transmode.com [2015-05-19 19:25]: On Tue, 2015-05-19 at 11:16 +, Johan Ymerson wrote: On Tue, 2015-05-19 at 11:24 +0100, Stuart Henderson wrote: On 2015/05/19 10:10, Johan Ymerson wrote: Yes I understand

Re: ospfd announces carp interface with physical link down

2015-05-21 Thread Martin Pieuchot
On 20/05/15(Wed) 14:14, Johan Ymerson wrote: [...] The patch did not apply cleanly to OPENBSD_5_7, I rewrote the patch a bit: Thanks, I committed my diff to -current. With this patch everything (almost) work. At least as good as my patch did. OSPFd still does something wrong with the link

Re: RTF_LOCAL and permanent ARP

2015-06-06 Thread Martin Pieuchot
On 05/06/15(Fri) 15:04, Claudio Jeker wrote: On Thu, Jun 04, 2015 at 12:19:10PM +0200, Martin Pieuchot wrote: I'd like to put the link-layer address back into the gateway field of RTF_LOCAL addresses. The problem is that RTF_LOCAL routes are also marked as RTF_LLINFO and a lot of code

Unneeded splnet()

2015-06-08 Thread Martin Pieuchot
bridge_ifenqueue() does not need any spl protection, if_output() already raises it. ok? Index: net/if_bridge.c === RCS file: /cvs/src/sys/net/if_bridge.c,v retrieving revision 1.241 diff -u -p -r1.241 if_bridge.c --- net/if_bridge.c

bridge_output() without m_buf_tag

2015-06-08 Thread Martin Pieuchot
Diff below moves bridge_output() to if_output(). It fixes the case I already described some weeks ago where you have a physical interface in a bridge and a vlan on top of it which is not in the bridge. It also change the loop prevention code to use M_PROTO1 like in the input path. Tests,

Conver bridge(4) to if_input()

2015-06-08 Thread Martin Pieuchot
This is the last pseudo-driver conversion. The idea is to run bridge_input() *before* any ifih on an interface. Doing so allow us to remove the hack between vlan(4) and bridge(4) and simplify the logic for stacked ifih. With that net/if_ethersubr.c is now free from #ifdef NPSEUDODRIVER. As

Re: Simple upd(4) sensors

2015-06-10 Thread Martin Pieuchot
On 02/06/15(Tue) 22:36, David Higgs wrote: Here are some new sensors for upd(4) devices. All exist on my device except AtRateTimeToEmpty, which still seemed a logical addition given that AtRateTimeToFull is already present. - AtRateTimeToEmpty - RunTimeToEmpty - NeedReplacement -

RTF_LOCAL and permanent ARP

2015-06-04 Thread Martin Pieuchot
I'd like to put the link-layer address back into the gateway field of RTF_LOCAL addresses. The problem is that RTF_LOCAL routes are also marked as RTF_LLINFO and a lot of code assume (correctly) that such routes contain valid ARP or ND information. I believe we decided to use an ``empty'' lladdr

Re: Conver bridge(4) to if_input()

2015-06-22 Thread Martin Pieuchot
On 22/06/15(Mon) 17:12, Alexander Bluhm wrote: On Wed, Jun 17, 2015 at 02:08:14PM +0200, Martin Pieuchot wrote: diff -u -p -r1.340 if.c --- net/if.c16 Jun 2015 11:09:39 - 1.340 +++ net/if.c17 Jun 2015 12:03:36 - @@ -530,6 +530,15 @@ if_input_process(void *xmq

Stop G/C mbufs in if_detach()

2015-06-23 Thread Martin Pieuchot
When an interface is detached or destroyed the CPU executing if_detach() removes all the mbufs received by this interface on three queues: ARP, IPv4 and IPv6 protocol queues. This made sense to avoid referencing a dangling rcvif pointer. But now mbufs contain unique interface indexes and protocol

Remove a #if NCARP hack

2015-06-24 Thread Martin Pieuchot
Time goes by and things must be cleaned. Thanks to claudio@'s work to support multiple connected routes carp(4) now have its own default priority. So I audited the remaining iterations on finet and I couldn't find any good reason to force carp(4) interfaces at a special position in the list of

Re: bridge_output() without m_buf_tag

2015-06-24 Thread Martin Pieuchot
On 17/06/15(Wed) 14:07, Martin Pieuchot wrote: On 08/06/15(Mon) 15:58, Martin Pieuchot wrote: Diff below moves bridge_output() to if_output(). It fixes the case I already described some weeks ago where you have a physical interface in a bridge and a vlan on top of it which

Re: macppc IPI counter

2015-06-24 Thread Martin Pieuchot
On 24/06/15(Wed) 16:45, Mark Kettenis wrote: Date: Wed, 24 Jun 2015 16:11:08 +0200 From: Martin Pieuchot m...@openbsd.org Use only one ipi counter just like other archs do. ok? Problem is that the event counters aren't really MP safe. By keeping them per-CPU you circumvent any

macppc IPI counter

2015-06-24 Thread Martin Pieuchot
Use only one ipi counter just like other archs do. ok? Index: dev/openpic.c === RCS file: /cvs/src/sys/arch/macppc/dev/openpic.c,v retrieving revision 1.81 diff -u -p -r1.81 openpic.c --- dev/openpic.c 24 Jun 2015 11:58:06

Re: umass quirk for ignoring residue?

2015-06-22 Thread Martin Pieuchot
On 20/06/15(Sat) 18:50, frantisek holop wrote: trying to use a replacement usb enclosure for an old 2.5 IDE drive. [...] Controller /dev/usb0: addr 1: high speed, self powered, config 1, EHCI root hub(0x), Intel(0x8086), rev 1.00 port 2 addr 6: high speed, self powered, config 1, USB

Re: SMP steroids for PF

2015-06-26 Thread Martin Pieuchot
On 26/06/15(Fri) 16:00, Alexandr Nedvedicky wrote: Hello Martin, I accept or your comments. I just have few quick notes/questions now. 2) I saw that you found some ALTQ leftovers, you have some Solaris (2) I think ALTQs leftovers are still in CVS repo, will double check anyway. Stack

Re: SMP steroids for PF

2015-06-26 Thread Martin Pieuchot
On 26/06/15(Fri) 17:19, Alexandr Nedvedicky wrote: On Fri, Jun 26, 2015 at 04:34:06PM +0200, Martin Pieuchot wrote: On 26/06/15(Fri) 16:00, Alexandr Nedvedicky wrote: 2) I saw that you found some ALTQ leftovers, you have some Solaris (2) I think ALTQs leftovers are still in CVS repo

Double free in trunk(4)

2015-06-10 Thread Martin Pieuchot
During clone/destroy stress tests on pseudo-interfaces I found a double free easily reproducible with dhclient(8) running on top of a trunk(4). The problem comes from trunk_ether_delmulti() which is almost identical to carp's version except that it always free mc. So when you do # ifconfig

Re: bridge_output() without m_buf_tag

2015-06-17 Thread Martin Pieuchot
On 08/06/15(Mon) 15:58, Martin Pieuchot wrote: Diff below moves bridge_output() to if_output(). It fixes the case I already described some weeks ago where you have a physical interface in a bridge and a vlan on top of it which is not in the bridge. It also change the loop prevention code

Re: Conver bridge(4) to if_input()

2015-06-17 Thread Martin Pieuchot
On 08/06/15(Mon) 16:11, Martin Pieuchot wrote: This is the last pseudo-driver conversion. The idea is to run bridge_input() *before* any ifih on an interface. Doing so allow us to remove the hack between vlan(4) and bridge(4) and simplify the logic for stacked ifih. With that net

bridge(4) local broadcast fix

2015-06-17 Thread Martin Pieuchot
It makes sense to not retransmit a packet on the interface it was received from but we should still call bridge_localbroadcast() on this interface otherwise the network stack never see this packet. This fix the configuration where you have a vlan(4) on top of an interface in a bridge(4) and the

Re: bridge(4) and if_input()

2015-06-01 Thread Martin Pieuchot
On 28/05/15(Thu) 11:23, Martin Pieuchot wrote: Let's use if_input() rather than ether_input_mbuf(). This simplifies the bpf(4) bits and removes some duplicate rcvif assignments. Once ether_input_mbuf() is no more my plan is to start merging various ifp counters and put an interface index

Re: arpresolve: unresolved and rt_expire == 0

2015-06-01 Thread Martin Pieuchot
On 31/05/15(Sun) 22:05, mxb wrote: Hello, any ideas regarding subject ? Yes various. Any idea about how to reproduce it? What you're seeing is a side-effect of r1.151 of netinet/if_ether.c. I see this in ‘dmesg’. Also all local (on machine itself) arp entries are incomplete: Yes

Re: carp(4) is out

2015-05-28 Thread Martin Pieuchot
On 23/05/15(Sat) 19:08, mxb wrote: [...] so far no problems. Here's an updated version to match recent changes. It also includes a nitpick fix from bluhm@. Tests and oks welcome. Index: net/if_ethersubr.c === RCS file:

tun(4) and if_input()

2015-05-28 Thread Martin Pieuchot
Replace the last ether_input_mbuf() by if_input(). Index: net/if_tun.c === RCS file: /cvs/src/sys/net/if_tun.c,v retrieving revision 1.144 diff -u -p -r1.144 if_tun.c --- net/if_tun.c26 May 2015 11:36:26 - 1.144 +++

<    1   2   3   4   5   6   7   8   9   10   >