OSDN Git Service

octeontx2-pf: Do not modify number of rules
authorSubbaraya Sundeep <sbhatta@marvell.com>
Thu, 18 Mar 2021 14:15:42 +0000 (19:45 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Mar 2021 21:12:41 +0000 (14:12 -0700)
commitf41b2d67d767f34bcd29fab83efaddb7f1e54579
treed5acabc8d7a49ad8b0f84bb0a6a283e4a70b2d63
parent804741ac7b9f2fdebe3740cb0579cb8d94d49e60
octeontx2-pf: Do not modify number of rules

In the ETHTOOL_GRXCLSRLALL ioctl ethtool uses
below structure to read number of rules from the driver.

    struct ethtool_rxnfc {
            __u32                           cmd;
            __u32                           flow_type;
            __u64                           data;
            struct ethtool_rx_flow_spec     fs;
            union {
                    __u32                   rule_cnt;
                    __u32                   rss_context;
            };
            __u32                           rule_locs[0];
    };

Driver must not modify rule_cnt member. But currently driver
modifies it by modifying rss_context. Hence fix it by using a
local variable.

Fixes: 81a4362016e7 ("octeontx2-pf: Add RSS multi group support")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c