sonic-linux-kernel icon indicating copy to clipboard operation
sonic-linux-kernel copied to clipboard

eBPF helper function for attribute search in the netlink message

Open Kalimuthu-Velappan opened this issue 5 years ago • 8 comments

There are few network applications relying on Netlink subsystem to get notifications for net-device attribute changes like MTU, Speed, Oper-Status, Name, slave, slave info, etc. The Netlink subsystem notifies the application on every attribute change regardless of what is needed for the application. The attribute search support in EBPF filter helps to filter the Netlink packets based on the specific set of attributes that are needed for the application.

The classical BPF supports attribute search but that doesn't support MAPS. The extended BPF supports MAPS, but the attribute search is not enabled. Hence this patch enables the support for attribute search in EBPF.

This patch adds the support for following helper function. FN(skb_get_nlattr), FN(skb_get_nlattr_nest)

skb_get_nlattr: Find a specific attribute in a stream of attributes

skb_get_nlattr_nest: Find a specific attribute in a stream of nested attributes

Kalimuthu-Velappan avatar Dec 04 '20 19:12 Kalimuthu-Velappan

is this upstream patch? if not, can you upstream this patch first?

lguohan avatar Dec 05 '20 13:12 lguohan

is this upstream patch? if not, can you upstream this patch first?

We have already upstreamed this to the Linux community. But it is taking time to merge. https://www.spinics.net/lists/netdev/msg627990.html

I will address your comments and resubmit the patch agagin.

Kalimuthu-Velappan avatar Dec 09 '20 19:12 Kalimuthu-Velappan

i looked the thread, the question is reasonable, we will need to wait till that one gets signed off.

lguohan avatar Dec 10 '20 03:12 lguohan

Fixed the alignment issue and added the descriptive summary.

The PR 6131 provides the library support on how to use these attributes. https://github.com/Azure/sonic-buildimage/pull/6131

Kalimuthu-Velappan avatar Dec 10 '20 13:12 Kalimuthu-Velappan

@Kalimuthu-Velappan , @lguohan , @paulmenzel - this one has been quiet for a few days - can we get it moving towards merge pls?

@lguohan - I'm not sure I understand your comment saying "i looked the thread, the question is reasonable, we will need to wait till that one gets signed off" - which thread and which question are you talking about please?

ben-gale avatar Dec 15 '20 22:12 ben-gale

Could you please rebase it on the master branch? Currently already committed changes are present in the commit list.

paulmenzel avatar Dec 17 '20 16:12 paulmenzel

retest this please

Kalimuthu-Velappan avatar Dec 18 '20 15:12 Kalimuthu-Velappan

/easycla

jarias-lfx avatar Jul 19 '23 19:07 jarias-lfx