CN114625475A - 基于龙芯平台的多网口扩展方法和系统 - Google Patents

基于龙芯平台的多网口扩展方法和系统 Download PDF

Info

Publication number
CN114625475A
CN114625475A CN202110693120.4A CN202110693120A CN114625475A CN 114625475 A CN114625475 A CN 114625475A CN 202110693120 A CN202110693120 A CN 202110693120A CN 114625475 A CN114625475 A CN 114625475A
Authority
CN
China
Prior art keywords
network
chip
bridge
controller
loongson
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110693120.4A
Other languages
English (en)
Other versions
CN114625475B (zh
Inventor
黄亮亮
陈立东
王遥
陆春燕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Lemote Information Technology Co ltd
Original Assignee
Jiangsu Lemote Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Lemote Information Technology Co ltd filed Critical Jiangsu Lemote Information Technology Co ltd
Priority to CN202110693120.4A priority Critical patent/CN114625475B/zh
Publication of CN114625475A publication Critical patent/CN114625475A/zh
Application granted granted Critical
Publication of CN114625475B publication Critical patent/CN114625475B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/173Interprocessor communication using an interconnection network, e.g. matrix, shuffle, pyramid, star, snowflake
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0016Inter-integrated circuit (I2C)

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Mathematical Physics (AREA)
  • Small-Scale Networks (AREA)

Abstract

本发明公开了基于龙芯平台的多网口扩展方法和系统,包括:桥片、集成在桥片上的网络控制器和连接到桥片的网络芯片构成的多网口扩展系统,以及,多网口扩展方法:S1、初始化桥片的I2C控制器;S2、将网络芯片注册为所述I2C控制器的从设备;S3、通过I2C总线对所述网络芯片进行配置;S4、网卡驱动新建虚拟phy设备;S5、将所述虚拟phy设备注册到网卡驱动。本发明用虚拟phy设备替代实际的phy设备进行网口的扩展,并将桥片和网络芯片集成在主板上,既节约了成本又节约了主板空间;通过桥片对网络芯片进行初始化和控制,也更加方便进行网络端口流量控制、网络端口管理和网口状态监控。

Description

基于龙芯平台的多网口扩展方法和系统
技术领域
本发明涉及计算机技术领域,特别是涉及基于龙芯平台的多网口扩展方法。
背景技术
网络控制器又称网卡或NIC(网络接口控制器),是一块被设计用来允许计算机在计算机网络上进行通讯的计算机硬件。由于其拥有MAC地址,因此属于OSI模型的第2层。它使得用户可以透过电缆或无线相互连接。
目前网卡主要是通过PCIE通道扩展网口,用于解决设备之间网络通信时网口缺乏的问题,常用的方案是网口直接和交换机连接,交换机再连接其他的通讯设备。但是对MAC与PHY分开的网络设备而言,需要增加单独的phy设备来实现网口的扩展,这既增加了成本,又增加了主板面积。
龙芯平台中龙芯7A桥片上集成有GMAC网络控制器,该桥片的PCIE通道有限,若通过PCIE通道扩展GMAC网络控制器的网口,则无法同时满足项目的功能多样性(PCIE通道用来扩展其他PCIE功能卡)和多网口的需求,若通过连接交换机的方式进行扩展则需要增加多个phy设备,因而,需要对现有方案进行改进。
发明内容
本发明主要解决的技术问题是提供基于龙芯平台的多网口扩展方法,以达到上述目的。
为解决上述技术问题,本发明采用的一个技术方案是:
提供基于龙芯平台的多网口扩展系统,包括:桥片、集成在桥片上的网络控制器和连接到桥片的网络芯片,所述桥片和网络芯片通过I2C总线连接和通讯,所述桥片和网络芯片集成在同一块主板上。
进一步的,所述桥片为龙芯7A桥片,所述网络控制器为龙芯7A桥片自带的GMAC网络控制器,所述网络芯片为SWITCH网络芯片,所述SWITCH网络芯片具有若干个RJ-45接口。
提供基于龙芯平台的多网口扩展方法:
S1、初始化桥片的I2C控制器;
S2、将网络芯片注册为所述I2C控制器的从设备;
S3、通过I2C总线对所述网络芯片进行配置;
S4、网卡驱动新建虚拟phy设备;
S5、将所述虚拟phy设备注册到网卡驱动。
进一步的,所述桥片上集成有网络控制器,所述网络控制器具有RGMII通讯接口。
进一步的,步骤S3还包括对所述RGMII通讯接口的port端口进行配置,所述配置包括根据网络控制器的特性设置TX和RX的延时和状态指示灯。
进一步的,步骤S4所述新建虚拟phy设备的具体步骤是:
S1、设置所述网络控制器的Link状态为连接状态;
S2、设置所述网络控制器的通讯速率为千兆速率;
S3、设置所述网络控制器通过RGMII通讯接口和网络芯片通讯,设置所述网络控制器的通讯模式为全双工。
进一步的,所述桥片为龙芯7A桥片,所述网络控制器为GMAC网络控制器,所述网卡驱动为内核GMAC网卡驱动,所述网络芯片为SWITCH网络芯片。
进一步的,步骤S5所述将虚拟phy设备注册到网卡驱动的具体步骤是:
S1、当所述RGMII通讯接口扫描网络phy的时候,将所述虚拟phy设备注册到网卡驱动;
S2、在所述网络phy初始化的过程中,找到注册的所述虚拟phy设备,并将所述虚拟phy设备绑定到网络控制器上。
本发明的有益效果是:
1、用虚拟phy设备替代实际的phy设备进行网口的扩展,并将桥片和网络芯片集成在主板上,既节约了成本又节约了主板空间;
2、通过桥片对网络芯片进行初始化和控制,也更加方便进行网络端口流量控制、网络端口管理和网口状态监控。
附图说明
图1是本发明GMAC网络控制器扩展多网口的架构图。
具体实施方式
下面结合附图对本发明的较佳实施例进行详细阐述,以使本发明的优点和特征能更易于被本领域技术人员理解,从而对本发明的保护范围做出更为清楚明确的界定。
本发明提供基于龙芯平台的多网口扩展的方法和系统,适用于MAC与PHY分开的网络设备,特别是适用于使用中龙芯7A桥片的龙芯平台,该平台中龙芯7A桥片自带GMAC网络控制器,通过连接GMAC网络控制器的mac和网络芯片的mac,去构建虚拟phy设备。
请参阅图1,本发明实施例中,基于龙芯平台的多网口扩展系统包括:龙芯7A桥片、集成在龙芯7A桥片上的GMAC网络控制器和连接到龙芯7A桥片的SWITCH网络芯片,龙芯7A桥片和SWITCH网络芯片通过I2C总线连接和通讯,龙芯7A桥片和SWITCH网络芯片集成在龙芯主板上,SWITCH网络芯片具有若干个RJ-45接口。
具体的, GMAC网络控制器的mac和SWITCH网络芯片的mac连接。
本发明实施例中,基于龙芯平台的多网口扩展方法是:
S1、初始化龙芯7A桥片的I2C控制器;
S2、将SWITCH网络芯片注册为I2C控制器的从设备;
S3、通过I2C总线对SWITCH网络芯片进行配置;
S4、内核GMAC网卡驱动新建虚拟phy设备;
S5、将虚拟phy设备注册到内核GMAC网卡驱动。
具体的,龙芯7A桥片通过I2C控制器与SWITCH网络芯片通讯,步骤S3中的配置指对SWITCH网络芯片的工作模式和mac进行配置,对龙芯7A桥片的GMAC网络控制器和SWITCH网络芯片的mac之间的通讯延迟进行配置。
龙芯7A桥片上集成有GMAC网络控制器,GMAC网络控制器具有RGMII通讯接口,步骤S3还包括对RGMII通讯接口的port端口进行配置,实现对port端口的管控。
具体的,配置包括根据GMAC网络控制器的特性设置TX和RX的延时和状态指示灯。
步骤S4中新建虚拟phy设备的具体步骤为:
S1、设置GMAC网络控制器的Link状态为连接状态;
S2、设置GMAC网络控制器的通讯速率为千兆速率;
S3、设置GMAC网络控制器通过RGMII通讯接口和SWITCH网络芯片通讯,设置GMAC网络控制器的通讯模式为全双工。
步骤S5中将虚拟phy设备注册到网卡驱动的具体步骤是:
S1、当RGMII通讯接口扫描网络phy的时候,将虚拟phy设备注册到内核GMAC网卡驱动;
S2、在网络phy初始化的过程中,找到注册的虚拟phy设备,并将虚拟phy设备绑定到GMAC网络控制器上。
具体的,内核GMAC网卡驱动进行初始化到一定阶段时,会通过RGMII通讯接口扫描网络phy,若未新建虚拟phy设备则初始化失败,若已新建虚拟phy设备则进行注册。
具体的,扩展的网口数量由SWITCH网络芯片的网口数量决定,能够在不同的应用场景满足多网口的功能。
本发明的有益效果是:
1、用虚拟phy设备替代实际的phy设备进行网口的扩展,并将桥片和网络芯片集成在主板上,既节约了成本又节约了主板空间;
2、通过桥片对网络芯片进行初始化和控制,也更加方便进行网络端口流量控制、网络端口管理和网口状态监控。
以上所述仅为本发明的实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。

Claims (8)

1.基于龙芯平台的多网口扩展系统,包括:桥片、集成在桥片上的网络控制器和连接到桥片的网络芯片,所述桥片和网络芯片通过I2C总线连接和通讯,其特征在于,所述桥片和网络芯片集成在同一块主板上。
2.根据权利要求1所述的基于龙芯平台的多网口扩展系统,其特征在于,所述桥片为龙芯7A桥片,所述网络控制器为龙芯7A桥片自带的GMAC网络控制器,所述网络芯片为SWITCH网络芯片,所述SWITCH网络芯片具有若干个RJ-45接口。
3.基于龙芯平台的多网口扩展方法,其特征在于,包括:
S1、初始化桥片的I2C控制器;
S2、将网络芯片注册为所述I2C控制器的从设备;
S3、通过I2C总线对所述网络芯片进行配置;
S4、网卡驱动新建虚拟phy设备;
S5、将所述虚拟phy设备注册到网卡驱动。
4.根据权利要求3所述的基于龙芯平台的多网口扩展方法,其特征在于,所述桥片上集成有网络控制器,所述网络控制器具有RGMII通讯接口。
5.根据权利要求4所述的基于龙芯平台的多网口扩展方法,其特征在于,步骤S3还包括对所述RGMII通讯接口的port端口进行配置,所述配置包括根据网络控制器的特性设置TX和RX的延时和状态指示灯。
6.根据权利要求4所述的基于龙芯平台的多网口扩展方法,其特征在于,步骤S4所述新建虚拟phy设备的具体步骤是:
S1、设置所述网络控制器的Link状态为连接状态;
S2、设置所述网络控制器的通讯速率为千兆速率;
S3、设置所述网络控制器通过RGMII通讯接口和网络芯片通讯,设置所述网络控制器的通讯模式为全双工。
7.根据权利要求3所述的基于龙芯平台的多网口扩展方法,其特征在于,所述桥片为龙芯7A桥片,所述网络控制器为GMAC网络控制器,所述网卡驱动为内核GMAC网卡驱动,所述网络芯片为SWITCH网络芯片。
8.根据权利要求4所述的基于龙芯平台的多网口扩展方法,其特征在于,步骤S5所述将虚拟phy设备注册到网卡驱动的具体步骤是:
S1、当所述RGMII通讯接口扫描网络phy的时候,将所述虚拟phy设备注册到网卡驱动;
S2、在所述网络phy初始化的过程中,找到注册的所述虚拟phy设备,并将所述虚拟phy设备绑定到网络控制器上。
CN202110693120.4A 2021-06-22 2021-06-22 基于龙芯平台的多网口扩展方法和系统 Active CN114625475B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110693120.4A CN114625475B (zh) 2021-06-22 2021-06-22 基于龙芯平台的多网口扩展方法和系统

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110693120.4A CN114625475B (zh) 2021-06-22 2021-06-22 基于龙芯平台的多网口扩展方法和系统

Publications (2)

Publication Number Publication Date
CN114625475A true CN114625475A (zh) 2022-06-14
CN114625475B CN114625475B (zh) 2023-10-24

Family

ID=81896629

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110693120.4A Active CN114625475B (zh) 2021-06-22 2021-06-22 基于龙芯平台的多网口扩展方法和系统

Country Status (1)

Country Link
CN (1) CN114625475B (zh)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102684964A (zh) * 2012-05-10 2012-09-19 南京英飞诺网络科技有限公司 一种万兆以太网接口卡及以太网组网方法
US20120284435A1 (en) * 2011-05-03 2012-11-08 Myrah Michael G Zone group manager virtual phy
US20150154138A1 (en) * 2013-12-04 2015-06-04 Lsi Corporation Wide port emulation at serial attached scsi expanders
CN105721476A (zh) * 2016-02-25 2016-06-29 深圳市亿威尔信息技术股份有限公司 一种网络安全管理系统及方法
CN107094150A (zh) * 2017-05-23 2017-08-25 郑州云海信息技术有限公司 一种ncsi协议实现结构及方法
CN209928413U (zh) * 2019-06-03 2020-01-10 龙芯中科技术有限公司 一种COMe模块和计算机
CN111880727A (zh) * 2020-06-29 2020-11-03 苏州浪潮智能科技有限公司 一种用于硬盘端口号灵活分配的硬件架构及其实现方法
CN112822149A (zh) * 2020-08-17 2021-05-18 北京辰信领创信息技术有限公司 一种基于智能路由器物理口和mac及ip的终端准入管控设计

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120284435A1 (en) * 2011-05-03 2012-11-08 Myrah Michael G Zone group manager virtual phy
CN102684964A (zh) * 2012-05-10 2012-09-19 南京英飞诺网络科技有限公司 一种万兆以太网接口卡及以太网组网方法
US20150154138A1 (en) * 2013-12-04 2015-06-04 Lsi Corporation Wide port emulation at serial attached scsi expanders
CN105721476A (zh) * 2016-02-25 2016-06-29 深圳市亿威尔信息技术股份有限公司 一种网络安全管理系统及方法
CN107094150A (zh) * 2017-05-23 2017-08-25 郑州云海信息技术有限公司 一种ncsi协议实现结构及方法
CN209928413U (zh) * 2019-06-03 2020-01-10 龙芯中科技术有限公司 一种COMe模块和计算机
CN111880727A (zh) * 2020-06-29 2020-11-03 苏州浪潮智能科技有限公司 一种用于硬盘端口号灵活分配的硬件架构及其实现方法
CN112822149A (zh) * 2020-08-17 2021-05-18 北京辰信领创信息技术有限公司 一种基于智能路由器物理口和mac及ip的终端准入管控设计

Also Published As

Publication number Publication date
CN114625475B (zh) 2023-10-24

Similar Documents

Publication Publication Date Title
US11531634B2 (en) System and method for supporting multi-path and/or multi-mode NMVe over fabrics devices
EP2241068B1 (en) Unified connector architecture
US8316377B2 (en) Sharing legacy devices in a multi-host environment
US9064058B2 (en) Virtualized PCI endpoint for extended systems
CN101242371B (zh) 基于PCIe交换架构路由器堆叠的方法、系统和装置
US6600739B1 (en) Method and apparatus for switching among a plurality of universal serial bus host devices
JP5792894B2 (ja) ポート拡張トポロジ情報の取得用方法、システム及び制御ブリッジ並びにアップリンクポートの処理方法及びシステム
DE102020115453A1 (de) Automatisches Umschalten und Einsetzen von Software- oder Firmware-basierten USB-Verbindungsmanagern
US8838867B2 (en) Software-based virtual PCI system
US20110219158A1 (en) Storage assembly, a physical expander and a method
US20080123552A1 (en) Method and system for switchless backplane controller using existing standards-based backplanes
CN102160341A (zh) 统一多传送介质连接器架构
US8478927B2 (en) USB hub supporting unequal numbers of high-speed and super-speed ports
US20070155422A1 (en) Method for controlling mobile data connection through USB Ethernet management of mobile station
CN114625475A (zh) 基于龙芯平台的多网口扩展方法和系统
CN105490844A (zh) 一种PCIe端口重构方法
CN209231920U (zh) 控制系统以及接入网络设备
CN115996204B (zh) 带外以太网接口交换装置、多节点服务器系统及服务器设备
WO2002067515A1 (en) Method and system for generating multiple self-id packets on the 1394 bus using a standard phy chip
US8954623B2 (en) Universal Serial Bus devices supporting super speed and non-super speed connections for communication with a host device and methods using the same
CN115221087A (zh) 一种基于spi总线实现kcs通信的方法
CN107645638B (zh) 视频处理器和背板通信方法
CN113132145B (zh) 一种管理、训练网分离的分布式训练网络系统及通信方法
CN103809538A (zh) 一种基于can总线的服务器电脑远程控制系统
CN101505235B (zh) 一种组件加载方法和装置

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant