mbox series

[ovs-dev,v9,00/11] Add offload support for sFlow

Message ID 20201215033812.145975-1-cmi@nvidia.com
Headers show
Series Add offload support for sFlow | expand

Message

Chris Mi Dec. 15, 2020, 3:38 a.m. UTC
This patch set adds offload support for sFlow.

Psample is a genetlink channel for packet sampling. TC action act_sample
uses psample to send sampled packets to userspace.

When offloading sample action to TC, userspace creates a unique ID to
map sFlow action and tunnel info and passes this ID to kernel instead
of the sFlow info. psample will send this ID and sampled packet to
userspace. Using the ID, userspace can recover the sFlow info and send
sampled packet to the right sFlow monitoring host.

GitHub Actions:
v9: https://github.com/mishuang2017/ovs/actions/runs/422310251

v2-v1:
- Fix robot errors.
v3-v2:
- Remove Gerrit Change-Id.
- Add patch #9 to fix older kernels build issue.
- Add travis test result.
v4-v3:
- Fix offload issue when sampling rate is 1.
v5-v4:
- Move polling thread from ofproto to netdev-offload-tc.
v6-v5:
- Rebase.
- Add GitHub Actions test result.
v7-v6:
- Remove Gerrit Change-Id.
- Fix "ERROR: Inappropriate spacing around cast"
v8-v7
- Address Eelco Chaudron's comment for patch #11.
v9-v8
- Remove sflow_len from struct dpif_sflow_attr.
- Log a debug message for other userspace actions.

Chris Mi (11):
  compat: Add psample and tc sample action defines for older kernels
  ovs-kmod-ctl: Load kernel module psample
  dpif: Introduce register sFlow upcall callback API
  ofproto: Add upcall callback to process sFlow packet
  netdev-offload: Introduce register sFlow upcall callback API
  netdev-offload-tc: Implement register sFlow upcall callback API
  dpif-netlink: Implement register sFlow upcall callback API
  netdev-offload-tc: Introduce group ID management API
  netdev-offload-tc: Create psample netlink socket
  netdev-offload-tc: Add psample receive handler
  netdev-offload-tc: Add offload support for sFlow

 include/linux/automake.mk        |   4 +-
 include/linux/psample.h          |  58 +++
 include/linux/tc_act/tc_sample.h |  25 ++
 lib/dpif-netdev.c                |   1 +
 lib/dpif-netlink.c               |  27 ++
 lib/dpif-netlink.h               |   4 +
 lib/dpif-provider.h              |  10 +
 lib/dpif.c                       |   8 +
 lib/dpif.h                       |  23 ++
 lib/netdev-offload-provider.h    |   3 +
 lib/netdev-offload-tc.c          | 600 ++++++++++++++++++++++++++++++-
 lib/netdev-offload.c             |  30 ++
 lib/netdev-offload.h             |   4 +
 lib/tc.c                         |  61 +++-
 lib/tc.h                         |  10 +-
 ofproto/ofproto-dpif-upcall.c    |  42 +++
 utilities/ovs-kmod-ctl.in        |  14 +
 17 files changed, 912 insertions(+), 12 deletions(-)
 create mode 100644 include/linux/psample.h
 create mode 100644 include/linux/tc_act/tc_sample.h

Comments

Chris Mi Jan. 11, 2021, 2:25 a.m. UTC | #1
Hi,

A reminder. I pushed the first version to the community in September.
All most 4 mouths passed. I'm wondering if we can speed up a little bit. :)

Thanks,
Chris

