mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-30 22:52:25 -05:00 
			
		
		
		
	[chore]: Bump github.com/KimMachineGun/automemlimit from 0.2.4 to 0.2.5 (#1666)
Bumps [github.com/KimMachineGun/automemlimit](https://github.com/KimMachineGun/automemlimit) from 0.2.4 to 0.2.5. - [Release notes](https://github.com/KimMachineGun/automemlimit/releases) - [Commits](https://github.com/KimMachineGun/automemlimit/compare/v0.2.4...v0.2.5) --- updated-dependencies: - dependency-name: github.com/KimMachineGun/automemlimit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
		
					parent
					
						
							
								3f9b2336c0
							
						
					
				
			
			
				commit
				
					
						57dc742c76
					
				
			
		
					 200 changed files with 16392 additions and 38190 deletions
				
			
		
							
								
								
									
										54
									
								
								vendor/github.com/cilium/ebpf/link/xdp.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								vendor/github.com/cilium/ebpf/link/xdp.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,54 @@ | |||
| package link | ||||
| 
 | ||||
| import ( | ||||
| 	"fmt" | ||||
| 
 | ||||
| 	"github.com/cilium/ebpf" | ||||
| ) | ||||
| 
 | ||||
| // XDPAttachFlags represents how XDP program will be attached to interface. | ||||
| type XDPAttachFlags uint32 | ||||
| 
 | ||||
| const ( | ||||
| 	// XDPGenericMode (SKB) links XDP BPF program for drivers which do | ||||
| 	// not yet support native XDP. | ||||
| 	XDPGenericMode XDPAttachFlags = 1 << (iota + 1) | ||||
| 	// XDPDriverMode links XDP BPF program into the driver’s receive path. | ||||
| 	XDPDriverMode | ||||
| 	// XDPOffloadMode offloads the entire XDP BPF program into hardware. | ||||
| 	XDPOffloadMode | ||||
| ) | ||||
| 
 | ||||
| type XDPOptions struct { | ||||
| 	// Program must be an XDP BPF program. | ||||
| 	Program *ebpf.Program | ||||
| 
 | ||||
| 	// Interface is the interface index to attach program to. | ||||
| 	Interface int | ||||
| 
 | ||||
| 	// Flags is one of XDPAttachFlags (optional). | ||||
| 	// | ||||
| 	// Only one XDP mode should be set, without flag defaults | ||||
| 	// to driver/generic mode (best effort). | ||||
| 	Flags XDPAttachFlags | ||||
| } | ||||
| 
 | ||||
| // AttachXDP links an XDP BPF program to an XDP hook. | ||||
| func AttachXDP(opts XDPOptions) (Link, error) { | ||||
| 	if t := opts.Program.Type(); t != ebpf.XDP { | ||||
| 		return nil, fmt.Errorf("invalid program type %s, expected XDP", t) | ||||
| 	} | ||||
| 
 | ||||
| 	if opts.Interface < 1 { | ||||
| 		return nil, fmt.Errorf("invalid interface index: %d", opts.Interface) | ||||
| 	} | ||||
| 
 | ||||
| 	rawLink, err := AttachRawLink(RawLinkOptions{ | ||||
| 		Program: opts.Program, | ||||
| 		Attach:  ebpf.AttachXDP, | ||||
| 		Target:  opts.Interface, | ||||
| 		Flags:   uint32(opts.Flags), | ||||
| 	}) | ||||
| 
 | ||||
| 	return rawLink, err | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue