Package ethtool allows control of the Linux ethtool generic netlink interface.

Overview
You might also like...
Slice - provides generic Map, Reduce and Filter functions for Go.

slice slice is a simple Go package to provide generic versions of Map, Reduce and Filter on slices. I mainly wrote it as an exercise to get more famil

πŸš€ GoDI: Generic based DI in Go

πŸš€ GoDI: Generic based DI in Go Installation DI: go get -u github.com/MaximZayats/godi/ import "github.com/MaximZayats/godi/di" CMD: go get -u github.

Generic-based collection tools

go-collection go collection is a tool implemented using generic, it can help you process slice/map data quickly and easily convert between them. Note:

sigbypass4xx is a utility to automate well-know techniques used to bypass access control restrictions.

sigbypass4xx sigbypass4xx is a utility to automate well-know techniques used to bypass access control restrictions. Resources Usage Installation From

Procswap is a simple application that allows you to prioritize processes on a Windows machine.
Procswap is a simple application that allows you to prioritize processes on a Windows machine.

Procswap is a simple application that allows you to prioritize processes on a Windows machine.

this allows you to get the real link of bit.ly
this allows you to get the real link of bit.ly

check the real url from a url shortener (bit.ly) Also you can use it as an API example with deno const rawResponse = await fetch("https://anti-url-s

memresolver is an in-memory golang resolver that allows to override current golang Lookup func literals

mem-resolver memresolver is an in-memory golang resolver that allows to override current golang Lookup func literals How to use it Create your custom

Automatically set GOMAXPROCS to match Linux container CPU quota.

automaxprocs Automatically set GOMAXPROCS to match Linux container CPU quota. Installation go get -u go.uber.org/automaxprocs Quick Start import _ "go

A Go library for the Linux Landlock sandboxing feature

Go Landlock library The Go Landlock library restricts the current processes' ability to use files, using Linux 5.13's Landlock feature. (Package docum

Comments
  • Add FEC() and SetFEC() methods to configure forward error correction

    Add FEC() and SetFEC() methods to configure forward error correction

    Some network card and SFP module combinations (e.g. Mellanox ConnectX-4 with a Flexoptix P.B1625G.10.AD) need to explicitly be configured to use RS forward error correction, otherwise they won’t link.

    I changed the get() function to only set the COMPACT_BITSETS flag for query commands so that the resulting request byte sequence matches the ethtool(8) byte sequence 1:1 (see TestFEC). Functionally, there is no change in behavior, as can be verified by looking at the corresponding Linux kernel code :)

    opened by stapelberg 0
  • Support for `ETHTOOL_MSG_TSINFO_GET` and `ETHTOOL_MSG_TSINFO_GET_REPLY`

    Support for `ETHTOOL_MSG_TSINFO_GET` and `ETHTOOL_MSG_TSINFO_GET_REPLY`

    It looks like ethtool can support querying a link to find out what kind of time-stamping capabilities it has with the -T option.

    > ethtool -T enp1s0
    Time stamping parameters for enp1s0:
    Capabilities:
            hardware-transmit     (SOF_TIMESTAMPING_TX_HARDWARE)
            software-transmit     (SOF_TIMESTAMPING_TX_SOFTWARE)
            hardware-receive      (SOF_TIMESTAMPING_RX_HARDWARE)
            software-receive      (SOF_TIMESTAMPING_RX_SOFTWARE)
            software-system-clock (SOF_TIMESTAMPING_SOFTWARE)
            hardware-raw-clock    (SOF_TIMESTAMPING_RAW_HARDWARE)
    PTP Hardware Clock: 0
    Hardware Transmit Timestamp Modes:
            off                   (HWTSTAMP_TX_OFF)
            on                    (HWTSTAMP_TX_ON)
    Hardware Receive Filter Modes:
            none                  (HWTSTAMP_FILTER_NONE)
            all                   (HWTSTAMP_FILTER_ALL)
    

    The results of this query could then be used in setsockopt to enable these capabilities when using sendmsg and recvmsg and then parsing the control message that gets returned to get timestamps of userspace, kernel, and hardware. Enabling these options would work with https://pkg.go.dev/github.com/mdlayher/socket as long as Recvmsg and Sendmsg are used and there is a utility function for assisting in parsing the control message, but this is outside the scope of this issue.

    Would you be open to adding support for this query? I propose something along the lines of:

    // TimestampInfo holds the decoded response from `ethtool -T`
    // NOTE: I am not suggesting that this is the struct we should use, but
    // it is similar to how I have a working version already.
    type TimestampInfo struct {
      HardwareRx bool
      HardwareTx bool
    
      SoftwareRx bool
      SoftwareTx bool
    
      SoftwareSystem bool
      HardwareRaw bool
    
      PTPClockIndex int
    }
    
    // TimestampingInfo essentiall does `ethtool -T DEV` and decodes the response into *TimestampInfo
    func (c *Client) TimestampingInfo(ifi Interface) (*TimestampInfo, error) {
      // TBD
    }
    

    Additional References:

    • https://kernel.googlesource.com/pub/scm/network/ethtool/ethtool/+/refs/tags/v5.14/ethtool.c#1653
    • https://www.kernel.org/doc/html/latest/networking/timestamping.html
    opened by blainsmith 1
  • ethtool: add LinkModeUpdate and Client.UpdateLinkMode

    ethtool: add LinkModeUpdate and Client.UpdateLinkMode

    This proposes an interface for partial updates of link mode information. Tests coming up: wanted to make sure the overall design was acceptable first. The motivation behind disjoining LinkMode and LinkModeUpdate is that:

    1. The sets of readable and writable fields are not the same, e.g. ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE is only readable and ETHTOOL_A_LINKMODES_LANES is only writable per docs.
    2. This allows for a natural (for golang) partial update interface via nullable fields.

    One point on which I waver is whether slices should have encoding/json-type semantics (nil <> empty slice) as proposed here, or perhaps be pointers like everything else. Let me know what you think.

    opened by dshynkev 0
  • ethtool: add Client.Watch(ctx) to watch for multicast group changes

    ethtool: add Client.Watch(ctx) to watch for multicast group changes

    The folks at Talos Systems (CC @smira) are setting up a manual ethtool genetlink watcher, but it'd be very reasonable for us to provide a nicer interface in this package for handling that functionality.

    See https://github.com/talos-systems/talos/blob/5811f4dda1b62848eefae9be56e8b91d443f4d34/internal/app/machined/pkg/controllers/network/watch/ethtool.go.

    opened by mdlayher 0
Owner
Matt Layher
Software Engineer. Go, Linux, and open source software enthusiast. On and ever upward.
Matt Layher
Perforator is a tool for recording performance metrics over subregions of a program using the Linux "perf" interface.

Perforator Perforator is a tool for recording performance metrics over subregions of a program (e.g., functions) using the Linux "perf" interface.

Zachary Yedidia 33 May 5, 2022
Di - A (very) WIP Go 1.18+ generic dependency injection package based on type reflection

di A (very) WIP Go 1.18+ generic dependency injection package based on type refl

Ringo Hoffmann 5 Apr 26, 2022
Go library to interface with NEAR nodes' JSON-RPC interface

StreamingFast Solana library for Go Go library to interface with NEAR nodes' JSON-RPC interface Contributing Issues and PR in this repo related strict

StreamingFast 1 Nov 9, 2021
This Go package allows you to set handler functions that run when named events occur

This Go package allows you to set handler functions that run when named events occur

James 1 Feb 10, 2022
πŸ“‹ cross-platform clipboard package that supports accessing text and image in Go (macOS/Linux/Windows/Android/iOS)

clipboard Cross platform (macOS/Linux/Windows/Android/iOS) clipboard package in Go import "golang.design/x/clipboard" Features Cross platform supports

The golang.design Initiative 268 Sep 24, 2022
A better Generic Pool (sync.Pool)

This package is a thin wrapper over the Pool provided by the sync package. The Pool is an essential package to obtain maximum performance by reducing the number of memory allocations.

null 38 Sep 15, 2022
Go library for decoding generic map values into native Go structures and vice versa.

mapstructure mapstructure is a Go library for decoding generic map values to structures and vice versa, while providing helpful error handling. This l

Mitchell Hashimoto 6.2k Sep 27, 2022
conditiond is a generic constraint and policy evaluator.

conditiond conditiond is a generic constraint and policy evaluator. This tool lets you define constraints in data and evaluate them at run time. It's

Tadas Vilkeliskis 22 Mar 23, 2022
Some utility functions for generic types in Go.

GOUF - Utility Functions for generic types Go team released Go 1.18 beta recently with support for Generics(a.k.a type parameters). This package provi

Akshay Bharambe 18 Apr 13, 2022
Generic Free List implementation to reuse memory and avoid allocations

gofl GOFL provides a Generic Free List implementation for Go. Installation This

Akshay Bharambe 1 Dec 26, 2021