SlideShare a Scribd company logo
1 of 3
Download to read offline
IXP1200中微 引擎和 StrongArm 通信 的技术 
王永革 
(河南省 鹤壁 市广播 电视发射 中心 鹤壁 458000) 
钟 声 
(解放军信 息工程大学计算机科学与技 术系 郑州 450002) 
摘 要 本文首先讲述了在运行 VxWorks操作系统的 IXP1200平台上进行开发的典型软件和硬件配 
置环境 。然后详细描述 了 StrongAITI1和微引擎间的通道技术 。 
关键词 VxWorks  IXP1200 微引擎 StrongAITI1 PETH 
网络 处理器 (Network Processor,NP)被 认为 
是推动下一代网络发展的一项核心技术 ,开始受到 
业界越来越多 的关 注。Intel IXP1200系列是 Intel公 
司推出的采用 IXA框架的核心产品。该产 品以其高 
性价 比成为 国 内和 国外众 多 网络 产 品开发商 的首 
选 ,尤其是 在路 由器 、防火墙 等方 面的研究 和开 
发。Intel IXP1200网络处理器在结构上分为控制 和 
数据 两个 平面 ,控 制平 面是一个 StrongArill核 ,主 
要是负责维护系统信息和协调处理部分工作 ,数据 
平面则是 由多个微 引擎 (Microengine)和其他专用 
硬件 组成 ,负 责利用 数据平 面下 发的微 代码和命 
令 ,直接处理 网络 数据 。StrongArm核上通 常运 行 
VxWorks操作系统 。VxWorks是美国风河公司开发 
的具有工业领 导地位的高性能实时操作 系统 内核 , 
具有先进的网络功能 。 
1  StrongArm 核 的软件 库 
StrongArm核 的软件库 是模块化 的用 于广泛 的 
配置 。从最小 的 IXP1200芯片支持到整个 网络协议 
栈 的支持 。它主要包括下述必需 的模块 。 
Chip/Board Support Package(BSP):每一 种 操 
作系统都需要用相应 的 BSP程序。它的作用就是在 
通 电后初始化硬件 、硬件时钟与定时管理 、局部和 
总线内存空间的映射 、内存 大小定义 ,等等 。 
操作系统:现在可选的操作系统是 Vxworks威 
者是其他的嵌入式操作 系统 。它 自带 的库文件包括 
最小 的常用 的系统 API函数 ,包括信号量 、线程 和 
系统时钟调用 。 
ISR(Interrupt Service Routine):这个底层 的例 
程负责快速处理来 自PCI、IX总线设备和微 引擎 的 
中断并调用相应的设备处理程序。 
2  StrongArm 上的开发 
VxWorks操 作 系 统 是 美 国 WindRiver公 司 于 
1983年 设 计 开 发 的 一 种 嵌 入 式 实 时 操 作 系 统 
(RTOS),是 目前世界 上用户数量最 大的实时操作 
系统。它具有高度可剪裁的微 内核结构 ,高效的具 
有 256个优先级的多任务调度 ,灵活的任务间通信 
手段 ,快速灵活 的 I/O系统 ,确定 的微秒级 中断延 
迟时间等优点。 
Intel IXP1200 的 StrongArm 核 上 可 以 运 行 
VxWorks操作系统 ,并且 Intel的参考设计 中提供 了 
支 持 VxWorks操 作 系 统 的 BSP程 序 包 。 因此 在 
StrongArill核 上 运 行 Vxworks操 作 系 统 成 为 
IXP1200开发的主流。 
2.1  开发环境设置 
图 1描 述 了 在 运 行 VxWorks操 作 系 统 的 
IXP1200平 台上进行开发的典型软件和硬件 配置环 
境 。一 个 开 发 主 机 (我 们 称 为 宿 主 机 )提 供 
IXP1200开发平 台 (典型 的是 Intel提供 的微引擎上 
的 开 发 平 台 workbench)和 StrongARM 开 发 系 统 
(典型的是 WindRiver的 Tornado II)用户接 口。 宿 
主机和 目标机器可 以通过以太 网进行连接 ,也可以 
通过串 口进行连接 。另外在宿主机上可通过 串口连 
£ 强  重 DA 私 C021,ZI/UNIC,I1"2"085"8 0 V 绷 N o.I1 
维普资讯 http://www.cqvip.com
 
开发 主机 
(Host Development System)  目标 机 
(TargetSystem) 
图 1  Tornado II开发调试环境协议框 图 
接 ,通过超级终端监视 目标机的输入、输出信息。 
1.宿主机 
开发机器 (编辑 器 、编译器 、调试器 、… ), 
在这里采用的是 WindRiver公司的开发工具 Tornado 
2.0 。 
2.目标机 
程序运行的机器 ,例如 Intel IXP1200 EVB。 
2.2 两个主要协议 
WTX (Wind RiverTool eXchange)协议 :用 于 
开发机内部 Tornado工具 与 Target Server之间通信 。 
WDB (Wind DeBug)协 议 :用 于 主 机 Target 
Server与 目标机之间的通信。 
3 微引擎和 ARM核间的通信 
伪 以太 网驱 动 (PETH)是 IXP1200以太 网评 
估 系统参考设计 中提供 的一种微引擎和 ARM核 间 
的通信方式 。当然用户也可以扩展该设计或者 自定 
义一个微 引擎 和 ARM 核间的通信模 式 。下面将就 
这种通信方式进行描述。 
PETH使得 IXP1200的每个 以太 网端 口被看作 
是 VxWorks内核 的一个 以太 网设备 。 由微 引擎排 
队 ,对应一个特定 的 “ARM core”端 口的数据包被 
PETH驱动器接收并传递给操作系统内核。这些数 
据包通过标 准的 sockets或别 的 API接 口依 次传 递 
给用户空间的程序 。由用户应用程序或 VxWorks内 
核产生的数据包 (例 如 ICMP包 )传递 给 PETH驱 
动器 ,然后在微 引擎的适 当的发送队列 中排队。 
图 2是运行了 PETH驱动器 的 IXP1200评估系 
统 。微引擎运行 Intel提供 的参考设计。在发送端 , 
每个 PETH实例对每个端 口把将要输 出的数据包在 
现存 的输出队列中排 队。在接收方 ,做 了两个小变 
化 ,首先一个特殊 的端 口 (port 18)被生成 ,代表 
“内核”。当微引擎发送一个数据包给一个 PETH实 
例并进一步发送给 VxWorks网络堆栈 ,微引擎接收 
在 port 18使用未修 改 的排 队操作 。其次 ,接收代 
码被修改 以传送本地绑定的数据包给 port 18。 
在运行 VxWorks的 ARM核 中 ,多个 PETH驱 
动器 的实例被生成 ,每个实例对应一个 IXP1200以 
太 网端 口。每个实例绑定在一个端 口上并仅从 自己 
的端 口收发数据包。每个 PETH实例在适 当的发送 
队列将要发送的数据包进行排队 ,但是输入 的数据 
包都在 port 18排队。考虑到每个 PETH实例只接收 
到达 与 自己相关端 口的数 据包 ,一个 PETH去复用 
器 (demux)是必须 的。demux从 port 18的输入 队 
列中提取数据包 ,把它们分发 到适 当的 PETH驱动 
器 实例 。图 2也显 示 了 demux正被用 为一个 轮询 
器 。最后 ,图 2显示每个 PETH实例都与操作 系统 
的 内核交互 。这是通 过标 准的驱动器接 口实现的。 
孛 罾 数 据 通 售 ∞∞ .11 
45。 
维普资讯 http://www.cqvip.com
 
StrongArm Core 
Standard applications(socket-baseAetc) 
VxW orks Kernel(TCP/IP stack+netTask) 
t 1‘『  t '‘r  t 1‘r PETH driver  PETH driver  PETH driver 
instance 1  installce2  instance n 
●____一  
、  
・..——, 。、 
PETH poller  \  
demIlx 
里  盲… Existing Microengine 
ReeeiveThreads  Existing Microengine 
—
Mustaddacheckforlocal  Tran smitThreads 
MAC and1Paddress  Packets will be enqueued 
-
Pass matching packets up  directly on tran smit queues 
totheStroagA ̄ Core 
M icreengincs 
图 2 采 用 PETHdriver的 IXP1200 EVB板 的整 体架构 
VxWorks内核不能分辨 出 PETH设备与另一个 更加 
传统的以太 网控制器的区别。 
关于 PETH的所有例程都在文件 OctalMAC一 
21440/PseudoDrvEnd.cpp内。 
3.1  驱动器初始化 
所有的 PETH组件 (driver instances、poller/ 
demux)都是在 NetApp_Init(){app1200/net_app.cppl 
说 明的。 
3.2 接收例程 
每次一个新来 的数据包在 port 18解除排 队时 , 
PETH demux调度例程 pethRecv()。pethRecv()例 
程需要两个参数 ,一个是针对 PETH驱动器实例 的 
驱动器数据 结构 ,其 次是数据包 
描述符。驱 动器控制数据结构提 
供对共享存储 池的访 问 ,包描述 
符则提供对 实际的数据包数据及 
数据包信 息的访问。接 收例程从 
共享 的存储 池中分配一个簇 (存 
储 器 的一块 ),将数 据包拷 贝到 
簇 中,再将数据包传递给 kernel。 
3.3 数据包发送 
数据包的发送 由下面的步骤 
组成 : 
(1)一个 VxWorks应 用程 
序或 kernel本身决定须在一个特 
定的接 口发送数据包 。 
(2)在驱 动器初 始化过 程 
中 在 kernel中 登 记 的 pethSend 
()例程 被 kernel调用 发送数 据 
包 。pethSend()的参数包 括驱 
动器 控 制 结 构 和要 发 送 的数 据 
包 ,发送例程分配一个新的包 描 
述符 ,并根据新分配 的包描述符 
把将要发送 的数据包拷贝到适 当 
的位置 ,在适 当的端 口发送 队列 
排队。最后 ,pethSend()通知微引擎有新的数据包 
到达。 
(3)微 引擎参考设计将要 发送的数据包解除 
排队并发送 出去 。 
4 结束语 
本文主要介绍的是在运行 VxWorks操作 系统的 
IXP1200开发板 中实现微 引擎 和 StrongAriB间通 信 
的技术 。当然 ,用户还可 以选择其他的嵌入式操作 
系统在 StrongArib上运行 ,本文 中提到的通道技术 
思想也可 以应用到其他操作系统平台。 
参 考 文 献 
【1】Tornado User’S Guide 1.0.WindRiver Systems Inc,January 1996 
【2】VxWorks Programmer's Guide 5.3.1.WindRiver Systems Inc,March 1997 
【3】IXP1200HardwareReferenceManua1.IntelCorporation,December2001 
[41 IXPI200 Microcode Software Reference Manua1.Intel Corporation,September 2001。 
【5]5 孔祥营 ,柏桂枝编 著 .嵌 入式 实时操作系统 VxWorks及其开发环境 Tornado 
I  N O V 嬲 肋 .11 
维普资讯 http://www.cqvip.com

More Related Content

Featured

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Ixp1200中微引擎和strong arm通信的技术

  • 1. IXP1200中微 引擎和 StrongArm 通信 的技术  王永革  (河南省 鹤壁 市广播 电视发射 中心 鹤壁 458000)  钟 声  (解放军信 息工程大学计算机科学与技 术系 郑州 450002)  摘 要 本文首先讲述了在运行 VxWorks操作系统的 IXP1200平台上进行开发的典型软件和硬件配  置环境 。然后详细描述 了 StrongAITI1和微引擎间的通道技术 。  关键词 VxWorks  IXP1200 微引擎 StrongAITI1 PETH  网络 处理器 (Network Processor,NP)被 认为  是推动下一代网络发展的一项核心技术 ,开始受到  业界越来越多 的关 注。Intel IXP1200系列是 Intel公  司推出的采用 IXA框架的核心产品。该产 品以其高  性价 比成为 国 内和 国外众 多 网络 产 品开发商 的首  选 ,尤其是 在路 由器 、防火墙 等方 面的研究 和开  发。Intel IXP1200网络处理器在结构上分为控制 和  数据 两个 平面 ,控 制平 面是一个 StrongArill核 ,主  要是负责维护系统信息和协调处理部分工作 ,数据  平面则是 由多个微 引擎 (Microengine)和其他专用  硬件 组成 ,负 责利用 数据平 面下 发的微 代码和命  令 ,直接处理 网络 数据 。StrongArm核上通 常运 行  VxWorks操作系统 。VxWorks是美国风河公司开发  的具有工业领 导地位的高性能实时操作 系统 内核 ,  具有先进的网络功能 。  1  StrongArm 核 的软件 库  StrongArm核 的软件库 是模块化 的用 于广泛 的  配置 。从最小 的 IXP1200芯片支持到整个 网络协议  栈 的支持 。它主要包括下述必需 的模块 。  Chip/Board Support Package(BSP):每一 种 操  作系统都需要用相应 的 BSP程序。它的作用就是在  通 电后初始化硬件 、硬件时钟与定时管理 、局部和  总线内存空间的映射 、内存 大小定义 ,等等 。  操作系统:现在可选的操作系统是 Vxworks威  者是其他的嵌入式操作 系统 。它 自带 的库文件包括  最小 的常用 的系统 API函数 ,包括信号量 、线程 和  系统时钟调用 。  ISR(Interrupt Service Routine):这个底层 的例  程负责快速处理来 自PCI、IX总线设备和微 引擎 的  中断并调用相应的设备处理程序。  2  StrongArm 上的开发  VxWorks操 作 系 统 是 美 国 WindRiver公 司 于  1983年 设 计 开 发 的 一 种 嵌 入 式 实 时 操 作 系 统  (RTOS),是 目前世界 上用户数量最 大的实时操作  系统。它具有高度可剪裁的微 内核结构 ,高效的具  有 256个优先级的多任务调度 ,灵活的任务间通信  手段 ,快速灵活 的 I/O系统 ,确定 的微秒级 中断延  迟时间等优点。  Intel IXP1200 的 StrongArm 核 上 可 以 运 行  VxWorks操作系统 ,并且 Intel的参考设计 中提供 了  支 持 VxWorks操 作 系 统 的 BSP程 序 包 。 因此 在  StrongArill核 上 运 行 Vxworks操 作 系 统 成 为  IXP1200开发的主流。  2.1  开发环境设置  图 1描 述 了 在 运 行 VxWorks操 作 系 统 的  IXP1200平 台上进行开发的典型软件和硬件 配置环  境 。一 个 开 发 主 机 (我 们 称 为 宿 主 机 )提 供  IXP1200开发平 台 (典型 的是 Intel提供 的微引擎上  的 开 发 平 台 workbench)和 StrongARM 开 发 系 统  (典型的是 WindRiver的 Tornado II)用户接 口。 宿  主机和 目标机器可 以通过以太 网进行连接 ,也可以  通过串 口进行连接 。另外在宿主机上可通过 串口连  £ 强  重 DA 私 C021,ZI/UNIC,I1"2"085"8 0 V 绷 N o.I1  维普资讯 http://www.cqvip.com
  • 2.   开发 主机  (Host Development System)  目标 机  (TargetSystem)  图 1  Tornado II开发调试环境协议框 图  接 ,通过超级终端监视 目标机的输入、输出信息。  1.宿主机  开发机器 (编辑 器 、编译器 、调试器 、… ),  在这里采用的是 WindRiver公司的开发工具 Tornado  2.0 。  2.目标机  程序运行的机器 ,例如 Intel IXP1200 EVB。  2.2 两个主要协议  WTX (Wind RiverTool eXchange)协议 :用 于  开发机内部 Tornado工具 与 Target Server之间通信 。  WDB (Wind DeBug)协 议 :用 于 主 机 Target  Server与 目标机之间的通信。  3 微引擎和 ARM核间的通信  伪 以太 网驱 动 (PETH)是 IXP1200以太 网评  估 系统参考设计 中提供 的一种微引擎和 ARM核 间  的通信方式 。当然用户也可以扩展该设计或者 自定  义一个微 引擎 和 ARM 核间的通信模 式 。下面将就  这种通信方式进行描述。  PETH使得 IXP1200的每个 以太 网端 口被看作  是 VxWorks内核 的一个 以太 网设备 。 由微 引擎排  队 ,对应一个特定 的 “ARM core”端 口的数据包被  PETH驱动器接收并传递给操作系统内核。这些数  据包通过标 准的 sockets或别 的 API接 口依 次传 递  给用户空间的程序 。由用户应用程序或 VxWorks内  核产生的数据包 (例 如 ICMP包 )传递 给 PETH驱  动器 ,然后在微 引擎的适 当的发送队列 中排队。  图 2是运行了 PETH驱动器 的 IXP1200评估系  统 。微引擎运行 Intel提供 的参考设计。在发送端 ,  每个 PETH实例对每个端 口把将要输 出的数据包在  现存 的输出队列中排 队。在接收方 ,做 了两个小变  化 ,首先一个特殊 的端 口 (port 18)被生成 ,代表  “内核”。当微引擎发送一个数据包给一个 PETH实  例并进一步发送给 VxWorks网络堆栈 ,微引擎接收  在 port 18使用未修 改 的排 队操作 。其次 ,接收代  码被修改 以传送本地绑定的数据包给 port 18。  在运行 VxWorks的 ARM核 中 ,多个 PETH驱  动器 的实例被生成 ,每个实例对应一个 IXP1200以  太 网端 口。每个实例绑定在一个端 口上并仅从 自己  的端 口收发数据包。每个 PETH实例在适 当的发送  队列将要发送的数据包进行排队 ,但是输入 的数据  包都在 port 18排队。考虑到每个 PETH实例只接收  到达 与 自己相关端 口的数 据包 ,一个 PETH去复用  器 (demux)是必须 的。demux从 port 18的输入 队  列中提取数据包 ,把它们分发 到适 当的 PETH驱动  器 实例 。图 2也显 示 了 demux正被用 为一个 轮询  器 。最后 ,图 2显示每个 PETH实例都与操作 系统  的 内核交互 。这是通 过标 准的驱动器接 口实现的。  孛 罾 数 据 通 售 ∞∞ .11  45。  维普资讯 http://www.cqvip.com
  • 3.   StrongArm Core  Standard applications(socket-baseAetc)  VxW orks Kernel(TCP/IP stack+netTask)  t 1‘『  t '‘r  t 1‘r PETH driver  PETH driver  PETH driver  instance 1  installce2  instance n  ●____一   、   ・..——, 。、  PETH poller  \   demIlx  里  盲… Existing Microengine  ReeeiveThreads  Existing Microengine  — Mustaddacheckforlocal  Tran smitThreads  MAC and1Paddress  Packets will be enqueued  - Pass matching packets up  directly on tran smit queues  totheStroagA ̄ Core  M icreengincs  图 2 采 用 PETHdriver的 IXP1200 EVB板 的整 体架构  VxWorks内核不能分辨 出 PETH设备与另一个 更加  传统的以太 网控制器的区别。  关于 PETH的所有例程都在文件 OctalMAC一  21440/PseudoDrvEnd.cpp内。  3.1  驱动器初始化  所有的 PETH组件 (driver instances、poller/  demux)都是在 NetApp_Init(){app1200/net_app.cppl  说 明的。  3.2 接收例程  每次一个新来 的数据包在 port 18解除排 队时 ,  PETH demux调度例程 pethRecv()。pethRecv()例  程需要两个参数 ,一个是针对 PETH驱动器实例 的  驱动器数据 结构 ,其 次是数据包  描述符。驱 动器控制数据结构提  供对共享存储 池的访 问 ,包描述  符则提供对 实际的数据包数据及  数据包信 息的访问。接 收例程从  共享 的存储 池中分配一个簇 (存  储 器 的一块 ),将数 据包拷 贝到  簇 中,再将数据包传递给 kernel。  3.3 数据包发送  数据包的发送 由下面的步骤  组成 :  (1)一个 VxWorks应 用程  序或 kernel本身决定须在一个特  定的接 口发送数据包 。  (2)在驱 动器初 始化过 程  中 在 kernel中 登 记 的 pethSend  ()例程 被 kernel调用 发送数 据  包 。pethSend()的参数包 括驱  动器 控 制 结 构 和要 发 送 的数 据  包 ,发送例程分配一个新的包 描  述符 ,并根据新分配 的包描述符  把将要发送 的数据包拷贝到适 当  的位置 ,在适 当的端 口发送 队列  排队。最后 ,pethSend()通知微引擎有新的数据包  到达。  (3)微 引擎参考设计将要 发送的数据包解除  排队并发送 出去 。  4 结束语  本文主要介绍的是在运行 VxWorks操作 系统的  IXP1200开发板 中实现微 引擎 和 StrongAriB间通 信  的技术 。当然 ,用户还可 以选择其他的嵌入式操作  系统在 StrongArib上运行 ,本文 中提到的通道技术  思想也可 以应用到其他操作系统平台。  参 考 文 献  【1】Tornado User’S Guide 1.0.WindRiver Systems Inc,January 1996  【2】VxWorks Programmer's Guide 5.3.1.WindRiver Systems Inc,March 1997  【3】IXP1200HardwareReferenceManua1.IntelCorporation,December2001  [41 IXPI200 Microcode Software Reference Manua1.Intel Corporation,September 2001。  【5]5 孔祥营 ,柏桂枝编 著 .嵌 入式 实时操作系统 VxWorks及其开发环境 Tornado  I  N O V 嬲 肋 .11  维普资讯 http://www.cqvip.com