Sharing Memory Sharing Memory 1/10 - 2004 INF5060: Multimedia data communication using network processors.

Slides:



Advertisements
Similar presentations
Introduction to Sockets Jan Why do we need sockets? Provides an abstraction for interprocess communication.
Advertisements

Socket Programming CS3320 Fall 2010.
Dynamic Allocation and Linked Lists. Dynamic memory allocation in C C uses the functions malloc() and free() to implement dynamic allocation. malloc is.
CS 11 C track: lecture 7 Last week: structs, typedef, linked lists This week: hash tables more on the C preprocessor extern const.
USERSPACE I/O Reporter: R 張凱富.
Things to Remember When Developing 64-bit Software OOO "Program Verification Systems"
R4 Dynamically loading processes. Overview R4 is closely related to R3, much of what you have written for R3 applies to R4 In R3, we executed procedures.
CS 450 Module R3. Next Week R2 is due next Friday ▫Make sure to correct all errors with R1 ▫Correct errors in the documentation as well, it will be checked.
C Structures Basics of structures Typedef. Data Hierarchy Byte –8 bits (ASCII character ‘A’ = ) Field –Group of characters (character string “Fred”)
1 SS and Pipelining: The Sequel Data Forwarding Caches Branch Prediction Michele Co, September 24, 2001.
Unions The storage referenced by a union variable can hold data of different types subject to the restriction that at any one time, the storage holds data.
Programming with UDP – I Covered Subjects: IPv4 Socket Address Structure Byte Ordering Functions Address Access/Conversion Functions Functions: 1.socket()
Assembly Code Example Selection Sort.
Pointers in C Rohit Khokher
SPLINT STATIC CHECKING TOOL Sripriya Subramanian 10/29/2002.
Programming III SPRING 2015 School of Computer and Information Sciences Francisco R. Ortega, Ph.D. McKnight Fellow and GAANN Fellow LECTURE #3 Control.
IXP: Bump in the Wire IXP: Bump in the Wire INF5063: Programming Asymmetric Multi-Core Processors 15 April 2015.
A First Example: The Bump in the Wire A First Example: The Bump in the Wire 9/ INF5061: Multimedia data communication using network processors.
A First Example: The Bump in the Wire A First Example: The Bump in the Wire 8/ INF5062: Programming Asymmetric Multi-Core Processors.
Discussion: The Web Bumper Code Discussion: The Web Bumper Code 17/ INF5060: Multimedia data communication using network processors.
IXP: The Bump in the Wire IXP: The Bump in the Wire INF5062: Programming Asymmetric Multi-Core Processors 22 April 2015.
Memory allocation CSE 2451 Matt Boggus. sizeof The sizeof unary operator will return the number of bytes reserved for a variable or data type. Determine:
IXP1200 Microengines Apparao Kodavanti Srinivasa Guntupalli.
Performance Analysis of the IXP1200 Network Processor Rajesh Krishna Balan and Urs Hengartner.
Shyamal Pandya Implementation of Network Processor Packet Filtering and Parameterization for Higher Performance Network Processors 1 Implementation of.
ECE 526 – Network Processing Systems Design IXP XScale and Microengines Chapter 18 & 19: D. E. Comer.
Imperative Programming. Heart of program is assignment statements Aware that memory contains instructions and data values Commands: variable declarations,
Paper Review Building a Robust Software-based Router Using Network Processors.
Porting Charm++ to a New System Writing a Machine Layer Sayantan Chakravorty 5/01/20081Parallel Programming Laboratory.
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
LWIP TCP/IP Stack 김백규.
ACE Address Configuration Executive. Why ACE? ACE provides access to several address resolution protocols under a single API ACE is the only API available.
Server Sockets: A server socket listens on a given port Many different clients may be connecting to that port Ideally, you would like a separate file descriptor.
Introduction to Data Structures Systems Programming.
Chapter 0.2 – Pointers and Memory. Type Specifiers  const  may be initialised but not used in any subsequent assignment  common and useful  volatile.
Offloading Multimedia Proxies using Network Processors A presentation by Øyvind Hvamstad 19. Nov
Ethernet Driver Changes for NET+OS V5.1. Design Changes Resides in bsp\devices\ethernet directory. Source code broken into more C files. Native driver.
Memory Memory 10/ INF5060: Multimedia data communication using network processors.
Dynamic Memory Allocation. Domain A subset of the total domain name space. A domain represents a level of the hierarchy in the Domain Name Space, and.
ACEs ACEs 24/ INF5060: Multimedia data communication using network processors.
Lab Assignment 15/ INF5060: Multimedia data communication using network processors.
Finding Memory Leaks. The new operator and operator new When allocating memory using new, e.g. –Student *ps = new Student(“Yossi Cohen”); –int *pi = new.
ARP ARP 8/ INF5060: Multimedia data communication using network processors.
1 Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani Lecture 3: Sockets.
(language, compilation and debugging) David 09/16/2011.
Socket Programming Tutorial Department of Computer Science Southern Illinois University Edwardsville Fall, 2015 Dr. Hiroshi Fujinoki
 Structures are like arrays except that they allow many variables of different types grouped together under the same name. For example you can create.
Introduction to Computer Organization & Systems Topics: C arrays C pointers COMP Spring 2014 C Part IV.
1 / 28 Multi-OS Project National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu Presenter: Tang-Hsun Tu How to work with.
How to write a MSGQ Transport (MQT) Overview Nov 29, 2005 Todd Mullanix.
 Program Abstractions  Concepts  ACE Structure.
Lecture 18 CIS 208 Wednesday, March 30, Test2 April 15 th : Happy Tax day. Review: Wednesday, the 13 th.
ECE 526 – Network Processing Systems Design Microengine Programming Chapter 23: D. E. Comer.
ECE 526 – Network Processing Systems Design Programming Model Chapter 21: D. E. Comer.
Imperative Programming C. Imperative Programming Heart of program is assignment statements Aware that memory contains instructions and data values Commands:
1 Socket Interface. 2 Basic Sockets API Review Socket Library TCPUDP IP EthernetPPP ARP DHCP, Mail, WWW, TELNET, FTP... Network cardCom Layer 4 / Transport.
Ex-1 #include <stdio.h> struct sample { int a=0; char b='A';
Function: Declaration
Introduction to Programming
C Basics.
ONL NP Router Plugins Shakir James, Charlie Wiseman, Ken Wong, John DeHart {scj1, cgw1, kenw,
Memory Management III: Perils and pitfalls Mar 13, 2001
Running A First Example: The Web Bumper
Code Review for IPv4 Metarouter Header Format
Code Review for IPv4 Metarouter Header Format
Apparao Kodavanti Srinivasa Guntupalli
Programming in C Miscellaneous Topics.
Programming in C Miscellaneous Topics.
Programming Language C Language.
Low-Level Thread Dispatching on the x86
Presentation transcript:

Sharing Memory Sharing Memory 1/ INF5060: Multimedia data communication using network processors

2004 Carsten Griwodz & Pål HalvorsenINF5060 – multimedia communication using network processors Resource Manager  Task  Used by StrongARM code  For microACEs and microACE applications to interface with microengines  API  Initialize and configure IXP1200  Send and receive packets to and from microcode blocks  Load code into microengines  Get/set microengine configuration and resource assignment  Enable/disable microengines  Allocate and access uncached SRAM, SDRAM and Scratch memory  Create and statically bind microACEs

2004 Carsten Griwodz & Pål HalvorsenINF5060 – multimedia communication using network processors Resource Manager  Data structures  RmMemoryHandle  Opaque handle identifying memory allocated by the resource manager  typedef int RmMemoryHandle  RmImportedSymbol  Structured used to patch microcode symbols  typedef struct { int meNumber; char name[MAX_SIZE_OF_IMPORTED_SYMBOL]; int value; } RmImportedSymbol;

2004 Carsten Griwodz & Pål HalvorsenINF5060 – multimedia communication using network processors Resource Manager  RmUengPatchSymbols  A function call that patches an array of variables to the StrongARM side into the microcode running on one microengine.  ix_error RmUengPatchSymbols( int uengNumber, RmImportedSymbol symbols[], int numberOfSymbols );

2004 Carsten Griwodz & Pål HalvorsenINF5060 – multimedia communication using network processors wwbump Using ExceptionsUsing Shared Memory

2004 Carsten Griwodz & Pål HalvorsenINF5060 – multimedia communication using network processors wwbump_import.h #ifndef _WWBUMP_IMPORT_H #define _WWBUMP_IMPORT_H #ifdef MICROCODE.import_var WWBUMP_TAG #else #define WWBUMP_TAG_STR "WWBUMP_TAG" #endif #endif /* _WWBUMP_IMPORT_H */ #ifndef _WWBUMP_IMPORT_H #define _WWBUMP_IMPORT_H #ifdef MICROCODE.import_var WWBUMP_TAG.import_var PKTCNT_ADDR #else #define WWBUMP_TAG_STR "WWBUMP_TAG" #define PCADDR_STR "PKTCNT_ADDR" #endif #endif /* _WWBUMP_IMPORT_H */

2004 Carsten Griwodz & Pål HalvorsenINF5060 – multimedia communication using network processors wwbcc.h #ifndef __CC_H #define __CC_H #include "wwbump_sk_c.h" #include "wwbump_cc_c.h" ix_error getcnt(ix_base_t* bp,long* rv); ix_error cc_init(struct wwbump *wwb); ix_error cc_fini(struct wwbump *wwb); extern long Webcnt; #endif /* __CC_H */ #ifndef __CC_H #define __CC_H #include #include "wwbump_sk_c.h" #include "wwbump_cc_c.h" ix_error getcnt(ix_base_t* bp,long* rv); ix_error cc_init(struct wwbump *wwb); ix_error cc_fini(struct wwbump *wwb); extern unsigned int Webcnt; #endif /* __CC_H */

2004 Carsten Griwodz & Pål HalvorsenINF5060 – multimedia communication using network processors #include #include "wwbump_sk_c.h" #include "wwbump_cc_c.h" unsigned int Webcnt; unsigned char *Sptr; ix_error cc_init(struct wwbump *wwb) { CC_VMT_wwbump *vmt = 0; ix_cap *capp; ix_error e; RmImportedSymbol sym; int i; wwbcc.c #include #include "wwbump_sk_c.h" #include "wwbump_cc_c.h" long Webcnt; ix_error cc_init(struct wwbump *wwb) { CC_VMT_wwbump *vmt = 0; ix_cap *capp; ix_error e;

2004 Carsten Griwodz & Pål HalvorsenINF5060 – multimedia communication using network processors wwbcc.c /* nothing here */ e = RmMalloc(RM_SCRATCH, &Sptr, 1); if ( e ) … e = RmGetPhysOffset(RM_SCRATCH, Sptr, &Webcnt); if ( e ) … e = RmWrite(RM_SCRATCH, Webcnt, 0, 0); if ( e ) … for ( i = 0 ; i < 5 ; ++i ) { if ( (1 ue ) { sym.meNumber = i; strncpy(sym.name, PCADDR_STR, MAX_SIZE_OF_IMPORTED_SYMBOL); sym.name[MAX_SIZE_OF_IMPORTED_SYMBOL - 1] = '\0'; sym.value = Webcnt; e = RmUengPatchSymbols(i, &sym, 1); if ( e ) … }

2004 Carsten Griwodz & Pål HalvorsenINF5060 – multimedia communication using network processors wwbcc.c memset(&wwb->ccbase, 0, sizeof(wwb->ccbase)); ix_ace_to_cap(&wwb->ace, &capp); e = sk_wwbump_init(&wwb->ccbase, capp); if (e) … e = getCCVMT_wwbump(&wwb->ccbase, &vmt); if (e) … vmt->_pCC_wwbump_getcnt = getcnt; Webcnt = 0; return 0; } memset(&wwb->ccbase, 0, sizeof(wwb->ccbase)); ix_ace_to_cap(&wwb->ace, &capp); e = sk_wwbump_init(&wwb->ccbase, capp); if (e) … e = getCCVMT_wwbump(&wwb->ccbase, &vmt); if (e) … vmt->_pCC_wwbump_getcnt = getcnt; return 0; }

2004 Carsten Griwodz & Pål HalvorsenINF5060 – multimedia communication using network processors wwbcc.c ix_error cc_fini(struct wwbump *wwb) { ix_error e; e = sk_wwbump_fini(&wwb->ccbase); if ( e ) … return 0; } ix_error getcnt(ix_base_t* bp, long* rv) { (void)bp; *rv = Webcnt; return 0; } ix_error cc_fini(struct wwbump *wwb) { ix_error e; e = sk_wwbump_fini(&wwb->ccbase); if ( e ) … e = RmFree(Sptr); if ( e ) … return 0; } ix_error getcnt(ix_base_t* bp, long* rv) { unsigned int val, dummy; ix_error e; (void)bp; e = RmRead(RM_SCRATCH, Webcnt, &val, &dummy); if ( e ) … *rv = val; return 0; }

2004 Carsten Griwodz & Pål HalvorsenINF5060 – multimedia communication using network processors WWB_dl.uc #define IX_EXCEPTION0 #define SA_CONSUME_NUM31 #define SEQNUM_IGNORE31.local dl_reg1 dl_reg2 dl_reg3 dl_reg4 dl_buffer_handle dl_next_block #include "DispatchLoop_h.uc" #include "DispatchLoopImportVars.h" #include "EthernetIngress.uc" #include "wwbump_import.h" #include "WWBump.uc" DL_Init[] EthernetIngress_Init[] WWBumpInit[].while(1) Top_Of_Loop#: DL_SASource[ ] alu[--, dl_buffer_handle, -, IX_BUFFER_NULL] br=0[Main_Dispatch#], guess_branch br[Send_MB#] #define IX_EXCEPTION0 #define SA_CONSUME_NUM31 #define SEQNUM_IGNORE31.local dl_reg1 dl_reg2 dl_reg3 dl_reg4 dl_buffer_handle dl_next_block #include "DispatchLoop_h.uc" #include "DispatchLoopImportVars.h" #include "EthernetIngress.uc" #include "wwbump_import.h" #include "WWBump.uc" DL_Init[] EthernetIngress_Init[] WWBumpInit[].local fixme immed32[fixme, WWBUMP_TAG].endlocal.while(1) Top_Of_Loop#: DL_SASource[ ] alu[--, dl_buffer_handle, -, IX_BUFFER_NULL] br=0[Main_Dispatch#], guess_branch br[Send_MB#]

2004 Carsten Griwodz & Pål HalvorsenINF5060 – multimedia communication using network processors WWB_dl.uc Main_Dispatch#: EthernetIngress[ ] alu[--, dl_buffer_handle, -, IX_BUFFER_NULL] br=0[Top_Of_Loop#] br!=byte[dl_next_block, 0, 1, Drop_Packet#] WWBump[] alu[ --, dl_next_block, -, IX_EXCEPTION] br=0[Send_SA#] br[Send_MB#] Send_SA#: DL_SASink[ ].continue Send_MB#: DL_MESink[ ] nop.continue Drop_Packet#: DL_Drop[ ].endw nop.endlocal Main_Dispatch#: EthernetIngress[ ] alu[--, dl_buffer_handle, -, IX_BUFFER_NULL] br=0[Top_Of_Loop#] br!=byte[dl_next_block, 0, 1, Drop_Packet#] WWBump[] alu[ --, dl_next_block, -, IX_EXCEPTION] br=0[Send_SA#] br[Send_MB#] Send_SA#: DL_SASink[ ].continue Send_MB#: DL_MESink[ ] nop.continue Drop_Packet#: DL_Drop[ ].endw nop.endlocal

2004 Carsten Griwodz & Pål HalvorsenINF5060 – multimedia communication using network processors WWBump.uc #define ETH_IP0x800 #define IPT_TCP6 #define TCP_WWW80 #macro WWBumpInit[] #endm #macro WWBump[] xbuf_alloc[$$hdr,6].local ifn DL_GetInputPort[ifn] alu [ ifn, ifn, XOR, 1 ] DL_SetOutputPort[ifn].endlocal.local base off Buf_GetData[base, dl_buffer_handle] DL_GetBufferOffset[off] alu_shf[off, --, B, off, >>3] sdram[read, $$hdr0, base, off, 3], ctx_swap.endlocal #define ETH_IP0x800 #define IPT_TCP6 #define TCP_WWW80 #macro WWBumpInit[] #endm #macro WWBump[] xbuf_alloc[$$hdr,6].local ifn DL_GetInputPort[ifn] alu [ ifn, ifn, XOR, 1 ] DL_SetOutputPort[ifn].endlocal.local base off Buf_GetData[base, dl_buffer_handle] DL_GetBufferOffset[off] alu_shf[off, --, B, off, >>3] sdram[read, $$hdr0, base, off, 3], ctx_swap.endlocal

2004 Carsten Griwodz & Pål HalvorsenINF5060 – multimedia communication using network processors WWBump.uc.local etype immed[etype, ETH_IP] alu_shf[ --, etype, -, $$hdr3, >>16] br!=0[NotWeb#].endlocal br!=byte[$$hdr5, 0, IPT_TCP, NotWeb#].local base boff dpoff dport ld_field_w_clr[dpoff, 0001, $$hdr3, >>6].local mask immed[mask, 0x3c] alu [dpoff, dpoff,AND,mask ].endlocal alu[dpoff, dpoff, +, 16] Buf_GetData[base, dl_buffer_handle] DL_GetBufferOffset[boff] alu[boff, boff, +, dpoff] alu_shf[boff, --, B, boff, >>3] sdram[read, $$hdr0, base, boff, 1], ctx_swap.local etype immed[etype, ETH_IP] alu_shf[ --, etype, -, $$hdr3, >>16] br!=0[NotWeb#].endlocal br!=byte[$$hdr5, 0, IPT_TCP, NotWeb#].local base boff dpoff dport ld_field_w_clr[dpoff, 0001, $$hdr3, >>6].local mask immed[mask, 0x3c] alu [ dpoff, dpoff,AND,mask ].endlocal alu[dpoff, dpoff, +, 16] Buf_GetData[base, dl_buffer_handle] DL_GetBufferOffset[boff] alu[boff, boff, +, dpoff] alu_shf[boff, --, B, boff, >>3] sdram[read, $$hdr0, base, boff, 1], ctx_swap

2004 Carsten Griwodz & Pål HalvorsenINF5060 – multimedia communication using network processors WWBump.uc alu[ dpoff, dpoff, AND, 0x7 ] alu[ --, dpoff, -, 4] br>=0[SecondWord#] FirstWord#: ld_field_w_clr[dport, 0011, $$hdr0, >>16] br[GotDstPort#] SecondWord#: ld_field_w_clr[dport, 0011, $$hdr1, >>16] GotDstPort#:.local wprt immed[wprt, TCP_WWW] alu[--, dport, -, wprt] br!=0[NotWeb#].endlocal alu[ dpoff, dpoff, AND, 0x7 ] alu[ --, dpoff, -, 4] br>=0[SecondWord#] FirstWord#: ld_field_w_clr[dport, 0011, $$hdr0, >>16] br[GotDstPort#] SecondWord#: ld_field_w_clr[dport, 0011, $$hdr1, >>16] GotDstPort#:.local wprt immed[wprt, TCP_WWW] alu[--, dport, -, wprt] br!=0[NotWeb#].endlocal

2004 Carsten Griwodz & Pål HalvorsenINF5060 – multimedia communication using network processors WWBump.uc IsWeb#:.local exc immed[exc, 0] DL_SetExceptionCode[exc].endlocal.local ace_tag immed32[ace_tag, WWBUMP_TAG] DL_SetAceTag[ace_tag].endlocal immed[dl_next_block,IX_EXCEPTION] br[Finish#] NotWeb#: immed32[dl_next_block, 1] Finish#: xbuf_free[$$hdr] #endm IsWeb#:.local saddr immed32[saddr, PKTCNT_ADDR] scratch[incr, --, saddr, 0, 1].endlocal NotWeb#: immed32[dl_next_block, 1] Finish#: xbuf_free[$$hdr] #endm