OLD | NEW |
1 /** Copyright (c) 2014-2016 Stanford University | 1 /** Copyright (c) 2014-2017 Stanford University |
2 * | 2 * |
3 * Permission to use, copy, modify, and distribute this software for any | 3 * Permission to use, copy, modify, and distribute this software for any |
4 * purpose with or without fee is hereby granted, provided that the above | 4 * purpose with or without fee is hereby granted, provided that the above |
5 * copyright notice and this permission notice appear in all copies. | 5 * copyright notice and this permission notice appear in all copies. |
6 * | 6 * |
7 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR(S) DISCLAIM ALL WARRANTIES | 7 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR(S) DISCLAIM ALL WARRANTIES |
8 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | 8 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
9 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL AUTHORS BE LIABLE FOR | 9 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL AUTHORS BE LIABLE FOR |
10 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | 10 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
11 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 11 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 395 |
396 // See docs in Driver class. | 396 // See docs in Driver class. |
397 int | 397 int |
398 SolarFlareDriver::getTransmitQueueSpace(uint64_t currentTime) | 398 SolarFlareDriver::getTransmitQueueSpace(uint64_t currentTime) |
399 { | 399 { |
400 return maxTransmitQueueSize - queueEstimator.getQueueSize(currentTime); | 400 return maxTransmitQueueSize - queueEstimator.getQueueSize(currentTime); |
401 } | 401 } |
402 | 402 |
403 // See docs in Driver class. | 403 // See docs in Driver class. |
404 void | 404 void |
405 SolarFlareDriver::receivePackets(int maxPackets, | 405 SolarFlareDriver::receivePackets(uint32_t maxPackets, |
406 std::vector<Received>* receivedPackets) | 406 std::vector<Received>* receivedPackets) |
407 { | 407 { |
408 assert(driver->context->dispatch->isDispatchThread()); | 408 assert(driver->context->dispatch->isDispatchThread()); |
409 if (maxPackets > EF_VI_EVENT_POLL_NUM_EVS) { | 409 if (maxPackets > EF_VI_EVENT_POLL_NUM_EVS) { |
410 maxPackets = EF_VI_EVENT_POLL_NUM_EVS; | 410 maxPackets = EF_VI_EVENT_POLL_NUM_EVS; |
411 } | 411 } |
412 | 412 |
413 // To receive packets, descriptors each identifying a buffer, | 413 // To receive packets, descriptors each identifying a buffer, |
414 // are queued in the RX ring. The event queue is a channel | 414 // are queued in the RX ring. The event queue is a channel |
415 // from the adapter to software which notifies software when | 415 // from the adapter to software which notifies software when |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 /// See docs in the ``Driver'' class. | 527 /// See docs in the ``Driver'' class. |
528 Driver::Address* | 528 Driver::Address* |
529 SolarFlareDriver::newAddress(const ServiceLocator& serviceLocator) { | 529 SolarFlareDriver::newAddress(const ServiceLocator& serviceLocator) { |
530 return new MacIpAddress(serviceLocator); | 530 return new MacIpAddress(serviceLocator); |
531 } | 531 } |
532 | 532 |
533 /// See docs in the ``Driver'' class. | 533 /// See docs in the ``Driver'' class. |
534 void | 534 void |
535 SolarFlareDriver::sendPacket(const Driver::Address* recipient, | 535 SolarFlareDriver::sendPacket(const Driver::Address* recipient, |
536 const void* header, | 536 const void* header, |
537 const uint32_t headerLen, | 537 uint32_t headerLen, |
538 Buffer::Iterator *payload) | 538 Buffer::Iterator* payload, |
| 539 int priority) |
539 { | 540 { |
540 | 541 |
541 uint32_t udpPayloadLen = downCast<uint32_t>(headerLen | 542 uint32_t udpPayloadLen = downCast<uint32_t>(headerLen |
542 + (payload ? payload->size() : 0)); | 543 + (payload ? payload->size() : 0)); |
543 uint16_t udpLen = downCast<uint16_t>(udpPayloadLen + sizeof(UdpHeader)); | 544 uint16_t udpLen = downCast<uint16_t>(udpPayloadLen + sizeof(UdpHeader)); |
544 uint16_t ipLen = downCast<uint16_t>(udpLen + sizeof(IpHeader)); | 545 uint16_t ipLen = downCast<uint16_t>(udpLen + sizeof(IpHeader)); |
545 assert(udpPayloadLen <= getMaxPacketSize()); | 546 assert(udpPayloadLen <= getMaxPacketSize()); |
546 uint32_t totalLen = downCast<uint32_t>(sizeof(EthernetHeader) + ipLen); | 547 uint32_t totalLen = downCast<uint32_t>(sizeof(EthernetHeader) + ipLen); |
547 | 548 |
548 const MacIpAddress* recipientAddress = | 549 const MacIpAddress* recipientAddress = |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 | 795 |
795 /** | 796 /** |
796 * See docs in the ``Driver'' class. | 797 * See docs in the ``Driver'' class. |
797 */ | 798 */ |
798 string | 799 string |
799 SolarFlareDriver::getServiceLocator() | 800 SolarFlareDriver::getServiceLocator() |
800 { | 801 { |
801 return localStringLocator; | 802 return localStringLocator; |
802 } | 803 } |
803 } // end RAMCloud | 804 } // end RAMCloud |
OLD | NEW |