From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Fastabend Subject: Re: [RFC net-next 2/9] net/switchdev: Introduce hardware offload support Date: Mon, 01 Feb 2016 01:26:06 -0800 Message-ID: <56AF24AE.8030101@gmail.com> References: <1454315685-32202-1-git-send-email-amir@vadai.me> <1454315685-32202-3-git-send-email-amir@vadai.me> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: Or Gerlitz , Hadar Har-Zion , Jiri Pirko , Jamal Hadi Salim , Scott Feldman To: Amir Vadai , "David S. Miller" , netdev@vger.kernel.org, John Fastabend Return-path: Received: from mail-pa0-f47.google.com ([209.85.220.47]:34102 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752155AbcBAJ0V (ORCPT ); Mon, 1 Feb 2016 04:26:21 -0500 Received: by mail-pa0-f47.google.com with SMTP id uo6so80489542pac.1 for ; Mon, 01 Feb 2016 01:26:21 -0800 (PST) In-Reply-To: <1454315685-32202-3-git-send-email-amir@vadai.me> Sender: netdev-owner@vger.kernel.org List-ID: On 16-02-01 12:34 AM, Amir Vadai wrote: > Extend the switchdev API with new operations: switchdev_port_flow_add() > and switchdev_port_flow_del(). > It allows the user to add/del a hardware offloaded flow classification > and actions. > For every new flow object a cookie is supplied. This cookie will be > used later on to identify the flow when removed. > > In order to make the API as flexible as possible, flow_dissector is > being used to describe the flow classifier. > > Every new flow object is consists of a flow_dissector+key+mask to > describe the classifier and a switchdev_obj_port_flow_act to describe > the actions and their attributes. > > object is passed to the lower layer driver to be pushed into the > hardware. > > Signed-off-by: Amir Vadai > --- +Scott [...] > +struct switchdev_obj_port_flow { > + struct switchdev_obj obj; > + > + unsigned long cookie; > + struct flow_dissector *dissector; /* Dissector for mask and keys */ > + void *mask; /* Flow keys mask */ > + void *key; /* Flow keys */ The heavy use of void* here and below seems questionable to me. If your going to consume flow keys/mask define them. > + struct switchdev_obj_port_flow_act *actions; > +}; [...]