diff options
author | Daode Huang <huangdaode@hisilicon.com> | 2016-06-21 11:56:31 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-21 04:51:55 -0400 |
commit | b76238168991f8b000c90ba053f6f125e4cf1e8c (patch) | |
tree | 6026356b91fc06fbd05463878d666d443ec70a1f /drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h | |
parent | 379d3954923537df4d895cb9d1ce36d8a7888d17 (diff) |
net: hns: add spin lock for tcam table operation
This patch adds spin lock for tcam table operation,
there maybe a race condition happens when more than
one thread try to change the tcam talbe entries.
Signed-off-by: Daode Huang <huangdaode@hisilicon.com>
Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h index 00a13debbf9a..1daf018d9071 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h @@ -322,6 +322,8 @@ struct dsaf_device { struct dsaf_hw_stats hw_stats[DSAF_NODE_NUM]; struct dsaf_int_stat int_stat; + /* make sure tcam table config spinlock */ + spinlock_t tcam_lock; }; static inline void *hns_dsaf_dev_priv(const struct dsaf_device *dsaf_dev) |