On Mon, Apr 9, 2018 at 8:15 PM, Jason Gunthorpe <jgg@xxxxxxxx> wrote: > On Sun, Apr 08, 2018 at 11:21:59AM +0300, Mark Bloch wrote: > >> >> +## 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 >> > >> > ? >> >> Well, this is mostly true, the HW might be doing some modification to the >> headers, like writing the correct checksum value/proper length and stuff >> like that, but it's all pretty standard stuff when it comes to encapsulation. > > Well.. that is a big issue and needs careful explanation. > > How is the user space to know if the driver supports the 'special' > transformations ? > > Seems like a pretty big gap. > yes, HW capabilities is missing. I suggest we replace the 'enum type' with 'int flags'. enum ibv_flow_action_encap_flags { IBV_ENCAP_FLAGS_CSUM = 1 << 0, /* HW offload to calc outer and inner CSUM for IP and TCP headers */ IBV_ENCAP_FLAGS_VXLAN_SPORT_ENTROPY = 1 << 1, /* HW offload calc of UDP src port entropy value based on inner packet headers */ }; So if user tries to create encap action with CSUM offload and HW does not support, action creation will fail. The providers might want to walk the users header to check what user is trying to do and match these with the flags provided. >> > Given that is RAW the right proto mode? Maybe just 'PREPEND' ? >> I think RAW is better, as there might be some other vendors that will need to provide >> a type, like MPLS/GRE/VXLAN, and then the PREPEND will look out of place as they >> all do pre append. > > If the HW is changing it then RAW is not a good name. True, this functionality will prepending user bytes to the original packet, but the common kernel network term is to 'encapsulate' the original packet with new headers. Still this needs to be better explained in the V2 man page. Alex -- 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