)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2678b994610afc7ffcab2c7e3c35d7a02fe2505f","unresolved":true,"context_lines":[{"line_number":4,"context_line":"Commit:     Balazs Gibizer \u003cbalazs.gibizer@est.tech\u003e"},{"line_number":5,"context_line":"CommitDate: 2022-02-16 19:12:38 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Show port MAC from binding profile for PFs"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Today Nova updates the mac_address of a direct-physical port to reflect"},{"line_number":10,"context_line":"the MAC address of the physical device the port is bound to. But this"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1884d7a2_75ae5bfc","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":4},"updated":"2022-02-17 10:44:46.000000000","message":"Why \"Show\"?","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e5e80489c406d320dbcd821aaeb610412980304c","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Balazs Gibizer \u003cbalazs.gibizer@est.tech\u003e"},{"line_number":5,"context_line":"CommitDate: 2022-02-16 19:12:38 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Show port MAC from binding profile for PFs"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Today Nova updates the mac_address of a direct-physical port to reflect"},{"line_number":10,"context_line":"the MAC address of the physical device the port is bound to. But this"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3f03d265_b5b79c2a","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":4},"in_reply_to":"1884d7a2_75ae5bfc","updated":"2022-03-04 14:31:08.000000000","message":"As it turned out this patch does not change the value of port.mac_address, it just shows the MAC from the binding:profile (if present) in the port dict returned on the REST API.","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d391da2edc5ed64615cecd7e7534739d81b90f6c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"59f42936_75e94109","updated":"2022-02-15 14:27:49.000000000","message":"Obviously this needs test coverage and release notes","commit_id":"a19eaddeb128fec09ab39c4b78e4e05a9338ee08"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"8b44cfcb6c271c994b59ede0d51b9e8af94df32f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"50885d43_f7a6a6cf","updated":"2022-02-17 08:12:24.000000000","message":"Fullstack test failure is unrelated to the patch, bug filed: https://bugs.launchpad.net/neutron/+bug/1961173","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"b45cafb38dbe44e08beb075a3ba6f432ad3ede00","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"1dc8931f_f54fafc8","updated":"2022-02-21 15:24:25.000000000","message":"I\u0027m not sure about this patch. I though we were going to update the Neutron \"port\" DB register with the new MAC address, provided in the port profile. This is not happening in this patch. We are just updating the port dictionary that is returned by the Neutron server; the port DB register is untouched. ","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"99411a7d62ef1eaa61a41d7a61eb553fecd49a68","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"12f151b5_5de05bf8","updated":"2022-02-21 14:29:29.000000000","message":"It is alligned what we discussed on the meeting (https://meetings.opendev.org/meetings/networking/2022/networking.2022-02-15-14.06.log.html#l-50 ), thanks","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"5bb9aca70323cdd1fd6363756412ce1f9a2374ce","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"e8122b02_c8784b62","updated":"2022-02-16 18:38:41.000000000","message":"Since this changes the API\u0027s behavior, shall we have an api-ref update and maybe a new extension? The api-ref\u0027s place would be in neutron-lib, but the extension could be added here.","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"531509cac4e505a5e7cb90e9df836d6bd1086670","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"dd0f29b7_28b221e4","updated":"2022-02-22 11:55:26.000000000","message":"could you please check the comments from Rodolfo?","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2fe697a99a5e48ac90f5cfa59fae2c767dbfd4c5","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"debaa7e4_28ad1603","updated":"2022-02-17 08:45:37.000000000","message":"recheck \n * fullstack: \"No ICMP reply obtained from IP address\" 2 hits in the last 7 days[1]\n * neutron-ovs-grenade-dvr-multinode: \"Job for pmlogger.service failed because a timeout was exceeded\" single hit in the last 4 days\n\n[1]https://paste.opendev.org/show/bnVbsrh9kzuqcsMOyfQe/","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"44d01897f8318179ca87117a10e7f4fd67240b32","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"cab95b20_527d5981","in_reply_to":"1dc8931f_f54fafc8","updated":"2022-02-21 16:11:03.000000000","message":"I can confirm that: the port DB register is never updated. The Neutron server will always return the new MAC (the one provided in the port binding). The VM will have the expected one (the one stored in the port binding). And any time we retrieve this port (port show, port list, etc), the MAC will be the address stored in the port binding. This is because what we return is the dictionary that is built from the port register and changed in this method.\n\nBut again this is not touching the Neutron DB register.","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"fe55e002a78d222b326a625083e937a7827c31d1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"e861349e_23856f3d","in_reply_to":"9310d101_2fc0b513","updated":"2022-02-21 18:04:50.000000000","message":"for example i know if you dont enable the pci numa afinity polciy in the \nextension_drivers config optionb \nhttps://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/extensions/port_numa_affinity_policy.py\n\nthe port numa affinity info will be in the intial respocne but will not be commited to the db\n\nthe delata here is this seams to persist into subsequent port shos where as it will not if you just dont list the exttion in the \nhttps://github.com/openstack/neutron/blob/master/neutron/conf/plugins/ml2/config.py#L36","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"234bad187989b129891ec586a3c45bf35415369e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"9310d101_2fc0b513","in_reply_to":"cab95b20_527d5981","updated":"2022-02-21 17:51:33.000000000","message":"ack so this kind of sound like there is a prexising but in neutorn which i can belive since i have been bitten by the port resopocne not matchign the db in the past if you do not load opitonal exteion in the server.\n\nwe might be able to fix this in the specific case in this patch but i dont think this is unique to this patch.","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e5e80489c406d320dbcd821aaeb610412980304c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"b67fc03b_3ff8e9ac","in_reply_to":"e8122b02_c8784b62","updated":"2022-03-04 14:31:08.000000000","message":"As the binding:profile is not a versioned dict I don\u0027t feel I need to add a new extension. I noted the extra behavior in the api-ref[1]\n\n[1] https://review.opendev.org/c/openstack/neutron-lib/+/831935","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8de32028738442cd90f4ff79c2f286238002b27d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"5a37362a_441a9f92","updated":"2022-03-04 15:02:38.000000000","message":"As per todays drivers meeting this needs to be changed to move the override to the port OVO","commit_id":"be6fe0432ae9c524eebced3e68ea9e1625c128fd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"4ae48efbe1d3ad657aa289ddadba0bc73ef93a4c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"ea338340_383ddd81","updated":"2022-03-20 10:52:25.000000000","message":"Tested this together with the n-lib and the nova patch in a real SRIOV env. It works as expected: https://paste.opendev.org/show/blmqhZ4A0fFeVVc75dY5/","commit_id":"2c50c9af1626178d0c3044a87d5cacb8bfefb17e"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"03e685c30e12e124924c1315c08d28b9864d7e92","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"05de7f60_2172e098","updated":"2022-03-23 17:20:59.000000000","message":"Good patch. Just one comment.\n\n","commit_id":"f0106f8c6a497d8b2935b9c273c988ba50b95a9b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a030ccd30f70b667e7a9f4c4bad132755d297f72","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"7b5a26b3_eecb61d5","updated":"2022-04-04 07:05:27.000000000","message":"Just double checking to avoid regression","commit_id":"1c0b5b1941dbf7dd0e060dc0f6be03d02f266ec7"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"1e2fc9dfa558da22966e7e7cbf5f55a9ac663ab9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"819c9ac5_7df0bd1a","updated":"2022-03-24 15:09:09.000000000","message":"Looking good.","commit_id":"1c0b5b1941dbf7dd0e060dc0f6be03d02f266ec7"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"4c2a70dd8a8a6e42e0c18af419785916bc6094b3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"34ea7256_ca558c15","updated":"2022-04-21 09:32:08.000000000","message":"Thanks Oleg for the double check!","commit_id":"1c0b5b1941dbf7dd0e060dc0f6be03d02f266ec7"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3adbe302258845c4dc1b2a77f112567be09263dd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"895caac9_f0ae71c7","updated":"2022-04-25 11:23:52.000000000","message":"I think that this release note should be changed as Bence mentioned. But we can propose follow up patch for that too. @gibi: will You do it?","commit_id":"4e78aaa694683f812d091a794bd140a7d363dd9b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"40bb304ceb26c54e39712617211c104ad648ff25","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"6cf1cb59_c1a269e5","updated":"2022-04-21 11:11:19.000000000","message":"Thanks!","commit_id":"4e78aaa694683f812d091a794bd140a7d363dd9b"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"de4de3b2b527d4c8b3a42a588146ef1450369cf8","unresolved":true,"context_lines":[{"line_number":798,"context_line":""},{"line_number":799,"context_line":"        return cur_context, need_notify, try_again"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"    def _update_port_dict_binding(self, port, binding):"},{"line_number":802,"context_line":"        port[portbindings.VNIC_TYPE] \u003d binding.vnic_type"},{"line_number":803,"context_line":"        profile \u003d self._get_profile(binding)"},{"line_number":804,"context_line":"        port[portbindings.PROFILE] \u003d profile"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a030dc9_56ccf743","line":801,"range":{"start_line":801,"start_character":8,"end_line":801,"end_character":33},"updated":"2022-02-23 17:54:43.000000000","message":"My two cents on this: if I\u0027m not wrong, what Nova expects for \"physical-direct\" ports (that means PF ports) is to be able to have, in the port profile (that is a generic json string), a dictionary with mac_binding\u003d{host: mac}.\n\nIf this new extension is enabled and the port profile has this information, Neutron can return the expected MAC address (that means, mac_binding[host]), not the Neutron port DB MAC address, that will never change.\n\nIs that correct? IMO this is doable. Of course, it is weird to have multiple MAC addresses, but there is a justification.\n\nSean, gibi, please, ping me whenever you want to discuss this.\n\n[1]https://review.opendev.org/c/openstack/neutron/+/767922","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"823d9eedee5177676e7b92fa784e761cd79a2f6b","unresolved":true,"context_lines":[{"line_number":798,"context_line":""},{"line_number":799,"context_line":"        return cur_context, need_notify, try_again"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"    def _update_port_dict_binding(self, port, binding):"},{"line_number":802,"context_line":"        port[portbindings.VNIC_TYPE] \u003d binding.vnic_type"},{"line_number":803,"context_line":"        profile \u003d self._get_profile(binding)"},{"line_number":804,"context_line":"        port[portbindings.PROFILE] \u003d profile"}],"source_content_type":"text/x-python","patch_set":2,"id":"992bbc5d_72419601","line":801,"range":{"start_line":801,"start_character":8,"end_line":801,"end_character":33},"in_reply_to":"14c88ba5_3171b311","updated":"2022-03-04 20:25:35.000000000","message":"On the today\u0027s drivers meeting it was agreed that this patch needs to be changed to do the override of the MAC in the OVO layer instead of the API layer. \n\nAfter the meeting I played around with that idea but I think the GET /ports/\u003cport_id\u003e API call does not use the port OVO to produce the API response. Bence confirmed my suspicion with [1].\n\n@Rodolfo: Should we change the API code to use the port OVO instead of directly reading from the DB? I feel that change can lead to a bunch of addition changes that will make this fix non-backportable. \n\nIn the meantime Bence raised the question that, why we don\u0027t overwrite the DB value of the port.mac_address (as suggested earlier). I think the MAC reset step (when the last binding is deleted) could be problematic there but I run out of time before I can properly formulate the problem. I will get back to this on Monday.\n\n[1] https://opendev.org/openstack/neutron/src/branch/master/neutron/db/db_base_plugin_v2.py#L1560-L1566","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a238e46353483aaa33240003cd4e7c3db3a6c03f","unresolved":true,"context_lines":[{"line_number":798,"context_line":""},{"line_number":799,"context_line":"        return cur_context, need_notify, try_again"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"    def _update_port_dict_binding(self, port, binding):"},{"line_number":802,"context_line":"        port[portbindings.VNIC_TYPE] \u003d binding.vnic_type"},{"line_number":803,"context_line":"        profile \u003d self._get_profile(binding)"},{"line_number":804,"context_line":"        port[portbindings.PROFILE] \u003d profile"}],"source_content_type":"text/x-python","patch_set":2,"id":"58a70355_22ab022c","line":801,"range":{"start_line":801,"start_character":8,"end_line":801,"end_character":33},"in_reply_to":"3756edd9_f6b9a23b","updated":"2022-03-07 08:10:07.000000000","message":"I think we cannot remove the logic of resetting the MAC of such port at unbind as that would re-introduce the bug https://bugs.launchpad.net/neutron/+bug/1830383","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"812b521a70e02eb6a93cde9aa2d75a53f028028a","unresolved":true,"context_lines":[{"line_number":798,"context_line":""},{"line_number":799,"context_line":"        return cur_context, need_notify, try_again"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"    def _update_port_dict_binding(self, port, binding):"},{"line_number":802,"context_line":"        port[portbindings.VNIC_TYPE] \u003d binding.vnic_type"},{"line_number":803,"context_line":"        profile \u003d self._get_profile(binding)"},{"line_number":804,"context_line":"        port[portbindings.PROFILE] \u003d profile"}],"source_content_type":"text/x-python","patch_set":2,"id":"b676d725_d3592f83","line":801,"range":{"start_line":801,"start_character":8,"end_line":801,"end_character":33},"in_reply_to":"58a70355_22ab022c","updated":"2022-03-07 10:35:38.000000000","message":"I\u0027ve talked this through with Rodolfo on IRC this morning: https://meetings.opendev.org/irclogs/%23openstack-neutron/%23openstack-neutron.2022-03-07.log.html#t2022-03-07T09:48:06","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"91bcb56f01580e2f2d02331e4c4f34504059bf57","unresolved":true,"context_lines":[{"line_number":798,"context_line":""},{"line_number":799,"context_line":"        return cur_context, need_notify, try_again"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"    def _update_port_dict_binding(self, port, binding):"},{"line_number":802,"context_line":"        port[portbindings.VNIC_TYPE] \u003d binding.vnic_type"},{"line_number":803,"context_line":"        profile \u003d self._get_profile(binding)"},{"line_number":804,"context_line":"        port[portbindings.PROFILE] \u003d profile"}],"source_content_type":"text/x-python","patch_set":2,"id":"a30693d0_46ffacbc","line":801,"range":{"start_line":801,"start_character":8,"end_line":801,"end_character":33},"in_reply_to":"80c20642_902a3399","updated":"2022-03-07 12:08:13.000000000","message":"Gibi referred to me getting involved in the background. I was suggesting to persist the new PF MAC (received from nova in the binding:profile) into the port\u0027s proper MAC attribute. My basic reason was to follow the principle of the least surprise. This way we would not have contradictory data in the DB about the port\u0027s MAC, therefore no (internal or external) consumer of this data could ever face the challenge of how to interpret the contradictory data.","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e6a609986d24af284a672005a32d1f380356e013","unresolved":true,"context_lines":[{"line_number":798,"context_line":""},{"line_number":799,"context_line":"        return cur_context, need_notify, try_again"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"    def _update_port_dict_binding(self, port, binding):"},{"line_number":802,"context_line":"        port[portbindings.VNIC_TYPE] \u003d binding.vnic_type"},{"line_number":803,"context_line":"        profile \u003d self._get_profile(binding)"},{"line_number":804,"context_line":"        port[portbindings.PROFILE] \u003d profile"}],"source_content_type":"text/x-python","patch_set":2,"id":"3756edd9_f6b9a23b","line":801,"range":{"start_line":801,"start_character":8,"end_line":801,"end_character":33},"in_reply_to":"992bbc5d_72419601","updated":"2022-03-07 08:03:44.000000000","message":"So going back to the question of persisting MAC from binding:profile to port.mac_address in the DB. \n\nI think it is doable. There is one downside. If the port is created with a MAC provided by the used then that MAC will be lost as soon as the port is bound as the new logic will overwrite that MAC in the port.mac_address field of the DB. When the port is unbound the neutron will generate a random MAC for the port. \n\nIs this acceptable?\n\nI think we can accept this as basically nova today already make such user defined MAC lost (for direct-physical ports). As nova update the port.mac_address before the port it binds the port. Also there is a neutron logic that if such port is unbound the MAC is reset already today.","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"61199af6607903666f250a627613e07f536ce3c6","unresolved":true,"context_lines":[{"line_number":798,"context_line":""},{"line_number":799,"context_line":"        return cur_context, need_notify, try_again"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"    def _update_port_dict_binding(self, port, binding):"},{"line_number":802,"context_line":"        port[portbindings.VNIC_TYPE] \u003d binding.vnic_type"},{"line_number":803,"context_line":"        profile \u003d self._get_profile(binding)"},{"line_number":804,"context_line":"        port[portbindings.PROFILE] \u003d profile"}],"source_content_type":"text/x-python","patch_set":2,"id":"e8dfe662_fef616c7","line":801,"range":{"start_line":801,"start_character":8,"end_line":801,"end_character":33},"in_reply_to":"9a030dc9_56ccf743","updated":"2022-03-03 12:00:32.000000000","message":"Making one step back and looking at the reality first.\n\nWhen a direct-physical port is bound to a compute host the port.mac_address value is not getting programmed to the physical device. Probably it wasn\u0027t implemented as we cannot make sure we can do it for all kind of physical devices. So at this point the port.mac_address and the MAC of the PF the port is bound to differs. This is can cause confusing for the user of the port. So there was work done in nova in the past to resolve the difference by updating the port.mac_address with the MAC of the PF right before the port is bound to that PF.\n\nHowever this solution is not complete as when the VM (using the port) is being moved to another host the port is re-bound to another PF with a different MAC. But that MAC is not reflected in the port.mac_address. This means that after the VM is moved the port.mac_address and the PF the port is bound to will be different again.\n\n^^ This is where we are today on master. \n\nMy goals is to remove the difference between the port.mac_address an the MAC of the PF the port is actually bound to.\n\nPossible options:\nA) remove the limitation from Neutron that today prevents updating port.mac_address when the port is in a bound state. This is dangerous for non direct-physical ports where the user expectation is that a change of the port.mac_address is automatically reflected on the device the port is bound to. This would be OK for direct-physical ports and nova could do the port.mac_address update during move operations.\n\nB) Change nova in a way that during a VM move operation nova first unbound the port from the source host, changes the MAC according to the dest host PF, then bounds the port to the dest host. This is problematic for two reasons.\n  i) live migration already uses multiple port binding so unbounding is not really possible as there is a passive binding on the target already\n  ii) this solution opens a race condition window where another client can bound the port after nova unbound from the source host but before nova binds it to the dest host\n\nC) Make the MAC address of the neutron port connected logically to the binding of the port instead of connected directly to the port itself. Make sure that each binding (binding:profile) of a port can specify the MAC address of the physical device (PF) the binding connects the port to. Then make sure that the port.mac_address always shows the MAC address of the active binding of the port (or show a neutron generated MAC if there is no active binding)\n\nI prefer option C)\n\n---\n\nYou suggestion of having a mac_binding\u003d{host: mac} structure is not necessary. The port already has a per host data structure as the port binding is always per host. This is why I suggest to handle the MAC via the binding:profile as that is already unique per host in neutron.\n\nOne can say that it is only true if multiple port binding is used. But in reality if neutron only allows a single port binding per port (if multiple port binding is disabled) then the logic still applies the binding profile is valid in the context of the host the port is bound to. (See the pci_slot bindig:profile field that is used with the same meaning today as that is also unique per host)\n\nAbout the point to how we persist things in neutron I\u0027m happy to follow the suggestion to change the patch from only showing the MAC from the profile to actually overwrite the port.mac_address in the DB according to the profile.","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"0063b40374467af01068a21b639815543472903b","unresolved":true,"context_lines":[{"line_number":798,"context_line":""},{"line_number":799,"context_line":"        return cur_context, need_notify, try_again"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"    def _update_port_dict_binding(self, port, binding):"},{"line_number":802,"context_line":"        port[portbindings.VNIC_TYPE] \u003d binding.vnic_type"},{"line_number":803,"context_line":"        profile \u003d self._get_profile(binding)"},{"line_number":804,"context_line":"        port[portbindings.PROFILE] \u003d profile"}],"source_content_type":"text/x-python","patch_set":2,"id":"b2a2117e_fe930ee2","line":801,"range":{"start_line":801,"start_character":8,"end_line":801,"end_character":33},"in_reply_to":"a30693d0_46ffacbc","updated":"2022-03-08 08:40:10.000000000","message":"I\u0027m fine with \"the principle of the least surprise\". I don\u0027t like easter eggs in the code.\n\nIf we make this change, based on the port profile info, we should change how we test the port MAC change in the ML2 plugin methods, considering the exception of the direct-physical ports.\n\nThis change should be IPAM compatible. There are many places in the IPAM module where the port MAC is used (just a heads-up).","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"030c3711741b675d10745940689ca1af384d2cb8","unresolved":false,"context_lines":[{"line_number":798,"context_line":""},{"line_number":799,"context_line":"        return cur_context, need_notify, try_again"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"    def _update_port_dict_binding(self, port, binding):"},{"line_number":802,"context_line":"        port[portbindings.VNIC_TYPE] \u003d binding.vnic_type"},{"line_number":803,"context_line":"        profile \u003d self._get_profile(binding)"},{"line_number":804,"context_line":"        port[portbindings.PROFILE] \u003d profile"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f1c5bbd_e41e5a88","line":801,"range":{"start_line":801,"start_character":8,"end_line":801,"end_character":33},"in_reply_to":"b2a2117e_fe930ee2","updated":"2022-03-18 15:47:50.000000000","message":"I\u0027ve updated the patch to overwrite the DB directly.","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"0c923cff930d9e39e65d31bf917c4f29e9fd8ea0","unresolved":true,"context_lines":[{"line_number":798,"context_line":""},{"line_number":799,"context_line":"        return cur_context, need_notify, try_again"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"    def _update_port_dict_binding(self, port, binding):"},{"line_number":802,"context_line":"        port[portbindings.VNIC_TYPE] \u003d binding.vnic_type"},{"line_number":803,"context_line":"        profile \u003d self._get_profile(binding)"},{"line_number":804,"context_line":"        port[portbindings.PROFILE] \u003d profile"}],"source_content_type":"text/x-python","patch_set":2,"id":"80c20642_902a3399","line":801,"range":{"start_line":801,"start_character":8,"end_line":801,"end_character":33},"in_reply_to":"b676d725_d3592f83","updated":"2022-03-07 11:29:01.000000000","message":"Summarized the discussion in the bug https://bugs.launchpad.net/nova/+bug/1942329/comments/9","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"958b6785d3f6ccc0f7671ecb989d42b4d317f86b","unresolved":false,"context_lines":[{"line_number":798,"context_line":""},{"line_number":799,"context_line":"        return cur_context, need_notify, try_again"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"    def _update_port_dict_binding(self, port, binding):"},{"line_number":802,"context_line":"        port[portbindings.VNIC_TYPE] \u003d binding.vnic_type"},{"line_number":803,"context_line":"        profile \u003d self._get_profile(binding)"},{"line_number":804,"context_line":"        port[portbindings.PROFILE] \u003d profile"}],"source_content_type":"text/x-python","patch_set":2,"id":"14c88ba5_3171b311","line":801,"range":{"start_line":801,"start_character":8,"end_line":801,"end_character":33},"in_reply_to":"dc194fec_9e481605","updated":"2022-03-04 10:56:25.000000000","message":"Cool. So you are OK not to change the persisted port.mac_address value just overwrite it with the returned port dict (as this patch proposed). Thanks. This make the solution on the neutron side pretty simple.","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"42662fa9f1788ef4031c756abb9ee12ecc4761c7","unresolved":true,"context_lines":[{"line_number":798,"context_line":""},{"line_number":799,"context_line":"        return cur_context, need_notify, try_again"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"    def _update_port_dict_binding(self, port, binding):"},{"line_number":802,"context_line":"        port[portbindings.VNIC_TYPE] \u003d binding.vnic_type"},{"line_number":803,"context_line":"        profile \u003d self._get_profile(binding)"},{"line_number":804,"context_line":"        port[portbindings.PROFILE] \u003d profile"}],"source_content_type":"text/x-python","patch_set":2,"id":"dc194fec_9e481605","line":801,"range":{"start_line":801,"start_character":8,"end_line":801,"end_character":33},"in_reply_to":"e8dfe662_fef616c7","updated":"2022-03-04 10:29:15.000000000","message":"Right, the port binding is per host; if we have multiple port binding, we don\u0027t need to create a mac_binding\u003d{host: mac} structure, just to add the \"{mac: value}\" you already added here.\n\nIf Neutron community is OK with this patch, I\u0027m too. The Neutron DB register \"port.mac\" value (I explicitly said Neutron DB register as opposed to the real L1 PF MAC value) is just a random generated value. In this specific case (and probably we\u0027ll have more in the future), this value is irrelevant. As you said, we need to use the NIC MAC value defined in the HW; not all drivers allow to override this value.\n\nThus, if in \"portbinding.profile\" we have \"{mac: value}\" (defined by Nova in this case, as is Nova who binds the port), Neutron will override the MAC value in the generated \"port\" dictionary; this value is returned by the API in any call (get/list port). As you said:\n* This allows to override the MAC address\n* We don\u0027t shortcut the protection we have in Neutron to block the MAC change for a bound port. We are not changing the DB register \"port.mac\" value.\n* We can handle multiple port binding with multiple MAC addresses.\n\nThanks for working on this!","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"4fec71c8b0d4032c3bd43c161fb26deaf9e81870","unresolved":true,"context_lines":[{"line_number":825,"context_line":"                # created by an old nova-compute"},{"line_number":826,"context_line":"                new_mac"},{"line_number":827,"context_line":"            ):"},{"line_number":828,"context_line":"                port[port_def.PORT_MAC_ADDRESS] \u003d new_mac"},{"line_number":829,"context_line":""},{"line_number":830,"context_line":"    def _update_port_dict_bound_drivers(self, port, binding_levels):"},{"line_number":831,"context_line":"        levels \u003d {str(bl.level): bl.driver for bl in binding_levels}"}],"source_content_type":"text/x-python","patch_set":2,"id":"4025e413_ca387cfe","line":828,"updated":"2022-02-21 12:45:18.000000000","message":"+1\n\nas discussed on irc after a few release we can move to only seeing the PF mac via this new mechanisium which will enable us to clean up the old code in nova.\n\ni also like how this can work cleanly for the single and multiple port binding workflows where as other solution would have to consider both paths.","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"030c3711741b675d10745940689ca1af384d2cb8","unresolved":false,"context_lines":[{"line_number":825,"context_line":"                # created by an old nova-compute"},{"line_number":826,"context_line":"                new_mac"},{"line_number":827,"context_line":"            ):"},{"line_number":828,"context_line":"                port[port_def.PORT_MAC_ADDRESS] \u003d new_mac"},{"line_number":829,"context_line":""},{"line_number":830,"context_line":"    def _update_port_dict_bound_drivers(self, port, binding_levels):"},{"line_number":831,"context_line":"        levels \u003d {str(bl.level): bl.driver for bl in binding_levels}"}],"source_content_type":"text/x-python","patch_set":2,"id":"ca869cd6_a9efe9a5","line":828,"in_reply_to":"4025e413_ca387cfe","updated":"2022-03-18 15:47:50.000000000","message":"Ack","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"b52598456f2c6149444b10644dd0733fc6f581a6","unresolved":true,"context_lines":[{"line_number":768,"context_line":"                ):"},{"line_number":769,"context_line":"                    profile \u003d jsonutils.loads(cur_context_binding.profile)"},{"line_number":770,"context_line":"                    new_mac \u003d profile.get(port_def.PORT_MAC_ADDRESS)"},{"line_number":771,"context_line":"                    if not new_mac:"},{"line_number":772,"context_line":"                        new_mac \u003d self._generate_macs()[0]"},{"line_number":773,"context_line":"                    old_mac \u003d port_db.mac_address"},{"line_number":774,"context_line":"                    port_db.mac_address \u003d new_mac"},{"line_number":775,"context_line":"                    LOG.debug("}],"source_content_type":"text/x-python","patch_set":7,"id":"7519fc5b_318a48c8","line":772,"range":{"start_line":771,"start_character":20,"end_line":772,"end_character":58},"updated":"2022-03-21 09:33:02.000000000","message":"why need to change port\u0027s mac if there is no new mac in binding profile?","commit_id":"2c50c9af1626178d0c3044a87d5cacb8bfefb17e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"0887add5811523e482197a47355a7318cf27dae9","unresolved":false,"context_lines":[{"line_number":768,"context_line":"                ):"},{"line_number":769,"context_line":"                    profile \u003d jsonutils.loads(cur_context_binding.profile)"},{"line_number":770,"context_line":"                    new_mac \u003d profile.get(port_def.PORT_MAC_ADDRESS)"},{"line_number":771,"context_line":"                    if not new_mac:"},{"line_number":772,"context_line":"                        new_mac \u003d self._generate_macs()[0]"},{"line_number":773,"context_line":"                    old_mac \u003d port_db.mac_address"},{"line_number":774,"context_line":"                    port_db.mac_address \u003d new_mac"},{"line_number":775,"context_line":"                    LOG.debug("}],"source_content_type":"text/x-python","patch_set":7,"id":"52dbd607_0008388c","line":772,"range":{"start_line":771,"start_character":20,"end_line":772,"end_character":58},"in_reply_to":"2feec4fe_a06630bd","updated":"2022-03-23 12:44:41.000000000","message":"If the port was bound then unbound then we need to reset the mac address of the port to a generated one as we want to avoid keeping the MAC of the existing PF in a port that is not bound to that PF any more. This is to avoid the duplicated MAC scenario when another port is being bound to that PF.\n\nThere is one edge case though. We re-generate the MAC here even if the port haven\u0027t had the PF MAC set before. But this is only possible if nova is old and does not send the MAC in the binding profile. So while it is a bit wasteful to regenerate in the MAC in this case it is will not happen in the future at all after nova is upgraded.\n\nI\u0027ve update the commit message and added a code comment to explain this.","commit_id":"2c50c9af1626178d0c3044a87d5cacb8bfefb17e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"33599100a23b5e2c9fac2e89581e3ea417089307","unresolved":true,"context_lines":[{"line_number":768,"context_line":"                ):"},{"line_number":769,"context_line":"                    profile \u003d jsonutils.loads(cur_context_binding.profile)"},{"line_number":770,"context_line":"                    new_mac \u003d profile.get(port_def.PORT_MAC_ADDRESS)"},{"line_number":771,"context_line":"                    if not new_mac:"},{"line_number":772,"context_line":"                        new_mac \u003d self._generate_macs()[0]"},{"line_number":773,"context_line":"                    old_mac \u003d port_db.mac_address"},{"line_number":774,"context_line":"                    port_db.mac_address \u003d new_mac"},{"line_number":775,"context_line":"                    LOG.debug("}],"source_content_type":"text/x-python","patch_set":7,"id":"2feec4fe_a06630bd","line":772,"range":{"start_line":771,"start_character":20,"end_line":772,"end_character":58},"in_reply_to":"7519fc5b_318a48c8","updated":"2022-03-21 09:52:59.000000000","message":"If it\u0027s required then commit message should state this imo","commit_id":"2c50c9af1626178d0c3044a87d5cacb8bfefb17e"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"03e685c30e12e124924c1315c08d28b9864d7e92","unresolved":true,"context_lines":[{"line_number":436,"context_line":"                                new_mac\u003dport[\u0027mac_address\u0027])"},{"line_number":437,"context_line":"        return mac_change"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"    def _reset_mac_for_direct_physical(self, orig_port, port, binding):"},{"line_number":440,"context_line":"        # when unbinding direct-physical port we need to free"},{"line_number":441,"context_line":"        # physical device MAC address so that other ports may reuse it"},{"line_number":442,"context_line":"        if (binding.vnic_type \u003d\u003d portbindings.VNIC_DIRECT_PHYSICAL and"}],"source_content_type":"text/x-python","patch_set":9,"id":"2b92b38b_d5fdc5ef","line":439,"range":{"start_line":439,"start_character":8,"end_line":439,"end_character":38},"updated":"2022-03-23 17:20:59.000000000","message":"Not needed anymore.","commit_id":"f0106f8c6a497d8b2935b9c273c988ba50b95a9b"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6cedb54cb29c57d75d3f7dd6299dc03142622ba1","unresolved":false,"context_lines":[{"line_number":436,"context_line":"                                new_mac\u003dport[\u0027mac_address\u0027])"},{"line_number":437,"context_line":"        return mac_change"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"    def _reset_mac_for_direct_physical(self, orig_port, port, binding):"},{"line_number":440,"context_line":"        # when unbinding direct-physical port we need to free"},{"line_number":441,"context_line":"        # physical device MAC address so that other ports may reuse it"},{"line_number":442,"context_line":"        if (binding.vnic_type \u003d\u003d portbindings.VNIC_DIRECT_PHYSICAL and"}],"source_content_type":"text/x-python","patch_set":9,"id":"39fddf2e_5bcabdf4","line":439,"range":{"start_line":439,"start_character":8,"end_line":439,"end_character":38},"in_reply_to":"2b92b38b_d5fdc5ef","updated":"2022-03-24 12:25:47.000000000","message":"Done","commit_id":"f0106f8c6a497d8b2935b9c273c988ba50b95a9b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a030ccd30f70b667e7a9f4c4bad132755d297f72","unresolved":true,"context_lines":[{"line_number":1779,"context_line":"                raise exc.PortNotFound(port_id\u003did)"},{"line_number":1780,"context_line":"            mac_address_updated \u003d self._check_mac_update_allowed("},{"line_number":1781,"context_line":"                port_db, attrs, binding)"},{"line_number":1782,"context_line":"            mac_address_updated |\u003d self._reset_mac_for_direct_physical("},{"line_number":1783,"context_line":"                port_db, attrs, binding)"},{"line_number":1784,"context_line":"            need_port_update_notify |\u003d mac_address_updated"},{"line_number":1785,"context_line":"            original_port \u003d self._make_port_dict(port_db)"}],"source_content_type":"text/x-python","patch_set":10,"id":"e04b20eb_dd377d9e","side":"PARENT","line":1782,"range":{"start_line":1782,"start_character":35,"end_line":1782,"end_character":70},"updated":"2022-04-04 07:05:27.000000000","message":"Not sure this is completely redundant now. Will new code reset direct port MAC in case of VM deletion (will _commit_port_binding() even be called)?","commit_id":"fc3d3cc8242f0f42004b7d6aaae470cc9a182716"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"4c2a70dd8a8a6e42e0c18af419785916bc6094b3","unresolved":false,"context_lines":[{"line_number":1779,"context_line":"                raise exc.PortNotFound(port_id\u003did)"},{"line_number":1780,"context_line":"            mac_address_updated \u003d self._check_mac_update_allowed("},{"line_number":1781,"context_line":"                port_db, attrs, binding)"},{"line_number":1782,"context_line":"            mac_address_updated |\u003d self._reset_mac_for_direct_physical("},{"line_number":1783,"context_line":"                port_db, attrs, binding)"},{"line_number":1784,"context_line":"            need_port_update_notify |\u003d mac_address_updated"},{"line_number":1785,"context_line":"            original_port \u003d self._make_port_dict(port_db)"}],"source_content_type":"text/x-python","patch_set":10,"id":"312f32a0_5ccaf07c","side":"PARENT","line":1782,"range":{"start_line":1782,"start_character":35,"end_line":1782,"end_character":70},"in_reply_to":"e04b20eb_dd377d9e","updated":"2022-04-21 09:32:08.000000000","message":"Good catch Oleg!\nI lost access to the lab where I had SRIOV setup to test this so I rely on the unit test env. But you are right the reset is not happening now as the _commit_port_binding is not called when the port in unbound. \n\nI\u0027ve added back the original reset logic that was removed in PS10 and added an explicit test to show that we need the separate reset logic.","commit_id":"fc3d3cc8242f0f42004b7d6aaae470cc9a182716"}],"neutron/tests/unit/plugins/ml2/test_plugin.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3adbe302258845c4dc1b2a77f112567be09263dd","unresolved":true,"context_lines":[{"line_number":1952,"context_line":"        plugin \u003d directory.get_plugin()"},{"line_number":1953,"context_line":"        port \u003d {\u0027device_id\u0027: \u0027123\u0027, \u0027device_owner\u0027: \u0027compute:nova\u0027}"},{"line_number":1954,"context_line":"        new_attrs \u003d ({\u0027device_id\u0027: \u0027\u0027, \u0027device_owner\u0027: \u0027\u0027} if unbinding else"},{"line_number":1955,"context_line":"                     {\u0027name\u0027: \u0027new\u0027})"},{"line_number":1956,"context_line":"        binding \u003d mock.Mock()"},{"line_number":1957,"context_line":"        binding.vnic_type \u003d ("},{"line_number":1958,"context_line":"            portbindings.VNIC_DIRECT_PHYSICAL if direct_physical else"}],"source_content_type":"text/x-python","patch_set":11,"id":"a50d472a_26454c5e","line":1955,"updated":"2022-04-25 11:23:52.000000000","message":"nit: unrelated change","commit_id":"4e78aaa694683f812d091a794bd140a7d363dd9b"}],"neutron/tests/unit/plugins/ml2/test_port_binding.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"4fec71c8b0d4032c3bd43c161fb26deaf9e81870","unresolved":false,"context_lines":[{"line_number":675,"context_line":"    def _update_port_with_binding("},{"line_number":676,"context_line":"        self, port_id, host, vnic_type, binding_profile_mac"},{"line_number":677,"context_line":"    ):"},{"line_number":678,"context_line":"        device_owner \u003d \u0027%s%s\u0027 % (const.DEVICE_OWNER_COMPUTE_PREFIX, \u0027nova\u0027)"},{"line_number":679,"context_line":"        update_body \u003d {"},{"line_number":680,"context_line":"            \"port\": {"},{"line_number":681,"context_line":"                \u0027device_owner\u0027: device_owner,"}],"source_content_type":"text/x-python","patch_set":2,"id":"eee92706_b67d54bc","line":678,"range":{"start_line":678,"start_character":8,"end_line":678,"end_character":75},"updated":"2022-02-21 12:45:18.000000000","message":"nit: lately i have been trying to avoid sting interpolation using % and fully adopting fstrings so this could be\n\ndevice_owner \u003d f\u0027{const.DEVICE_OWNER_COMPUTE_PREFIX}nova\u0027\nwhich is slightly simpler","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e5e80489c406d320dbcd821aaeb610412980304c","unresolved":false,"context_lines":[{"line_number":675,"context_line":"    def _update_port_with_binding("},{"line_number":676,"context_line":"        self, port_id, host, vnic_type, binding_profile_mac"},{"line_number":677,"context_line":"    ):"},{"line_number":678,"context_line":"        device_owner \u003d \u0027%s%s\u0027 % (const.DEVICE_OWNER_COMPUTE_PREFIX, \u0027nova\u0027)"},{"line_number":679,"context_line":"        update_body \u003d {"},{"line_number":680,"context_line":"            \"port\": {"},{"line_number":681,"context_line":"                \u0027device_owner\u0027: device_owner,"}],"source_content_type":"text/x-python","patch_set":2,"id":"90e6f3a0_fa1fde5c","line":678,"range":{"start_line":678,"start_character":8,"end_line":678,"end_character":75},"in_reply_to":"eee92706_b67d54bc","updated":"2022-03-04 14:31:08.000000000","message":"Done","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"4fec71c8b0d4032c3bd43c161fb26deaf9e81870","unresolved":false,"context_lines":[{"line_number":715,"context_line":"        host_1_pf_mac \u003d \u0027b4:96:91:34:f4:36\u0027"},{"line_number":716,"context_line":"        # this hostname is also accepted by the TestMechanismDriver"},{"line_number":717,"context_line":"        host2 \u003d \u0027host-ovs-filter-active\u0027"},{"line_number":718,"context_line":"        host_2_pf_mac \u003d \u0027b4:96:91:34:f4:d6\u0027"},{"line_number":719,"context_line":"        port \u003d self._create_unbound_port()"},{"line_number":720,"context_line":"        # neutron generates a MAC for each port created"},{"line_number":721,"context_line":"        generated_mac \u003d port[port_def.PORT_MAC_ADDRESS]"}],"source_content_type":"text/x-python","patch_set":2,"id":"96fdb557_b583753f","line":718,"range":{"start_line":718,"start_character":40,"end_line":718,"end_character":41},"updated":"2022-02-21 12:45:18.000000000","message":"i almost did not see the d is different but it is so cool","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e5e80489c406d320dbcd821aaeb610412980304c","unresolved":false,"context_lines":[{"line_number":715,"context_line":"        host_1_pf_mac \u003d \u0027b4:96:91:34:f4:36\u0027"},{"line_number":716,"context_line":"        # this hostname is also accepted by the TestMechanismDriver"},{"line_number":717,"context_line":"        host2 \u003d \u0027host-ovs-filter-active\u0027"},{"line_number":718,"context_line":"        host_2_pf_mac \u003d \u0027b4:96:91:34:f4:d6\u0027"},{"line_number":719,"context_line":"        port \u003d self._create_unbound_port()"},{"line_number":720,"context_line":"        # neutron generates a MAC for each port created"},{"line_number":721,"context_line":"        generated_mac \u003d port[port_def.PORT_MAC_ADDRESS]"}],"source_content_type":"text/x-python","patch_set":2,"id":"b4921a7b_d0c3c0fd","line":718,"range":{"start_line":718,"start_character":40,"end_line":718,"end_character":41},"in_reply_to":"96fdb557_b583753f","updated":"2022-03-04 14:31:08.000000000","message":"made it more obvious","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"4fec71c8b0d4032c3bd43c161fb26deaf9e81870","unresolved":true,"context_lines":[{"line_number":747,"context_line":"        # this should not change the MAC on the port as the new binding is"},{"line_number":748,"context_line":"        # inactive"},{"line_number":749,"context_line":"        self.assertEqual(host_1_pf_mac, self._get_port_mac(port[\u0027id\u0027]))"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":"        # Now activate the binding on host2"},{"line_number":752,"context_line":"        with mock.patch.object("},{"line_number":753,"context_line":"                mechanism_test.TestMechanismDriver, \u0027_check_port_context\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"954087d3_1e119e6b","line":750,"updated":"2022-02-21 12:45:18.000000000","message":"ack very good this ensure the mac is not prematurely changed during a live migration (which is implented via a hot unplug and a replug on the dest host)\nor cross cell cold migration which similarly uses multiple port binding.","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e5e80489c406d320dbcd821aaeb610412980304c","unresolved":false,"context_lines":[{"line_number":747,"context_line":"        # this should not change the MAC on the port as the new binding is"},{"line_number":748,"context_line":"        # inactive"},{"line_number":749,"context_line":"        self.assertEqual(host_1_pf_mac, self._get_port_mac(port[\u0027id\u0027]))"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":"        # Now activate the binding on host2"},{"line_number":752,"context_line":"        with mock.patch.object("},{"line_number":753,"context_line":"                mechanism_test.TestMechanismDriver, \u0027_check_port_context\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"5c6b5290_d594304e","line":750,"in_reply_to":"954087d3_1e119e6b","updated":"2022-03-04 14:31:08.000000000","message":"Ack","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"4fec71c8b0d4032c3bd43c161fb26deaf9e81870","unresolved":true,"context_lines":[{"line_number":765,"context_line":""},{"line_number":766,"context_line":"        # Neutron should update the port MAC to the MAC in the host1 binding"},{"line_number":767,"context_line":"        self.assertEqual(host_1_pf_mac, self._get_port_mac(port[\u0027id\u0027]))"},{"line_number":768,"context_line":""},{"line_number":769,"context_line":"        # Now delete both bindings. This should make the port get a generated"},{"line_number":770,"context_line":"        # MAC"},{"line_number":771,"context_line":"        response \u003d self._delete_port_binding(port[\u0027id\u0027], host1)"}],"source_content_type":"text/x-python","patch_set":2,"id":"4fff8a18_96d94cbd","line":768,"updated":"2022-02-21 12:45:18.000000000","message":"+1","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e5e80489c406d320dbcd821aaeb610412980304c","unresolved":false,"context_lines":[{"line_number":765,"context_line":""},{"line_number":766,"context_line":"        # Neutron should update the port MAC to the MAC in the host1 binding"},{"line_number":767,"context_line":"        self.assertEqual(host_1_pf_mac, self._get_port_mac(port[\u0027id\u0027]))"},{"line_number":768,"context_line":""},{"line_number":769,"context_line":"        # Now delete both bindings. This should make the port get a generated"},{"line_number":770,"context_line":"        # MAC"},{"line_number":771,"context_line":"        response \u003d self._delete_port_binding(port[\u0027id\u0027], host1)"}],"source_content_type":"text/x-python","patch_set":2,"id":"67d23390_9d9d4946","line":768,"in_reply_to":"4fff8a18_96d94cbd","updated":"2022-03-04 14:31:08.000000000","message":"Ack","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"4fec71c8b0d4032c3bd43c161fb26deaf9e81870","unresolved":true,"context_lines":[{"line_number":772,"context_line":"        self.assertEqual(webob.exc.HTTPNoContent.code, response.status_int)"},{"line_number":773,"context_line":"        response \u003d self._delete_port_binding(port[\u0027id\u0027], host2)"},{"line_number":774,"context_line":"        self.assertEqual(webob.exc.HTTPNoContent.code, response.status_int)"},{"line_number":775,"context_line":"        self.assertEqual(generated_mac, self._get_port_mac(port[\u0027id\u0027]))"}],"source_content_type":"text/x-python","patch_set":2,"id":"88d48c38_adc65fba","line":775,"updated":"2022-02-21 12:45:18.000000000","message":"ack this is to prevent mac collision if another vms uses the pf","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"e8a6b6d239d96414d69ae5a4de948d1e5852fd1a","unresolved":true,"context_lines":[{"line_number":772,"context_line":"        self.assertEqual(webob.exc.HTTPNoContent.code, response.status_int)"},{"line_number":773,"context_line":"        response \u003d self._delete_port_binding(port[\u0027id\u0027], host2)"},{"line_number":774,"context_line":"        self.assertEqual(webob.exc.HTTPNoContent.code, response.status_int)"},{"line_number":775,"context_line":"        self.assertEqual(generated_mac, self._get_port_mac(port[\u0027id\u0027]))"}],"source_content_type":"text/x-python","patch_set":2,"id":"bd949f79_660d234f","line":775,"in_reply_to":"88d48c38_adc65fba","updated":"2022-02-22 12:42:34.000000000","message":"ok so talking to rodolfo on irc we need to alter the end of this test\n\n\ninstead fo deleting both we shoudl delete the inactive binding\n\n        response \u003d self._delete_port_binding(port[\u0027id\u0027], host2)\n        self.assertEqual(webob.exc.HTTPNoContent.code, response.status_int)\n\nthen we shoudl clear the mac from the active binding profile\nand assert that the mac does not change.\n        self._update_port_with_binding(\n            port[\u0027id\u0027],\n            host1,\n            vnic_type\u003dportbindings.VNIC_DIRECT_PHYSICAL,\n            profile\u003d{}\n        )\n        self.assertEqual(host_1_pf_mac, self._get_port_mac(port[\u0027id\u0027]))\n\nthen finally delete the final binding and assert teh reset behavior \n\n        # Now delete both bindings. This should make the port get a generated\n        # MAC\n        response \u003d self._delete_port_binding(port[\u0027id\u0027], host1)\n        self.assertEqual(webob.exc.HTTPNoContent.code, response.status_int)\n        self.assertEqual(generated_mac, self._get_port_mac(port[\u0027id\u0027]))","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"9d94a083a9026d41a197ce60e8953345224b3a5a","unresolved":true,"context_lines":[{"line_number":772,"context_line":"        self.assertEqual(webob.exc.HTTPNoContent.code, response.status_int)"},{"line_number":773,"context_line":"        response \u003d self._delete_port_binding(port[\u0027id\u0027], host2)"},{"line_number":774,"context_line":"        self.assertEqual(webob.exc.HTTPNoContent.code, response.status_int)"},{"line_number":775,"context_line":"        self.assertEqual(generated_mac, self._get_port_mac(port[\u0027id\u0027]))"}],"source_content_type":"text/x-python","patch_set":2,"id":"d1348232_bb890841","line":775,"in_reply_to":"bd949f79_660d234f","updated":"2022-02-22 12:54:29.000000000","message":"rodoflo pointed out correctly that the update_port_with_binding does not support this but effectivly that can be replaced with\n\n        update_body \u003d {\n            \"port\": {\n                \u0027device_owner\u0027: device_owner,\n                \u0027binding:vnic_type\u0027: vnic_type,\n                \u0027binding:profile\u0027: {\n                },\n                \u0027binding:host_id\u0027: host,\n            }\n        }\n        with mock.patch.object(\n                mechanism_test.TestMechanismDriver, \u0027_check_port_context\u0027\n        ):\n            req \u003d self.new_update_request(\u0027ports\u0027, update_body, port_id)\n\n\ni.e. just clar the mac form the profile the exact way you do that is not really important but the intent of the test change is to ensure that the only place the mac can come from is the db not the profile dict.","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e5e80489c406d320dbcd821aaeb610412980304c","unresolved":false,"context_lines":[{"line_number":772,"context_line":"        self.assertEqual(webob.exc.HTTPNoContent.code, response.status_int)"},{"line_number":773,"context_line":"        response \u003d self._delete_port_binding(port[\u0027id\u0027], host2)"},{"line_number":774,"context_line":"        self.assertEqual(webob.exc.HTTPNoContent.code, response.status_int)"},{"line_number":775,"context_line":"        self.assertEqual(generated_mac, self._get_port_mac(port[\u0027id\u0027]))"}],"source_content_type":"text/x-python","patch_set":2,"id":"e9277c31_924a5d2a","line":775,"in_reply_to":"d1348232_bb890841","updated":"2022-03-04 14:31:08.000000000","message":"Done. Adapted it to the current agreement that we not update the port.mac_address in the DB.","commit_id":"5146cc8a9d35aa909db73da3d4f08812137df284"}],"releasenotes/notes/bug-1942329-7687504f9b177f80.yaml":[{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"1e2fc9dfa558da22966e7e7cbf5f55a9ac663ab9","unresolved":true,"context_lines":[{"line_number":7,"context_line":"    If it is provided then Neutron overwrites the value of the"},{"line_number":8,"context_line":"    ``device_mac_address`` field of the port object in the database with the"},{"line_number":9,"context_line":"    value from the active binding profile."},{"line_number":10,"context_line":"    If there are ports bound before `the nova side of this fix is depolyed"},{"line_number":11,"context_line":"    \u003chttps://review.opendev.org/c/openstack/nova/+/829248\u003e`_ then the VM using"},{"line_number":12,"context_line":"    the port needs to be moved or the port needs to be detached and re-attached"},{"line_number":13,"context_line":"    to force nova to provide the MAC address of the direct-physical port in the"},{"line_number":14,"context_line":"    port binding."}],"source_content_type":"text/x-yaml","patch_set":10,"id":"2a20ed45_035e4c16","line":14,"range":{"start_line":10,"start_character":4,"end_line":14,"end_character":17},"updated":"2022-03-24 15:09:09.000000000","message":"This may be better in the \"upgrade:\" section.","commit_id":"1c0b5b1941dbf7dd0e060dc0f6be03d02f266ec7"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3adbe302258845c4dc1b2a77f112567be09263dd","unresolved":true,"context_lines":[{"line_number":7,"context_line":"    If it is provided then Neutron overwrites the value of the"},{"line_number":8,"context_line":"    ``device_mac_address`` field of the port object in the database with the"},{"line_number":9,"context_line":"    value from the active binding profile."},{"line_number":10,"context_line":"    If there are ports bound before `the nova side of this fix is depolyed"},{"line_number":11,"context_line":"    \u003chttps://review.opendev.org/c/openstack/nova/+/829248\u003e`_ then the VM using"},{"line_number":12,"context_line":"    the port needs to be moved or the port needs to be detached and re-attached"},{"line_number":13,"context_line":"    to force nova to provide the MAC address of the direct-physical port in the"},{"line_number":14,"context_line":"    port binding."}],"source_content_type":"text/x-yaml","patch_set":10,"id":"7bf02dfe_89ea423b","line":14,"range":{"start_line":10,"start_character":4,"end_line":14,"end_character":17},"in_reply_to":"2a20ed45_035e4c16","updated":"2022-04-25 11:23:52.000000000","message":"+1","commit_id":"1c0b5b1941dbf7dd0e060dc0f6be03d02f266ec7"}]}
