Skip to content

Commit

Permalink
Merge branch 'aquantia-add-rx-flow-filter-support'
Browse files Browse the repository at this point in the history
Igor Russkikh says:

====================
net: aquantia: add rx-flow filter support

In this patchset the rx-flow filters functionality and vlan filter offloads
are implemented.

The rules in NIC hardware have fixed order and priorities.
To support this, the locations of filters from ethtool perspective are also fixed:

* Locations 0 - 15 for VLAN ID filters
* Locations 16 - 31 for L2 EtherType and PCP filters
* Locations 32 - 39 for L3/L4 5-tuple filters (locations 32, 36 for IPv6)
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Nov 14, 2018
2 parents 4fd3e2a + 7975d2a commit 15cef30
Show file tree
Hide file tree
Showing 15 changed files with 1,531 additions and 36 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/aquantia/atlantic/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ atlantic-objs := aq_main.o \
aq_ring.o \
aq_hw_utils.o \
aq_ethtool.o \
aq_filters.o \
hw_atl/hw_atl_a0.o \
hw_atl/hw_atl_b0.o \
hw_atl/hw_atl_utils.o \
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/aquantia/atlantic/aq_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <linux/etherdevice.h>
#include <linux/pci.h>

#include <linux/if_vlan.h>
#include "ver.h"
#include "aq_cfg.h"
#include "aq_utils.h"
Expand Down
31 changes: 31 additions & 0 deletions drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "aq_ethtool.h"
#include "aq_nic.h"
#include "aq_vec.h"
#include "aq_filters.h"

static void aq_ethtool_get_regs(struct net_device *ndev,
struct ethtool_regs *regs, void *p)
Expand Down Expand Up @@ -213,7 +214,36 @@ static int aq_ethtool_get_rxnfc(struct net_device *ndev,
case ETHTOOL_GRXRINGS:
cmd->data = cfg->vecs;
break;
case ETHTOOL_GRXCLSRLCNT:
cmd->rule_cnt = aq_get_rxnfc_count_all_rules(aq_nic);
break;
case ETHTOOL_GRXCLSRULE:
err = aq_get_rxnfc_rule(aq_nic, cmd);
break;
case ETHTOOL_GRXCLSRLALL:
err = aq_get_rxnfc_all_rules(aq_nic, cmd, rule_locs);
break;
default:
err = -EOPNOTSUPP;
break;
}

return err;
}

static int aq_ethtool_set_rxnfc(struct net_device *ndev,
struct ethtool_rxnfc *cmd)
{
int err = 0;
struct aq_nic_s *aq_nic = netdev_priv(ndev);

switch (cmd->cmd) {
case ETHTOOL_SRXCLSRLINS:
err = aq_add_rxnfc_rule(aq_nic, cmd);
break;
case ETHTOOL_SRXCLSRLDEL:
err = aq_del_rxnfc_rule(aq_nic, cmd);
break;
default:
err = -EOPNOTSUPP;
break;
Expand Down Expand Up @@ -520,6 +550,7 @@ const struct ethtool_ops aq_ethtool_ops = {
.get_rxfh_key_size = aq_ethtool_get_rss_key_size,
.get_rxfh = aq_ethtool_get_rss,
.get_rxnfc = aq_ethtool_get_rxnfc,
.set_rxnfc = aq_ethtool_set_rxnfc,
.get_sset_count = aq_ethtool_get_sset_count,
.get_ethtool_stats = aq_ethtool_stats,
.get_link_ksettings = aq_ethtool_get_link_ksettings,
Expand Down
Loading

0 comments on commit 15cef30

Please sign in to comment.