On 12/15/2020 11:38 AM, Chris Mi wrote:
> This patch set adds offload support for sFlow.
>
> Psample is a genetlink channel for packet sampling. TC action act_sample
> uses psample to send sampled packets to userspace.
>
> When offloading sample action to TC, userspace creates a unique ID to
> map sFlow action and tunnel info and passes this ID to kernel instead
> of the sFlow info. psample will send this ID and sampled packet to
> userspace. Using the ID, userspace can recover the sFlow info and send
> sampled packet to the right sFlow monitoring host.
>
> GitHub Actions:
> v9: https://github.com/mishuang2017/ovs/actions/runs/422310251
>
> v2-v1:
> - Fix robot errors.
> v3-v2:
> - Remove Gerrit Change-Id.
> - Add patch #9 to fix older kernels build issue.
> - Add travis test result.
> v4-v3:
> - Fix offload issue when sampling rate is 1.
> v5-v4:
> - Move polling thread from ofproto to netdev-offload-tc.
> v6-v5:
> - Rebase.
> - Add GitHub Actions test result.
> v7-v6:
> - Remove Gerrit Change-Id.
> - Fix "ERROR: Inappropriate spacing around cast"
> v8-v7
> - Address Eelco Chaudron's comment for patch #11.
> v9-v8
> - Remove sflow_len from struct dpif_sflow_attr.
> - Log a debug message for other userspace actions.
>
> Chris Mi (11):
>    compat: Add psample and tc sample action defines for older kernels
>    ovs-kmod-ctl: Load kernel module psample
>    dpif: Introduce register sFlow upcall callback API
>    ofproto: Add upcall callback to process sFlow packet
>    netdev-offload: Introduce register sFlow upcall callback API
>    netdev-offload-tc: Implement register sFlow upcall callback API
>    dpif-netlink: Implement register sFlow upcall callback API
>    netdev-offload-tc: Introduce group ID management API
>    netdev-offload-tc: Create psample netlink socket
>    netdev-offload-tc: Add psample receive handler
>    netdev-offload-tc: Add offload support for sFlow
>
>   include/linux/automake.mk        |   4 +-
>   include/linux/psample.h          |  58 +++
>   include/linux/tc_act/tc_sample.h |  25 ++
>   lib/dpif-netdev.c                |   1 +
>   lib/dpif-netlink.c               |  27 ++
>   lib/dpif-netlink.h               |   4 +
>   lib/dpif-provider.h              |  10 +
>   lib/dpif.c                       |   8 +
>   lib/dpif.h                       |  23 ++
>   lib/netdev-offload-provider.h    |   3 +
>   lib/netdev-offload-tc.c          | 600 ++++++++++++++++++++++++++++++-
>   lib/netdev-offload.c             |  30 ++
>   lib/netdev-offload.h             |   4 +
>   lib/tc.c                         |  61 +++-
>   lib/tc.h                         |  10 +-
>   ofproto/ofproto-dpif-upcall.c    |  42 +++
>   utilities/ovs-kmod-ctl.in        |  14 +
>   17 files changed, 912 insertions(+), 12 deletions(-)
>   create mode 100644 include/linux/psample.h
>   create mode 100644 include/linux/tc_act/tc_sample.h
>
Eelco Chaudron Jan. 11, 2021, 1:20 p.m. UTC | #2
Hi Chris,

It’s on my TODO list for this week, hoping nothing else will comes up…

//Eelco


BTW: I also have some patches waiting for review ;)


On 11 Jan 2021, at 3:25, Chris Mi wrote:

> Hi,
>
> A reminder. I pushed the first version to the community in September.
> All most 4 mouths passed. I'm wondering if we can speed up a little bit. :)
>
> Thanks,
> Chris
>
> On 12/15/2020 11:38 AM, Chris Mi wrote:
>> This patch set adds offload support for sFlow.
>>
>> Psample is a genetlink channel for packet sampling. TC action act_sample
>> uses psample to send sampled packets to userspace.
>>
>> When offloading sample action to TC, userspace creates a unique ID to
>> map sFlow action and tunnel info and passes this ID to kernel instead
>> of the sFlow info. psample will send this ID and sampled packet to
>> userspace. Using the ID, userspace can recover the sFlow info and send
>> sampled packet to the right sFlow monitoring host.
>>
>> GitHub Actions:
>> v9: https://github.com/mishuang2017/ovs/actions/runs/422310251
>>
>> v2-v1:
>> - Fix robot errors.
>> v3-v2:
>> - Remove Gerrit Change-Id.
>> - Add patch #9 to fix older kernels build issue.
>> - Add travis test result.
>> v4-v3:
>> - Fix offload issue when sampling rate is 1.
>> v5-v4:
>> - Move polling thread from ofproto to netdev-offload-tc.
>> v6-v5:
>> - Rebase.
>> - Add GitHub Actions test result.
>> v7-v6:
>> - Remove Gerrit Change-Id.
>> - Fix "ERROR: Inappropriate spacing around cast"
>> v8-v7
>> - Address Eelco Chaudron's comment for patch #11.
>> v9-v8
>> - Remove sflow_len from struct dpif_sflow_attr.
>> - Log a debug message for other userspace actions.
>>
>> Chris Mi (11):
>>    compat: Add psample and tc sample action defines for older kernels
>>    ovs-kmod-ctl: Load kernel module psample
>>    dpif: Introduce register sFlow upcall callback API
>>    ofproto: Add upcall callback to process sFlow packet
>>    netdev-offload: Introduce register sFlow upcall callback API
>>    netdev-offload-tc: Implement register sFlow upcall callback API
>>    dpif-netlink: Implement register sFlow upcall callback API
>>    netdev-offload-tc: Introduce group ID management API
>>    netdev-offload-tc: Create psample netlink socket
>>    netdev-offload-tc: Add psample receive handler
>>    netdev-offload-tc: Add offload support for sFlow
>>
>>   include/linux/automake.mk        |   4 +-
>>   include/linux/psample.h          |  58 +++
>>   include/linux/tc_act/tc_sample.h |  25 ++
>>   lib/dpif-netdev.c                |   1 +
>>   lib/dpif-netlink.c               |  27 ++
>>   lib/dpif-netlink.h               |   4 +
>>   lib/dpif-provider.h              |  10 +
>>   lib/dpif.c                       |   8 +
>>   lib/dpif.h                       |  23 ++
>>   lib/netdev-offload-provider.h    |   3 +
>>   lib/netdev-offload-tc.c          | 600 ++++++++++++++++++++++++++++++-
>>   lib/netdev-offload.c             |  30 ++
>>   lib/netdev-offload.h             |   4 +
>>   lib/tc.c                         |  61 +++-
>>   lib/tc.h                         |  10 +-
>>   ofproto/ofproto-dpif-upcall.c    |  42 +++
>>   utilities/ovs-kmod-ctl.in        |  14 +
>>   17 files changed, 912 insertions(+), 12 deletions(-)
>>   create mode 100644 include/linux/psample.h
>>   create mode 100644 include/linux/tc_act/tc_sample.h
>>
Chris Mi Jan. 11, 2021, 2:07 p.m. UTC | #3
Thanks for the update, Eelco :)

