GithubHelp home page GithubHelp logo

support filter by net namespace about pwru HOT 8 CLOSED

cilium avatar cilium commented on June 6, 2024
support filter by net namespace

from pwru.

Comments (8)

Asphaltt avatar Asphaltt commented on June 6, 2024 1

assign netns ID to an existing netns to facilitate your proposed debugging?

By reading the kernel source code net_namespace/peernet2id, netnsid is not retrieved from struct net neither struct ns_common.

inode is a good way to identify an net namespace. In kernel space, inode is the unsigned int inum field of struct ns_common. In user space, inode is the inode of the net namespace file, wherever the file is, like /proc/<pid>/ns/net, /var/run/docker/netns/<netns name>.

For example:

log of pwru: 0xffff8f26c23d4500 [isc-worker0000] neigh_resolve_output 3355665098061 netns=4026531992 mark=0x0 ifindex=2 proto=8 mtu=1500 len=62

inode of netns file: got netns: NS(4:4026531992)

(Go code to get inode: ns.UniqueID)

from pwru.

duanjiong avatar duanjiong commented on June 6, 2024

/assign @duanjiong

from pwru.

brb avatar brb commented on June 6, 2024

@duanjiong What would you use to identify netns from both user and kernel space?

from pwru.

duanjiong avatar duanjiong commented on June 6, 2024

I haven't seriously considered this question, just for the record first

from pwru.

duanjiong avatar duanjiong commented on June 6, 2024

@duanjiong What would you use to identify netns from both user and kernel space?

Most net namespaces should have a netnsid to match against. If not, can we consider using the net namespace's memory address to match? Or can we use inode?

from pwru.

brb avatar brb commented on June 6, 2024

I'm wondering whether you can assign netns ID to an existing netns to facilitate your proposed debugging? If yes, then netns ID seems to be a good candidate.

from pwru.

brb avatar brb commented on June 6, 2024

@Asphaltt Thanks! Using the inode makes sense to me. Would you like to work on this?

from pwru.

brb avatar brb commented on June 6, 2024

Fixed by #34.

from pwru.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.