Project

General

Profile

Actions

Submit #3126

closed

Bring in BIOC{S,G}FEEDBACK

Added by tuxillo over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
net
Target version:
-
Start date:
03/31/2018
Due date:
% Done:

100%

Estimated time:

Description

Hi,

The port net/vde2 uses a ioctl command BIOCFEEDBACK for FreeBSD to allow host-guest communication in a vde switch. The attached patch is the initial attempt to bring that ioctl command from NetBSD.
It compiles but it's untested until I figure out how to test it.

I'd need some pointers though:

- Is it okay to use directly ifp->if_input directly? Isn't there a mechanism similar to the one used in bpfwrite() > bpf_output_dispatch but for input?
If it's okay to use ifp->if_input directly, wouldn't it need some locking?

Cheers,
Antonio Huete


Files

bpf_biocfeedback.patch (3.37 KB) bpf_biocfeedback.patch tuxillo, 04/18/2018 01:39 AM
Actions #1

Updated by sepherosa over 6 years ago

This is wrong. You should move the change to bpf_output_dispatch().
And before calling if_input, make sure to clear the M_HASH on the
duplicated mbuf's m_flags.

On Sat, Mar 31, 2018 at 8:13 AM,
<> wrote:

Issue #3126 has been reported by tuxillo.

----------------------------------------
Submit #3126: Bring in BIOC{S,G}FEEDBACK
http://bugs.dragonflybsd.org/issues/3126

  • Author: tuxillo
  • Status: New
  • Priority: Normal
  • Assignee:
  • Category:
  • Target version:
    ----------------------------------------
    Hi,

The port net/vde2 uses a ioctl command BIOCFEEDBACK for FreeBSD to allow host-guest communication in a vde switch. The attached patch is the initial attempt to bring that ioctl command from NetBSD.
It compiles but it's untested until I figure out how to test it.

I'd need some pointers though:

- Is it okay to use directly ifp->if_input directly? Isn't there a mechanism similar to the one used in bpfwrite() > bpf_output_dispatch but for input?
If it's okay to use ifp->if_input directly, wouldn't it need some locking?

Cheers,
Antonio Huete

---Files--------------------------------
bpf_biocfeedback.patch (3.28 KB)

--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account

--
Tomorrow Will Never Die

Actions #2

Updated by tuxillo over 6 years ago

  • File deleted (bpf_biocfeedback.patch)
Actions #3

Updated by tuxillo over 6 years ago

  • File bpf_biocfeedback.patch added
  • Category set to net
  • Status changed from New to In Progress
  • Assignee set to tuxillo

Hi Sephe,

See attached the new patch, I've deleted the previous one.

Regards,
Antonio Huete

Actions #4

Updated by sepherosa over 6 years ago

Line 607~608 are wrong, they probably should be:
if (mc != NULL) {
if (error == 0) {
/* the if_input part */
} else {
m_freem(mc);
}
}

Line 658~659 are wrong, you will have to unconditionally initialize nm_feedback.

Thanks,
sephe

On Wed, Apr 4, 2018 at 1:50 AM, <> wrote:

Issue #3126 has been updated by tuxillo.

File bpf_biocfeedback.patch added
Category set to net
Status changed from New to In Progress
Assignee set to tuxillo

Hi Sephe,

See attached the new patch, I've deleted the previous one.

Regards,
Antonio Huete

----------------------------------------
Submit #3126: Bring in BIOC{S,G}FEEDBACK
http://bugs.dragonflybsd.org/issues/3126#change-13400

  • Author: tuxillo
  • Status: In Progress
  • Priority: Normal
  • Assignee: tuxillo
  • Category: net
  • Target version:
    ----------------------------------------
    Hi,

The port net/vde2 uses a ioctl command BIOCFEEDBACK for FreeBSD to allow host-guest communication in a vde switch. The attached patch is the initial attempt to bring that ioctl command from NetBSD.
It compiles but it's untested until I figure out how to test it.

I'd need some pointers though:

- Is it okay to use directly ifp->if_input directly? Isn't there a mechanism similar to the one used in bpfwrite() > bpf_output_dispatch but for input?
If it's okay to use ifp->if_input directly, wouldn't it need some locking?

Cheers,
Antonio Huete

---Files--------------------------------
bpf_biocfeedback.patch (3.33 KB)

--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account

--
Tomorrow Will Never Die

Actions #5

Updated by tuxillo over 6 years ago

  • File deleted (bpf_biocfeedback.patch)
Actions #6

Updated by tuxillo over 6 years ago

Attached the patch with the corrections. By the way, who frees the mc mbuf which is passed to ifp->if_input ?

Actions #7

Updated by sepherosa over 6 years ago

network stack :)

On Wed, Apr 18, 2018 at 4:40 PM,
<> wrote:

Issue #3126 has been updated by tuxillo.

File bpf_biocfeedback.patch added

Attached the patch with the corrections. By the way, who frees the mc mbuf which is passed to ifp->if_input ?

----------------------------------------
Submit #3126: Bring in BIOC{S,G}FEEDBACK
http://bugs.dragonflybsd.org/issues/3126#change-13413

  • Author: tuxillo
  • Status: In Progress
  • Priority: Normal
  • Assignee: tuxillo
  • Category: net
  • Target version:
    ----------------------------------------
    Hi,

The port net/vde2 uses a ioctl command BIOCFEEDBACK for FreeBSD to allow host-guest communication in a vde switch. The attached patch is the initial attempt to bring that ioctl command from NetBSD.
It compiles but it's untested until I figure out how to test it.

I'd need some pointers though:

- Is it okay to use directly ifp->if_input directly? Isn't there a mechanism similar to the one used in bpfwrite() > bpf_output_dispatch but for input?
If it's okay to use ifp->if_input directly, wouldn't it need some locking?

Cheers,
Antonio Huete

---Files--------------------------------
bpf_biocfeedback.patch (3.37 KB)

--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account

--
Tomorrow Will Never Die

Actions #8

Updated by sepherosa over 6 years ago

Patch looks good. Commit it!

On Wed, Apr 18, 2018 at 4:45 PM, Sepherosa Ziehau <> wrote:

network stack :)

On Wed, Apr 18, 2018 at 4:40 PM,
<> wrote:

Issue #3126 has been updated by tuxillo.

File bpf_biocfeedback.patch added

Attached the patch with the corrections. By the way, who frees the mc mbuf which is passed to ifp->if_input ?

----------------------------------------
Submit #3126: Bring in BIOC{S,G}FEEDBACK
http://bugs.dragonflybsd.org/issues/3126#change-13413

  • Author: tuxillo
  • Status: In Progress
  • Priority: Normal
  • Assignee: tuxillo
  • Category: net
  • Target version:
    ----------------------------------------
    Hi,

The port net/vde2 uses a ioctl command BIOCFEEDBACK for FreeBSD to allow host-guest communication in a vde switch. The attached patch is the initial attempt to bring that ioctl command from NetBSD.
It compiles but it's untested until I figure out how to test it.

I'd need some pointers though:

- Is it okay to use directly ifp->if_input directly? Isn't there a mechanism similar to the one used in bpfwrite() > bpf_output_dispatch but for input?
If it's okay to use ifp->if_input directly, wouldn't it need some locking?

Cheers,
Antonio Huete

---Files--------------------------------
bpf_biocfeedback.patch (3.37 KB)

--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account

--
Tomorrow Will Never Die

--
Tomorrow Will Never Die

Actions #9

Updated by tuxillo over 6 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF