Abstract:
A network interface device for providing an interface between a network and a data processing device, the network interface device having: a plurality of resources of different types for supporting the interface, and a bus interface for interfacing with the data processing device by means of a bus over which data can be sent by addressing to a address on the bus, the network interface device being arranged so that each resource may be addressed by a respective address on the bus.

Description:
1. PRIOR APPLICATION DATA 
       [0001]    This application claims priority to PCT Application No. PCT/IB2005/002639, entitled Dynamic Resource Allocation which was published as WO 2006/027663 and which is entitled to a priority date of Sep. 9, 2004. 
     
    
     2. FIELD OF THE INVENTION 
       [0002]    This invention relates to the configuration of resources for use in the operation of a device such as a network interface device. 
       SUMMARY 
       [0003]    To overcome the drawbacks of the prior art and provide additional advantages, a network interface device is disclosed. In one embodiment the network interface is configured to provide an interface between a network and a data processing device. The network interface device has a plurality of resources of different types for supporting the interface and a bus interface. The bus interface is for interfacing with the data processing device by means of a bus over which data can be sent by addressing to an address on the bus. The network interface device is arranged so that each resource may be addressed by a respective address on the bus. 
         [0004]    In one embodiment the network interface device further comprises a data store configured to store mapping data defining for each of the resources the respective address on the bus by which it may be addressed. It is contemplated that the mapping data can be changed whilst the network interface device is providing at least one of the said interfaces. In addition, the mapping data can be changed so as to change the address on the bus by which a resource may be addressed whilst the network interface device is providing an interface supported by that resource. In one embodiment the data store stores ownership data defining for each of the resources one or more entities that are permitted to modify the state of the respective resource. For example, the ownership data may be changed whilst the network interface device is providing an interface supported by that resource. 
         [0005]    It is also contemplated that the network interface device may be arranged so as to restrict modification of the state of each resource by entities that are not defined by the ownership data as being permitted to modify the state of the respective resource. In one variation, the bus interface may be arranged to cause data received by the device over the bus and addressed to an address defined by the mapping data as being the address of a resource to be passed to that resource. 
         [0006]    With regard to resources, the types of resources may include two or more of timers, resources for supporting queues of data to pass from the network device to the data processing device, and resources for supporting queues of data to pass from the data processing device to the network device. In one embodiment the network device further comprising a data processing device linked to the bus for communication with the data processing device such that the data processing device is arranged to allocate addresses on the bus in page blocks and more than one resource is individually addressable within a single page. Each page may be 4 kB or larger and multiple resources may be addressable within at least one page block of the bus. 
         [0007]    Also disclosed herein is a program for controlling the operation of a data processing device for communication with a network device over a bus. In one embodiment, the program is arranged to receive a request for allocation of a resource on the bus and in response to such a request, identify a page block on the bus that has been allocated to the network device. The process identifies an unallocated address within that page to be allocated to the resource and transmits to the network device a message indicative of allocation of the resource and including the identified address. 
         [0008]    Also disclosed herein is a network interface device for providing interfaces between a network and processes of a data processing device that is capable of supporting a plurality of processes such that each process has an identity code. In such a configuration, the network interface device is configured with a plurality of resources of different types for supporting the interface such that each resource may be capable of being allocated to a single one of the processes. This embodiment also comprises a data store configured to store mapping data defining for each of the resources the identity code of the process to which the resource is allocated. 
         [0009]    In one embodiment, the network interface device has a resource security arrangement arranged to inhibit processes other than the one to which each resource is allocated from modifying the state of the respective resource. It is also contemplated that the resource security arrangement may be arranged to prevent processes other than the one to which each resource is allocated from modifying the state of the respective resource. The resource security arrangement may also be arranged for supporting a virtual memory mechanism whereby memory space of the data processing device can be mapped on to memory space of another data processing device. In addition, the resource security arrangement comprises a data processor arranged to process requests received by the network interface device to modify the state of a resource and this embodiment may further comprise an identity of a memory mapping according to the mechanism by accessing a data store to identify whether the resource is associated with that mapping and if it is not so associated preventing the request. 
         [0010]    In one embodiment, the types of resources include two or more of timers, resources for supporting queues of data to pass from the network device to the data processing device, and resources for supporting queues of data to pass from the data processing device to the network device. It is also contemplated that the mapping data can be changed so as to change the address on the bus by which a resource may be addressed whilst the network interface device is providing at least one of the said interfaces. 
         [0011]    Also disclosed is a network interface device for providing interfaces between a network and a data processing device. In this configuration, the network interface device has a plurality of resources of different types for supporting the interface such that each resource of one of the types being capable of communicating data to a respective resource of another of the types. This configuration also comprises a data store for storing mapping data defining one or more pairings of resources of different types between which communications are permitted. 
         [0012]    In one variation, the mapping data can be varied while the network interface device is providing at least one of the said interfaces. It is contemplated that the network interface may have a resource security arrangement arranged to inhibit any resource for which mapping data defining a pairing with another resource is not stored, from altering the state of that other resource. In addition, the resource security arrangement arranged may be configured to prevent resources other than one(s) resource for which mapping data, defining a pairing with another resource is not stored, from altering the state of that other resource. The types of resources may comprise two or more of timers, resources for supporting queues of data to pass from the network device to the data processing device, and resources for supporting queues of data to pass from the data processing device to the network device. 
         [0013]    According to one aspect of the present invention there is provided a network interface device for providing an interface between a network and a data processing device, the network interface device having: a plurality of resources of different types for supporting the interface, and a bus interface for interfacing with the data processing device by means of a bus over which data can be sent by addressing to an address on the bus, the network interface device being arranged so that each resource may be addressed by a respective address on the bus. 
         [0014]    The network interface device may comprise a data store storing mapping data defining for each of the resources the respective address on the bus by which it may be addressed. The mapping data can preferably be changed whilst the network interface device is providing at least one of the said interfaces. The mapping data can preferably be changed so as to change the address on the bus by which a resource may be addressed whilst the network interface device is providing an interface supported by that resource. Preferably the data store stores ownership data defining for each of the resources one or more entities that are permitted to modify the state of the respective resource. If the device supports a memory mapping protocol then the data store may also store an indication of which mapping is associated with each resource. The ownership data may preferably be changed whilst the network interface device is providing an interface supported by that resource. The device may be arranged so as to restrict modification of the state of each resource by entities that are not defined by the ownership data as being permitted to modify the state of the respective resource. The state of the resource may include operational settings or configuration of the device (including pointers used by the resource) and/or (if available, for instance if the resource is active) the resource&#39;s running state (e.g a buffer of traffic data to be processed by the device, or the countdown value of a timer). 
         [0015]    Preferably the bus interface is arranged to cause data received by the device over the bus and addressed to an address defined by the mapping data as being the address of a resource to be passed to that resource. 
         [0016]    The types of resources preferably include two or more of timers, resources for supporting queues of data to pass from the network device to the data processing device, and resources for supporting queues of data to pass from the data processing device to the network device. Thus each resource may, for example, be a timer or a queue support device. Such a queue may be a buffer or a DMA queue. 
         [0017]    According to a second aspect of the invention there is provided such a network device and a data processing device linked to the bus for communication with the data processing device, wherein the data processing device is arranged to allocate addresses on the bus in page blocks and more than one resource is individually addressable within a single page. 
         [0018]    Each page may preferably be 4 kB or larger in size. Preferably multiple resources are addressable within at least one page block of the bus. 
         [0019]    According to a third aspect of the present invention there is provided a program for controlling the operation of a data processing device for communication with a network device over a bus, the program being arranged to: receive a request for allocation of a resource on the bus; in response to such a request, identify a page block on the bus that has been allocated to the network device and identify an unallocated address within that page to be allocated to the resource; and transmit to the network device a message indicative of allocation of the resource and including the identified address. 
         [0020]    According to a fourth aspect of the present invention there is provided network interface device for providing interfaces between a network and processes of a data processing device capable of supporting a plurality of processes, each process having an identity code, the network interface device having: a plurality of resources of different types for supporting the interface, each resource being capable of being allocated to a single one of the processes, and a data store storing mapping data defining for each of the resources the identity code of the process to which the resource is allocated. 
         [0021]    The network interface may have a resource security arrangement arranged to inhibit processes other than the one to which each resource is allocated from modifying the state of the respective resource. 
         [0022]    The resource security arrangement is preferably arranged to prevent processes other than the one to which each resource is allocated from modifying the state of the respective resource. 
         [0023]    Preferably the resource security arrangement is arranged for supporting a virtual memory mechanism whereby memory space of the data processing device can be mapped on to memory space of another data processing device. The resource security arrangement may comprise a data processor arranged to process requests received by the network interface device to modify the state of a resource and comprising an identity of a memory mapping according to the mechanism by accessing a data store to identify whether the resource is associated with that mapping and if it is not so associated preventing the request. The operation of the virtual memory mechanism is suitably managed by hardware or software on each of the data processing devices. 
         [0024]    Preferably the mapping data can be changed so as to change the address on the bus by which a resource may be addressed whilst the network interface device is providing at least one of the said interfaces. 
         [0025]    According to a fifth aspect of the present invention there is provided a network interface device for providing interfaces between a network and a data processing device, the network interface device having: a plurality of resources of different types for supporting the interface, each resource of one of the types being capable of communicating data to a respective resource of another of the types, and a data store storing mapping data defining one or more pairings of resources of different types between which communications are permitted. 
         [0026]    Preferably the mapping data can be varied whist the network interface device is providing at least one of the said interfaces. Preferably the network interface has a resource security arrangement arranged to inhibit any resource for which mapping data defining a pairing with another resource is not stored from altering the state of that other resource. Preferably the resource security arrangement arranged to prevent resources other than one(s) resource for which mapping data defining a pairing with another resource is not stored from altering the state of that other resource. 
         [0027]    Other systems, methods, features and advantages of the invention will be or will become apparent to one with skill in the art upon examination of the following figures and detailed description. It is intended that all such additional systems, methods, features and advantages be included within this description, be within the scope of the invention, and be protected by the accompanying claims. The present invention will now be described by way of example only, with reference to the drawings. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0028]    The components in the figures are not necessarily to scale, emphasis instead being placed upon illustrating the principles of the invention. In the figures, like reference numerals designate corresponding parts throughout the different views. 
           [0029]      FIG. 1  shows the architecture of a networked system. 
           [0030]      FIG. 2  shows the architecture of another networked system. 
           [0031]      FIG. 3  illustrates a bus mapping table. 
       
    
    
     DETAILED DESCRIPTION 
       [0032]      FIG. 1  shows the architecture of a computer  1  connected to a network  2  via a network interface card (NIC)  3 . A bus  4 , such as a PCI (personal computer interface) bus, connects the data processing components of the computer  1  to each other and to the NIC. 
         [0033]    The computer runs an operating system  10  which is capable of supporting applications  11  also running on the computer. A library  12  of instructions is stored by the computer and available to the applications. The part of the library usable for communications with the NIC  3  is termed a transport library  13 . Included in the operating system kernel is a driver component  14 : a dedicated set of instructions which allow for data transfer and control-plane operations to be performed with the NIC. 
         [0034]    In order to transfer data to and from the computer over the network a number of network-specific processing and data resources are needed. The resources that are needed depend on the network protocol that is in use, but they may include one or more timers (for identifying network protocol timeouts) and data queues (for transferring network data and instructions between the computer and the NIC). These resources are typically provided by dedicated elements of the NIC. 
         [0035]    When an application wishes to establish a network connection it calls an establishment routine in the library  12 . This instructs the kernel driver to signal the NIC to allocate a set of resources for use by the application. The composition of the set of resources that is needed to support a network connection is known to the designers of the system. Therefore, to allow the application to establish the connection through a single call to the library the composition of the set of resources that can be requested is fixed: it includes a fixed number of timers and a fixed number of queues of each type, which is sufficient to support the network connection that is required. 
         [0036]    Address space on the bus  4  is typically allocated in pages of a fixed size: normally 4 or 8 kB. A page is allocated to the set of resources, with each resource having an individual address within that page. 
         [0037]    This arrangement suffers from a number of problems. First, if the application wishes to have additional resources, for instance to support multiple processor threads, then it must request another complete set of resources, which will occupy another page of bus address-space. However, that may be wasteful since such an additional thread might not need the full set of resources. For example, the additional thread may not need certain resources such as a timer. 
         [0038]    Second, resources that have been allocated even to a single thread and that are subsequently unwanted cannot be freed-up until the whole set to which they belong is released. This means that the NIC must have more resource capacity than might otherwise be necessary. 
         [0039]    Third, it is problematic, or even impossible, to reallocate resources from one application or thread to another. This may be required, for example, if one thread wishes to pass ownership of a set of memory buffers to another. 
         [0040]    There is a need for a system that addresses one or more of these problems. 
         [0041]      FIG. 2  shows a computing device  20  coupled to a network interface device  30  for connection to a network  40 . The computer could be a personal computer or a server, or could be a non-reconfigurable processing device for which network connectivity is desired. The network interface device could be in any suitable form, for example a stand-alone device, a network interface card, which could be in the form of a peripheral card, or could be built on to a main circuit board of the computer. Purely for convenience the computing device will be referred to as a PC and the network interface device will be referred to as a NIC. The network could be an Ethernet network or another type of data network. 
         [0042]    The computer runs an operating system  21  which is capable of supporting applications  22  also running on the computer. A library  23  of instructions is stored by the computer and available to the applications. The part of the library usable for communications with the NIC  30  is termed a transport library  24 . Included in the operating system kernel is a driver component  25 : a dedicated set of instructions which allow for data transfer with the NIC. Each application would normally take the form of a software program running on the computer, but it could be embedded in firmware. Some operating systems include applications in addition to fundamental operating system code. 
         [0043]    Aspects of the system that are not described herein may be as set out in WO 2004/025477. 
         [0044]    The NIC can support resources of a number of types: i.e. resources having capabilities of different natures. Examples include DMA queues, event queues, timers and support resources for remote apertures of the type described in WO 2004/025477. Each type of resource ( 31 - 34 ) is provided from a dedicated hardware resource pool which can support numerous instances of resources of the respective type. In order for such an instance to be made operational it must be configured by means of instructions from the PC, as will be described in more detail below. 
         [0045]    The NIC communicates with the PC over a bus  50 . In this example the bus is a PCI bus, but the invention is not limited to such a bus. Data transmitted over the PCI bus is associated with a destination address and is received by whichever entity that is connected to the bus has had that address allocated to it. In a typical PC implementation the addresses are allocated in pages of 4 or 8 kB. One or more of these pages may be allocated to the NIC. Blocks  51  and  52  represent allocated pages on the PCI bus. 
         [0046]    The NIC has a bus interface controller  35 , a resource configuration unit  36  and a bus mapping table  37 . The resource configuration unit processes communications received from the computer that provide instructions on the allocation, re-allocation and de-allocation of resources on the NIC, and configures the resources in accordance with such instructions. The driver  25  stores a record of which resources on the NIC are allocated. When a resource is to be allocated the driver  25  identifies a suitable free resource of the required type on the NIC and transmits an allocation instruction to the NIC. The instruction identifies the resource and specifies the details of how it is to be allocated, including details of the internal configuration of the resource (e.g. in the case of a timer the amount of time it is to run for). That instruction is passed to the resource configuration unit. The resource configuration unit then loads the specified configuration into the identified resource. The instruction also includes an ownership string, which may be an identification of which application or thread on the computer is using the resource. The resource configuration unit stores these in a row of the bus mapping table. An example of entries in the bus mapping table is shown in  FIG. 3  and will be described in more detail below. When a resource is to be re-allocated the relevant entries in the resource&#39;s own configuration store and in the bus mapping table are altered as necessary. When a resource is to be de-allocated it is disabled and any rows of the bus mapping table that relate to it are deleted. 
         [0047]    The operation of the system for the transfer of data to and from the network will now be described. 
         [0048]    During set-up of the system one or more pages ( 51 ,  52 ) on the bus  50  have been allocated to the NIC. Part of this address space (page  51 ) can be used by the kernel driver  25  to send instructions to the NIC. Other pages (e.g. page  52 ) can be used for communication between applications such as application  22  and the resources  31 - 34 . The resource allocation unit  36  stores a record of the pages that are allocated to the NIC for use by resources. 
         [0049]    When an application  22  wishes to open a data connection over the network it calls a routine in the transport library to cause the NIC resources that are required for the connection to be allocated. Standard types of network connection require standard sets of resources; for example: an event queue, TX and RX DMA channels, and set of DMA&#39; able memory buffers. For example a typical set may contain 1 TX and RX dma channel 2 timers and order 100 DMA memory buffers. 
         [0050]    The transport library includes one or more routines that can be called directly by the application and that cause such standard sets of resources, including set numbers of resources of different types, to be allocated. The transport library also includes routines that allow a resource of each type to be allocated, re-allocated or de-allocated individually. The presence of both these types of instruction means that standard connections can be set up efficiently, and yet non-standard groups of resources can be created, and existing connections can be reconfigured on a resource-by-resource basis. 
         [0051]    The routines for allocation of resources cause actions to be taken by the kernel driver  25  to communicate instructions to the NIC for the allocation of the resources as specified in the routines. Those instructions specify the identity of the application or thread with which the resources are to be associated, and the nature of the resources. The instructions are processed by the resource configuration unit  36  of the NIC. Some or all of the functions of the resource allocation unit may alternatively be provided by the kernel driver  25 . 
         [0052]    A significant feature of the present system is that the space on the bus  50  that is allocated to the NIC can be split dynamically between the resources on the bus  50 . Once one or more pages  52  have been allocated to the NIC for use by resources those resources can be allocated one or more individual sub-page addresses within that page, corresponding to locations as illustrated at  53 ,  54 . Thus each resource can have a part of the total space allocated to it. A record of which part of the total space is allocated to which resource is stored in the bus mapping table  37 . The effect is that a single page of the bus can be used for communication to resources of multiple types and/or resources that relate to multiple connections and/or resources that are associated with multiple applications or threads on the computer  20 . As a result, the total bus space can be used relatively efficiently. 
         [0053]    The usage of the allocated bus space  52  is managed by the driver  25 . When a resource is to be allocated the RAU identifies using a data store whose content it manages an unused block in the space on the bus that has already been allocated for use by resources of the NIC, the space being of the size required for the resource. It then stores in that data store the identity of the resource (“resource ID”), the address of the block within the allocated space (“sub-page ID), and the identity of the application or thread that is to use the resource (“thread tag”); and sends a message to the resource allocation unit (RAU)  36  to cause it to store corresponding data in the bus mapping table  37  (as shown in  FIG. 3 ). If the RAU finds that table  37  indicates the address to be already occupied then it returns an error code to the driver. The sub-page address may need to be supplemented with the address of the page in which the sub-page lies if that cannot be inferred as a result of only a single page having been allocated for use by the resources. If the total space allocated for use by resources is insufficient then the kernel driver allocates it more space. Having allocated the resources, the RAU returns a success message to the kernel driver. The allocated page and sub-page addresses are returned to and mapped onto the application that requested the resources in order that it can access them by means of that data. 
         [0054]    An application that has had resources allocated to it can access them by sending data (e.g. by means of load/store cycles through a virtual memory mapping) to the relevant bus page, at the sub-page address corresponding to the respective resource. Any data sent to pages allocated to resources is picked off the bus  50  by the bus interface controller  35 . It directs that data to the appropriate one of the resources  31 - 34  by performing a look-up in the table  37  to identify the identity of the resource to which the sub-page address has been allocated. An application can also access a resource by means other than a bus write: for example by means of direct memory access (DMA). In those instances, the NIC checks that the identity of the application/thread from which the access has been received matches the identity indicated in the table  37  for the resource. If it does not match, the data is ignored. If it matches, it is passed to the relevant resource. This adds to security and helps to prevent corruption of the resources by other applications. 
         [0055]    The set of resources allocated to an application or thread may be considered to constitute a virtual network interface (VNIC). 
         [0056]    Once a virtual interface has been composed, it may be reconfigured dynamically. Examples of the actions that may be taken are as follows: A resource that is no longer required may be freed-up. To achieve this the application using the resource calls a de-allocation routine in the transport library  23 . The de-allocation routine calls the kernel driver  25 , which instructs the RAU to de-allocate the resource by disabling it, clearing its status and deleting its row in the table  37 . 
         [0057]    Additional resources may be added to the VNIC. (etc) The process is analogous to that described above for initial composition of the VNIC. 
         [0058]    Resources may be passed from one application or thread to another. This is most useful in the situation where a single application has multiple threads and wants to pass control of a resource from on thread to another, for example if data from the network is to be received into and processed by a new thread. To achieve this the application using the resource calls a re-allocation routine in the transport library  23 . The re-allocation routine calls the kernel driver  25 , which instructs the RAU to re-allocate the resource modifying its row in the table  37  to specify the identity of the application or thread that is taking over its control. 
         [0059]    In some instances it may be desirable for resources of one type to communicate with resources of another type. For example, data received from the network  40  may be being passed to an application  22  for processing. The application has a queue  26  in a memory  27  connected to the bus  50 . The queue is managed in part by the transport library  23 , which provides a DMA queue resource  31  on the NIC with an up-to-date pointer to the next available location on the queue  26 . This is updated as the application reads data from the queue  26 . When data is received from the network it is passed to an event queue resource  32 , which writes it to the location identified by the pointer and also triggers an event such as an interrupt on the computing device  20  to indicate that data is available on the queue. In order for this to happen the event queue resource  32  must learn the pointer details from the DMA queue resource  31 . This requires data to be passed from the DMA queue resource to the event queue resource. 
         [0060]    To achieve this the “thread tag” column of the table  37  can be treated more generally as an ownership tag, and can link the DMA queue to the related event queue. To achieve this the ownership tag of the event queue can be set to the identity of the related DMA queue. When the DMA queue needs to pass data to the related event queue it can identify the event queue from the table  37  by performing a look-up on its own identity in the ownership tag column. 
         [0061]    Data intended to be passed from one resource to another can be checked by the bus controller  35  to ensure that it is compatible with the settings in the table  37 . Specifically, when data is to be sent from one resource to another the bus controller can check that there is a row in the table  37  that has the identity of the resource that is the source of the data in the ownership tag field, and the identity of the resource that is the intended destination of the data in the resource ID field. If there is no match then the data is prevented from reaching its destination. This provides additional security and protection against corruption. Alternatively, or in addition, it may be permitted for one resource to transmit data to another if both are in common ownership: in this example if their resource ID fields indicate that they are owned by the same thread, application or other resource. 
         [0062]    The identities of resources linked in this way can also be reconfigured dynamically by means of the re-configuration routines in the transport library. 
         [0063]    The network may be an Ethernet network or another type of network. Protocols used on the network may include, but are not limited to, TCP/IP. 
         [0064]    The applicant hereby discloses in isolation each individual feature described herein and any combination of two or more such features, to the extent that such features or combinations are capable of being carried out based on the present specification as a whole in the light of the common general knowledge of a person skilled in the art, irrespective of whether such features or combinations of features solve any problems disclosed herein, and without limitation to the scope of the claims. The applicant indicates that aspects of the present invention may consist of any such individual feature or combination of features. In view of the foregoing description it will be evident to a person skilled in the art that various modifications may be made within the scope of the invention. In addition, the various features, elements, and embodiments described herein may be claimed or combined in any combination or arrangement.