WLS

WLS来源:https://docs.o-ran-sc.org/projects/o-ran-sc-o-du-phy/en/latest/wls-lib.htmlWls_lib是英特尔开元的一个无线服务

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

来源:

https://docs.o-ran-sc.org/projects/o-ran-sc-o-du-phy/en/latest/wls-lib.html

Wls_lib是英特尔开元的一个无线服务库,支持实现gNb或eNb的应用程序使用的共享内存和缓冲区管理。该库使用DPDK、libhugetlbfs和pthreads,通过从DPDK的角度共享相同的内存区域,在二级应用程序、API转换器模块和一级应用程序之间提供无内存的数据交换。

Project Resources

The source code is avalable from the Linux Foundation Gerrit server:
https://gerrit.o-ran-sc.org/r/gitweb?p=o-du%2Fphy.git;a=summary  —- 可以自选一个snapshot查看源码实现

https://gerrit.o-ran-sc.org/r/gitweb?p=o-du%2Fphy.git

 

Library Functions 基本库函数

WLS_Open() and WLS_Open_Dual() that open a single or dual wls instance interface and registers the instance with the kernel space driver.
WLS_Close(), WLS_Close1() closes the wls instance and deregisters it from the kernel space driver.
WLS_Ready(), WLS_Ready1() checks state of remote peer of WLS interface and returns 1 if remote peer is available.
WLS_Alloc() allocates a memory block for data exchange shared memory. This block uses hugepages.
WLS_Free() frees memory block for data exchange shared memory.
WLS_Put(), WLS_Put1() puts memory block (or group of blocks) allocated from WLS memory into the interface for transfer to remote peer.
WLS_Check(), WLS_Check1() checks if there are memory blocks with data from remote peer and returns number of blocks available for “get” operation.
WLS_Get(), WLS_Get1() gets memory block from interface received from remote peer. Function is a non-blocking operation and returns NULL if no blocks available.
WLS_Wait(), WLS_Wait1() waits for new memory block from remote peer. This Function is a blocking call and returns number of blocks received.
WLS_WakeUp(), WLS_WakeUp1() performs “wakeup” notification to remote peer to unblock “wait” operations pending.
WLS_Get(), WLS_Get1() gets a memory block from the interface received from remote peer. This Function is blocking operation and waits till next memory block from remote peer.
WLS_VA2PA() converts virtual address (VA) to physical address (PA).
WLS_PA2VA() converts physical address (PA) to virtual address (VA).
WLS_EnqueueBlock(), WLS_EnqueueBlock1() This function is used by a master or secondary master to provide memory blocks to a slave for next slave to master (sec master) transfer of data.
WLS_NumBlocks() returns number of current available blocks provided by master for a new transfer of data from the slave.
The _1() functions are only needed when using the WLS_Open_Dual().

Building and Installation

Retrieve the source files from the Linux Foundation Gerrit server:
https://gerrit.o-ran-sc.org/r/gitweb?p=o-du%2Fphy.git;a=summary
  1. cd wls_lib
  2. wls_lib$ ./build.sh xclean
  3. wls_lib$ ./build.sh

The shared library is available at wls_lib/lib

This library is used by the ODUHIGH, shin layer implementing a 5G FAPI to IAPI translator and the ODULOW components.

Please define an environment variable DIR_WIRELESS_WLS with the path to the root folder of the wls_lib as it is needed for the fapi_5g build process.

编译依赖DPDK,需要编译好DPDK lib提供基本的rte静态库和头文件。

 

下载最新的节点,看看里面都用了啥?

phy-81a0969.tar.gz

 

wls_lib 下 Makefile

ifeq ($(RTE_SDK),)   #依赖dpdk的编译结果
$(error “Please define RTE_SDK environment variable”)
endif
# Default target, can be overridden by command line or environment
RTE_TARGET ?= x86_64-native-linuxapp-icc   # 默认英特尔的 ICC 我们可以设置成 gcc
RTE_OUTPUT = ${PWD}

include $(RTE_SDK)/mk/rte.vars.mk
SRCS-y := wls_lib_dpdk.c syslib.c  # 实现代码都在这2个C文件中
SHARED = libwls.so  # 输出动态库

CFLAGS +=-Wall -fstack-protector
EXTRA_CFLAGS +=-g
include $(RTE_SDK)/mk/rte.extshared.mk  #依赖dpdk的环境变量设置

##############################################################

wls_initialize

初始化由 RTE_PROC_PRIMARY 进程执行

 

rte_memzone_reserve_aligned

多申请sizeof(wls_drv_ctx_t)保存上下文信息;该wls_drv_ctx_t信息是保存在数据位尾部分

pthread_mutexattr_init(&attr);
pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED);
if (ret = pthread_mutex_init(&mng_ctx->mng_mutex, &attr)) {
PLIB_ERR(“Failed to initialize mng_mutex %d\n”, ret);
pthread_mutexattr_destroy(&attr);
return ret;
}
pthread_mutexattr_destroy(&attr);

 

pWls_us=wls_create_us_ctx

初始化队列

SFL_DefQueue(&pUsCtx->ul_free_block_pq, pUsCtx->ul_free_block_storage,
UL_FREE_BLOCK_QUEUE_SIZE * sizeof (void*));
WLS_MsgDefineQueue(&pUsCtx->get_queue, pUsCtx->get_storage, WLS_GET_QUEUE_N_ELEMENTS, 0);
WLS_MsgDefineQueue(&pUsCtx->put_queue, pUsCtx->put_storage, WLS_PUT_QUEUE_N_ELEMENTS, 0);

 

sem_init(&pUs_priv->sema.sem

将 pWls_us 返回给用户

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/168128.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 使用sp_executesql存储过程执行动态SQL查询

    使用sp_executesql存储过程执行动态SQL查询Thesp_executesqlstoredprocedureisusedtoexecutedynamicSQLqueriesinSQLServer.AdynamicSQLqueryisaqueryinstringformat.ThereareseveralscenarioswhereyouhaveanSQLq…

    2022年5月21日
    31
  • Webstorm的一些常用快捷键

    Webstorm的一些常用快捷键下面是Webstorm的一些常用快捷键:1.ctrl+shift+n:打开工程中的文件,目的是打开当前工程下任意目录的文件。2.ctrl+j:输出模板3.ctrl+b:跳到变量申明处4.ctrl+alt+T:围绕包裹代码(包括zencoding的WrapwithAbbreviation)5.ctrl+[]:匹配{}[]6

    2022年6月12日
    27
  • dojo/dom-construct.toDom方法学习笔记

    dojo/dom-construct.toDom方法学习笔记  toDom方法用来将html标签字符串转化成DOM节点。1.7之后toDom方法被分配到了dom-construct模块。require(["dojo/dom-construct"],function(domConstruct){//TakeastringandturnitintoaDOMnodevarnode=domConstruc…

    2022年9月12日
    4
  • 数据库ER图基础概念整理

    数据库ER图基础概念整理什么是ER图?ER图即是实体关系图!ER图分为实体、属性、关系三个核心部分。实体是长方形体现,而属性则是椭圆形,关系为菱形。ER图中关联关系有三种:1对1(1:1):1对1关系是指对于实体集A与实体集B,A中的每一个实体至多与B中一个实体有关系;反之,在实体集B中的每个实体至多与实体集A中一个实体有关系。1对多(1:N):1对多关系是指实体集A与实体集B中至

    2022年6月21日
    25
  • Delphi XE5 FireMonkey移动开发示例:粒子系统

    Delphi XE5 FireMonkey移动开发示例:粒子系统这个例子是参照Processing中的例子写的。  测试结果:在Windows7上,脱离开发环境的性能与Processing相当,在Android上表现良好。 源码如下:  unitExample.Particles;interfaceusesSystem.SysUtils,System.Types,System.UITypes,System.Classes,

    2022年7月18日
    18
  • 联盟链初识以及Fabric环境搭建流程

    联盟链初识以及Fabric环境搭建流程

    2021年6月17日
    112

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号