-Chris

On 1/11/2021 9:20 PM, Eelco Chaudron wrote:
> Hi Chris,
>
> It’s on my TODO list for this week, hoping nothing else will comes up…
>
> //Eelco
>
>
> BTW: I also have some patches waiting for review ;)
>
>
> On 11 Jan 2021, at 3:25, Chris Mi wrote:
>
>> Hi,
>>
>> A reminder. I pushed the first version to the community in September.
>> All most 4 mouths passed. I'm wondering if we can speed up a little bit. :)
>>
>> Thanks,
>> Chris
>>
>> On 12/15/2020 11:38 AM, Chris Mi wrote:
>>> This patch set adds offload support for sFlow.
>>>
>>> Psample is a genetlink channel for packet sampling. TC action act_sample
>>> uses psample to send sampled packets to userspace.
>>>
>>> When offloading sample action to TC, userspace creates a unique ID to
>>> map sFlow action and tunnel info and passes this ID to kernel instead
>>> of the sFlow info. psample will send this ID and sampled packet to
>>> userspace. Using the ID, userspace can recover the sFlow info and send
>>> sampled packet to the right sFlow monitoring host.
>>>
>>> GitHub Actions:
>>> v9: https://github.com/mishuang2017/ovs/actions/runs/422310251
>>>
>>> v2-v1:
>>> - Fix robot errors.
>>> v3-v2:
>>> - Remove Gerrit Change-Id.
>>> - Add patch #9 to fix older kernels build issue.
>>> - Add travis test result.
>>> v4-v3:
>>> - Fix offload issue when sampling rate is 1.
>>> v5-v4:
>>> - Move polling thread from ofproto to netdev-offload-tc.
>>> v6-v5:
>>> - Rebase.
>>> - Add GitHub Actions test result.
>>> v7-v6:
>>> - Remove Gerrit Change-Id.
>>> - Fix "ERROR: Inappropriate spacing around cast"
>>> v8-v7
>>> - Address Eelco Chaudron's comment for patch #11.
>>> v9-v8
>>> - Remove sflow_len from struct dpif_sflow_attr.
>>> - Log a debug message for other userspace actions.
>>>
>>> Chris Mi (11):
>>>     compat: Add psample and tc sample action defines for older kernels
>>>     ovs-kmod-ctl: Load kernel module psample
>>>     dpif: Introduce register sFlow upcall callback API
>>>     ofproto: Add upcall callback to process sFlow packet
>>>     netdev-offload: Introduce register sFlow upcall callback API
>>>     netdev-offload-tc: Implement register sFlow upcall callback API
>>>     dpif-netlink: Implement register sFlow upcall callback API
>>>     netdev-offload-tc: Introduce group ID management API
>>>     netdev-offload-tc: Create psample netlink socket
>>>     netdev-offload-tc: Add psample receive handler
>>>     netdev-offload-tc: Add offload support for sFlow
>>>
>>>    include/linux/automake.mk        |   4 +-
>>>    include/linux/psample.h          |  58 +++
>>>    include/linux/tc_act/tc_sample.h |  25 ++
>>>    lib/dpif-netdev.c                |   1 +
>>>    lib/dpif-netlink.c               |  27 ++
>>>    lib/dpif-netlink.h               |   4 +
>>>    lib/dpif-provider.h              |  10 +
>>>    lib/dpif.c                       |   8 +
>>>    lib/dpif.h                       |  23 ++
>>>    lib/netdev-offload-provider.h    |   3 +
>>>    lib/netdev-offload-tc.c          | 600 ++++++++++++++++++++++++++++++-
>>>    lib/netdev-offload.c             |  30 ++
>>>    lib/netdev-offload.h             |   4 +
>>>    lib/tc.c                         |  61 +++-
>>>    lib/tc.h                         |  10 +-
>>>    ofproto/ofproto-dpif-upcall.c    |  42 +++
>>>    utilities/ovs-kmod-ctl.in        |  14 +
>>>    17 files changed, 912 insertions(+), 12 deletions(-)
>>>    create mode 100644 include/linux/psample.h
>>>    create mode 100644 include/linux/tc_act/tc_sample.h
>>>