Methods and apparatus for dynamically switching between polling and interrupt mode for a ring buffer of a network interface card
First Claim
1. A method of configuring a network interface card, comprising:
- mapping each one of a plurality of ring buffers associated with a network interface card (NIC) to one of a plurality of processors, wherein a first queue is associated with a first processor of the plurality of processors and a second queue is associated with a second processor of the plurality of processors, and, wherein the NIC comprises a driver to facilitate communication between the NIC and the plurality of processors;
wherein the NIC is dynamically instructed, by an operating system, to individually operate each of the plurality of ring buffers in one of a polling mode and an interrupt mode, wherein the operating system is configured to communicate with the NIC using at least one of a plurality of ring buffer identifiers and an application programming interface of the driver, wherein each of the plurality of ring buffers is associated with one of the plurality of ring buffer identifiers;
operating a first of the plurality of ring buffers associated with the NIC in the interrupt mode by;
obtaining, from the mapping, a first ring buffer identifier of the plurality of ring buffer identifiers associated with the first processor of the plurality of processors, andsending an instruction comprising the first ring buffer identifier to the NIC,wherein the first ring buffer is operated in the interrupt mode when the memory mapped to the one of the plurality of ring buffers has less than a predefined number of packets or packets are received from the one of the plurality of ring buffers at less than a predefined rate;
operating a second of the plurality of ring buffers associated with the NIC in a polling mode by;
obtaining, from the mapping, a second ring buffer identifier of the plurality of ring buffer identifiers associated with the second processor of the plurality of processors, andsending an instruction comprising the second ring buffer identifier to the NIC,wherein the second ring buffer is operated in the polling mode when the memory mapped to the one of the plurality of ring buffers has greater than a predefined number of packets or packets are received from one of the plurality of ring buffers at greater than a predefined rate;
transferring, by the operating system, packets from the first ring buffer to the first queue of the first processor; and
transferring, by the operating system, packets from the second ring buffer to the second queue of the second processor.
2 Assignments
0 Petitions
Accused Products
Abstract
Methods and apparatus for processing packets in a computer system including an operating system and a network interface card (NIC) are disclosed. The NIC having a plurality of ring buffers is configured to operate in either a polling mode or an interrupt mode for a particular ring buffer. When the NIC is in the polling mode for a ring buffer, the NIC is periodically polled to determine whether one or more packets have been received by the ring buffer. When the NIC is in the interrupt mode, the operating system is capable of receiving an interrupt indicating that the ring buffer of the NIC has received one or more packets. The operating system is capable of instructing the NIC to change its mode from the polling mode to the interrupt mode for a particular ring buffer, and from the interrupt mode to the polling mode for a particular ring buffer.
46 Citations
42 Claims
-
1. A method of configuring a network interface card, comprising:
-
mapping each one of a plurality of ring buffers associated with a network interface card (NIC) to one of a plurality of processors, wherein a first queue is associated with a first processor of the plurality of processors and a second queue is associated with a second processor of the plurality of processors, and, wherein the NIC comprises a driver to facilitate communication between the NIC and the plurality of processors; wherein the NIC is dynamically instructed, by an operating system, to individually operate each of the plurality of ring buffers in one of a polling mode and an interrupt mode, wherein the operating system is configured to communicate with the NIC using at least one of a plurality of ring buffer identifiers and an application programming interface of the driver, wherein each of the plurality of ring buffers is associated with one of the plurality of ring buffer identifiers; operating a first of the plurality of ring buffers associated with the NIC in the interrupt mode by; obtaining, from the mapping, a first ring buffer identifier of the plurality of ring buffer identifiers associated with the first processor of the plurality of processors, and sending an instruction comprising the first ring buffer identifier to the NIC, wherein the first ring buffer is operated in the interrupt mode when the memory mapped to the one of the plurality of ring buffers has less than a predefined number of packets or packets are received from the one of the plurality of ring buffers at less than a predefined rate; operating a second of the plurality of ring buffers associated with the NIC in a polling mode by; obtaining, from the mapping, a second ring buffer identifier of the plurality of ring buffer identifiers associated with the second processor of the plurality of processors, and sending an instruction comprising the second ring buffer identifier to the NIC, wherein the second ring buffer is operated in the polling mode when the memory mapped to the one of the plurality of ring buffers has greater than a predefined number of packets or packets are received from one of the plurality of ring buffers at greater than a predefined rate; transferring, by the operating system, packets from the first ring buffer to the first queue of the first processor; and transferring, by the operating system, packets from the second ring buffer to the second queue of the second processor. - View Dependent Claims (2, 3)
-
-
4. A method of processing packets in a computer system including an operating system and a network interface card (NIC), the NIC having a plurality of ring buffers, comprising:
-
mapping each one of the plurality of ring buffers associated with the NIC to one of a plurality of processors, wherein a first queue is associated with one a first processor of the plurality of processors and a second queue is associated with a second processor of the plurality of processors, wherein the NIC comprises a driver to facilitate communication between the NIC and the plurality of processors; polling the NIC to determine whether one or more packets have been received by a first ring buffer of the plurality of ring buffers when the NIC is in a polling mode for the first ring buffer; receiving an interrupt from the NIC when the NIC is in an interrupt mode for a second ring buffer of the plurality of ring buffers, the interrupt indicating that the second ring buffer of the NIC has received one or more packets, wherein the NIC is capable of being dynamically instructed, by the operating system, to individually operate each of the plurality of ring buffers in one of the polling mode and the interrupt mode, wherein the operating system is configured to communicate with the NIC using at least one of a plurality of ring buffer identifiers and an application programming interface of the driver, wherein each of the plurality of ring buffers is associated with one of the plurality of ring buffer identifiers; obtaining a first ring buffer identifier of the plurality of ring buffer identifiers corresponding to the first ring buffer and a second ring buffer identifier of the plurality of ring buffer identifiers corresponding to the second ring buffer; transferring, by the operating system, packets from the first ring buffer to the first queue of the first processor associated with the first ring buffer identifier obtained from the mapping; and transferring, by the operating system, packets from the second ring buffer to the second queue of the second processor associated with the second ring buffer identifier obtained from the mapping, when the interrupt occurs. - View Dependent Claims (5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37)
-
-
38. A computer system, comprising:
-
a plurality of processors; an operating system; a network interface card (NIC) coupled to the operating system and having a first ring buffer and a second ring buffer, wherein each of the first and second ring buffers is associated with one of a plurality of ring buffer identifiers; a mapping stored in the computer system configured to map each ring buffers to one of the plurality of processors and a corresponding queue, wherein a first queue is associated with a first processor of the plurality of processors and a second queue is associated with a second processor of the plurality of processors wherein the NIC is capable of being dynamically instructed, by the operating system, to individually operate the first ring buffer in an interrupt mode and the second ring buffer in a polling mode, wherein the operating system is configured to; obtain, from the mapping, a first ring buffer identifier of the plurality of ring buffer identifiers associated with a first processor of the plurality of processors; send an instruction comprising the first ring buffer identifier to the NIC to operate the first ring buffer in the interrupt mode when the first ring buffer has less than a predefined number of packets or packets are received from the first ring buffer at less than a predefined rate; obtain, from the mapping, a second ring buffer identifier of the plurality of ring buffer identifiers associated with a second processor of the plurality of processors; send an instruction comprising the second ring buffer identifier to the NIC to operate the second ring buffer in the polling mode when the second ring buffer has greater than the predefined number of packets or packets are received from the second ring buffer at more than the predefined rate; transfer packets from the first ring buffer to the first queue corresponding to the first processor associated with the first ring buffer identifier in the mapping; and transfer packets from the second ring buffer to the second queue corresponding to the second processor associated with the second ring buffer identifier in the mapping. - View Dependent Claims (39, 40, 41, 42)
-
Specification