IP Library Granted Patent US 11,347,488
Granted Patent B2
US 11,347,488 · App. 16/877,204 · Granted May 31, 2022

Compiling domain-specific language code to generate executable code targeting an appropriate type of processor of a network device

Inventors: Zhi Guo (San Jose, CA); John Cortes (Santa Clara, CA); Hao Wang (Sunnyvale, CA)
Assignee: Fortinet, Inc.
G06F8/447G06F8/315
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,347,488
App. No.
16/877,204
Granted
May 31, 2022
Kind
B2
Abstract

Systems and methods for programming a network device using a domain-specific language (DSL) are provided. According to one embodiment, source code in a form of a DSL, describing a slow-path task that is to be performed by a network device, is received by a processing resource. A determination is made regarding one or more types of processors are available within the network device to implement the slow-path task. For each portion of the source code, a preferred type of processor is determined by which the portion of the source code would be most efficiently implemented. When the preferred type of processor is available within the network device, executable code is generated targeting the preferred type of processor based on the portion of the source code; otherwise, intermediate code is generated in a form of a high-level programming language, targeting a general purpose processor of the network device.

Claims (54)

1. A method comprising:

receiving, by a processing resource, source code in a form of a domain-specific language, wherein the domain-specific language describes a slow-path task that is to be performed by a network device, and wherein the source code includes a first portion and a second portion;

determining, by the processing resource, a first processor type and a general purpose processor that are available within the network device to implement the slow-path task, and that a second processor type is not available within the network device to implement the slow-path task; and

for the first portion of the source code:

determining, by the processing resource, that the first processor type is better suited to the first portion than the general purpose processor;

based at least in part on the determination that the first processor type is available within the network device, generating, by the processing resource, executable code targeting the first processor type based on the first portion of the source code; and

for the second portion of the source code:

determining, by the processing resource, that the second processor type is better suited to the second portion than the general purpose processor;

based at least in part on the determination that the second processor type is not available within the network device, generating, by the processing resource, intermediate code, in a form of a high-level programming language, targeting the general purpose processor available within the network device based on the second portion of the source code.

2. The method of claim 1 , wherein the first processor type is a network processor, and wherein said generating, by the processing resource, executable code targeting the first processor type comprises:

compiling, by the processing resource, the first portion of the source code into an intermediate representation; and

generating, by the processing resource, binary code targeting the network processor by compiling the intermediate representation.

3. The method of claim 2 , further comprising: performing, by the processor, one or more optimizations on the intermediate representation prior to generation of the binary code.

4. The method of claim 2 , wherein compiling, by the processing resource, the first portion of the source code into an intermediate representation includes: generating an indication that the first processor type is desired for the first portion, and wherein determining, by the processing resource, that the first processor type is better suited to the first portion than the general purpose processor is based at least in part on the indication that the first processor type is desired for the first portion.

5. The method of claim 1 , wherein the high-level programming language comprises a procedural programming language.

6. The method of claim 5 , wherein the procedural programming language is C.

7. The method of claim 1 , wherein the high-level programming language comprises a hybrid language that supports both procedural programming and object-oriented programming.

8. The method of claim 7 , wherein the hybrid language is C++.

9. The method of claim 1 , wherein the network device comprises any or a combination of a gateway device, a network controller device, a firewall, a router, a unified threat management (UTM) appliance, an Intrusion Prevention System (IPS), an Intrusion Detection System (IDS), a Distributed Denial of Service (DDoS) prevention device, and a software defined networking security device.

10. The method of claim 1 , wherein the source code includes a first indication of processor preference for the first portion and a second indication of processor preference for the second portion, and wherein determining, by the processing resource, that the first processor type is better suited to the first portion than the general purpose processor is based at least in part on the first indication of processor preference.

11. A non-transitory computer-readable medium storing instructions, which when executed by a processing resource cause the processing resource to perform a method comprising:

receiving source code in a form of a domain-specific language, wherein the domain-specific language describes a slow-path task that is to be performed by a network device, and wherein the source code includes a first portion and a second portion;

determining a first processor type and a general purpose processor that are available within the network device to implement the slow-path task, and that a second processor type is not available within the network device to implement the slow-path task; and

for the first portion of the source code:

determining that the first processor type is better suited to the first portion than the general purpose processor;

based at least in part on the determination that the first processor type is available within the network device, generating executable code targeting the first processor type based on the first portion of the source code; and

for the second portion of the source code:

determining that the second processor type is better suited to the second portion than the general purpose processor;

based at least in part on the determination that the second processor type is not available within the network device, generating intermediate code, in a form of a high-level programming language, targeting the general purpose processor available within the network device based on the second portion of the source code.

12. The non-transitory computer-readable medium of claim 11 , wherein the first processor type is a network processor, and wherein said generating executable code targeting the first processor type comprises:

compiling the first portion of the source code into an intermediate representation; and

generating binary code targeting the network processor by compiling the intermediate representation.

13. The non-transitory computer-readable medium of claim 12 , wherein the method further comprises performing one or more optimizations on the intermediate representation prior to generation of the binary code.

14. The non-transitory computer-readable medium of claim 11 , wherein the high-level programming language comprises a procedural programming language.

15. The non-transitory computer-readable medium of claim 14 , wherein the procedural programming language is C.

16. The non-transitory computer-readable medium of claim 11 , wherein the high-level programming language comprises a hybrid language that supports both procedural programming and object-oriented programming.

17. The non-transitory computer-readable medium of claim 16 , wherein the hybrid language is C++.

18. The non-transitory computer-readable medium of claim 11 , wherein the network device comprises any or a combination of a gateway device, a network controller device, a firewall, a router, a unified threat management (UTM) appliance, an Intrusion Prevention System (IPS), an Intrusion Detection System (IDS), a Distributed Denial of Service (DDoS) prevention device, and a software defined networking security device.

19. A system comprising:

a processing resource; and

a non-transitory computer-readable medium, coupled to the processing resource, having stored therein instructions that when executed by the processing resource cause the processing resource to perform a method comprising:

receiving source code in a form of a domain-specific language, wherein the domain-specific language describes a slow-path task that is to be performed by a network device, and wherein the source code includes a first portion and a second portion;

determining a first processor type and a general purpose processor that are available within the network device to implement the slow-path task, and that a second processor type is not available within the network device to implement the slow-path task;

for the first portion of the source code:

determining that the first processor type is better suited to the first portion than the general purpose processor;

based at least in part on the determination that the first processor type is available within the network device, generating executable code targeting the first processor type based on the first portion of the source code; and

for the second portion of the source code:

determining that the second processor type is better suited to the second portion than the general purpose processor;

based at least in part on the determination that the second processor type is not available within the network device, generating intermediate code, in a form of a high-level programming language, targeting the general purpose processor available within the network device based on the second portion of the source code.

20. The system of claim 19 , wherein the first processor type is a network processor, and wherein said generating executable code targeting the first processor type comprises:

compiling the first portion of the source code into an intermediate representation; and

generating binary code targeting the network processor by compiling the intermediate representation.

21. The system of claim 19 , wherein the high-level programming language comprises a procedural programming language.

22. The system of claim 19 , wherein the network device comprises any or a combination of a gateway device, a network controller device, a firewall, a router, a unified threat management (UTM) appliance, an Intrusion Prevention System (IPS), an Intrusion Detection System (IDS), a Distributed Denial of Service (DDoS) prevention device, and a software defined networking security device.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 18, 2020
From: GUO, ZHI; CORTES, JOHN; WANG, HAO
To: FORTINET, INC.
Reel/Frame 052692/0332 →
Continuity (1)
Related Publication 20210357194A1 · Nov 18, 2021
Cited By (1)
US 12,356,207