-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable ip address allocation for dpdk interface #142
enable ip address allocation for dpdk interface #142
Conversation
How the allocated IP address will be retrieved and used by the application? Using downward API? |
Right. The ip address will be contained in the CNI result and published to pod network-status annotation by Multus. application can get it via mapping the annotation context into container as env var or file via downward API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this look OK to me, small comment on the cmdDel
.
cmd/sriov/main.go
Outdated
|
||
return fmt.Errorf("failed to open netns %s: %q", netns, err) | ||
netns, err := ns.GetNS(args.Netns) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to avoid opening and closing ns fd , as its not being used in dpdk mode, you could move L181-196 into the if block at L197
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
587e4d4
to
72a2933
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we are changing a bit the behaviour from skip IPAM to call it and not configure it. I think it worth updating the README on as it change that "dpdk driver then the IPAM configuration will be ignored". Also will it work with all IPAM e.g dhcp? (it look for the interface in side the POD as far as I remember) maybe it worth to list the supported IPAM or the one you tested it with. Also reflect it in the code and the others will still be ignored.
Also "DPDK userspace driver config" section I think we need to add a note that not all pmds requires uio/vfio driver. (e.g Mellanox bifurcated pmd). Or maybe it related to different PR
+1 on updating docs
As far as i saw in containernetworking/plugins, ipam plugins dont access the interface inside the pod. |
72a2933
to
a46e111
Compare
Updated the doc.
I only tested host-local, but I think it should work for all IPAM plugins including dhcp.
I think we could add a bifurcated driver section in a separate PR. |
Right, in current code path, |
in the dhcp you have daemon using pod interface as far as I remember https://github.com/containernetworking/plugins/blob/master/plugins/ipam/dhcp/daemon.go#L64. |
found it. |
you're right, I will add the dhcp ipam as exception in the doc. |
thanks for the link! |
a46e111
to
4b8b450
Compare
added a note in README |
@ahalim-intel hi, any other concern about this change? |
I have no concerns so far. We will be doing some testing with this patch and let you know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. We passed merge criteria now.
@zshi-redhat I have a question. In dpdk mode (the driver of vfio-pci I use), the ip setting of the network card is not performed. When should I set it? |
The allocated IP address is not set automatically to the VF, since the VF device is in vfio-pci driver mode, we cannot directly configure IP to the VF. It is on the application who shall get the allocated IP address and use it to form the packet. |
Thank you, I've now understood |
For an external gateway pod that routes pod traffic to
external world via secondary dpdk interface, it requires
an IP address be allocated to the dpdk interface and exposed
in the multus network-status annotation.
This commit enables allocation of ipam IP address to dpdk
interface, but not configuring to the dpdk interface.