-
Notifications
You must be signed in to change notification settings - Fork 113
updateInterface: enable hot-add nic on arm64 #545
Conversation
device_amd64.go
Outdated
|
||
var pciBusRescanFile = sysfsDir + "/bus/pci/rescan" | ||
|
||
func rescanPciBus() error { |
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.
Since hot-add differs only on ARM, how about keeping the new files (device_amd64.go
, device_s390x.go
, etc), but having all non-ARM implementations call a generic handler like this:
func rescanPciBus() error {
return genericRescanPCIBus()
}
That would avoid the duplication.
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.
@jodh-intel thanks, if the implementation for rescanPciBus contains many lines of code, it is better to package them. but for only one line, keep it maybe better, as I fear of that more function call need more stack context switch which may be harmful to performance.
fb7d025
to
78a2fff
Compare
/test |
could someone help me retrigger test? |
/test |
Hi~ @grahamwhaley could we add ARM CI machine here?? ;) |
@Pennyzct - I expect so. If you are confident it is stable enough, then I don't think anybody will object. The only 'rule' I try to lay down is that if it becomes unstable and starts to block PRs, and is not fixed in a reasonable time, then we may disable it again :-) |
@grahamwhaley - could you add those CI arch requirements maybe to https://github.com/kata-containers/ci/blob/master/README.md? |
@jodh-intel - sure, I opened kata-containers/ci#156 as a starter. |
I agree we can add the arm job to the agent repo. |
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.
I'm not a fan of duplication, but this "1-liner duplication" can always be refactored in a follow-up PR I guess.
Thanks for dealing with all the architectures here by the way too.
/test |
@jodh-intel yeah, code duplication is not a good code style. |
@grahamwhaley @bergwolf any comments? |
np from me. I'd quite like to hear from @devimc on it for the pci/hotplug stuff. |
@grahamwhaley thanks. |
@@ -0,0 +1,11 @@ | |||
// | |||
// Copyright (c) 2019 Intel Corporation |
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.
This is probably a wrong header
@@ -0,0 +1,11 @@ | |||
// | |||
// Copyright (c) 2019 Intel Corporation |
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.
ARM Limited?
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.
@jcvenegas I'm confused with these copyright header, those no-arm64 code are all copy from the original file with Intel header. so I'm not sure how to write these header. @jodh-intel @grahamwhaley @bergwolf any idea?
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.
Thanks for raising this issue @jongwu! I agree that this is confusing, so we need to document this. IANAL so will need to get input from folks more knowledgeable in that area. Since this file is based on an existing one, I would think it is "safe" to always reference the original copyright as well (so that you could list both Intel and ARM for 2019).
@grahamwhaley - any thoughts on this? I'm happy to write it up once we have clarity on this subtle area.
As to a location for where to put the words.. I think it would either need to go in:
-
https://github.com/kata-containers/community/blob/master/CONTRIBUTING.md
-
But, for parity with https://github.com/kata-containers/documentation/blob/master/Documentation-Requirements.md, it may make sense to create a
https://github.com/kata-containers/documentation/blob/master/Source-File-Requirements.md
Wherever it goes, it needs to cover the following copyright scenarios:
- Adding a new source file.
- Adding a new source file which is similar to an existing file:
- Exact copy but for different arch (covering both a tiny fragment (like on this PR) and also a very large and complex file).
- "Based on" an existing file but with potentially extensive modifications.
- ... ?
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.
Thanks @jodh-intel, it is very helpful for me. If I get it right, the copyright header for device_amd64.go, device_ppc64le.go and device_s390x.go should include both intel and ARM. Is that right?
If that is the truth, what's the shape of these header? eg. it should be "Intel Corporation and ARM limited" or "Intel Corporation && ARM limited" or something else?
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.
afaik, you would put your new addition copyright on a new line, so like:
//
// Copyright (c) 2018 Intel Corporation
// Copyright (c) 2019 <your company/person name here>
//
// SPDX-License-Identifier: Apache-2.0
//
and replace your company
etc. :-)
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.
I should probably note - your company may have its own ideas, rules or specific name/format for this btw, and you might want to check internally first.
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.
// Copyright (c) 2019 ARM Limited
//
// SPDX-License-Identifier: Apache-2.0
//
plz use this. ;)
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.
Thanks @grahamwhaley
For now, update interface in agent will fail when hot-add nic to a running containers on arm64 as rescan pci bus will occur between uf and bf of shpc hotplug interrupt handling. Another problem is that the rootBusPath will be "/devices/platform/4010000000.pcie/pci0000:00" on arm64. To enable hot-add nic on arm64, rootBusPath should be changed here and shpc hotplug should be disabled in guest kernel. This patch just change rootBusPath. Fixes: kata-containers#544 Signed-off-by: Jianyong Wu <[email protected]>
Hi~ @grahamwhaley |
@devimc any comments? |
/test |
Fixes: #544
Signed-off-by: Jianyong Wu [email protected]
@bergwolf @jodh-intel @teawater @Pennyzct