diff options
author | Vipul Pandya <vipul@chelsio.com> | 2012-12-10 04:30:56 -0500 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2012-12-20 02:03:12 -0500 |
commit | 793dad94e7455c113e391bd3d418c7b95a4c2687 (patch) | |
tree | c5352be56d70a9ac46b81da71fb6c8c0e06a2566 /drivers/net/ethernet | |
parent | 1cab775c3e75f1250c965feafd061d696df36e53 (diff) |
RDMA/cxgb4: Fix bug for active and passive LE hash collision path
Retries active opens for INUSE errors.
Logs any active ofld_connect_wr error replies.
Sends ofld_connect_wr on same ctrlq. It needs to go on the same control txq as
regular CPL active/passive messages.
Retries on active open replies with EADDRINUSE.
Uses active open fw wr only if active filter region is set.
Adds stat for ofld_connect_wr failures.
This patch also adds debugfs file to show endpoints.
Signed-off-by: Vipul Pandya <vipul@chelsio.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 19 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h | 8 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/t4_regs.h | 2 |
4 files changed, 24 insertions, 6 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h index 46ddd432cdf2..6db997c78a5f 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | |||
@@ -530,6 +530,7 @@ struct adapter { | |||
530 | struct net_device *port[MAX_NPORTS]; | 530 | struct net_device *port[MAX_NPORTS]; |
531 | u8 chan_map[NCHAN]; /* channel -> port map */ | 531 | u8 chan_map[NCHAN]; /* channel -> port map */ |
532 | 532 | ||
533 | u32 filter_mode; | ||
533 | unsigned int l2t_start; | 534 | unsigned int l2t_start; |
534 | unsigned int l2t_end; | 535 | unsigned int l2t_end; |
535 | struct l2t_data *l2t; | 536 | struct l2t_data *l2t; |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index a7830a1d8b89..f0718e1a8369 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | |||
@@ -2670,7 +2670,8 @@ static int tid_init(struct tid_info *t) | |||
2670 | * Returns <0 on error and one of the %NET_XMIT_* values on success. | 2670 | * Returns <0 on error and one of the %NET_XMIT_* values on success. |
2671 | */ | 2671 | */ |
2672 | int cxgb4_create_server(const struct net_device *dev, unsigned int stid, | 2672 | int cxgb4_create_server(const struct net_device *dev, unsigned int stid, |
2673 | __be32 sip, __be16 sport, unsigned int queue) | 2673 | __be32 sip, __be16 sport, __be16 vlan, |
2674 | unsigned int queue) | ||
2674 | { | 2675 | { |
2675 | unsigned int chan; | 2676 | unsigned int chan; |
2676 | struct sk_buff *skb; | 2677 | struct sk_buff *skb; |
@@ -3043,7 +3044,7 @@ static void uld_attach(struct adapter *adap, unsigned int uld) | |||
3043 | lli.ucq_density = 1 << QUEUESPERPAGEPF0_GET( | 3044 | lli.ucq_density = 1 << QUEUESPERPAGEPF0_GET( |
3044 | t4_read_reg(adap, SGE_INGRESS_QUEUES_PER_PAGE_PF) >> | 3045 | t4_read_reg(adap, SGE_INGRESS_QUEUES_PER_PAGE_PF) >> |
3045 | (adap->fn * 4)); | 3046 | (adap->fn * 4)); |
3046 | lli.filt_mode = tp_vlan_pri_map; | 3047 | lli.filt_mode = adap->filter_mode; |
3047 | /* MODQ_REQ_MAP sets queues 0-3 to chan 0-3 */ | 3048 | /* MODQ_REQ_MAP sets queues 0-3 to chan 0-3 */ |
3048 | for (i = 0; i < NCHAN; i++) | 3049 | for (i = 0; i < NCHAN; i++) |
3049 | lli.tx_modq[i] = i; | 3050 | lli.tx_modq[i] = i; |
@@ -3307,7 +3308,8 @@ static int delete_filter(struct adapter *adapter, unsigned int fidx) | |||
3307 | } | 3308 | } |
3308 | 3309 | ||
3309 | int cxgb4_create_server_filter(const struct net_device *dev, unsigned int stid, | 3310 | int cxgb4_create_server_filter(const struct net_device *dev, unsigned int stid, |
3310 | __be32 sip, __be16 sport, unsigned int queue) | 3311 | __be32 sip, __be16 sport, __be16 vlan, |
3312 | unsigned int queue, unsigned char port, unsigned char mask) | ||
3311 | { | 3313 | { |
3312 | int ret; | 3314 | int ret; |
3313 | struct filter_entry *f; | 3315 | struct filter_entry *f; |
@@ -3339,11 +3341,16 @@ int cxgb4_create_server_filter(const struct net_device *dev, unsigned int stid, | |||
3339 | f->fs.val.lport = cpu_to_be16(sport); | 3341 | f->fs.val.lport = cpu_to_be16(sport); |
3340 | f->fs.mask.lport = ~0; | 3342 | f->fs.mask.lport = ~0; |
3341 | val = (u8 *)&sip; | 3343 | val = (u8 *)&sip; |
3342 | if ((val[0] | val[1] | val[2] | val[3]) != 0) | 3344 | if ((val[0] | val[1] | val[2] | val[3]) != 0) { |
3343 | for (i = 0; i < 4; i++) { | 3345 | for (i = 0; i < 4; i++) { |
3344 | f->fs.val.lip[i] = val[i]; | 3346 | f->fs.val.lip[i] = val[i]; |
3345 | f->fs.mask.lip[i] = ~0; | 3347 | f->fs.mask.lip[i] = ~0; |
3346 | } | 3348 | } |
3349 | if (adap->filter_mode & F_PORT) { | ||
3350 | f->fs.val.iport = port; | ||
3351 | f->fs.mask.iport = mask; | ||
3352 | } | ||
3353 | } | ||
3347 | 3354 | ||
3348 | f->fs.dirsteer = 1; | 3355 | f->fs.dirsteer = 1; |
3349 | f->fs.iq = queue; | 3356 | f->fs.iq = queue; |
@@ -4450,6 +4457,10 @@ static int adap_init0(struct adapter *adap) | |||
4450 | for (j = 0; j < NCHAN; j++) | 4457 | for (j = 0; j < NCHAN; j++) |
4451 | adap->params.tp.tx_modq[j] = j; | 4458 | adap->params.tp.tx_modq[j] = j; |
4452 | 4459 | ||
4460 | t4_read_indirect(adap, TP_PIO_ADDR, TP_PIO_DATA, | ||
4461 | &adap->filter_mode, 1, | ||
4462 | TP_VLAN_PRI_MAP); | ||
4463 | |||
4453 | adap->flags |= FW_OK; | 4464 | adap->flags |= FW_OK; |
4454 | return 0; | 4465 | return 0; |
4455 | 4466 | ||
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h index 065bbd5b2411..e2bbc7f3e2de 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/cache.h> | 38 | #include <linux/cache.h> |
39 | #include <linux/spinlock.h> | 39 | #include <linux/spinlock.h> |
40 | #include <linux/skbuff.h> | 40 | #include <linux/skbuff.h> |
41 | #include <linux/inetdevice.h> | ||
41 | #include <linux/atomic.h> | 42 | #include <linux/atomic.h> |
42 | 43 | ||
43 | /* CPL message priority levels */ | 44 | /* CPL message priority levels */ |
@@ -151,9 +152,12 @@ void cxgb4_remove_tid(struct tid_info *t, unsigned int qid, unsigned int tid); | |||
151 | struct in6_addr; | 152 | struct in6_addr; |
152 | 153 | ||
153 | int cxgb4_create_server(const struct net_device *dev, unsigned int stid, | 154 | int cxgb4_create_server(const struct net_device *dev, unsigned int stid, |
154 | __be32 sip, __be16 sport, unsigned int queue); | 155 | __be32 sip, __be16 sport, __be16 vlan, |
156 | unsigned int queue); | ||
155 | int cxgb4_create_server_filter(const struct net_device *dev, unsigned int stid, | 157 | int cxgb4_create_server_filter(const struct net_device *dev, unsigned int stid, |
156 | __be32 sip, __be16 sport, unsigned int queue); | 158 | __be32 sip, __be16 sport, __be16 vlan, |
159 | unsigned int queue, | ||
160 | unsigned char port, unsigned char mask); | ||
157 | int cxgb4_remove_server_filter(const struct net_device *dev, unsigned int stid, | 161 | int cxgb4_remove_server_filter(const struct net_device *dev, unsigned int stid, |
158 | unsigned int queue, bool ipv6); | 162 | unsigned int queue, bool ipv6); |
159 | static inline void set_wr_txq(struct sk_buff *skb, int prio, int queue) | 163 | static inline void set_wr_txq(struct sk_buff *skb, int prio, int queue) |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h b/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h index a2c29f7b7aa1..83ec5f7844ac 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h +++ b/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h | |||
@@ -1098,5 +1098,7 @@ | |||
1098 | #define A_TP_TX_SCHED_PCMD 0x25 | 1098 | #define A_TP_TX_SCHED_PCMD 0x25 |
1099 | 1099 | ||
1100 | #define S_PORT 1 | 1100 | #define S_PORT 1 |
1101 | #define V_PORT(x) ((x) << S_PORT) | ||
1102 | #define F_PORT V_PORT(1U) | ||
1101 | 1103 | ||
1102 | #endif /* __T4_REGS_H */ | 1104 | #endif /* __T4_REGS_H */ |