)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"63adafbfb9a9cf9a2d37864cd45320c8547b9852","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix - os-vif fails to get the correct VF representor and UpLink Representor"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Due to the new change in kerenl [1], the PF and VF representors are linked"},{"line_number":10,"context_line":"to their parent PCI device. This patch fixes the failures caused by the new"},{"line_number":11,"context_line":"kernel change."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id\u003d123f0f53dd64b67e34142485fe866a8a581f12f1"},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9f560f44_3c20f9b0","line":11,"range":{"start_line":10,"start_character":27,"end_line":11,"end_character":14},"updated":"2020-08-13 14:04:31.000000000","message":"the commit message shoudl explain how you fixed the issue not just why.\n\nyou also need to wrap the lines ar 72 charaters\nfor commit mssages","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"24881bccd6c0d66bc1940ca4564ce129c17056ba","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix - os-vif fails to get the correct VF representor and UpLink Representor"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Due to the new change in kerenl [1], the PF and VF representors are linked"},{"line_number":10,"context_line":"to their parent PCI device. This patch fixes the failures caused by the new"},{"line_number":11,"context_line":"kernel change."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id\u003d123f0f53dd64b67e34142485fe866a8a581f12f1"},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9f560f44_bd7df06f","line":11,"range":{"start_line":10,"start_character":27,"end_line":11,"end_character":14},"in_reply_to":"9f560f44_3c20f9b0","updated":"2020-08-19 06:25:29.000000000","message":"Done","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"63adafbfb9a9cf9a2d37864cd45320c8547b9852","unresolved":false,"context_lines":[{"line_number":10,"context_line":"to their parent PCI device. This patch fixes the failures caused by the new"},{"line_number":11,"context_line":"kernel change."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id\u003d123f0f53dd64b67e34142485fe866a8a581f12f1"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I49f6ae3f0e6bfbf555c8284bfd70371ce90da0c7"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9f560f44_c7664a2a","line":13,"range":{"start_line":13,"start_character":0,"end_line":13,"end_character":118},"updated":"2020-08-13 14:04:31.000000000","message":"in general its considered bad partice to jsut link to an external resouce without explianing what it is in the commit.\n\nhttps://wiki.openstack.org/wiki/GitCommitMessages#Information_in_commit_messages\n\nif you have not read that document i would suggest doing so in full.","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"24881bccd6c0d66bc1940ca4564ce129c17056ba","unresolved":false,"context_lines":[{"line_number":10,"context_line":"to their parent PCI device. This patch fixes the failures caused by the new"},{"line_number":11,"context_line":"kernel change."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id\u003d123f0f53dd64b67e34142485fe866a8a581f12f1"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I49f6ae3f0e6bfbf555c8284bfd70371ce90da0c7"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9f560f44_9d80ec48","line":13,"range":{"start_line":13,"start_character":0,"end_line":13,"end_character":118},"in_reply_to":"9f560f44_c7664a2a","updated":"2020-08-19 06:25:29.000000000","message":"Done","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"63adafbfb9a9cf9a2d37864cd45320c8547b9852","unresolved":false,"context_lines":[{"line_number":11,"context_line":"kernel change."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id\u003d123f0f53dd64b67e34142485fe866a8a581f12f1"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I49f6ae3f0e6bfbf555c8284bfd70371ce90da0c7"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9f560f44_c74f6a90","line":14,"updated":"2020-08-13 14:04:31.000000000","message":"you need to file a bug in lanuch pad then add\n\nCloses-Bug: #\u003cbug number\u003e\n\ncan you include an example of how this faile sin the bug report too as well as any other relevnet info like how sysfs has been modifed with output of ls/tree before and after.\n\n\nif im reading the kernel commit properly \n\n+\tSET_NETDEV_DEV(netdev, mdev-\u003edevice);\n \tif (rep-\u003evport \u003d\u003d MLX5_VPORT_UPLINK) {\n-\t\tSET_NETDEV_DEV(netdev, mdev-\u003edevice);\n\nthe netdev was previoulsy only set for the uplink\nbut now its set for all the vports\n\nso if you can show the change for this induces for a PF and VF that would be useful to help review if this change is valid.\n\n\ngiven we do not have hardware to test this locally the more info you can provide showing its correct the better.","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"24881bccd6c0d66bc1940ca4564ce129c17056ba","unresolved":false,"context_lines":[{"line_number":11,"context_line":"kernel change."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id\u003d123f0f53dd64b67e34142485fe866a8a581f12f1"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I49f6ae3f0e6bfbf555c8284bfd70371ce90da0c7"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9f560f44_9008c62d","line":14,"in_reply_to":"9f560f44_889a9f6b","updated":"2020-08-19 06:25:29.000000000","message":"Done","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"c42e1e4837a0815a9ebc1c9d7c62ec52727a254f","unresolved":false,"context_lines":[{"line_number":11,"context_line":"kernel change."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id\u003d123f0f53dd64b67e34142485fe866a8a581f12f1"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I49f6ae3f0e6bfbf555c8284bfd70371ce90da0c7"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9f560f44_889a9f6b","line":14,"in_reply_to":"9f560f44_c74f6a90","updated":"2020-08-13 16:19:40.000000000","message":"+1 \nlets add examples for before and after this change from user perspective.\n\nSean, you are correct in understanding the change.","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"24881bccd6c0d66bc1940ca4564ce129c17056ba","unresolved":false,"context_lines":[{"line_number":11,"context_line":"kernel change."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id\u003d123f0f53dd64b67e34142485fe866a8a581f12f1"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I49f6ae3f0e6bfbf555c8284bfd70371ce90da0c7"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9f560f44_b00d0a40","line":14,"in_reply_to":"9f560f44_c74f6a90","updated":"2020-08-19 06:25:29.000000000","message":"Done","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"144881f559164b50c5dcabece30849423ef20af3","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix - os-vif fails to get the correct UpLink Representor"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Due to the new change in kerenl, the PF and VF representors are linked"},{"line_number":10,"context_line":"to their parent PCI device, and so \"get_ifname_by_pci_address\" fails"},{"line_number":11,"context_line":"to get the correct UpLink Representor."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"9f560f44_478155fb","line":9,"range":{"start_line":9,"start_character":0,"end_line":9,"end_character":31},"updated":"2020-10-05 21:01:12.000000000","message":"better to point out the kernel change","commit_id":"664f8931afc564381e71b6c3c996b39d26e82941"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"c1b9d20d279cb2e80f695690cde5a31bad318302","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix - os-vif fails to get the correct UpLink Representor"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Due to the new change in kerenl, the PF and VF representors are linked"},{"line_number":10,"context_line":"to their parent PCI device, and so \"get_ifname_by_pci_address\" fails"},{"line_number":11,"context_line":"to get the correct UpLink Representor."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"7f6b1bfe_442ecca5","line":9,"range":{"start_line":9,"start_character":0,"end_line":9,"end_character":31},"in_reply_to":"9f560f44_478155fb","updated":"2020-10-14 12:55:02.000000000","message":"Done","commit_id":"664f8931afc564381e71b6c3c996b39d26e82941"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"3cc033400ad3297bae544e79bf65b5c2ca3cf475","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id\u003d123f0f53dd64b67e34142485fe866a8a581f12f1"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Closes-Bug: #1892132"},{"line_number":24,"context_line":"Change-Id: I49f6ae3f0e6bfbf555c8284bfd70371ce90da0c7"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"5f681702_cc5b1c2c","line":23,"range":{"start_line":23,"start_character":0,"end_line":23,"end_character":20},"updated":"2020-10-19 12:24:50.000000000","message":"sepeaking to jan on irc he raised a vaild point.\nwe should have a release note for this change ideally since this is going to be backported and opertors will need to upgrade there os-vif if they have a newer kernel.","commit_id":"3b51acafec0ae970bcb61f282fa9827379b008df"}],"vif_plug_ovs/linux_net.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"63adafbfb9a9cf9a2d37864cd45320c8547b9852","unresolved":false,"context_lines":[{"line_number":273,"context_line":"        device_port_name_file \u003d ("},{"line_number":274,"context_line":"            os.path.join(device_path, \u0027phys_port_name\u0027))"},{"line_number":275,"context_line":""},{"line_number":276,"context_line":"        if not os.path.isfile(device_port_name_file):"},{"line_number":277,"context_line":"            continue"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        try:"},{"line_number":280,"context_line":"            with open(device_port_name_file, \u0027r\u0027) as fd:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_c202b809","side":"PARENT","line":277,"range":{"start_line":276,"start_character":5,"end_line":277,"end_character":20},"updated":"2020-08-13 14:04:31.000000000","message":"by removing this if the file does not exist we will raise an exception  in _get_phys_port_name(device)\n\nwhich will be then caugth.\n\ni would prefer to keep the check and not ot the open on a file that does not exist.","commit_id":"041ce67619074ee79226161aab8169f990e4c175"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"24881bccd6c0d66bc1940ca4564ce129c17056ba","unresolved":false,"context_lines":[{"line_number":273,"context_line":"        device_port_name_file \u003d ("},{"line_number":274,"context_line":"            os.path.join(device_path, \u0027phys_port_name\u0027))"},{"line_number":275,"context_line":""},{"line_number":276,"context_line":"        if not os.path.isfile(device_port_name_file):"},{"line_number":277,"context_line":"            continue"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        try:"},{"line_number":280,"context_line":"            with open(device_port_name_file, \u0027r\u0027) as fd:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_3a9e0663","side":"PARENT","line":277,"range":{"start_line":276,"start_character":5,"end_line":277,"end_character":20},"in_reply_to":"9f560f44_c202b809","updated":"2020-08-19 06:25:29.000000000","message":"Done","commit_id":"041ce67619074ee79226161aab8169f990e4c175"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"eab4e7bb7527833411816e08d0505a91560bf59c","unresolved":false,"context_lines":[{"line_number":44,"context_line":"# phys_port_name contains PF## or pf##"},{"line_number":45,"context_line":"PF_RE \u003d re.compile(r\"pf(\\d+)\", re.IGNORECASE)"},{"line_number":46,"context_line":"# phys_port_name contains p##"},{"line_number":47,"context_line":"PF_PORT_RE \u003d re.compile(r\"p(\\d+)\")"},{"line_number":48,"context_line":"# bus_info (bdf) contains \u003cbus\u003e:\u003cdev\u003e.\u003cfunc\u003e"},{"line_number":49,"context_line":"PF_FUNC_RE \u003d re.compile(r\"\\.(\\d+)\", 0)"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_22455844","line":47,"updated":"2020-08-17 11:42:32.000000000","message":"shall we add `re.IGNORECASE` like above ?\n\nAlso as that regex should match the uplink port, perhaps name this : UPLINK_PORT_RE ?","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"6f1afa466c1444481210999bd1b2a3455634cb2f","unresolved":false,"context_lines":[{"line_number":44,"context_line":"# phys_port_name contains PF## or pf##"},{"line_number":45,"context_line":"PF_RE \u003d re.compile(r\"pf(\\d+)\", re.IGNORECASE)"},{"line_number":46,"context_line":"# phys_port_name contains p##"},{"line_number":47,"context_line":"PF_PORT_RE \u003d re.compile(r\"p(\\d+)\")"},{"line_number":48,"context_line":"# bus_info (bdf) contains \u003cbus\u003e:\u003cdev\u003e.\u003cfunc\u003e"},{"line_number":49,"context_line":"PF_FUNC_RE \u003d re.compile(r\"\\.(\\d+)\", 0)"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_7ad23e36","line":47,"in_reply_to":"9f560f44_22455844","updated":"2020-08-18 11:13:32.000000000","message":"Done","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"63adafbfb9a9cf9a2d37864cd45320c8547b9852","unresolved":false,"context_lines":[{"line_number":257,"context_line":"    except (OSError, IOError):"},{"line_number":258,"context_line":"        raise exception.RepresentorNotFound(ifname\u003dpf_ifname, vf_num\u003dvf_num)"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"    ifname_pf_func \u003d _get_pf_func(pf_ifname)"},{"line_number":261,"context_line":"    for device in devices:"},{"line_number":262,"context_line":"        device_sw_id_file \u003d \"/sys/class/net/%s/phys_switch_id\" % device"},{"line_number":263,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_1ce9b57f","line":260,"range":{"start_line":260,"start_character":3,"end_line":260,"end_character":44},"updated":"2020-08-13 14:04:31.000000000","message":"if this is none we should just raise\n\nif ifname_pf_func is None:\n raise exception.RepresentorNotFound(ifname\u003dpf_ifname, vf_num\u003dvf_num)","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"24881bccd6c0d66bc1940ca4564ce129c17056ba","unresolved":false,"context_lines":[{"line_number":257,"context_line":"    except (OSError, IOError):"},{"line_number":258,"context_line":"        raise exception.RepresentorNotFound(ifname\u003dpf_ifname, vf_num\u003dvf_num)"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"    ifname_pf_func \u003d _get_pf_func(pf_ifname)"},{"line_number":261,"context_line":"    for device in devices:"},{"line_number":262,"context_line":"        device_sw_id_file \u003d \"/sys/class/net/%s/phys_switch_id\" % device"},{"line_number":263,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_7aa07ea6","line":260,"range":{"start_line":260,"start_character":3,"end_line":260,"end_character":44},"in_reply_to":"9f560f44_1ce9b57f","updated":"2020-08-19 06:25:29.000000000","message":"Changed in the refactoring patch","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"63adafbfb9a9cf9a2d37864cd45320c8547b9852","unresolved":false,"context_lines":[{"line_number":259,"context_line":""},{"line_number":260,"context_line":"    ifname_pf_func \u003d _get_pf_func(pf_ifname)"},{"line_number":261,"context_line":"    for device in devices:"},{"line_number":262,"context_line":"        device_sw_id_file \u003d \"/sys/class/net/%s/phys_switch_id\" % device"},{"line_number":263,"context_line":"        try:"},{"line_number":264,"context_line":"            with open(device_sw_id_file, \u0027r\u0027) as fd:"},{"line_number":265,"context_line":"                device_sw_id \u003d fd.readline().rstrip()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_5cb04d8c","line":262,"range":{"start_line":262,"start_character":7,"end_line":262,"end_character":71},"updated":"2020-08-13 14:04:31.000000000","message":"nit this si an unrelated refactoring.\n\npreviously this was done over two lines\n\n  device_path \u003d \"/sys/class/net/%s\" % device\n  device_sw_id_file \u003d os.path.join(device_path, \"phys_switch_id\")\n\ni guess its fine but it adds noise to the review because it does not actully change behavior.\n\nyou should try to avoid this in the future and move cleanups\nlike this into follow up patches or at least call it out with a gerrit comment so review dont have to try an figure out if you changed the behavior or not","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"24881bccd6c0d66bc1940ca4564ce129c17056ba","unresolved":false,"context_lines":[{"line_number":259,"context_line":""},{"line_number":260,"context_line":"    ifname_pf_func \u003d _get_pf_func(pf_ifname)"},{"line_number":261,"context_line":"    for device in devices:"},{"line_number":262,"context_line":"        device_sw_id_file \u003d \"/sys/class/net/%s/phys_switch_id\" % device"},{"line_number":263,"context_line":"        try:"},{"line_number":264,"context_line":"            with open(device_sw_id_file, \u0027r\u0027) as fd:"},{"line_number":265,"context_line":"                device_sw_id \u003d fd.readline().rstrip()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_da8eea30","line":262,"range":{"start_line":262,"start_character":7,"end_line":262,"end_character":71},"in_reply_to":"9f560f44_5cb04d8c","updated":"2020-08-19 06:25:29.000000000","message":"Moved this change to refactoring patch","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"63adafbfb9a9cf9a2d37864cd45320c8547b9852","unresolved":false,"context_lines":[{"line_number":278,"context_line":"        # the PCI func number of pf_ifname."},{"line_number":279,"context_line":"        rep_parent_pf_func \u003d _parse_pf_number(phys_port_name)"},{"line_number":280,"context_line":"        if rep_parent_pf_func is not None:"},{"line_number":281,"context_line":"            if ifname_pf_func is None:"},{"line_number":282,"context_line":"                continue"},{"line_number":283,"context_line":"            if int(rep_parent_pf_func) !\u003d int(ifname_pf_func):"},{"line_number":284,"context_line":"                continue"},{"line_number":285,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_3cff5935","line":282,"range":{"start_line":281,"start_character":6,"end_line":282,"end_character":24},"updated":"2020-08-13 14:04:31.000000000","message":"this can then be removed.","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"24881bccd6c0d66bc1940ca4564ce129c17056ba","unresolved":false,"context_lines":[{"line_number":278,"context_line":"        # the PCI func number of pf_ifname."},{"line_number":279,"context_line":"        rep_parent_pf_func \u003d _parse_pf_number(phys_port_name)"},{"line_number":280,"context_line":"        if rep_parent_pf_func is not None:"},{"line_number":281,"context_line":"            if ifname_pf_func is None:"},{"line_number":282,"context_line":"                continue"},{"line_number":283,"context_line":"            if int(rep_parent_pf_func) !\u003d int(ifname_pf_func):"},{"line_number":284,"context_line":"                continue"},{"line_number":285,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_1a998278","line":282,"range":{"start_line":281,"start_character":6,"end_line":282,"end_character":24},"in_reply_to":"9f560f44_3cff5935","updated":"2020-08-19 06:25:29.000000000","message":"Done","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"eab4e7bb7527833411816e08d0505a91560bf59c","unresolved":false,"context_lines":[{"line_number":339,"context_line":"    try:"},{"line_number":340,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":341,"context_line":"            if ignore_switchdev or _is_switchdev(netdev):"},{"line_number":342,"context_line":"                netdev_get_phys_port_name \u003d _get_phys_port_name(netdev)"},{"line_number":343,"context_line":"                if PF_PORT_RE.search(netdev_get_phys_port_name):"},{"line_number":344,"context_line":"                    return netdev"},{"line_number":345,"context_line":"    except Exception:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_d3f26c06","line":342,"range":{"start_line":342,"start_character":16,"end_line":342,"end_character":41},"updated":"2020-08-17 11:42:32.000000000","message":"nit: phys_port name ?","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"24881bccd6c0d66bc1940ca4564ce129c17056ba","unresolved":false,"context_lines":[{"line_number":339,"context_line":"    try:"},{"line_number":340,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":341,"context_line":"            if ignore_switchdev or _is_switchdev(netdev):"},{"line_number":342,"context_line":"                netdev_get_phys_port_name \u003d _get_phys_port_name(netdev)"},{"line_number":343,"context_line":"                if PF_PORT_RE.search(netdev_get_phys_port_name):"},{"line_number":344,"context_line":"                    return netdev"},{"line_number":345,"context_line":"    except Exception:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_faf80e7d","line":342,"range":{"start_line":342,"start_character":16,"end_line":342,"end_character":41},"in_reply_to":"9f560f44_d3f26c06","updated":"2020-08-19 06:25:29.000000000","message":"Done","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"eab4e7bb7527833411816e08d0505a91560bf59c","unresolved":false,"context_lines":[{"line_number":338,"context_line":"    ignore_switchdev \u003d not switchdev"},{"line_number":339,"context_line":"    try:"},{"line_number":340,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":341,"context_line":"            if ignore_switchdev or _is_switchdev(netdev):"},{"line_number":342,"context_line":"                netdev_get_phys_port_name \u003d _get_phys_port_name(netdev)"},{"line_number":343,"context_line":"                if PF_PORT_RE.search(netdev_get_phys_port_name):"},{"line_number":344,"context_line":"                    return netdev"},{"line_number":345,"context_line":"    except Exception:"},{"line_number":346,"context_line":"        raise exception.PciDeviceNotFoundById(id\u003dpci_addr)"},{"line_number":347,"context_line":"    raise exception.PciDeviceNotFoundById(id\u003dpci_addr)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_d3e6ece8","line":344,"range":{"start_line":341,"start_character":12,"end_line":344,"end_character":33},"updated":"2020-08-17 11:42:32.000000000","message":"So the intention here (i think) is to:\n1. return the first netdev we encounter in case switchdev\u003dFalse\n2. return the uplink representor in case switchdev\u003dTrue\n\ni would either explain this in a comment or just define a new method : \"is_uplink_representor()\" and use it here","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"24881bccd6c0d66bc1940ca4564ce129c17056ba","unresolved":false,"context_lines":[{"line_number":338,"context_line":"    ignore_switchdev \u003d not switchdev"},{"line_number":339,"context_line":"    try:"},{"line_number":340,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":341,"context_line":"            if ignore_switchdev or _is_switchdev(netdev):"},{"line_number":342,"context_line":"                netdev_get_phys_port_name \u003d _get_phys_port_name(netdev)"},{"line_number":343,"context_line":"                if PF_PORT_RE.search(netdev_get_phys_port_name):"},{"line_number":344,"context_line":"                    return netdev"},{"line_number":345,"context_line":"    except Exception:"},{"line_number":346,"context_line":"        raise exception.PciDeviceNotFoundById(id\u003dpci_addr)"},{"line_number":347,"context_line":"    raise exception.PciDeviceNotFoundById(id\u003dpci_addr)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_facf6e54","line":344,"range":{"start_line":341,"start_character":12,"end_line":344,"end_character":33},"in_reply_to":"9f560f44_b3ec1890","updated":"2020-08-19 06:25:29.000000000","message":"yes","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"24881bccd6c0d66bc1940ca4564ce129c17056ba","unresolved":false,"context_lines":[{"line_number":338,"context_line":"    ignore_switchdev \u003d not switchdev"},{"line_number":339,"context_line":"    try:"},{"line_number":340,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":341,"context_line":"            if ignore_switchdev or _is_switchdev(netdev):"},{"line_number":342,"context_line":"                netdev_get_phys_port_name \u003d _get_phys_port_name(netdev)"},{"line_number":343,"context_line":"                if PF_PORT_RE.search(netdev_get_phys_port_name):"},{"line_number":344,"context_line":"                    return netdev"},{"line_number":345,"context_line":"    except Exception:"},{"line_number":346,"context_line":"        raise exception.PciDeviceNotFoundById(id\u003dpci_addr)"},{"line_number":347,"context_line":"    raise exception.PciDeviceNotFoundById(id\u003dpci_addr)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_5a649a49","line":344,"range":{"start_line":341,"start_character":12,"end_line":344,"end_character":33},"in_reply_to":"9f560f44_d3e6ece8","updated":"2020-08-19 06:25:29.000000000","message":"Done","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"7b3bad15d79130106056b33be4a0d70225e29dfe","unresolved":false,"context_lines":[{"line_number":338,"context_line":"    ignore_switchdev \u003d not switchdev"},{"line_number":339,"context_line":"    try:"},{"line_number":340,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":341,"context_line":"            if ignore_switchdev or _is_switchdev(netdev):"},{"line_number":342,"context_line":"                netdev_get_phys_port_name \u003d _get_phys_port_name(netdev)"},{"line_number":343,"context_line":"                if PF_PORT_RE.search(netdev_get_phys_port_name):"},{"line_number":344,"context_line":"                    return netdev"},{"line_number":345,"context_line":"    except Exception:"},{"line_number":346,"context_line":"        raise exception.PciDeviceNotFoundById(id\u003dpci_addr)"},{"line_number":347,"context_line":"    raise exception.PciDeviceNotFoundById(id\u003dpci_addr)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_b3ec1890","line":344,"range":{"start_line":341,"start_character":12,"end_line":344,"end_character":33},"in_reply_to":"9f560f44_d3e6ece8","updated":"2020-08-17 11:55:30.000000000","message":"also thats actually the only bit of code that addresses the kernel change right ?","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"63adafbfb9a9cf9a2d37864cd45320c8547b9852","unresolved":false,"context_lines":[{"line_number":383,"context_line":"    return os.path.basename(physfn_path)"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"def _get_phys_port_name(ifname):"},{"line_number":387,"context_line":"    \"\"\"Get the interface name and return its phys_port_name"},{"line_number":388,"context_line":"    Get"},{"line_number":389,"context_line":"    :param ifname: The Interface name"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_fc49618b","line":386,"range":{"start_line":386,"start_character":4,"end_line":386,"end_character":23},"updated":"2020-08-13 14:04:31.000000000","message":"this is also a refactoring although in this case it enabled reuse of code so its fine but it shoudl be called out in the commit message.","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"24881bccd6c0d66bc1940ca4564ce129c17056ba","unresolved":false,"context_lines":[{"line_number":383,"context_line":"    return os.path.basename(physfn_path)"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"def _get_phys_port_name(ifname):"},{"line_number":387,"context_line":"    \"\"\"Get the interface name and return its phys_port_name"},{"line_number":388,"context_line":"    Get"},{"line_number":389,"context_line":"    :param ifname: The Interface name"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_9a9bd264","line":386,"range":{"start_line":386,"start_character":4,"end_line":386,"end_character":23},"in_reply_to":"9f560f44_fc49618b","updated":"2020-08-19 06:25:29.000000000","message":"Done","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"eab4e7bb7527833411816e08d0505a91560bf59c","unresolved":false,"context_lines":[{"line_number":387,"context_line":"    \"\"\"Get the interface name and return its phys_port_name"},{"line_number":388,"context_line":"    Get"},{"line_number":389,"context_line":"    :param ifname: The Interface name"},{"line_number":390,"context_line":"    :return: The phys_port_name of the given ifname"},{"line_number":391,"context_line":"    \"\"\""},{"line_number":392,"context_line":"    device_port_name_file \u003d \"/sys/class/net/%s/phys_port_name\" % ifname"},{"line_number":393,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_f3e050fb","line":390,"updated":"2020-08-17 11:42:32.000000000","message":"perhaps we should return None if the file does not exist, then on after L#272 you could add a check for it and continue to the next iteration of the loop instead of raising exception in this case","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"24881bccd6c0d66bc1940ca4564ce129c17056ba","unresolved":false,"context_lines":[{"line_number":387,"context_line":"    \"\"\"Get the interface name and return its phys_port_name"},{"line_number":388,"context_line":"    Get"},{"line_number":389,"context_line":"    :param ifname: The Interface name"},{"line_number":390,"context_line":"    :return: The phys_port_name of the given ifname"},{"line_number":391,"context_line":"    \"\"\""},{"line_number":392,"context_line":"    device_port_name_file \u003d \"/sys/class/net/%s/phys_port_name\" % ifname"},{"line_number":393,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_faa12e97","line":390,"in_reply_to":"9f560f44_f3e050fb","updated":"2020-08-19 06:25:29.000000000","message":"Done","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"eab4e7bb7527833411816e08d0505a91560bf59c","unresolved":false,"context_lines":[{"line_number":389,"context_line":"    :param ifname: The Interface name"},{"line_number":390,"context_line":"    :return: The phys_port_name of the given ifname"},{"line_number":391,"context_line":"    \"\"\""},{"line_number":392,"context_line":"    device_port_name_file \u003d \"/sys/class/net/%s/phys_port_name\" % ifname"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"    with open(device_port_name_file, \u0027r\u0027) as fd:"},{"line_number":395,"context_line":"        return fd.readline().strip()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_1397c492","line":392,"range":{"start_line":392,"start_character":4,"end_line":392,"end_character":25},"updated":"2020-08-17 11:42:32.000000000","message":"nit: phys_port_name_path ?","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"24881bccd6c0d66bc1940ca4564ce129c17056ba","unresolved":false,"context_lines":[{"line_number":389,"context_line":"    :param ifname: The Interface name"},{"line_number":390,"context_line":"    :return: The phys_port_name of the given ifname"},{"line_number":391,"context_line":"    \"\"\""},{"line_number":392,"context_line":"    device_port_name_file \u003d \"/sys/class/net/%s/phys_port_name\" % ifname"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"    with open(device_port_name_file, \u0027r\u0027) as fd:"},{"line_number":395,"context_line":"        return fd.readline().strip()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_da9c2a5d","line":392,"range":{"start_line":392,"start_character":4,"end_line":392,"end_character":25},"in_reply_to":"9f560f44_1397c492","updated":"2020-08-19 06:25:29.000000000","message":"Done","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"4bf7a8af1b8c5e9f9e5d9f91bce26863c4051017","unresolved":false,"context_lines":[{"line_number":344,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":345,"context_line":"            # Return the uplink representor in case of switchdev\u003dTrue"},{"line_number":346,"context_line":"            # Return the netdev in case of switchdev\u003dFalse"},{"line_number":347,"context_line":"            if ignore_switchdev or _is_switchdev(netdev):"},{"line_number":348,"context_line":"                phys_port_name \u003d _get_phys_port_name(netdev)"},{"line_number":349,"context_line":"                if phys_port_name is not None and \\"},{"line_number":350,"context_line":"                        UPLINK_PORT_RE.search(phys_port_name):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_0e2e5242","line":347,"updated":"2020-08-19 13:00:22.000000000","message":"So, before this change the method would return the first netdev from the list if ignore_switchdev\u003d\u003dtrue or the first netdev encountered which had a readable phys_switch_id if ignore_switchdev\u003d\u003dfalse.\n\nIf im reading it correctly.This is no longer the case with the new impl.\n\nfor ignore_switchdev\u003d\u003dfalse i think we want the same behaviour as before.\n\nAlso if pf_interface\u003d\u003dfalse you will now fail where it previously succeeded.","commit_id":"841e4e1c42dfdcc8e8eee6a25c3ced706b57bebd"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"73de882f5081b02fb5086471414fcd78905dfda4","unresolved":false,"context_lines":[{"line_number":344,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":345,"context_line":"            # Return the uplink representor in case of switchdev\u003dTrue"},{"line_number":346,"context_line":"            # Return the netdev in case of switchdev\u003dFalse"},{"line_number":347,"context_line":"            if ignore_switchdev or _is_switchdev(netdev):"},{"line_number":348,"context_line":"                phys_port_name \u003d _get_phys_port_name(netdev)"},{"line_number":349,"context_line":"                if phys_port_name is not None and \\"},{"line_number":350,"context_line":"                        UPLINK_PORT_RE.search(phys_port_name):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_8166b0ba","line":347,"in_reply_to":"9f560f44_0e2e5242","updated":"2020-09-20 08:45:32.000000000","message":"Done","commit_id":"841e4e1c42dfdcc8e8eee6a25c3ced706b57bebd"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"6a952791f8ceffc4a63e5d57f837712a6b01517c","unresolved":false,"context_lines":[{"line_number":347,"context_line":"            if ignore_switchdev or _is_switchdev(netdev):"},{"line_number":348,"context_line":"                phys_port_name \u003d _get_phys_port_name(netdev)"},{"line_number":349,"context_line":"                if phys_port_name is not None and \\"},{"line_number":350,"context_line":"                        UPLINK_PORT_RE.search(phys_port_name):"},{"line_number":351,"context_line":"                    return netdev"},{"line_number":352,"context_line":"    except Exception:"},{"line_number":353,"context_line":"        raise exception.PciDeviceNotFoundById(id\u003dpci_addr)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_ad776b3a","line":350,"range":{"start_line":350,"start_character":24,"end_line":350,"end_character":62},"updated":"2020-08-19 14:29:32.000000000","message":"if this file exists, this regular expression the only expected format ?","commit_id":"841e4e1c42dfdcc8e8eee6a25c3ced706b57bebd"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"9c8504f754b57d2ed36f4701ebcbfd5626910c5d","unresolved":false,"context_lines":[{"line_number":347,"context_line":"            if ignore_switchdev or _is_switchdev(netdev):"},{"line_number":348,"context_line":"                phys_port_name \u003d _get_phys_port_name(netdev)"},{"line_number":349,"context_line":"                if phys_port_name is not None and \\"},{"line_number":350,"context_line":"                        UPLINK_PORT_RE.search(phys_port_name):"},{"line_number":351,"context_line":"                    return netdev"},{"line_number":352,"context_line":"    except Exception:"},{"line_number":353,"context_line":"        raise exception.PciDeviceNotFoundById(id\u003dpci_addr)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_e94005a5","line":350,"range":{"start_line":350,"start_character":24,"end_line":350,"end_character":62},"in_reply_to":"9f560f44_46300008","updated":"2020-09-08 15:29:25.000000000","message":"given you are not allow to import any of the plug code out of tree we only have to look at the in tree usage.\n\ne.g. you are not allowed to inhirt for the ovs plugin or use any of the linux_net code in your own out of tree plug-in.\n\nthe plug in code is not part of the os-vif api that you can depend on.","commit_id":"841e4e1c42dfdcc8e8eee6a25c3ced706b57bebd"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"d7d00e87608f9ee4411c59d5d40d34f382541767","unresolved":false,"context_lines":[{"line_number":347,"context_line":"            if ignore_switchdev or _is_switchdev(netdev):"},{"line_number":348,"context_line":"                phys_port_name \u003d _get_phys_port_name(netdev)"},{"line_number":349,"context_line":"                if phys_port_name is not None and \\"},{"line_number":350,"context_line":"                        UPLINK_PORT_RE.search(phys_port_name):"},{"line_number":351,"context_line":"                    return netdev"},{"line_number":352,"context_line":"    except Exception:"},{"line_number":353,"context_line":"        raise exception.PciDeviceNotFoundById(id\u003dpci_addr)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_bdb1fa46","line":350,"range":{"start_line":350,"start_character":24,"end_line":350,"end_character":62},"in_reply_to":"9f560f44_ad776b3a","updated":"2020-08-25 16:28:19.000000000","message":"adrian i am assuming the question is in regards to netroneme or intel nics for example that may use a different pf format?\n\nwhat distingues an uplink prot form our existing PF ports\n\n# phys_port_name contains PF## or pf##\nPF_RE \u003d re.compile(r\"pf(\\d+)\", re.IGNORECASE)\n\nvs\n\n# phys_port_name contains p##\nUPLINK_PORT_RE \u003d re.compile(r\"p(\\d+)\", re.IGNORECASE)\n\nare we sure it will start with just p and not PF across all vendors.\n\ndo we need to test for both.","commit_id":"841e4e1c42dfdcc8e8eee6a25c3ced706b57bebd"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"d1848742842a1dc6b64c64cddb3f0fd987882af6","unresolved":false,"context_lines":[{"line_number":347,"context_line":"            if ignore_switchdev or _is_switchdev(netdev):"},{"line_number":348,"context_line":"                phys_port_name \u003d _get_phys_port_name(netdev)"},{"line_number":349,"context_line":"                if phys_port_name is not None and \\"},{"line_number":350,"context_line":"                        UPLINK_PORT_RE.search(phys_port_name):"},{"line_number":351,"context_line":"                    return netdev"},{"line_number":352,"context_line":"    except Exception:"},{"line_number":353,"context_line":"        raise exception.PciDeviceNotFoundById(id\u003dpci_addr)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_e665d4b0","line":350,"range":{"start_line":350,"start_character":24,"end_line":350,"end_character":62},"in_reply_to":"9f560f44_bdb1fa46","updated":"2020-09-08 14:35:29.000000000","message":"So, devlink attempts to standardize the naming[1]\n\nit should be either `p\u003cnum\u003e` or `p\u003cnum\u003es\u003cnum\u003e` for uplink representor and `pf\u003cnum\u003e` for PF respresentor.\n\nthe former represents the uplink and the latter represents the PF in case the uplink is represented as a separate interface.\n\nWe can do the following so we can cover our bases:\n\n1. if ignore_switchdev is true return the first one same as before the change\n2. if pf_interface is false, return the first interface that has phys_switch_id. same as before the cange\n3. if pf_interface is true then return first interface matching one of the formats for phys_port_name listed above.\n\nWhat do you think ?\n\n[1] https://github.com/torvalds/linux/blob/06a4ec1d9dc652e17ee3ac2ceb6c7cf6c2b75cdd/net/core/devlink.c#L7753","commit_id":"841e4e1c42dfdcc8e8eee6a25c3ced706b57bebd"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"a66fbba30c9bdfe5e6f55b9f98b747df84728ff4","unresolved":false,"context_lines":[{"line_number":347,"context_line":"            if ignore_switchdev or _is_switchdev(netdev):"},{"line_number":348,"context_line":"                phys_port_name \u003d _get_phys_port_name(netdev)"},{"line_number":349,"context_line":"                if phys_port_name is not None and \\"},{"line_number":350,"context_line":"                        UPLINK_PORT_RE.search(phys_port_name):"},{"line_number":351,"context_line":"                    return netdev"},{"line_number":352,"context_line":"    except Exception:"},{"line_number":353,"context_line":"        raise exception.PciDeviceNotFoundById(id\u003dpci_addr)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_46300008","line":350,"range":{"start_line":350,"start_character":24,"end_line":350,"end_character":62},"in_reply_to":"9f560f44_e665d4b0","updated":"2020-09-08 15:07:13.000000000","message":"on a side note, `get_ifname_by_pci_address()` is only called with pf_interface\u003dtrue and switchdev\u003dtrue in os-vif, but not sure if its being used by other modules. \n\nIf its only used internally we can probably simplify the logic abit.","commit_id":"841e4e1c42dfdcc8e8eee6a25c3ced706b57bebd"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"62e02f63f631884a9611e08e190b6e9ba3c40b01","unresolved":false,"context_lines":[{"line_number":335,"context_line":"    try:"},{"line_number":336,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":337,"context_line":"            # Return the uplink representor in case of switchdev\u003dTrue"},{"line_number":338,"context_line":"            # Return the netdev in case of switchdev\u003dFalse"},{"line_number":339,"context_line":"            if ignore_switchdev:"},{"line_number":340,"context_line":"                return netdev"},{"line_number":341,"context_line":"            elif _is_switchdev(netdev):"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_d99ec1b6","line":338,"range":{"start_line":338,"start_character":21,"end_line":338,"end_character":25},"updated":"2020-09-22 08:48:12.000000000","message":"the first ?","commit_id":"71177859540de35ca7eeec24b11491a8c8df1d99"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"1b1bcef272266186ed59d2909d949830f58a9f1f","unresolved":false,"context_lines":[{"line_number":335,"context_line":"    try:"},{"line_number":336,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":337,"context_line":"            # Return the uplink representor in case of switchdev\u003dTrue"},{"line_number":338,"context_line":"            # Return the netdev in case of switchdev\u003dFalse"},{"line_number":339,"context_line":"            if ignore_switchdev:"},{"line_number":340,"context_line":"                return netdev"},{"line_number":341,"context_line":"            elif _is_switchdev(netdev):"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_edbc9f6d","line":338,"range":{"start_line":338,"start_character":21,"end_line":338,"end_character":25},"in_reply_to":"9f560f44_d99ec1b6","updated":"2020-09-22 12:30:33.000000000","message":"Done","commit_id":"71177859540de35ca7eeec24b11491a8c8df1d99"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bc0fd56220320eb3c919dc27090e2feed1f5d84b","unresolved":false,"context_lines":[{"line_number":331,"context_line":"    \"\"\""},{"line_number":332,"context_line":"    dev_path \u003d _get_sysfs_netdev_path(pci_addr, pf_interface)"},{"line_number":333,"context_line":"    # make the if statement later more readable"},{"line_number":334,"context_line":"    ignore_switchdev \u003d not switchdev"},{"line_number":335,"context_line":"    try:"},{"line_number":336,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":337,"context_line":"            # Return the uplink representor in case of switchdev\u003dTrue"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_1ebb2d75","line":334,"range":{"start_line":334,"start_character":2,"end_line":334,"end_character":36},"updated":"2020-10-05 13:58:46.000000000","message":"nit: i would remove this","commit_id":"664f8931afc564381e71b6c3c996b39d26e82941"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"c1b9d20d279cb2e80f695690cde5a31bad318302","unresolved":false,"context_lines":[{"line_number":331,"context_line":"    \"\"\""},{"line_number":332,"context_line":"    dev_path \u003d _get_sysfs_netdev_path(pci_addr, pf_interface)"},{"line_number":333,"context_line":"    # make the if statement later more readable"},{"line_number":334,"context_line":"    ignore_switchdev \u003d not switchdev"},{"line_number":335,"context_line":"    try:"},{"line_number":336,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":337,"context_line":"            # Return the uplink representor in case of switchdev\u003dTrue"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_a3543323","line":334,"range":{"start_line":334,"start_character":2,"end_line":334,"end_character":36},"in_reply_to":"9f560f44_1ebb2d75","updated":"2020-10-14 12:55:02.000000000","message":"Done","commit_id":"664f8931afc564381e71b6c3c996b39d26e82941"},{"author":{"_account_id":25733,"name":"Jan Gutter","email":"github@jangutter.com","username":"jangutter"},"change_message_id":"395374dca38e3d70e8e075ceeb79955f51d3b5f3","unresolved":false,"context_lines":[{"line_number":331,"context_line":"    \"\"\""},{"line_number":332,"context_line":"    dev_path \u003d _get_sysfs_netdev_path(pci_addr, pf_interface)"},{"line_number":333,"context_line":"    # make the if statement later more readable"},{"line_number":334,"context_line":"    ignore_switchdev \u003d not switchdev"},{"line_number":335,"context_line":"    try:"},{"line_number":336,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":337,"context_line":"            # Return the uplink representor in case of switchdev\u003dTrue"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_81c36239","line":334,"range":{"start_line":334,"start_character":2,"end_line":334,"end_character":36},"in_reply_to":"9f560f44_1ebb2d75","updated":"2020-10-05 14:43:26.000000000","message":"Yep, that was my bad.","commit_id":"664f8931afc564381e71b6c3c996b39d26e82941"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"c1b9d20d279cb2e80f695690cde5a31bad318302","unresolved":false,"context_lines":[{"line_number":331,"context_line":"    \"\"\""},{"line_number":332,"context_line":"    dev_path \u003d _get_sysfs_netdev_path(pci_addr, pf_interface)"},{"line_number":333,"context_line":"    # make the if statement later more readable"},{"line_number":334,"context_line":"    ignore_switchdev \u003d not switchdev"},{"line_number":335,"context_line":"    try:"},{"line_number":336,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":337,"context_line":"            # Return the uplink representor in case of switchdev\u003dTrue"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_834f6f8a","line":334,"range":{"start_line":334,"start_character":2,"end_line":334,"end_character":36},"in_reply_to":"9f560f44_81c36239","updated":"2020-10-14 12:55:02.000000000","message":"Done","commit_id":"664f8931afc564381e71b6c3c996b39d26e82941"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bc0fd56220320eb3c919dc27090e2feed1f5d84b","unresolved":false,"context_lines":[{"line_number":335,"context_line":"    try:"},{"line_number":336,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":337,"context_line":"            # Return the uplink representor in case of switchdev\u003dTrue"},{"line_number":338,"context_line":"            # Return the first netdev in case of switchdev\u003dFalse"},{"line_number":339,"context_line":"            if ignore_switchdev:"},{"line_number":340,"context_line":"                return netdev"},{"line_number":341,"context_line":"            elif _is_switchdev(netdev):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_1e2e8daa","line":338,"range":{"start_line":338,"start_character":12,"end_line":338,"end_character":64},"updated":"2020-10-05 13:58:46.000000000","message":"this feels like a latent bug to me.\nthis proably will work for some nic nameing schems but if you disable systemd names and bios dev names it may not work correcctly.\n\nwe shoudl ideally figure out if this is still needed and remove it if not and document why its needed if it is.that can be done seperatly but i dont really like having this logic without documenting why it works this way\n\ni dont think the connectx3 support hardware offload but if im not mistacken the connectx3 shared the came pci adress for two different PFs e.g. it had two different pf netdevs for the same pci adress corresponding to differnt uplink ports on the card. in that case this would select teh wrong pf 50% of the time but i dont know if that actully matters.","commit_id":"664f8931afc564381e71b6c3c996b39d26e82941"},{"author":{"_account_id":25733,"name":"Jan Gutter","email":"github@jangutter.com","username":"jangutter"},"change_message_id":"395374dca38e3d70e8e075ceeb79955f51d3b5f3","unresolved":false,"context_lines":[{"line_number":335,"context_line":"    try:"},{"line_number":336,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":337,"context_line":"            # Return the uplink representor in case of switchdev\u003dTrue"},{"line_number":338,"context_line":"            # Return the first netdev in case of switchdev\u003dFalse"},{"line_number":339,"context_line":"            if ignore_switchdev:"},{"line_number":340,"context_line":"                return netdev"},{"line_number":341,"context_line":"            elif _is_switchdev(netdev):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_c1471aa3","line":338,"range":{"start_line":338,"start_character":12,"end_line":338,"end_character":64},"in_reply_to":"9f560f44_1e2e8daa","updated":"2020-10-05 14:43:26.000000000","message":"For Netronome NICs (disclaimer: ex-Netronome employee), we had multiple netdevs associated with the PF:\n* phys port representor for each of the ports\n* \"PF uplink\" also referred to as \"PF netdev\"\n\nThere\u0027s more information in this guide: \n\nhttps://netronome.freshdesk.com/support/solutions/articles/36000081172-agilio-open-vswitch-tc-user-guide#smartnic-netdev-interfaces\n\nIIRC, the VF config is duplicated on _all_ netdevs in that directory, but the switchdev field is only set for phys port representors. This was to keep compatibility with libvirt (it chose the first netdev in that directory to run the \"ip link set vf mac\" commands on).\n\nThat said, the only reason you should call this function with pf_interface \u003d\u003d True, switchdev \u003d\u003d False is when you want the original SR-IOV VEB or VEPA mode. In that case, libvirt\u0027s codepath has recently changed and it\u0027s no longer just picking the first netdev. I\u0027m in favor of (in slight order of preference):\n\n* Just raising an Unsupported exception if that combination pops up\n* Printing a big fat warning (I think there are enough duplication in the kernel netdev ops to make things \"just work\")\n* Silently doing the same thing.","commit_id":"664f8931afc564381e71b6c3c996b39d26e82941"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"c1b9d20d279cb2e80f695690cde5a31bad318302","unresolved":false,"context_lines":[{"line_number":335,"context_line":"    try:"},{"line_number":336,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":337,"context_line":"            # Return the uplink representor in case of switchdev\u003dTrue"},{"line_number":338,"context_line":"            # Return the first netdev in case of switchdev\u003dFalse"},{"line_number":339,"context_line":"            if ignore_switchdev:"},{"line_number":340,"context_line":"                return netdev"},{"line_number":341,"context_line":"            elif _is_switchdev(netdev):"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f6b1bfe_56a974dd","line":338,"range":{"start_line":338,"start_character":12,"end_line":338,"end_character":64},"in_reply_to":"9f560f44_a7967148","updated":"2020-10-14 12:55:02.000000000","message":"This patch is to fix the issue with the swichdev issue, I \n will add separate patch to fix the issue mentioned above","commit_id":"664f8931afc564381e71b6c3c996b39d26e82941"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"144881f559164b50c5dcabece30849423ef20af3","unresolved":false,"context_lines":[{"line_number":335,"context_line":"    try:"},{"line_number":336,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":337,"context_line":"            # Return the uplink representor in case of switchdev\u003dTrue"},{"line_number":338,"context_line":"            # Return the first netdev in case of switchdev\u003dFalse"},{"line_number":339,"context_line":"            if ignore_switchdev:"},{"line_number":340,"context_line":"                return netdev"},{"line_number":341,"context_line":"            elif _is_switchdev(netdev):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_a7967148","line":338,"range":{"start_line":338,"start_character":12,"end_line":338,"end_character":64},"in_reply_to":"9f560f44_c1471aa3","updated":"2020-10-05 21:01:12.000000000","message":"Yes so in libvirt change the implementation from picking the first nerdevice to [1]. and it think we should do the same  \n[1] - https://github.com/libvirt/libvirt/commit/747116e0b904a4bc3c438c1fe6badd9961504814","commit_id":"664f8931afc564381e71b6c3c996b39d26e82941"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bc0fd56220320eb3c919dc27090e2feed1f5d84b","unresolved":false,"context_lines":[{"line_number":336,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":337,"context_line":"            # Return the uplink representor in case of switchdev\u003dTrue"},{"line_number":338,"context_line":"            # Return the first netdev in case of switchdev\u003dFalse"},{"line_number":339,"context_line":"            if ignore_switchdev:"},{"line_number":340,"context_line":"                return netdev"},{"line_number":341,"context_line":"            elif _is_switchdev(netdev):"},{"line_number":342,"context_line":"                phys_port_name \u003d _get_phys_port_name(netdev)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_9eae1d2d","line":339,"range":{"start_line":339,"start_character":14,"end_line":339,"end_character":32},"updated":"2020-10-05 13:58:46.000000000","message":"and make this\n \n\n    if not switchdev:","commit_id":"664f8931afc564381e71b6c3c996b39d26e82941"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"c1b9d20d279cb2e80f695690cde5a31bad318302","unresolved":false,"context_lines":[{"line_number":336,"context_line":"        for netdev in os.listdir(dev_path):"},{"line_number":337,"context_line":"            # Return the uplink representor in case of switchdev\u003dTrue"},{"line_number":338,"context_line":"            # Return the first netdev in case of switchdev\u003dFalse"},{"line_number":339,"context_line":"            if ignore_switchdev:"},{"line_number":340,"context_line":"                return netdev"},{"line_number":341,"context_line":"            elif _is_switchdev(netdev):"},{"line_number":342,"context_line":"                phys_port_name \u003d _get_phys_port_name(netdev)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_03123f61","line":339,"range":{"start_line":339,"start_character":14,"end_line":339,"end_character":32},"in_reply_to":"9f560f44_9eae1d2d","updated":"2020-10-14 12:55:02.000000000","message":"Done","commit_id":"664f8931afc564381e71b6c3c996b39d26e82941"},{"author":{"_account_id":25733,"name":"Jan Gutter","email":"github@jangutter.com","username":"jangutter"},"change_message_id":"4e316e39a5613e39d9696c0ab4fff9372774e85f","unresolved":false,"context_lines":[{"line_number":335,"context_line":""},{"line_number":336,"context_line":"        # Return the first netdev in case of switchdev\u003dFalse"},{"line_number":337,"context_line":"        if not switchdev:"},{"line_number":338,"context_line":"            return devices[0]"},{"line_number":339,"context_line":"        elif pf_interface:"},{"line_number":340,"context_line":"            fallback_netdev \u003d None"},{"line_number":341,"context_line":"            for netdev in devices:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f681702_20d0d1f7","line":338,"range":{"start_line":338,"start_character":12,"end_line":338,"end_character":29},"updated":"2020-10-19 16:32:33.000000000","message":"I\u0027m happy with this as is, with a potential follow-up to:\na) first choice - raise a \"not supported\" exception\nb) second choice - sync with libvirt logic (problematic in my opinion, but still ok)","commit_id":"3b51acafec0ae970bcb61f282fa9827379b008df"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"3cc033400ad3297bae544e79bf65b5c2ca3cf475","unresolved":false,"context_lines":[{"line_number":341,"context_line":"            for netdev in devices:"},{"line_number":342,"context_line":"                # Return the uplink representor in case of switchdev\u003dTrue"},{"line_number":343,"context_line":"                if _is_switchdev(netdev):"},{"line_number":344,"context_line":"                    fallback_netdev \u003d netdev if fallback_netdev is None \\"},{"line_number":345,"context_line":"                        else fallback_netdev"},{"line_number":346,"context_line":"                    phys_port_name \u003d _get_phys_port_name(netdev)"},{"line_number":347,"context_line":"                    if phys_port_name is not None and \\"},{"line_number":348,"context_line":"                            UPLINK_PORT_RE.search(phys_port_name):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f681702_187d53b1","line":345,"range":{"start_line":344,"start_character":19,"end_line":345,"end_character":44},"updated":"2020-10-19 12:24:50.000000000","message":"so this sets it to the first netdev that is a switchdev","commit_id":"3b51acafec0ae970bcb61f282fa9827379b008df"}],"vif_plug_ovs/tests/unit/test_linux_net.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"63adafbfb9a9cf9a2d37864cd45320c8547b9852","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    @mock.patch(\u0027builtins.open\u0027)"},{"line_number":67,"context_line":"    @mock.patch(\"os.path.exists\")"},{"line_number":68,"context_line":"    def test__disable_ipv6(self, mock_exists, mock_open):"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        exists_path \u003d \"/proc/sys/net/ipv6/conf/br0/disable_ipv6\""},{"line_number":71,"context_line":"        mock_exists.return_value \u003d False"},{"line_number":72,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_670c9e42","side":"PARENT","line":69,"updated":"2020-08-13 14:04:31.000000000","message":"nit: unrelated","commit_id":"041ce67619074ee79226161aab8169f990e4c175"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"24881bccd6c0d66bc1940ca4564ce129c17056ba","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    @mock.patch(\u0027builtins.open\u0027)"},{"line_number":67,"context_line":"    @mock.patch(\"os.path.exists\")"},{"line_number":68,"context_line":"    def test__disable_ipv6(self, mock_exists, mock_open):"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        exists_path \u003d \"/proc/sys/net/ipv6/conf/br0/disable_ipv6\""},{"line_number":71,"context_line":"        mock_exists.return_value \u003d False"},{"line_number":72,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_da38aa3c","side":"PARENT","line":69,"in_reply_to":"9f560f44_670c9e42","updated":"2020-08-19 06:25:29.000000000","message":"Done","commit_id":"041ce67619074ee79226161aab8169f990e4c175"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"ef3ca2ff9082d6e9c930102002229b4d32bbebe0","unresolved":false,"context_lines":[{"line_number":133,"context_line":"        mock_set.assert_called_once_with(\"vnet1\", master\u003d\"br0\")"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    @mock.patch(\u0027builtins.open\u0027)"},{"line_number":136,"context_line":"    def test_is_switchdev_ioerror(self, mock_open):"},{"line_number":137,"context_line":"        mock_open.return_value.__enter__ \u003d lambda s: s"},{"line_number":138,"context_line":"        readline_mock \u003d mock_open.return_value.readline"},{"line_number":139,"context_line":"        readline_mock.side_effect \u003d ("}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_d3d0accc","line":136,"updated":"2020-08-17 11:53:52.000000000","message":"i see you didnt modify  _is_switchdev(), why was the test modified ? tox complained ?","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"24881bccd6c0d66bc1940ca4564ce129c17056ba","unresolved":false,"context_lines":[{"line_number":133,"context_line":"        mock_set.assert_called_once_with(\"vnet1\", master\u003d\"br0\")"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    @mock.patch(\u0027builtins.open\u0027)"},{"line_number":136,"context_line":"    def test_is_switchdev_ioerror(self, mock_open):"},{"line_number":137,"context_line":"        mock_open.return_value.__enter__ \u003d lambda s: s"},{"line_number":138,"context_line":"        readline_mock \u003d mock_open.return_value.readline"},{"line_number":139,"context_line":"        readline_mock.side_effect \u003d ("}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_1a4342b1","line":136,"in_reply_to":"9f560f44_d3d0accc","updated":"2020-08-19 06:25:29.000000000","message":"Moved to refactoring patch","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"63adafbfb9a9cf9a2d37864cd45320c8547b9852","unresolved":false,"context_lines":[{"line_number":238,"context_line":"        mock_open.return_value.__enter__ \u003d lambda s: s"},{"line_number":239,"context_line":"        readline_mock \u003d mock_open.return_value.readline"},{"line_number":240,"context_line":"        readline_mock.side_effect \u003d ("},{"line_number":241,"context_line":"                [\u0027pf_sw_id\u0027] * 7)"},{"line_number":242,"context_line":"        # PCI IDs mocked:"},{"line_number":243,"context_line":"        # PF1:    0000:0a:00.1    PF2:    0000:0a:00.2"},{"line_number":244,"context_line":"        # PF1VF1: 0000:0a:02.1    PF1VF2: 0000:0a:02.2"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_9c4785bd","line":241,"range":{"start_line":241,"start_character":14,"end_line":241,"end_character":32},"updated":"2020-08-13 14:04:31.000000000","message":"this is a feature of python that is not frequently used.\ni woudl prefer if you create teh list manually instead of using *7","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"24881bccd6c0d66bc1940ca4564ce129c17056ba","unresolved":false,"context_lines":[{"line_number":238,"context_line":"        mock_open.return_value.__enter__ \u003d lambda s: s"},{"line_number":239,"context_line":"        readline_mock \u003d mock_open.return_value.readline"},{"line_number":240,"context_line":"        readline_mock.side_effect \u003d ("},{"line_number":241,"context_line":"                [\u0027pf_sw_id\u0027] * 7)"},{"line_number":242,"context_line":"        # PCI IDs mocked:"},{"line_number":243,"context_line":"        # PF1:    0000:0a:00.1    PF2:    0000:0a:00.2"},{"line_number":244,"context_line":"        # PF1VF1: 0000:0a:02.1    PF1VF2: 0000:0a:02.2"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_5a165aa9","line":241,"range":{"start_line":241,"start_character":14,"end_line":241,"end_character":32},"in_reply_to":"9f560f44_9c4785bd","updated":"2020-08-19 06:25:29.000000000","message":"Done","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"63adafbfb9a9cf9a2d37864cd45320c8547b9852","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        mock_open.return_value.__enter__ \u003d lambda s: s"},{"line_number":267,"context_line":"        readline_mock \u003d mock_open.return_value.readline"},{"line_number":268,"context_line":"        readline_mock.side_effect \u003d ("},{"line_number":269,"context_line":"                [\u0027pf_sw_id\u0027] * 4)"},{"line_number":270,"context_line":"        # PCI IDs mocked:"},{"line_number":271,"context_line":"        # PF0:    0000:0a:00.0"},{"line_number":272,"context_line":"        # PF0VF1: 0000:0a:02.1    PF0VF2: 0000:0a:02.2"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_bc17e9a3","line":269,"range":{"start_line":269,"start_character":15,"end_line":269,"end_character":32},"updated":"2020-08-13 14:04:31.000000000","message":"same please fill this out manually","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"24881bccd6c0d66bc1940ca4564ce129c17056ba","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        mock_open.return_value.__enter__ \u003d lambda s: s"},{"line_number":267,"context_line":"        readline_mock \u003d mock_open.return_value.readline"},{"line_number":268,"context_line":"        readline_mock.side_effect \u003d ("},{"line_number":269,"context_line":"                [\u0027pf_sw_id\u0027] * 4)"},{"line_number":270,"context_line":"        # PCI IDs mocked:"},{"line_number":271,"context_line":"        # PF0:    0000:0a:00.0"},{"line_number":272,"context_line":"        # PF0VF1: 0000:0a:02.1    PF0VF2: 0000:0a:02.2"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_ba0df691","line":269,"range":{"start_line":269,"start_character":15,"end_line":269,"end_character":32},"in_reply_to":"9f560f44_bc17e9a3","updated":"2020-08-19 06:25:29.000000000","message":"Done","commit_id":"e4a7101f9ea811f07a6e45bcd045dc429108e931"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"62e02f63f631884a9611e08e190b6e9ba3c40b01","unresolved":false,"context_lines":[{"line_number":268,"context_line":"        mock_listdir.return_value \u003d [\u0027foo\u0027, \u0027bar\u0027]"},{"line_number":269,"context_line":"        mock__get_phys_switch_id.side_effect \u003d ("},{"line_number":270,"context_line":"            [\u0027\u0027, \u0027valid_switch\u0027])"},{"line_number":271,"context_line":"        mock__get_phys_port_name.return_value \u003d \"p1\""},{"line_number":272,"context_line":"        ifname \u003d linux_net.get_ifname_by_pci_address("},{"line_number":273,"context_line":"            \u00270000:00:00.1\u0027, pf_interface\u003dTrue, switchdev\u003dFalse)"},{"line_number":274,"context_line":"        self.assertEqual(ifname, \u0027foo\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_99de0968","line":271,"range":{"start_line":271,"start_character":8,"end_line":271,"end_character":52},"updated":"2020-09-22 08:48:12.000000000","message":"according to the existing test, only \u0027bar\u0027 is in switchdev so only bar should have a phys_port_name","commit_id":"71177859540de35ca7eeec24b11491a8c8df1d99"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"1b1bcef272266186ed59d2909d949830f58a9f1f","unresolved":false,"context_lines":[{"line_number":268,"context_line":"        mock_listdir.return_value \u003d [\u0027foo\u0027, \u0027bar\u0027]"},{"line_number":269,"context_line":"        mock__get_phys_switch_id.side_effect \u003d ("},{"line_number":270,"context_line":"            [\u0027\u0027, \u0027valid_switch\u0027])"},{"line_number":271,"context_line":"        mock__get_phys_port_name.return_value \u003d \"p1\""},{"line_number":272,"context_line":"        ifname \u003d linux_net.get_ifname_by_pci_address("},{"line_number":273,"context_line":"            \u00270000:00:00.1\u0027, pf_interface\u003dTrue, switchdev\u003dFalse)"},{"line_number":274,"context_line":"        self.assertEqual(ifname, \u0027foo\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_cdc1dbe6","line":271,"range":{"start_line":271,"start_character":8,"end_line":271,"end_character":52},"in_reply_to":"9f560f44_99de0968","updated":"2020-09-22 12:30:33.000000000","message":"Done","commit_id":"71177859540de35ca7eeec24b11491a8c8df1d99"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"62e02f63f631884a9611e08e190b6e9ba3c40b01","unresolved":false,"context_lines":[{"line_number":282,"context_line":"        mock_listdir.return_value \u003d [\u0027foo\u0027, \u0027bar\u0027]"},{"line_number":283,"context_line":"        mock__get_phys_switch_id.side_effect \u003d ("},{"line_number":284,"context_line":"            [\u0027\u0027, \u0027valid_switch\u0027])"},{"line_number":285,"context_line":"        mock__get_phys_port_name.return_value \u003d \"p1\""},{"line_number":286,"context_line":"        ifname \u003d linux_net.get_ifname_by_pci_address("},{"line_number":287,"context_line":"            \u00270000:00:00.1\u0027, pf_interface\u003dTrue, switchdev\u003dTrue)"},{"line_number":288,"context_line":"        self.assertEqual(ifname, \u0027bar\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_f903c5bc","line":285,"updated":"2020-09-22 08:48:12.000000000","message":"according to the existing test, only \u0027bar\u0027 is in switchdev so only bar should have a phys_port_name\n\nalso perhaps use a different uplink rep value e.g `p1s0`","commit_id":"71177859540de35ca7eeec24b11491a8c8df1d99"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"1b1bcef272266186ed59d2909d949830f58a9f1f","unresolved":false,"context_lines":[{"line_number":282,"context_line":"        mock_listdir.return_value \u003d [\u0027foo\u0027, \u0027bar\u0027]"},{"line_number":283,"context_line":"        mock__get_phys_switch_id.side_effect \u003d ("},{"line_number":284,"context_line":"            [\u0027\u0027, \u0027valid_switch\u0027])"},{"line_number":285,"context_line":"        mock__get_phys_port_name.return_value \u003d \"p1\""},{"line_number":286,"context_line":"        ifname \u003d linux_net.get_ifname_by_pci_address("},{"line_number":287,"context_line":"            \u00270000:00:00.1\u0027, pf_interface\u003dTrue, switchdev\u003dTrue)"},{"line_number":288,"context_line":"        self.assertEqual(ifname, \u0027bar\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_ada62753","line":285,"in_reply_to":"9f560f44_f903c5bc","updated":"2020-09-22 12:30:33.000000000","message":"Done","commit_id":"71177859540de35ca7eeec24b11491a8c8df1d99"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"62e02f63f631884a9611e08e190b6e9ba3c40b01","unresolved":false,"context_lines":[{"line_number":286,"context_line":"        ifname \u003d linux_net.get_ifname_by_pci_address("},{"line_number":287,"context_line":"            \u00270000:00:00.1\u0027, pf_interface\u003dTrue, switchdev\u003dTrue)"},{"line_number":288,"context_line":"        self.assertEqual(ifname, \u0027bar\u0027)"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    @mock.patch.object(os, \u0027listdir\u0027)"},{"line_number":291,"context_line":"    def test_get_ifname_by_pci_address_exception(self, mock_listdir):"},{"line_number":292,"context_line":"        mock_listdir.side_effect \u003d OSError(\u0027No such file or directory\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_994c4940","line":289,"updated":"2020-09-22 08:48:12.000000000","message":"Can you add test with multiple rep netdev ? as its expected to be with the latest kernel changes ?\n\ngood/bad flow for this scenario","commit_id":"71177859540de35ca7eeec24b11491a8c8df1d99"},{"author":{"_account_id":32296,"name":"Mamduh","email":"mamduhala@nvidia.com","username":"Mamduh"},"change_message_id":"1b1bcef272266186ed59d2909d949830f58a9f1f","unresolved":false,"context_lines":[{"line_number":286,"context_line":"        ifname \u003d linux_net.get_ifname_by_pci_address("},{"line_number":287,"context_line":"            \u00270000:00:00.1\u0027, pf_interface\u003dTrue, switchdev\u003dTrue)"},{"line_number":288,"context_line":"        self.assertEqual(ifname, \u0027bar\u0027)"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    @mock.patch.object(os, \u0027listdir\u0027)"},{"line_number":291,"context_line":"    def test_get_ifname_by_pci_address_exception(self, mock_listdir):"},{"line_number":292,"context_line":"        mock_listdir.side_effect \u003d OSError(\u0027No such file or directory\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_e8776d07","line":289,"in_reply_to":"9f560f44_994c4940","updated":"2020-09-22 12:30:33.000000000","message":"Done","commit_id":"71177859540de35ca7eeec24b11491a8c8df1d99"},{"author":{"_account_id":28714,"name":"Adrian Chiris","email":"adrianc@nvidia.com","username":"adrianc"},"change_message_id":"9d48fcc3584505226aa7c7f724a192135121e2b5","unresolved":false,"context_lines":[{"line_number":304,"context_line":"    @mock.patch.object(os, \u0027listdir\u0027)"},{"line_number":305,"context_line":"    @mock.patch.object(linux_net, \"_get_phys_switch_id\")"},{"line_number":306,"context_line":"    @mock.patch.object(linux_net, \"_get_phys_port_name\")"},{"line_number":307,"context_line":"    def test_physical_function_interface_name_with_representors_invalid("},{"line_number":308,"context_line":"            self, mock__get_phys_port_name, mock__get_phys_switch_id,"},{"line_number":309,"context_line":"            mock_listdir):"},{"line_number":310,"context_line":"        mock_listdir.return_value \u003d [\u0027enp2s0f0_0\u0027, \u0027enp2s0f0_1\u0027, \u0027enp2s0f0\u0027]"},{"line_number":311,"context_line":"        mock__get_phys_switch_id.side_effect \u003d ([\u0027valid_switch\u0027])"},{"line_number":312,"context_line":"        mock__get_phys_port_name.side_effect \u003d ([\"pf0vf0\"])"},{"line_number":313,"context_line":"        ifname \u003d linux_net.get_ifname_by_pci_address("},{"line_number":314,"context_line":"            \u00270000:00:00.1\u0027, pf_interface\u003dTrue, switchdev\u003dFalse)"},{"line_number":315,"context_line":"        self.assertEqual(ifname, \u0027enp2s0f0_0\u0027)"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"    @mock.patch.object(os, \u0027listdir\u0027)"},{"line_number":318,"context_line":"    def test_get_ifname_by_pci_address_exception(self, mock_listdir):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_5afe5a04","line":315,"range":{"start_line":307,"start_character":3,"end_line":315,"end_character":46},"updated":"2020-10-04 12:55:16.000000000","message":"i dont quite understand what is it you are testing here.\n\nis it simply testing that the first netdev is returned if switchdev is false (which is being tested in test_physical_function_interface_name).\n\n\nif its related to my \"good/bad\" flow of my previous comment, the bad flow scenario i referred to is essentially having none of the netdev\u0027s phys_port_name matching the regex, then ensuring get_ifname_by_pci_address() raises.\n\nyou would still call it with switchdev\u003dtrue in this case.","commit_id":"664f8931afc564381e71b6c3c996b39d26e82941"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"1a57aee14f5f50bfea4792707b3996b3d60036e0","unresolved":false,"context_lines":[{"line_number":304,"context_line":"    @mock.patch.object(os, \u0027listdir\u0027)"},{"line_number":305,"context_line":"    @mock.patch.object(linux_net, \"_get_phys_switch_id\")"},{"line_number":306,"context_line":"    @mock.patch.object(linux_net, \"_get_phys_port_name\")"},{"line_number":307,"context_line":"    def test_physical_function_interface_name_with_representors_invalid("},{"line_number":308,"context_line":"            self, mock__get_phys_port_name, mock__get_phys_switch_id,"},{"line_number":309,"context_line":"            mock_listdir):"},{"line_number":310,"context_line":"        mock_listdir.return_value \u003d [\u0027enp2s0f0_0\u0027, \u0027enp2s0f0_1\u0027, \u0027enp2s0f0\u0027]"},{"line_number":311,"context_line":"        mock__get_phys_switch_id.side_effect \u003d ([\u0027valid_switch\u0027])"},{"line_number":312,"context_line":"        mock__get_phys_port_name.side_effect \u003d ([\"pf0vf0\"])"},{"line_number":313,"context_line":"        ifname \u003d linux_net.get_ifname_by_pci_address("},{"line_number":314,"context_line":"            \u00270000:00:00.1\u0027, pf_interface\u003dTrue, switchdev\u003dFalse)"},{"line_number":315,"context_line":"        self.assertEqual(ifname, \u0027enp2s0f0_0\u0027)"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"    @mock.patch.object(os, \u0027listdir\u0027)"},{"line_number":318,"context_line":"    def test_get_ifname_by_pci_address_exception(self, mock_listdir):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_7e64e94d","line":315,"range":{"start_line":307,"start_character":3,"end_line":315,"end_character":46},"in_reply_to":"9f560f44_5afe5a04","updated":"2020-10-05 13:50:14.000000000","message":"by the way i know the existing logic was to retrun the first netdev name if it did not find a mach but i think that likely was a bug.\n\nwe probly dont want to change that beahvior in this patch but i think we should be raising an error in that case and refusing to plug the vif.\n\ni am also having a hard time following this test.\ncan you annotate this with comments to explain what its doing and the others you have modified like \ntest_physical_function_interface_name_with_representors above","commit_id":"664f8931afc564381e71b6c3c996b39d26e82941"},{"author":{"_account_id":25733,"name":"Jan Gutter","email":"github@jangutter.com","username":"jangutter"},"change_message_id":"4e316e39a5613e39d9696c0ab4fff9372774e85f","unresolved":false,"context_lines":[{"line_number":287,"context_line":"            \u00270000:00:00.1\u0027, pf_interface\u003dTrue, switchdev\u003dTrue)"},{"line_number":288,"context_line":"        self.assertEqual(ifname, \u0027bar\u0027)"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    @mock.patch.object(os, \u0027listdir\u0027)"},{"line_number":291,"context_line":"    @mock.patch.object(linux_net, \"_get_phys_switch_id\")"},{"line_number":292,"context_line":"    @mock.patch.object(linux_net, \"_get_phys_port_name\")"},{"line_number":293,"context_line":"    def test_physical_function_interface_name_with_representors("},{"line_number":294,"context_line":"            self, mock__get_phys_port_name, mock__get_phys_switch_id,"},{"line_number":295,"context_line":"            mock_listdir):"},{"line_number":296,"context_line":"        # Get the PF that matches the phys_port_name regex"},{"line_number":297,"context_line":"        mock_listdir.return_value \u003d [\u0027enp2s0f0_0\u0027, \u0027enp2s0f0_1\u0027, \u0027enp2s0f0\u0027]"},{"line_number":298,"context_line":"        mock__get_phys_switch_id.side_effect \u003d ("},{"line_number":299,"context_line":"            [\u0027valid_switch\u0027, \u0027valid_switch\u0027, \u0027valid_switch\u0027])"},{"line_number":300,"context_line":"        mock__get_phys_port_name.side_effect \u003d ([\"pf0vf0\", \"pf0vf1\", \"p0\"])"},{"line_number":301,"context_line":"        ifname \u003d linux_net.get_ifname_by_pci_address("},{"line_number":302,"context_line":"            \u00270000:00:00.1\u0027, pf_interface\u003dTrue, switchdev\u003dTrue)"},{"line_number":303,"context_line":"        self.assertEqual(ifname, \u0027enp2s0f0\u0027)"},{"line_number":304,"context_line":""},{"line_number":305,"context_line":"    @mock.patch.object(os, \u0027listdir\u0027)"},{"line_number":306,"context_line":"    @mock.patch.object(linux_net, \"_get_phys_switch_id\")"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f681702_0085d5ad","line":303,"range":{"start_line":290,"start_character":4,"end_line":303,"end_character":44},"updated":"2020-10-19 16:32:33.000000000","message":"Thanks, tests look much nicer now.","commit_id":"3b51acafec0ae970bcb61f282fa9827379b008df"}]}
