Skip to content

Conversation

@HaavardRei
Copy link
Contributor

Adds support for using relay buffers and advertising set for the subnet bridge feature, even if the relay feature is disabled. Introduces new Kconfig options that allows the user to configure the relay buffer count and advertising sets in the case when the relay feature is disabled.

Copy link
Contributor

@alxelax alxelax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really required to have more config options?

What if you add just dependency to the relay buffer\advertiser instances on bridge feature?

Advantages:
It will not require any C code changes. You will not need more KConfig options. There is only one place to configure number of buffers.

Disadvantages:
It requires better documentation with description that you require more buffers if two features are enabled.

My opinion is less entities in both C and KConfig is better than more. It is better maintainable.

@LingaoM
Copy link
Contributor

LingaoM commented Nov 12, 2024

I previously proposed that the relay advertising set be renamed to a common name, for example: parallel advertising set, which not depends any feature, and can be used by relay, provision and brg_cfg.

@HaavardRei HaavardRei force-pushed the subnet_bridge_adv_buf branch from a7dc4d8 to 163eda4 Compare November 12, 2024 08:39
@HaavardRei
Copy link
Contributor Author

I previously proposed that the relay advertising set be renamed to a common name, for example: parallel advertising set, which not depends any feature, and can be used by relay, provision and brg_cfg.

IMO it's a bit more invasive than the current changes, but not a bad idea. This would require some restructuring and doc changes to functions/Kconfigs such as BT_MESH_PB_ADV_USE_RELAY_SETS, bt_mesh_adv_relay_ready, etc.
I would rather suggest creating a separate issue for this.

@HaavardRei
Copy link
Contributor Author

This might pose a problem:
https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/bluetooth/mesh/net.c#L709
If relaying is disabled, the number of retransmits returned will be 0 for bridged messages (https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/bluetooth/mesh/cfg.c#L373)
I can't just add a simple || CONFIG_BT_MESH_BRG_CFG_SRV here as bt_mesh.relay_xmit is not compiled in. Any suggestions on how to deal with this? (I. e. compiling in retransmits anyway, or adding a separate option, or something else)

@alxelax
Copy link
Contributor

alxelax commented Nov 12, 2024

This might pose a problem: https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/bluetooth/mesh/net.c#L709 If relaying is disabled, the number of retransmits returned will be 0 for bridged messages (https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/bluetooth/mesh/cfg.c#L373) I can't just add a simple || CONFIG_BT_MESH_BRG_CFG_SRV here as bt_mesh.relay_xmit is not compiled in. Any suggestions on how to deal with this? (I. e. compiling in retransmits anyway, or adding a separate option, or something else)

I guess in case of bridging between subnetworks it should be networked xmit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading this isolated, I am missing half a sentence what these buffer and advertising sets are used for when MESH_RELAY is disabled... not for relaying, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The relay and bridge functionality is quite similar IMO, with relaying you're a middleman for nodes in the same subnet, but with subnet bridge you're a middleman between subnets. So it's kind of relaying. The bt_mesh_net_relay func is used for both: https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/bluetooth/mesh/net.c#L685

@HaavardRei HaavardRei force-pushed the subnet_bridge_adv_buf branch from f283f41 to 0b64e7a Compare November 19, 2024 09:48
Adds support for using relay buffers and advertising set for the subnet
bridge feature, even if the relay feature is disabled.

Signed-off-by: Håvard Reierstad <[email protected]>
Makes sure that the Network Transmit state is used when using a Subnet
Bridge.

Signed-off-by: Håvard Reierstad <[email protected]>
@HaavardRei HaavardRei force-pushed the subnet_bridge_adv_buf branch from 0b64e7a to 88da907 Compare November 19, 2024 09:55
@HaavardRei HaavardRei requested a review from PavelVPV November 19, 2024 11:04
Copy link
Contributor

@omkar3141 omkar3141 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it looks aligned. I have tiny thing about name of the KConfig itself (like calling them as "RELAY_BUF_COUNT" as they are more generic now), but let's leave it for now.

@nashif nashif merged commit b38773f into zephyrproject-rtos:main Nov 19, 2024
26 checks passed
@HaavardRei HaavardRei deleted the subnet_bridge_adv_buf branch November 20, 2024 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants