summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c
diff options
context:
space:
mode:
authorKumar Sanghvi <kumaras@chelsio.com>2017-10-18 20:49:12 +0530
committerDavid S. Miller <davem@davemloft.net>2017-10-20 13:06:53 +0100
commit202187c34c7e3efd9662a25977cddef6e7dec572 (patch)
treec87a83a7eae41b024cfbfeedf2e8dab410538c59 /drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c
parent3bdb376e6944134d0f4d6d65497054a54ef273c9 (diff)
downloadblackbird-op-linux-202187c34c7e3efd9662a25977cddef6e7dec572.tar.gz
blackbird-op-linux-202187c34c7e3efd9662a25977cddef6e7dec572.zip
cxgb4: add tc flower support for ETH-SMAC rewrite
Adds support for ETH-SMAC rewrite via TC-PEDIT action. Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c')
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c
index 7c8b0c65934c..34d67a2a86f4 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c
@@ -45,6 +45,8 @@
struct ch_tc_pedit_fields pedits[] = {
PEDIT_FIELDS(ETH_, DMAC_31_0, 4, dmac, 0),
PEDIT_FIELDS(ETH_, DMAC_47_32, 2, dmac, 4),
+ PEDIT_FIELDS(ETH_, SMAC_15_0, 2, smac, 0),
+ PEDIT_FIELDS(ETH_, SMAC_47_16, 4, smac, 2),
};
static struct ch_tc_flower_entry *allocate_flower_entry(void)
@@ -291,6 +293,13 @@ static void process_pedit_field(struct ch_filter_specification *fs, u32 val,
case PEDIT_ETH_DMAC_47_32_SMAC_15_0:
if (~mask & PEDIT_ETH_DMAC_MASK)
offload_pedit(fs, val, mask, ETH_DMAC_47_32);
+ else
+ offload_pedit(fs, val >> 16, mask >> 16,
+ ETH_SMAC_15_0);
+ break;
+ case PEDIT_ETH_SMAC_47_16:
+ fs->newsmac = 1;
+ offload_pedit(fs, val, mask, ETH_SMAC_47_16);
}
}
}
@@ -440,6 +449,7 @@ static int cxgb4_validate_flow_actions(struct net_device *dev,
switch (offset) {
case PEDIT_ETH_DMAC_31_0:
case PEDIT_ETH_DMAC_47_32_SMAC_15_0:
+ case PEDIT_ETH_SMAC_47_16:
break;
default:
netdev_err(dev, "%s: Unsupported pedit field\n",
OpenPOWER on IntegriCloud