How to implement UDP scheme in Rebol3 - rebol

As far as I understand source code, net device is already prepared fot UDP, but how to make UDP scheme?

In this line of the source https://github.com/rebol/r3/blob/master/src/core/c-port.c#L612, the comments say
In order to add a port scheme:
In mezz-ports.r add a make-scheme.
Add an Init_*_Scheme() here.
Be sure host-devices.c has the device enabled.
I think the first instruction refers to mezz/sys-ports.r. So, we have this example https://github.com/rebol/r3/blob/master/src/mezz/sys-ports.r#L254, we could add something like
make-scheme [
title: "UDP Networking"
name: 'udp
spec: system/standard/port-spec-net
info: system/standard/net-info ; for C enums
awake: func [event] [print ['UDP-event event/type] true]
]
You would then have to write an INIT_UDP_SCHEME like this one for TCP https://github.com/rebol/r3/blob/master/src/core/p-net.c#L299 where TCP_Actor starts here https://github.com/rebol/r3/blob/master/src/core/p-net.c#L92, and then initialize it here https://github.com/rebol/r3/blob/master/src/core/c-port.c#L626
And as you say, the UDP does seem to be otherwise ready.

Related

What does RHPort mean in tinyusb?

Looking through tinyusb, am a bit confused on the meaning of RHPort - cannot find much on Internet, grepping through source gives me results like:
tinyusb/docs/info/changelog.rst:- Add rhport to hcd_init()
tinyusb/docs/info/changelog.rst: - Support multiple usb ports with rhport=1 is high
...
tinyusb/examples/device/cdc_dual_ports/src/tusb_config.h:// RHPort max operational speed can defined by board.mk
...
tinyusb/examples/device/cdc_dual_ports/src/tusb_config.h:// Device mode with rhport and speed defined by board.mk
...
tinyusb/examples/device/cdc_msc/src/tusb_config.h:// RHPort number used for device can be defined by board.mk, default to port 0
...
... and trying to think of what could "RH" possibly stand for as an acronym, the only thing that pops in my head is "Right Honourable" :)
So, what is the meaning of RHPort in (tiny)USB?
Ok, I think I found at least some sort of an explanation ...
Anyways, https://docs.tinyusb.org/en/latest/reference/getting_started.html says:
Port Selection
If a board has several ports, one port is chosen by default in the
individual board.mk file. Use option PORT=x To choose another port.
For example to select the HS port of a STM32F746Disco board, use:
$ make BOARD=stm32f746disco PORT=1 all
A bit tricky to find where that PORT is used, then - but for the above example, it is most likely in https://github.com/hathach/tinyusb/blob/master/hw/bsp/stm32f7/family.mk :
...
CFLAGS += \
...
-DBOARD_TUD_RHPORT=$(PORT)
...
... which then gets used in e.g. https://github.com/hathach/tinyusb/blob/master/examples/device/dfu_runtime/src/main.c :
...
// init device stack on configured roothub port
tud_init(BOARD_TUD_RHPORT);
...
... which reveals, that "RH" in "RHPort" most likely stands for "Root Hub".
So, my guess is, that for boards that have multiple physical USB port connectors, the RHPort determines which of those ports is tinyusb targeting?

DPDK SRIOV multiple vlan traffic over single VF of SRIOV passthrough

When trying to use RTE API's for VLAN offload and VLAN filtering I observe that both VLAN tagged and untagged packets are being sent out.
API's used:
rte_eth_dev_set_vlan_offload ,
rte_eth_dev_vlan_filter
DPDK - 18.08
RHEL - 7.6
Driver - igb_uio
Is there a way to allow only VLAN tagged packets to be sent out?
Regards,
Not sure if I understand correctly - you're trying to strip vlan tags from tx packets? Why would you want to offload that? If you forward packets from somewhere else they already have their tags stripped by rx offload. If you create them yourself, well - you're in control.
Regardless, if you'd want to offload tx vlan insertion:
rte_eth_dev_set_vlan_offload only sets RX offload flags.
You'll probably have to set the tx offload flag in your port config manually, like in this abridged snippet from the DPDK Flow Filtering example code:
struct rte_eth_conf port_conf = {
.txmode = {
.offloads =
DEV_TX_OFFLOAD_VLAN_INSERT,
},
};

Specman - error while connecting the monitor to scoreboard

I am using e (specman) in my project.
I build verification environment for uart.
I have a struct which is like any_sequence_item named uart_frame_s.
I want to add scoreboard for the tx in the uart.
I have the following instance in the uart_tx_agent:
uart_monitor: uart_tx_monitor_u is instance;
Definition of the scoreboard:
unit uart_tx_scoreboard_u like uvm_scoreboard{
scbd_port frame_add : add uart_frame_s;
scbd_port frame_match : match uart_frame_s;
};
I try to connect by:
connect_ports() is also {
uart_monitor.uart_frame_s_started.connect(tx_scb.uart_frame_s_add);
uart_monitor.uart_frame_s_ended.connect(tx_scb.uart_frame_s_match);
};
where:
uart_scb (scoreboard) is instance in uart_tx_agent
Definition of the TLM ports in the monitor:
uart_frame_s_started : out iterface_port of tlm_analysis of uart_frame_s is instance;
uart_frame_s_ended : out iterface_port of tlm_analysis of uart_frame_s is instance;
I get the following errors:
Error: 'uart_monitor' (of 'uart_tx_monitor_u') does not have 'uart_frame_S_started'field....
Error: 'uart_monitor' (of 'uart_tx_monitor_u') does not have 'uart_frame_S_ended'field
from the information that you have provided above, I can conclude the following:
1.the e scoreboard comes with predefined TLM implementation ports that you need to connect the monitor TLM output ports to.It seems like you did not define the TLM ports in your monitor. Pleas define those TLM ports as they are required when connecting to the scoreboard (there are examples for that in the scoreboard documentation).
What I suggest is that as soon as you finish collecting the frame from the bus , emit an event that notifies that a frame was completed (I guess you can call it "uart_frame_s_endded" ), then upon that event emit , send the collected frame to the scoreboard through the Monitor's TLM output ports for add/match. ( I guess 'add' would be appropriate for UART tx).
if the ports are defined, make sure to use the connect_portS() function in a place in the code that the parser will read later than the port definition.
just an FYI:
it seems like you defined the scoreboard from within the Agent. (seems like tx_scbd and uart_monitor are under the same hierarchy.
It is considered 'bad practice' to put a system level component (scoreboard) inside an uVC (which in this case is a UART interface component).
hopw this helps

openflow rule with multiple action ports

I am a little bit confused when interpreting the action part for the following rule
cookie=0x2b000000000000a5, duration=528.939s, table=0, n_packets=176, n_bytes=33116, idle_age=0, priority=2,in_port=1 actions=output:4,output:2
we have multiple action ports in a certain order, when checking the "restconf/operational/opendaylight-inventory:nodes/" in ODL controller we have different order for each port
"action": [
{ "order": 0,"output-action": {
"max-length": 65535,
"output-node-connector": "2" }
{"order": 1, "output-action": {
"max-length": 65535,
"output-node-connector": "4" }
}
I am not sure how the packets hitting such entry will be forwarded, are they replicated and send over both? are they load balanced over all ports?
what does the max-length refer to?
Is there any documentation explaining all fields in detail?
It seems, this is a group-table flow.
You can use group table functionality to support multiports in action part. You can read Openflow 1.3 spec documentation for details. (Part. 5.6, 5.6.1)
For max length, again from the same document (Part A.2.5):
An Output action uses the following structure and fields:
Action structure for OFPAT_OUTPUT, which sends packets out 'port'. When the
'port' is the OFPP_CONTROLLER, 'max_len' indicates the max number of
bytes to send. A 'max_len' of zero means no bytes of the packet should
be sent. A 'max_len' of OFPCML_NO_BUFFER means that the packet is not
buffered and the complete packet is to be sent to the controller.

Sending Mail in seaside+Gemstone " a Message: NotUnderstood occurred (error 2010), a UndefinedObject does not understand #'isEmpty' "

Tried with a similar question earlier, but could not I make headway. So I did new tests and here is the new question:
I did a brand new installation of PHARO 1.4 and GEMSTONE 3.0.1.2 on the same machine. (Linux CENTOS). Loaded seaside 3.0 in Pharo and version 3.0.7.1 in Gemstone using the latest version of Gemtools (1.0 beta 87) with the latest version of glass workspace (1.0 beta 8.7.4).
I opened the workspace and evaluated:
(WAEmailMessage
from: (WAEmailAddress address: 'xx#aa.com' username: 'fromMe')
to: (WAEmailAddress address: 'shyam#localhost' username: 'shyam')
subject: 'Email Test')
body: 'This is a Test Email sent';
send.
(BTW, As the default mail host in Gemstone is "mailhost", I added the following line to the /etc/hosts file127.0.0.1 localhost mailhost ).
On Pharo the message is sent and received correctly, while in Gemstone I get
a MessageNotUnderstood occurred (error 2010), a UndefinedObject does not understand #'isEmpty', in the method
readSmtpResult
| result firstChar |
[self readWillNotBlockWithin: 5000]
whileFalse: [GsFile stderr log: 'Waiting for server to write...'].
result := self readString: 500.
result isEmpty =========================> HERE result is "nil".
ifTrue:
[self log: 'Empty result'.
^false].
The reason being that result returns a nil.
I tried with similar results also on MAC OS X which instead went into a loop in the lines above.
Using tcpdump -X -i lo tcp port 25 and WireShark, I noticed that for GEMSTONE, I saw NO activity while the packets were correctly exchanged for PHARO.
Evidently, I am doing something terribly wrong to get it wrong on two different systems.
Any idea ?
Thanks
Shyam.
result is nil because #readString: returned nil.
It seems that the peer does not send any data. As you already traced that there is no activity on port 25 going on, are you sure that the SMTP parameters are correct?
Seaside-Email contains code that you can use to configure your SMTP-Server.
Given you have your Seaside application seasideApp, you can do the following:
seasideApp configuration
addParent: WAEmailConfiguration instance.
seasideApp
preferenceAt: #smtpServer put: 'your.smtp.host';
preferenceAt: #smtpPort put: 25;
preferenceAt: #smtpUsername put: 'your.smtp.username.or.nil.if.unecessary';
preferenceAt: #smtpUsername put: 'your.smtp.password.or.nil.if.unecessary';
yourself.
Note that #smtpServer and smtpPort must be configured the way described, as they are used in the GemStone version of GRPlatform>>#seasideDeliverEmailMessage:. I opted to deliberately not use the GemStone defaults.
Also, setting the SMTP parameters this way is ment to work cross-platform; if it does not, please contact me directly.