Commit eb44201e authored by Junxin Chen's avatar Junxin Chen Committed by Fengyan
Browse files

ubl: add CONFIG_UBL definition and UBL interface

kernel inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I850RQ


CVE: NA

-----------------------------------------------------------

This patch adds UB link interfaces to support it.

UB is a new interconnection protocol that defines its own Layer 2 protocol.
The format of a complete UB packet is as follows. UBL HDR includes UB LINK,
CC and NPI. UB LINK replaces Ether header in packets. The UB Network header
consists of CC, NPI, and traditional Network packet headers.

|<-------- UBL HDR --------->|
+--------------+------+------+---------+-----------+---------+
|    UB LINK   |  CC  |  NPI | Network | TPH / TAH | Payload |
+--------------+------+------+---------+-----------+---------+
               |<----- UB Network ---->|

- UB LINK: Format specified by the data link layer of the UB LINK.
- CC: Congestion Control.
- NPI: Network Partition Identifier.
- Network: Traditinal L3 Header.

At network layer, the UB Network Header is encapsulated. However,
the packet type cannot be known by parsing packet from user, which
leads to restrictions on the use of socket.

This patch adds sw_ctype field to indicate the packet type. As shown
in the following figure, the sw_ctype field will be add at the header
of packet before entering the dirver.

+----------+----+-----+---------+-----------+---------+
| sw_ctype | CC | NPI | Network | TPH / TAH | Payload |
+----------+----+-----+---------+-----------+---------+

-sw_ctype: L3 Header type.

When packets are sent to hardware, the sw_ctype field will be deleted
and the original packet will be restored.

+----+-----+---------+-----------+---------+
| CC | NPI | Network | TPH / TAH | Payload |
+----+-----+---------+-----------+---------+

Signed-off-by: default avatarJunxin Chen <chenjunxin1@huawei.com>
Signed-off-by: default avatarHaiqing Fang <fanghaiqing@huawei.com>
parent 1efb77bf
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -2903,6 +2903,7 @@ CONFIG_NET_VENDOR_NEBULA_MATRIX=y
CONFIG_M1600=m
CONFIG_M1600=m
# CONFIG_FDDI is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
# CONFIG_HIPPI is not set
CONFIG_UBL=y
# CONFIG_NET_SB1000 is not set
# CONFIG_NET_SB1000 is not set
CONFIG_PHYLIB=y
CONFIG_PHYLIB=y
CONFIG_SWPHY=y
CONFIG_SWPHY=y
+2 −0
Original line number Original line Diff line number Diff line
@@ -444,6 +444,8 @@ source "drivers/net/fddi/Kconfig"


source "drivers/net/hippi/Kconfig"
source "drivers/net/hippi/Kconfig"


source "drivers/net/ub/Kconfig"

source "drivers/net/ipa/Kconfig"
source "drivers/net/ipa/Kconfig"


config NET_SB1000
config NET_SB1000
+1 −0
Original line number Original line Diff line number Diff line
@@ -68,6 +68,7 @@ obj-$(CONFIG_WAN) += wan/
obj-$(CONFIG_WLAN) += wireless/
obj-$(CONFIG_WLAN) += wireless/
obj-$(CONFIG_WIMAX) += wimax/
obj-$(CONFIG_WIMAX) += wimax/
obj-$(CONFIG_IEEE802154) += ieee802154/
obj-$(CONFIG_IEEE802154) += ieee802154/
obj-$(CONFIG_UBL) += ub/


obj-$(CONFIG_VMXNET3) += vmxnet3/
obj-$(CONFIG_VMXNET3) += vmxnet3/
obj-$(CONFIG_XEN_NETDEV_FRONTEND) += xen-netfront.o
obj-$(CONFIG_XEN_NETDEV_FRONTEND) += xen-netfront.o

drivers/net/ub/Kconfig

0 → 100644
+11 −0
Original line number Original line Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
#
# UBL configuration
#

config UBL
	default n
	tristate "UB link support"
	help
	  This enables UB link support. Say 'Y' or 'm' if your
	  device works in UB.
+7 −0
Original line number Original line Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0+
#
# Makefile for the HISILICON network device drivers.
#

#### compile ubl
obj-$(CONFIG_UBL) += dev/
Loading