Efficient packet re-transmission for express data paths
A network packet is received from a network interface card (NIC). A determination is made, in view of a filter specifying handling of network packets, as to whether the network packet is to be modified. In response to determining that the network packet is to be modified, a portion of the network packet is modified in view of the filter. The modified portion of the network packet is provided to the NIC.
1. A method comprising:
validating register values of a filter, wherein the validation comprises determining an access bound of the filter;
providing the access bound to a network interface card (NIC);
receiving a network packet from the NIC;
determining, in view of the filter specifying handling of network packets, whether the network packet is to be modified;
in response to determining that the network packet is to be modified, modifying a portion of the network packet in view of the filter to generate a modified portion of the network packet; and
providing, by a processing device, the modified portion of the network packet to the NIC.
2. The method of claim 1 , wherein the modified portion of the network packet comprises a header of the network packet.
3. The method of claim 1 , wherein providing the modified portion of the network packet to the NIC causes the NIC to transmit the network packet comprising the modified portion via a network.
4. The method of claim 1 , wherein the processing device is operatively coupled to one or more non-coherent direct-memory access devices.
5. The method of claim 1 , wherein providing the access bound to the NIC causes the NIC to synchronize a second portion of network packets received by the NIC to the processing device, wherein the second portion corresponds to the access bound.
6. The method of claim 1 , wherein the modified portion of the network packet corresponds to the access bound.
7. The method of claim 1 , wherein providing the modified portion of the network packet to the NIC further comprises:
flushing the modified portion of the network packet from a cache operatively coupled to the processing device to the NIC.
8. A system comprising:
a memory; and
a processing device, operatively coupled to the memory, to:
validate register values of a filter, wherein the validation comprises determining an access bound of the filter;
provide the access bound to a network interface card (NIC);
receive a network packet from the NIC;
determine, in view of the filter specifying handling of network packets, whether the network packet is to be modified;
in response to determining that the network packet is to be modified, modify a portion of the network packet in view of the filter to generate a modified portion of the network packet; and
provide the modified portion of the network packet to the NIC.
9. The system of claim 8 , wherein the modified portion of the network packet comprises a header of the network packet.
10. The system of claim 8 , wherein synchronizing the modified portion of the network packet to the NIC causes the NIC to transmit the network packet comprising the modified portion via a network.
11. The system of claim 8 , wherein the processing device is operatively coupled to one or more non-coherent direct-memory access devices.
12. The system of claim 8 , wherein providing the access bound to the NIC causes the NIC to synchronize a second portion of network packets received by the NIC to the processing device, wherein the second portion corresponds to the access bound.
13. The system of claim 8 , wherein the modified portion of the network packet corresponds to the access bound.
14. The system of claim 8 , wherein to provide the modified portion of the network packet to the NIC, the processing device is further to:
flush the modified portion of the network packet from a cache operatively coupled to the processing device to the NIC.
15. A non-transitory computer-readable storage medium including instructions that, when executed by a processing device, cause the processing device to:
validate register values of a filter, wherein the validation comprises determining an access bound of the filter;
provide the access bound to a network interface card (NIC);
receive a network packet from the NIC;
determine, in view of the filter specifying handling of network packets, whether the network packet is to be modified;
in response to determining that the network packet is to be modified, modify a portion of the network packet in view of the filter to generate a modified portion of the network packet; and
provide, by the processing device, the modified portion of the network packet to the NIC.
16. The non-transitory computer-readable storage medium of claim 15 , wherein the modified portion of the network packet comprises a header of the network packet.
17. The non-transitory computer-readable storage medium of claim 15 , wherein synchronizing the modified portion of the network packet to the NIC causes the NIC to transmit the network packet comprising the modified portion via a network.
18. The non-transitory computer-readable storage medium of claim 15 , wherein the processing device is operatively coupled to one or more non-coherent direct-memory access devices.
19. The non-transitory computer-readable storage medium of claim 15 , wherein providing the access bound to the NIC causes the NIC to synchronize a second portion of network packets received by the NIC to the processing device, wherein the second portion corresponds to the access bound.
20. The non-transitory computer-readable storage medium of claim 15 , wherein the modified portion of the network packet corresponds to the access bound.