]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: mvpp2: cls: Extract the RSS context when parsing the ethtool rule
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Fri, 24 May 2019 10:05:53 +0000 (12:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:10:16 +0000 (09:10 +0200)
[ Upstream commit c561da68038a738f30eca21456534c2d1872d13d ]

ethtool_rx_flow_rule_create takes into parameter the ethtool flow spec,
which doesn't contain the rss context id. We therefore need to extract
it ourself before parsing the ethtool rule.

The FLOW_RSS flag is only set in info->fs.flow_type, and not
info->flow_type.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c

index a57d17ab91f04749fa090bcc371956bbf45c6f9e..fb06c0aa620a97d39ec575ed263c38c10bb78597 100644 (file)
@@ -1242,6 +1242,12 @@ int mvpp2_ethtool_cls_rule_ins(struct mvpp2_port *port,
 
        input.fs = &info->fs;
 
+       /* We need to manually set the rss_ctx, since this info isn't present
+        * in info->fs
+        */
+       if (info->fs.flow_type & FLOW_RSS)
+               input.rss_ctx = info->rss_context;
+
        ethtool_rule = ethtool_rx_flow_rule_create(&input);
        if (IS_ERR(ethtool_rule)) {
                ret = PTR_ERR(ethtool_rule);