public inbox for developer@lists.illumos.org (since 2011-08)
 help / color / mirror / Atom feed
From: Marcel Telka <marcel@telka.sk>
To: illumos-developer <developer@lists.illumos.org>
Subject: Re: [developer] Raw ethernet packets
Date: Thu, 6 Jun 2024 14:54:51 +0200	[thread overview]
Message-ID: <ZmGxm-fiCHWJ3smM@telcontar> (raw)
In-Reply-To: <Zlw15EaVyk7PArM7@telcontar>

On Sun, Jun 02, 2024 at 11:05:40AM +0200, Marcel Telka wrote:
> On Fri, May 31, 2024 at 10:43:03AM +0200, Marcel Telka wrote:
> > I'm trying to send a raw ethernet packet from an userland application
> > but all my attempts so far were unsuccessful.  I basically tried two
> 
> Attached is the testing program ethersend.c that uses both bpf and
> socket approaches to send the raw ethernet frame.  In both cases the
> frame is silently dropped in mac_tx() because fe_tx_srs is NULL:
> 
> https://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/io/mac/mac_client.c?r=119d61cc&mo=100885&fi=3519#3576
> 
> There is attached the ethersend.d dtrace script that shows the issue:
> 
> # gcc -Wall -lsocket -o ethersend ethersend.c
> # ./ethersend.d -c './ethersend e1000g0' 2>&1 | grep mac_tx
>   1              -> mac_tx                    
>   1               | mac_tx:entry                              0
>   1              <- mac_tx                                    0
>   1            -> mac_tx                      
>   1             | mac_tx:entry                                0
>   1            <- mac_tx                                      0
> 
> Since something similar reportedly works on dilos (I assume it is a fork
> of old illumos-gate) then it looks like the issue is in new illumos.
> 
> I'll try to do some archaeology...

The archeology revealed that the ethersend works on Solaris, but does
not on work on even very old illumos:

Solaris with the net0 network device:

Solaris 11.1 FCS	10/2012		WORKS!
Solaris 11.4 FCS	08/2018		WORKS!

Below is illumos.  All tests with e1000g0 device:

oi_147			10/2010		DOES NOT WORK
oi_151a8		08/2013		DOES NOT WORK
hipster_20131023	10/2013		DOES NOT WORK
dilos 2.0.2.48		11/2019		DOES NOT WORK

I also tested up-to-date illumos (OpenIndiana) with vioif0 interface
(qemu/kvm guest) and it does not work.

Solaris apparently changed something since we parted and even there is
the same hardware underneath (82540EM, VirtualBox) their networking
stack looks differently (net0 vs. e1000g0).  The ethersend simply works
there.

-- 
+-------------------------------------------+
| Marcel Telka   e-mail:   marcel@telka.sk  |
|                homepage: http://telka.sk/ |
+-------------------------------------------+

  reply	other threads:[~2024-06-06 12:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-31  8:43 Marcel Telka
2024-05-31  8:54 ` [developer] " Marcel Telka
2024-05-31  9:13   ` Denis Kozadaev
2024-05-31  9:51     ` Marcel Telka
2024-05-31 11:08       ` Marcel Telka
2024-05-31 11:23         ` Denis Kozadaev
2024-05-31 12:07           ` Marcel Telka
2024-05-31 12:18             ` Denis Kozadaev
2024-05-31 13:33               ` Marcel Telka
2024-05-31 14:15                 ` Denis Kozadaev
2024-05-31 15:04                   ` Marcel Telka
2024-05-31 15:20                     ` Denis Kozadaev
2024-05-31  9:03 ` Joshua M. Clulow
2024-05-31  9:50   ` Marcel Telka
2024-05-31 13:45     ` Marcel Telka
2024-05-31  9:43 ` Pramod Batni
2024-05-31  9:49   ` Marcel Telka
2024-06-02  9:05 ` Marcel Telka
2024-06-06 12:54   ` Marcel Telka [this message]
2024-06-06 16:51     ` Alan Coopersmith

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=ZmGxm-fiCHWJ3smM@telcontar \
    --to=marcel@telka.sk \
    --cc=developer@lists.illumos.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).