[ovs-discuss] regarding trunc feature changes for OVS_ACTION_ATTR_USERSPACE

2019-11-12 Thread bindiya Kurle
Hi ,
i am not getting reason,why highlighted code is added for
OVS_ACTION_ATTR_USERSPACE.
What purpose it serves.
This code got added as part of feature "ofp-actions: Add truncate
action. The patch adds a new action to support packet truncation. "

Can somebody please help in understanding below part?

 file :"lib/dpif-netdev.c"
function : dp_execute_cb

case OVS_ACTION_ATTR_USERSPACE:
   .
.
.

userdata = nl_attr_find_nested(a, OVS_USERSPACE_ATTR_USERDATA);
ofpbuf_init(&actions, 0);









* if (packets_->trunc) {if (!should_steal) {
dp_packet_batch_clone(&usr_pkt, packets_);packets_
= &usr_pkt;clone = true;
dp_packet_batch_reset_cutlen(orig_packets_);}
  dp_packet_batch_apply_cutlen(packets_);*
}



return;
}
break;

regards,
Bindiya
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] regarding trunc feature changes for OVS_ACTION_ATTR_USERSPACE

2019-11-20 Thread Ben Pfaff
On Tue, Nov 12, 2019 at 01:36:09PM +0530, bindiya Kurle wrote:
> Hi ,
> i am not getting reason,why highlighted code is added for
> OVS_ACTION_ATTR_USERSPACE.
> What purpose it serves.
> This code got added as part of feature "ofp-actions: Add truncate
> action. The patch adds a new action to support packet truncation. "
> 
> Can somebody please help in understanding below part?
> 
>  file :"lib/dpif-netdev.c"
> function : dp_execute_cb
> 
> case OVS_ACTION_ATTR_USERSPACE:
>.
> .
> .
> 
> userdata = nl_attr_find_nested(a, OVS_USERSPACE_ATTR_USERDATA);
> ofpbuf_init(&actions, 0);
> 
> 
> 
> 
> 
> 
> 
> 
> 
> * if (packets_->trunc) {if (!should_steal) {
> dp_packet_batch_clone(&usr_pkt, packets_);packets_
> = &usr_pkt;clone = true;
> dp_packet_batch_reset_cutlen(orig_packets_);}
>   dp_packet_batch_apply_cutlen(packets_);*
> }

I believe that this code truncates the packets.
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss