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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 干货 | LIDAR、ToF相机、双目相机如何科学选择?「建议收藏」

    干货 | LIDAR、ToF相机、双目相机如何科学选择?「建议收藏」点击“计算机视觉life”关注,置顶更快接收消息!本文阅读时间约5分钟本文翻译自卡内基梅隆大学Chrisasteroid三维视觉技术的选择传感器参数及定义LIDAR&ToF相机&双目相机介绍工作原理优缺点采样数据比较测试及极端情况测试三维成像技术原理和应用想必大家在之前的文章中了解过啦,今天想给大家比较一下LIDAR、ToF相机…

    2022年5月26日
    52
  • kalidirsearch_kali.org

    kalidirsearch_kali.orgdirsearch是一个python3开发的目录扫描工具,目的是扫描网站的敏感文件和目录从而找到突破口。dirsearch使用:-u指定网址-e指定网站语言-w指定字典-r递归目录(跑出目录后,继续跑目录下面的目录)-random-agents使用随机UApythondirsearch.py-u网址-e*模板:pythondirsearch.py-uhttp://5073135b-4e2c-4551-b64f-242d901d8076.chall

    2022年9月27日
    1
  • 软件测试用例编写方法_软件测试用例包括

    软件测试用例编写方法_软件测试用例包括编写测试用例HttpRunnerv3.x支持三种测试用例格式pytest,YAML和JSON。官方强烈建议以pytest格式而不是以前的YAML/JSON格式编写和维护测试用例格式关系如下图所示

    2022年7月29日
    4
  • 神经网络学习 之 BP神经网络

    神经网络学习 之 BP神经网络上一次我们讲了M-P模型,它实际上就是对单个神经元的一种建模,还不足以模拟人脑神经系统的功能。由这些人工神经元构建出来的网络,才能够具有学习、联想、记忆和模式识别的能力。BP网络就是一种简单的人工神经网络。本文具体来介绍一下一种非常常见的神经网络模型——反向传播(BackPropagation)神经网络。概述BP(BackPropagation)神经网络是1986年由Rumelhart和Mc

    2022年5月24日
    29
  • Spring Web Services 框架入门研究–发布服务

    Spring Web Services 框架入门研究–发布服务

    2021年8月17日
    55
  • 如何去除IDEA中xml文件的屎黄色背景

    点击上方“全栈程序员社区”,星标公众号 重磅干货,第一时间送达 作者:翟凤玺 blog.csdn.net/u010318957/article/details/72459183 导…

    2021年6月25日
    75

发表回复

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

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