I think you want packet->size instead of sizeof *packet, but otherwise
that seems reasonable enough.

If you plan to have the controller send packets back through the
switch as OpenFlow "packet-out" messages, then you'll need some way to
avoid looping those back out to the controller, too.

On Mon, Jul 23, 2012 at 01:35:17PM -0700, Abhishek Chanda wrote:
> Hi Ben,
> 
> Thanks for the reply.
> I do not have a tight performance constraint for now. So, I think I
> will work with the userspace datapath.
> I think I need to modify dp_netdev_execute_actions in
> lib/dpif-netdev.c and add a condition like:
> if (sizeof(*packet) > threshold)
>      dp_netdev_output_port(dp, packet, nl_attr_get_u32(a));
> before the switch starts.
> 
> Please let me know if I am missing something else.
> 
> Thanks
> 
> On Mon, Jul 23, 2012 at 11:05 AM, Ben Pfaff <[email protected]> wrote:
> > On Mon, Jul 23, 2012 at 11:02:50AM -0700, Abhishek Chanda wrote:
> >> I have a requirement where I need to send all packets beyond a
> >> specific size to the controller, I am pretty sure that this is very
> >> specific to my case a not a general scenario. I am trying to modify
> >> OVS to do this. I noticed that the vswicthd maintains all net devices,
> >> so I think I need to change the ofproto_run function in ofproto.c. But
> >> I could not find a place where a network device is read and the packet
> >> is processed. Where else should I look?
> >
> > What are your performance requirements?  If they are low, then you can
> > use the userspace datapath and modify lib/dpif-netdev.c.  If they are
> > high, then you will have to modify the kernel module in datapath/ to
> > be able to do this.
_______________________________________________
discuss mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/discuss

Reply via email to