Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hostif Generic Netlink interface #936

Merged
merged 3 commits into from
Jul 11, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions inc/saihostif.h
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,10 @@ typedef enum _sai_hostif_type_t
SAI_HOSTIF_TYPE_NETDEV,

/** File descriptor */
SAI_HOSTIF_TYPE_FD
SAI_HOSTIF_TYPE_FD,

/** Generic netlink */
SAI_HOSTIF_TYPE_GENETLINK

} sai_hostif_type_t;

Expand Down Expand Up @@ -736,9 +739,11 @@ typedef enum _sai_hostif_attr_t
* The maximum number of characters for the name is SAI_HOSTIF_NAME_SIZE - 1 since
* it needs the terminating null byte ('\0') at the end.
*
* If Hostif is a generic netlink, this indicates the generic netlink family name.
*
* @type char
* @flags MANDATORY_ON_CREATE | CREATE_ONLY
* @condition SAI_HOSTIF_ATTR_TYPE == SAI_HOSTIF_TYPE_NETDEV
* @condition SAI_HOSTIF_ATTR_TYPE == SAI_HOSTIF_TYPE_NETDEV or SAI_HOSTIF_ATTR_TYPE == SAI_HOSTIF_TYPE_GENETLINK
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it always equal to "NETLINK_GENERIC"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is set to the generic netlink family name whose multicast port id (SAI_HOSTIF_ATTR_GENETLINK_PORT_ID) is used to lift the samples. If the psample driver is used, it should be set to "psample" (refer https://github.com/torvalds/linux/blob/master/include/uapi/linux/psample.h#L33 ).

*/
SAI_HOSTIF_ATTR_NAME,

Expand Down Expand Up @@ -770,6 +775,16 @@ typedef enum _sai_hostif_attr_t
*/
SAI_HOSTIF_ATTR_VLAN_TAG,

/**
* @brief Set the Generic netlink (multicast) port id on which the packets/buffers
* are received on this host interface
*
* @type sai_uint32_t
* @flags CREATE_AND_SET
* @default 0
*/
SAI_HOSTIF_ATTR_GENETLINK_PORT_ID,

/**
* @brief End of attributes
*/
Expand Down Expand Up @@ -875,7 +890,10 @@ typedef enum _sai_hostif_table_entry_channel_type_t
SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_NETDEV_LOGICAL_PORT,

/** Receive packets via Linux netdev L3 interface */
SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_NETDEV_L3
SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_NETDEV_L3,

/** Receive packets via Linux generic netlink interface */
SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_GENETLINK

} sai_hostif_table_entry_channel_type_t;

Expand Down
1 change: 1 addition & 0 deletions meta/aspell.en.pws
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ multi
multicast
netdev
netdevs
netlink
nexthop
nexthopgroup
objlist
Expand Down