aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/qlogic/qede/qede_filter.c
diff options
context:
space:
mode:
authorManish Chopra <manish.chopra@cavium.com>2018-05-24 09:54:53 -0700
committerDavid S. Miller <davem@davemloft.net>2018-05-25 16:10:42 -0400
commit608e00d0a2eb53079c55dc9c14d8711bbb3a4390 (patch)
tree8bcd124b8ae3a1291dccdce055c738144a14c9e4 /drivers/net/ethernet/qlogic/qede/qede_filter.c
parentqede: Support flow classification to the VFs. (diff)
downloadlinux-dev-608e00d0a2eb53079c55dc9c14d8711bbb3a4390.tar.xz
linux-dev-608e00d0a2eb53079c55dc9c14d8711bbb3a4390.zip
qed*: Support drop action classification
With this patch, User can configure for the supported flows to be dropped. Added a stat "gft_filter_drop" as well to be populated in ethtool for the dropped flows. For example - ethtool -N p5p1 flow-type udp4 dst-port 8000 action -1 ethtool -N p5p1 flow-type tcp4 scr-ip 192.168.8.1 action -1 Signed-off-by: Manish Chopra <manish.chopra@cavium.com> Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com> Signed-off-by: Ariel Elior <ariel.elior@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qede/qede_filter.c')
-rw-r--r--drivers/net/ethernet/qlogic/qede/qede_filter.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/ethernet/qlogic/qede/qede_filter.c
index 6c02c21d996d..e9e088d9c815 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_filter.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c
@@ -90,6 +90,7 @@ struct qede_arfs_fltr_node {
bool filter_op;
bool used;
u8 fw_rc;
+ bool b_is_drop;
struct hlist_node node;
};
@@ -125,6 +126,7 @@ static void qede_configure_arfs_fltr(struct qede_dev *edev,
params.length = n->buf_len;
params.qid = rxq_id;
params.b_is_add = add_fltr;
+ params.b_is_drop = n->b_is_drop;
if (n->vfid) {
params.b_is_vf = true;
@@ -1445,6 +1447,9 @@ int qede_get_cls_rule_entry(struct qede_dev *edev, struct ethtool_rxnfc *cmd)
fsp->ring_cookie |= ((u64)fltr->vfid) <<
ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF;
}
+
+ if (fltr->b_is_drop)
+ fsp->ring_cookie = RX_CLS_FLOW_DISC;
unlock:
__qede_unlock(edev);
return rc;
@@ -1816,6 +1821,10 @@ static int qede_flow_spec_validate(struct qede_dev *edev,
return -EINVAL;
}
+ /* If drop requested then no need to validate other data */
+ if (fs->ring_cookie == RX_CLS_FLOW_DISC)
+ return 0;
+
if (ethtool_get_flow_spec_ring_vf(fs->ring_cookie))
return 0;
@@ -1852,6 +1861,11 @@ static void qede_flow_set_destination(struct qede_dev *edev,
struct qede_arfs_fltr_node *n,
struct ethtool_rx_flow_spec *fs)
{
+ if (fs->ring_cookie == RX_CLS_FLOW_DISC) {
+ n->b_is_drop = true;
+ return;
+ }
+
n->vfid = ethtool_get_flow_spec_ring_vf(fs->ring_cookie);
n->rxq_id = ethtool_get_flow_spec_ring(fs->ring_cookie);
n->next_rxq_id = n->rxq_id;