Re: [PATCH RFC] New verbs API for flow action: ENCAP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 04, 2018 at 12:15:53PM +0300, Alex Rosenbaum wrote:

Your diff seems to have been whitespace mangled..

> +# SYNOPSIS
> +
> +```c
> +#include <infiniband/verbs.h>
> +
> +struct ibv_flow_action *
> +ibv_create_flow_action_encap(struct ibv_context *ctx,
> +      struct ibv_flow_action_encap_attr *attr);
> +
> +int ibv_destroy_flow_action(struct ibv_flow_action *action);
> +```

> +# DESCRIPTION
> +
> +An ENCAP flow steering action allows a flow steering rule to encapsulate
> +a packet after matching.
> +
> +After the action is created, it should be associated with a *struct
> +ibv_flow_attr* using *struct ibv_flow_spec_action_handle* flow specification.
> +An action can be associated with multiple flows.
> +
> +# ARGUMENTS
> +
> +*ctx*
> +: RDMA device context to create the action on.
> +
> +*attr*
> +: ENCAP type and header to be used.
> +
> +*action*
> +: Existing action to be destroyed.
> +
> +## *action* Argument
> +
> +```c
> +struct ibv_flow_action_encap_attr {
> + enum ibv_flow_action_encap hdr_proto;
> + uint16_t                hdr_len;
> + void                    *hdr_ptr;
> +};
> +```

We don't really need this struct, we really have struct-itis in verbs,
just put these three things as function arguments.

hdr_len should be size_t and hdr_ptr is const

> +*hdr_proto*
> +: Encapsulation protocol to be used.
> +
> +*hdr_len*
> +: Length in bytes of the provided encap headers.
> +
> +*hdr_ptr*
> +: Buffing containing the encap headers.

Describe the lifetime, I assume this function copies the header
internally so hdr_ptr can be deleted by the caller immediately?

> +## Encapsulate protocols (*ibv_flow_action_encap*)
> +
> +A user can create flow actions that implement different encapsulation
> +protocols.
> +
> +*IBV_FLOW_ACTION_ENCAP_RAW* provides the ability to provide unspecified
> +encapsulation protocol, this can be expressed by passing it in *hdr_proto*.

This man page doesn't actually describe what is supposed to happen.

I guess it is something like

Prepend the given hdr_len bytes of hdr_ptr in front of the packet
before sending it

 ?

Given that is RAW the right proto mode? Maybe just 'PREPEND' ?

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux