Re: [PATCH net-next v1 1/1] net: openvswitch: ovs_packet_cmd_execute put sw_flow mainbody in stack

From: Eddy Tao
Date: Mon Feb 20 2023 - 02:11:36 EST


Hi, Simon:


    About your concern for the stack size, it leads to more room for improvement.

I will file a new version which will have smaller stack occupation and better performance


The new revision is invoked by existing examples of using struct in stack, in the same file net/openvswitch/datapath.c

struct sw_flow_actions *get_flow_actions(..)
{
    struct sw_flow_key masked_key;==> sizeof sw_flow_key is 464 bytes

static noinline_for_stack int
ovs_nla_init_match_and_action(..)
{
    struct sw_flow_mask mask;==> sizeof sw_flow_mask is 496 bytes


The first example reminded me, revisiting the code in ovs_packet_cmd_execute, basically sw_flow serves as a container for sw_flow_actions and sw_flow_key only.

We do not need the bulk of tunnel info memory in sw_flow, which saves us 200+ bytes further -- less is more.


The new revision will be presented shortly after some sanity and benchmark

eddy