Conversation
|
|
||
| port = dp_get_port_by_id(port_id); | ||
| if (!port) { | ||
| if (!port || !port->is_pf) { |
There was a problem hiding this comment.
This is just to make sure the function is not called on a bad port.
I checked the code and this original function was only ever called on a PF? so this should not change behavior.
| rte_ether_addr_copy(&port->own_mac, &arp_hdr->arp_data.arp_sha); | ||
| if (dp_arp_cycle_needed(port)) | ||
| if (dp_l2_addr_needed(port)) | ||
| arp_hdr->arp_data.arp_tip = htonl(port->iface.cfg.own_ip); |
There was a problem hiding this comment.
This will now behave differently!
Previously this branch was being executed until ARP arrived.
Now this will not only stop after ARP, but also after DHCP or ND.
I think it is fine, but this warrants someone else's attention to check my thought process.
There was a problem hiding this comment.
This branch is still good, as long as the "l2_addr_received" is set to false, after a dpservice restart. (which is the case)
As after a dpservice restart, no DHCP cycle would run and this code path would make sure the dpservice ARP cache gets a quick update. (This "if branch" changes the gratuitous ARP to a normal ARP request asking for the MAC of the VM's assigned ip)
|
Oh, the pytest failure is because I developed this on the new isolation branch and that one changes WCMP test in one place. |
| rte_ether_addr_copy(&port->own_mac, &arp_hdr->arp_data.arp_sha); | ||
| if (dp_arp_cycle_needed(port)) | ||
| if (dp_l2_addr_needed(port)) | ||
| arp_hdr->arp_data.arp_tip = htonl(port->iface.cfg.own_ip); |
There was a problem hiding this comment.
This branch is still good, as long as the "l2_addr_received" is set to false, after a dpservice restart. (which is the case)
As after a dpservice restart, no DHCP cycle would run and this code path would make sure the dpservice ARP cache gets a quick update. (This "if branch" changes the gratuitous ARP to a normal ARP request asking for the MAC of the VM's assigned ip)
| UDP(dport=1234)) | ||
| delayed_sendp(pkt, VM1.tap) | ||
|
|
||
| def test_l2_addr_once(request, prepare_ifaces, grpc_client): |
|
@PlagueCZ could you please rebase to main ? |
0b16f29 to
786ca5e
Compare
I created a wrapper function to set the VF MAC address. This will later be helpful for synchronizing the MAC address with the backup dpservice.
MAC address is only changed once per-lifetime of the VF. The old value is kept and reused as a "suggestion" until ARP/DHCP/ND arrives.
The initial value is set in the process init stage to the MAC address of the representor.
I also renamed
dp_set_neigh_mac()as it was meant as the "neighboring router mac", i.e. neighbor of a PF, never a VF.Fixes #713