Page MenuHomeFreeBSD

ice(4): allow to turn off/on tx lldp filter
Needs ReviewPublic

Authored by ae on Sat, Nov 23, 11:10 AM.

Details

Reviewers
erj
kbowling
krzysztof.galazka_intel.com
jeffrey.e.pieper_intel.com
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

ice(4) NICs have own LLDP agent that can generate LLDP frames to the lan.
However it is disabled by default and can be turned on via sysctl dev.ice.0.fw_lldp_agent=1

When LLDP agent is disabled, driver configures RX filter to forward LLDP frames
to the kernel, where they can be captured by user level applications. When LLDP agent
is enabled, it handles LLDP frames itself.

Also there is TX filter for LLDP frames that prevents transmitting them from the host,
when LLDP agent is disabled, i.e. this filter is enabled by default.

So by default we have a system that can capture LLDP frames, but cannot send them.
Disabling TX filter is possible via debug level sysctl, that is present only in
kernel with INVARIANTS option.

This patch adds new sysctl dev.ice.0.lldp_tx_filter that can be used to control
TX LLDP filter behaviour. Also it disables LLDP TX filter by default to match the
RX LLDP filter.

This allows capture and send LLDP frames from user level applications like cdpd.
Internal LLDP agent doesn't provide any useful information about the system that
cdpd does.

For example, this is information from internal agent:

XGigabitEthernet0/0/2 has 1 neighbor(s):

Neighbor index :1
Chassis type   :MAC address
Chassis ID     :00e0-edfb-0370
Port ID type   :MAC address
Port ID        :00e0-edfb-0370
Expired time   :116s

This from cdpd:

XGigabitEthernet0/0/2 has 1 neighbor(s):

Neighbor index :1
Chassis type   :MAC address
Chassis ID     :00e0-edfb-0370
Port ID type   :Locally assigned
Port ID        :ice0
Port description    :ice0
System name         :THERE.IS.FREEBSD.HOSTNAME
System description  :FreeBSD 15.0-G1 FreeBSD 15.0-G1 #0 ice_lldp-n272859-469bfd44751: Fri Nov 15 19:33:47 UTC 2024     root@hostname:/wrkdirs/usr/ports/local/freebsd15-kernel-test/work/stage/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64
System capabilities supported   :stationOnly
System capabilities enabled     :stationOnly
Management address type  :ipv4
Management address value :0.0.0.0
OID  :
Management address type  :ipv6
Management address value :FE80::2E0:EDFF:FEFB:370
OID  :
Expired time   :169s

with short description:

XGE1/0/13       00e0-edfb-0378  ice8                            THERE.IS.FREEBSD.HOSTNAME
XGE1/0/14       00e0-edfb-037b  ice11                           THERE.IS.FREEBSD.HOSTNAME
XGE1/0/15       00e0-edfb-0379  ice9                            THERE.IS.FREEBSD.HOSTNAME
XGE1/0/16       00e0-edfb-037a  ice10                           THERE.IS.FREEBSD.HOSTNAME

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 60741
Build 57625: arc lint + arc unit

Event Timeline

ae held this revision as a draft.
Owners added a reviewer: Restricted Owners Package.Sat, Nov 23, 11:10 AM
ae published this revision for review.Sat, Nov 23, 11:14 AM
ae added a reviewer: erj.
ae retitled this revision from ice(4): allow to turn off/on for tx lldp filter to ice(4): allow to turn off/on tx lldp filter.Sat, Nov 23, 11:27 AM