mbox series

[ovs-dev,v5,00/12] Add offload support for sFlow

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

Message

Chris Mi Oct. 29, 2020, 11:23 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.

Travis:
v5: https://travis-ci.com/github/mishuang2017/ovs/builds/195422006

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.

Chris Mi (12):
  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: Remove redundant ovsthread once
  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                       |  26 ++
 lib/netdev-offload-provider.h    |   3 +
 lib/netdev-offload-tc.c          | 594 ++++++++++++++++++++++++++++++-
 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, 902 insertions(+), 19 deletions(-)
 create mode 100644 include/linux/psample.h
 create mode 100644 include/linux/tc_act/tc_sample.h

Comments

Chris Mi Nov. 10, 2020, 11:48 a.m. UTC | #1
Hi Ilya,

Any comments for this patch set?

Thanks,
Chris

On Thu, 2020-10-29 at 19:23 +0800, 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.
> 
> Travis:
> v5: 
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftravis-ci.com%2Fgithub%2Fmishuang2017%2Fovs%2Fbuilds%2F195422006&data=02%7C01%7Ccmi%40nvidia.com%7C8048d7a70bcf43b69c5108d87bfd1df6%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C637395674367205649&sdata=Uz6So8Kw1VBw2MYBVIUAWMhGJkv1uverdI5fFLLPAtk%3D&reserved=0
> 
> 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.
> 
> Chris Mi (12):
>   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: Remove redundant ovsthread once
>   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                       |  26 ++
>  lib/netdev-offload-provider.h    |   3 +
>  lib/netdev-offload-tc.c          | 594
> ++++++++++++++++++++++++++++++-
>  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, 902 insertions(+), 19 deletions(-)
>  create mode 100644 include/linux/psample.h
>  create mode 100644 include/linux/tc_act/tc_sample.h
>