intel / openlldp

Other
54 stars 42 forks source link

Add support for Additional Ethernet Capabilities TLV (Frame Preemption) (v2) #92

Closed vladimiroltean closed 1 year ago

vladimiroltean commented 1 year ago

The Linux kernel gained support for configuring the IEEE 802.3 MAC Merge layer via ethtool netlink: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=f3c6e128936e11e62d0af3c52f756194d79cf2e2 The intended usage for this feature is to advertise and negotiate the Frame Preemption feature with the link partner via the Additional Ethernet Capabilities (IEEE 802.3-2018 clause 79.3.7) TLV. This pull request adds support to lldpad and lldptool for this new TLV, and for talking to the kernel via the ethtool genetlink family. To that end, the lldpad program now links with libnl-genl-3.0 in addition to the libnl-3.0 it used so far.

v1: https://github.com/intel/openlldp/pull/91

pranavisomisetty commented 1 year ago

Hi Vladimir,

Getting this error " stack smashing detected : terminated" when I add addEthCaps TLV using lldptool. Changing the size of "struct nlattr tb" in lldp_ethtool.c, in the function "ethtool_msg_mm_get_parse" fixes it. line 184 : "struct nlattr tb[ETHTOOL_A_MM_MAX]" -> "struct nlattr *tb[ETHTOOL_A_MM_MAX+1]". I think that is inline with the ethtool mm entries, can you please incorporate in the next version?

Thanks Pranavi

vladimiroltean commented 1 year ago

Thanks for noticing, Pranavi, this is really good feedback. I'm not sure why I hadn't noticed this while running lldpad with valgrind. It probably got lost in all the journalctl output with debug logging enabled for this service. I've made this change and force-pushed to the branch for this PR, since the change was minimal.

apconole commented 1 year ago

Thanks - I'll plan to merge this by Wednesday of next week, if not sooner. Sorry it has taken so long.

apconole commented 1 year ago

Merged - thanks!

vladimiroltean commented 1 year ago

Thank you too!