Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
4790f4dc
Commit
4790f4dc
authored
Jan 16, 2011
by
Roland Dreier
Browse files
Options
Browse Files
Download
Plain Diff
Merge branches 'misc', 'mlx4', 'mthca', 'nes' and 'srp' into for-next
parents
f0626710
da995a8a
eb4a7cbf
843276ad
695b8349
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
297 additions
and
60 deletions
+297
-60
drivers/infiniband/hw/mlx4/main.c
drivers/infiniband/hw/mlx4/main.c
+7
-5
drivers/infiniband/hw/mthca/mthca_catas.c
drivers/infiniband/hw/mthca/mthca_catas.c
+3
-2
drivers/infiniband/hw/mthca/mthca_cmd.c
drivers/infiniband/hw/mthca/mthca_cmd.c
+1
-1
drivers/infiniband/hw/mthca/mthca_eq.c
drivers/infiniband/hw/mthca/mthca_eq.c
+1
-1
drivers/infiniband/hw/mthca/mthca_main.c
drivers/infiniband/hw/mthca/mthca_main.c
+1
-1
drivers/infiniband/hw/mthca/mthca_mr.c
drivers/infiniband/hw/mthca/mthca_mr.c
+1
-1
drivers/infiniband/hw/nes/nes.c
drivers/infiniband/hw/nes/nes.c
+30
-5
drivers/infiniband/hw/nes/nes.h
drivers/infiniband/hw/nes/nes.h
+4
-0
drivers/infiniband/hw/nes/nes_cm.c
drivers/infiniband/hw/nes/nes_cm.c
+7
-1
drivers/infiniband/hw/nes/nes_hw.c
drivers/infiniband/hw/nes/nes_hw.c
+95
-0
drivers/infiniband/hw/nes/nes_hw.h
drivers/infiniband/hw/nes/nes_hw.h
+10
-0
drivers/infiniband/hw/nes/nes_nic.c
drivers/infiniband/hw/nes/nes_nic.c
+66
-12
drivers/infiniband/hw/nes/nes_verbs.c
drivers/infiniband/hw/nes/nes_verbs.c
+36
-1
drivers/infiniband/ulp/srp/ib_srp.c
drivers/infiniband/ulp/srp/ib_srp.c
+7
-8
drivers/net/mlx4/catas.c
drivers/net/mlx4/catas.c
+3
-3
drivers/net/mlx4/en_main.c
drivers/net/mlx4/en_main.c
+2
-1
drivers/net/mlx4/main.c
drivers/net/mlx4/main.c
+1
-1
drivers/net/mlx4/mcg.c
drivers/net/mlx4/mcg.c
+13
-10
include/linux/mlx4/device.h
include/linux/mlx4/device.h
+8
-2
include/linux/mlx4/driver.h
include/linux/mlx4/driver.h
+1
-5
No files found.
drivers/infiniband/hw/mlx4/main.c
View file @
4790f4dc
...
@@ -623,8 +623,9 @@ static int mlx4_ib_mcg_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
...
@@ -623,8 +623,9 @@ static int mlx4_ib_mcg_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
struct
mlx4_ib_dev
*
mdev
=
to_mdev
(
ibqp
->
device
);
struct
mlx4_ib_dev
*
mdev
=
to_mdev
(
ibqp
->
device
);
struct
mlx4_ib_qp
*
mqp
=
to_mqp
(
ibqp
);
struct
mlx4_ib_qp
*
mqp
=
to_mqp
(
ibqp
);
err
=
mlx4_multicast_attach
(
mdev
->
dev
,
&
mqp
->
mqp
,
gid
->
raw
,
!!
(
mqp
->
flags
&
err
=
mlx4_multicast_attach
(
mdev
->
dev
,
&
mqp
->
mqp
,
gid
->
raw
,
MLX4_IB_QP_BLOCK_MULTICAST_LOOPBACK
));
!!
(
mqp
->
flags
&
MLX4_IB_QP_BLOCK_MULTICAST_LOOPBACK
),
MLX4_PROTOCOL_IB
);
if
(
err
)
if
(
err
)
return
err
;
return
err
;
...
@@ -635,7 +636,7 @@ static int mlx4_ib_mcg_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
...
@@ -635,7 +636,7 @@ static int mlx4_ib_mcg_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
return
0
;
return
0
;
err_add:
err_add:
mlx4_multicast_detach
(
mdev
->
dev
,
&
mqp
->
mqp
,
gid
->
raw
);
mlx4_multicast_detach
(
mdev
->
dev
,
&
mqp
->
mqp
,
gid
->
raw
,
MLX4_PROTOCOL_IB
);
return
err
;
return
err
;
}
}
...
@@ -665,7 +666,7 @@ static int mlx4_ib_mcg_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
...
@@ -665,7 +666,7 @@ static int mlx4_ib_mcg_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
struct
mlx4_ib_gid_entry
*
ge
;
struct
mlx4_ib_gid_entry
*
ge
;
err
=
mlx4_multicast_detach
(
mdev
->
dev
,
err
=
mlx4_multicast_detach
(
mdev
->
dev
,
&
mqp
->
mqp
,
gid
->
raw
);
&
mqp
->
mqp
,
gid
->
raw
,
MLX4_PROTOCOL_IB
);
if
(
err
)
if
(
err
)
return
err
;
return
err
;
...
@@ -1005,7 +1006,8 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
...
@@ -1005,7 +1006,8 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
if
(
mlx4_uar_alloc
(
dev
,
&
ibdev
->
priv_uar
))
if
(
mlx4_uar_alloc
(
dev
,
&
ibdev
->
priv_uar
))
goto
err_pd
;
goto
err_pd
;
ibdev
->
uar_map
=
ioremap
(
ibdev
->
priv_uar
.
pfn
<<
PAGE_SHIFT
,
PAGE_SIZE
);
ibdev
->
uar_map
=
ioremap
((
phys_addr_t
)
ibdev
->
priv_uar
.
pfn
<<
PAGE_SHIFT
,
PAGE_SIZE
);
if
(
!
ibdev
->
uar_map
)
if
(
!
ibdev
->
uar_map
)
goto
err_uar
;
goto
err_uar
;
MLX4_INIT_DOORBELL_LOCK
(
&
ibdev
->
uar_lock
);
MLX4_INIT_DOORBELL_LOCK
(
&
ibdev
->
uar_lock
);
...
...
drivers/infiniband/hw/mthca/mthca_catas.c
View file @
4790f4dc
...
@@ -146,7 +146,7 @@ static void poll_catas(unsigned long dev_ptr)
...
@@ -146,7 +146,7 @@ static void poll_catas(unsigned long dev_ptr)
void
mthca_start_catas_poll
(
struct
mthca_dev
*
dev
)
void
mthca_start_catas_poll
(
struct
mthca_dev
*
dev
)
{
{
unsigned
long
addr
;
phys_addr_t
addr
;
init_timer
(
&
dev
->
catas_err
.
timer
);
init_timer
(
&
dev
->
catas_err
.
timer
);
dev
->
catas_err
.
map
=
NULL
;
dev
->
catas_err
.
map
=
NULL
;
...
@@ -158,7 +158,8 @@ void mthca_start_catas_poll(struct mthca_dev *dev)
...
@@ -158,7 +158,8 @@ void mthca_start_catas_poll(struct mthca_dev *dev)
dev
->
catas_err
.
map
=
ioremap
(
addr
,
dev
->
catas_err
.
size
*
4
);
dev
->
catas_err
.
map
=
ioremap
(
addr
,
dev
->
catas_err
.
size
*
4
);
if
(
!
dev
->
catas_err
.
map
)
{
if
(
!
dev
->
catas_err
.
map
)
{
mthca_warn
(
dev
,
"couldn't map catastrophic error region "
mthca_warn
(
dev
,
"couldn't map catastrophic error region "
"at 0x%lx/0x%x
\n
"
,
addr
,
dev
->
catas_err
.
size
*
4
);
"at 0x%llx/0x%x
\n
"
,
(
unsigned
long
long
)
addr
,
dev
->
catas_err
.
size
*
4
);
return
;
return
;
}
}
...
...
drivers/infiniband/hw/mthca/mthca_cmd.c
View file @
4790f4dc
...
@@ -713,7 +713,7 @@ int mthca_RUN_FW(struct mthca_dev *dev, u8 *status)
...
@@ -713,7 +713,7 @@ int mthca_RUN_FW(struct mthca_dev *dev, u8 *status)
static
void
mthca_setup_cmd_doorbells
(
struct
mthca_dev
*
dev
,
u64
base
)
static
void
mthca_setup_cmd_doorbells
(
struct
mthca_dev
*
dev
,
u64
base
)
{
{
unsigned
long
addr
;
phys_addr_t
addr
;
u16
max_off
=
0
;
u16
max_off
=
0
;
int
i
;
int
i
;
...
...
drivers/infiniband/hw/mthca/mthca_eq.c
View file @
4790f4dc
...
@@ -653,7 +653,7 @@ static int mthca_map_reg(struct mthca_dev *dev,
...
@@ -653,7 +653,7 @@ static int mthca_map_reg(struct mthca_dev *dev,
unsigned
long
offset
,
unsigned
long
size
,
unsigned
long
offset
,
unsigned
long
size
,
void
__iomem
**
map
)
void
__iomem
**
map
)
{
{
unsigned
long
base
=
pci_resource_start
(
dev
->
pdev
,
0
);
phys_addr_t
base
=
pci_resource_start
(
dev
->
pdev
,
0
);
*
map
=
ioremap
(
base
+
offset
,
size
);
*
map
=
ioremap
(
base
+
offset
,
size
);
if
(
!*
map
)
if
(
!*
map
)
...
...
drivers/infiniband/hw/mthca/mthca_main.c
View file @
4790f4dc
...
@@ -790,7 +790,7 @@ static int mthca_setup_hca(struct mthca_dev *dev)
...
@@ -790,7 +790,7 @@ static int mthca_setup_hca(struct mthca_dev *dev)
goto
err_uar_table_free
;
goto
err_uar_table_free
;
}
}
dev
->
kar
=
ioremap
(
dev
->
driver_uar
.
pfn
<<
PAGE_SHIFT
,
PAGE_SIZE
);
dev
->
kar
=
ioremap
(
(
phys_addr_t
)
dev
->
driver_uar
.
pfn
<<
PAGE_SHIFT
,
PAGE_SIZE
);
if
(
!
dev
->
kar
)
{
if
(
!
dev
->
kar
)
{
mthca_err
(
dev
,
"Couldn't map kernel access region, "
mthca_err
(
dev
,
"Couldn't map kernel access region, "
"aborting.
\n
"
);
"aborting.
\n
"
);
...
...
drivers/infiniband/hw/mthca/mthca_mr.c
View file @
4790f4dc
...
@@ -853,7 +853,7 @@ void mthca_arbel_fmr_unmap(struct mthca_dev *dev, struct mthca_fmr *fmr)
...
@@ -853,7 +853,7 @@ void mthca_arbel_fmr_unmap(struct mthca_dev *dev, struct mthca_fmr *fmr)
int
mthca_init_mr_table
(
struct
mthca_dev
*
dev
)
int
mthca_init_mr_table
(
struct
mthca_dev
*
dev
)
{
{
unsigned
long
addr
;
phys_addr_t
addr
;
int
mpts
,
mtts
,
err
,
i
;
int
mpts
,
mtts
,
err
,
i
;
err
=
mthca_alloc_init
(
&
dev
->
mr_table
.
mpt_alloc
,
err
=
mthca_alloc_init
(
&
dev
->
mr_table
.
mpt_alloc
,
...
...
drivers/infiniband/hw/nes/nes.c
View file @
4790f4dc
...
@@ -144,6 +144,7 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
...
@@ -144,6 +144,7 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
struct
nes_device
*
nesdev
;
struct
nes_device
*
nesdev
;
struct
net_device
*
netdev
;
struct
net_device
*
netdev
;
struct
nes_vnic
*
nesvnic
;
struct
nes_vnic
*
nesvnic
;
unsigned
int
is_bonded
;
nes_debug
(
NES_DBG_NETDEV
,
"nes_inetaddr_event: ip address %pI4, netmask %pI4.
\n
"
,
nes_debug
(
NES_DBG_NETDEV
,
"nes_inetaddr_event: ip address %pI4, netmask %pI4.
\n
"
,
&
ifa
->
ifa_address
,
&
ifa
->
ifa_mask
);
&
ifa
->
ifa_address
,
&
ifa
->
ifa_mask
);
...
@@ -152,7 +153,8 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
...
@@ -152,7 +153,8 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
nesdev
,
nesdev
->
netdev
[
0
]
->
name
);
nesdev
,
nesdev
->
netdev
[
0
]
->
name
);
netdev
=
nesdev
->
netdev
[
0
];
netdev
=
nesdev
->
netdev
[
0
];
nesvnic
=
netdev_priv
(
netdev
);
nesvnic
=
netdev_priv
(
netdev
);
if
(
netdev
==
event_netdev
)
{
is_bonded
=
(
netdev
->
master
==
event_netdev
);
if
((
netdev
==
event_netdev
)
||
is_bonded
)
{
if
(
nesvnic
->
rdma_enabled
==
0
)
{
if
(
nesvnic
->
rdma_enabled
==
0
)
{
nes_debug
(
NES_DBG_NETDEV
,
"Returning without processing event for %s since"
nes_debug
(
NES_DBG_NETDEV
,
"Returning without processing event for %s since"
" RDMA is not enabled.
\n
"
,
" RDMA is not enabled.
\n
"
,
...
@@ -169,6 +171,9 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
...
@@ -169,6 +171,9 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
nes_manage_arp_cache
(
netdev
,
netdev
->
dev_addr
,
nes_manage_arp_cache
(
netdev
,
netdev
->
dev_addr
,
ntohl
(
nesvnic
->
local_ipaddr
),
NES_ARP_DELETE
);
ntohl
(
nesvnic
->
local_ipaddr
),
NES_ARP_DELETE
);
nesvnic
->
local_ipaddr
=
0
;
nesvnic
->
local_ipaddr
=
0
;
if
(
is_bonded
)
continue
;
else
return
NOTIFY_OK
;
return
NOTIFY_OK
;
break
;
break
;
case
NETDEV_UP
:
case
NETDEV_UP
:
...
@@ -178,14 +183,23 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
...
@@ -178,14 +183,23 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
nes_debug
(
NES_DBG_NETDEV
,
"Interface already has local_ipaddr
\n
"
);
nes_debug
(
NES_DBG_NETDEV
,
"Interface already has local_ipaddr
\n
"
);
return
NOTIFY_OK
;
return
NOTIFY_OK
;
}
}
/* fall through */
case
NETDEV_CHANGEADDR
:
/* Add the address to the IP table */
/* Add the address to the IP table */
if
(
netdev
->
master
)
nesvnic
->
local_ipaddr
=
((
struct
in_device
*
)
netdev
->
master
->
ip_ptr
)
->
ifa_list
->
ifa_address
;
else
nesvnic
->
local_ipaddr
=
ifa
->
ifa_address
;
nesvnic
->
local_ipaddr
=
ifa
->
ifa_address
;
nes_write_indexed
(
nesdev
,
nes_write_indexed
(
nesdev
,
NES_IDX_DST_IP_ADDR
+
(
0x10
*
PCI_FUNC
(
nesdev
->
pcidev
->
devfn
)),
NES_IDX_DST_IP_ADDR
+
(
0x10
*
PCI_FUNC
(
nesdev
->
pcidev
->
devfn
)),
ntohl
(
ifa
->
ifa_address
));
ntohl
(
nesvnic
->
local_ipaddr
));
nes_manage_arp_cache
(
netdev
,
netdev
->
dev_addr
,
nes_manage_arp_cache
(
netdev
,
netdev
->
dev_addr
,
ntohl
(
nesvnic
->
local_ipaddr
),
NES_ARP_ADD
);
ntohl
(
nesvnic
->
local_ipaddr
),
NES_ARP_ADD
);
if
(
is_bonded
)
continue
;
else
return
NOTIFY_OK
;
return
NOTIFY_OK
;
break
;
break
;
default:
default:
...
@@ -660,6 +674,8 @@ static int __devinit nes_probe(struct pci_dev *pcidev, const struct pci_device_i
...
@@ -660,6 +674,8 @@ static int __devinit nes_probe(struct pci_dev *pcidev, const struct pci_device_i
}
}
nes_notifiers_registered
++
;
nes_notifiers_registered
++
;
INIT_DELAYED_WORK
(
&
nesdev
->
work
,
nes_recheck_link_status
);
/* Initialize network devices */
/* Initialize network devices */
if
((
netdev
=
nes_netdev_init
(
nesdev
,
mmio_regs
))
==
NULL
)
if
((
netdev
=
nes_netdev_init
(
nesdev
,
mmio_regs
))
==
NULL
)
goto
bail7
;
goto
bail7
;
...
@@ -742,6 +758,7 @@ static void __devexit nes_remove(struct pci_dev *pcidev)
...
@@ -742,6 +758,7 @@ static void __devexit nes_remove(struct pci_dev *pcidev)
struct
nes_device
*
nesdev
=
pci_get_drvdata
(
pcidev
);
struct
nes_device
*
nesdev
=
pci_get_drvdata
(
pcidev
);
struct
net_device
*
netdev
;
struct
net_device
*
netdev
;
int
netdev_index
=
0
;
int
netdev_index
=
0
;
unsigned
long
flags
;
if
(
nesdev
->
netdev_count
)
{
if
(
nesdev
->
netdev_count
)
{
netdev
=
nesdev
->
netdev
[
netdev_index
];
netdev
=
nesdev
->
netdev
[
netdev_index
];
...
@@ -768,6 +785,14 @@ static void __devexit nes_remove(struct pci_dev *pcidev)
...
@@ -768,6 +785,14 @@ static void __devexit nes_remove(struct pci_dev *pcidev)
free_irq
(
pcidev
->
irq
,
nesdev
);
free_irq
(
pcidev
->
irq
,
nesdev
);
tasklet_kill
(
&
nesdev
->
dpc_tasklet
);
tasklet_kill
(
&
nesdev
->
dpc_tasklet
);
spin_lock_irqsave
(
&
nesdev
->
nesadapter
->
phy_lock
,
flags
);
if
(
nesdev
->
link_recheck
)
{
spin_unlock_irqrestore
(
&
nesdev
->
nesadapter
->
phy_lock
,
flags
);
cancel_delayed_work_sync
(
&
nesdev
->
work
);
}
else
{
spin_unlock_irqrestore
(
&
nesdev
->
nesadapter
->
phy_lock
,
flags
);
}
/* Deallocate the Adapter Structure */
/* Deallocate the Adapter Structure */
nes_destroy_adapter
(
nesdev
->
nesadapter
);
nes_destroy_adapter
(
nesdev
->
nesadapter
);
...
...
drivers/infiniband/hw/nes/nes.h
View file @
4790f4dc
...
@@ -268,6 +268,9 @@ struct nes_device {
...
@@ -268,6 +268,9 @@ struct nes_device {
u8
napi_isr_ran
;
u8
napi_isr_ran
;
u8
disable_rx_flow_control
;
u8
disable_rx_flow_control
;
u8
disable_tx_flow_control
;
u8
disable_tx_flow_control
;
struct
delayed_work
work
;
u8
link_recheck
;
};
};
...
@@ -507,6 +510,7 @@ void nes_nic_ce_handler(struct nes_device *, struct nes_hw_nic_cq *);
...
@@ -507,6 +510,7 @@ void nes_nic_ce_handler(struct nes_device *, struct nes_hw_nic_cq *);
void
nes_iwarp_ce_handler
(
struct
nes_device
*
,
struct
nes_hw_cq
*
);
void
nes_iwarp_ce_handler
(
struct
nes_device
*
,
struct
nes_hw_cq
*
);
int
nes_destroy_cqp
(
struct
nes_device
*
);
int
nes_destroy_cqp
(
struct
nes_device
*
);
int
nes_nic_cm_xmit
(
struct
sk_buff
*
,
struct
net_device
*
);
int
nes_nic_cm_xmit
(
struct
sk_buff
*
,
struct
net_device
*
);
void
nes_recheck_link_status
(
struct
work_struct
*
work
);
/* nes_nic.c */
/* nes_nic.c */
struct
net_device
*
nes_netdev_init
(
struct
nes_device
*
,
void
__iomem
*
);
struct
net_device
*
nes_netdev_init
(
struct
nes_device
*
,
void
__iomem
*
);
...
...
drivers/infiniband/hw/nes/nes_cm.c
View file @
4790f4dc
...
@@ -1107,6 +1107,7 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
...
@@ -1107,6 +1107,7 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
struct
flowi
fl
;
struct
flowi
fl
;
struct
neighbour
*
neigh
;
struct
neighbour
*
neigh
;
int
rc
=
arpindex
;
int
rc
=
arpindex
;
struct
net_device
*
netdev
;
struct
nes_adapter
*
nesadapter
=
nesvnic
->
nesdev
->
nesadapter
;
struct
nes_adapter
*
nesadapter
=
nesvnic
->
nesdev
->
nesadapter
;
memset
(
&
fl
,
0
,
sizeof
fl
);
memset
(
&
fl
,
0
,
sizeof
fl
);
...
@@ -1117,7 +1118,12 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
...
@@ -1117,7 +1118,12 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
return
rc
;
return
rc
;
}
}
neigh
=
neigh_lookup
(
&
arp_tbl
,
&
rt
->
rt_gateway
,
nesvnic
->
netdev
);
if
(
nesvnic
->
netdev
->
master
)
netdev
=
nesvnic
->
netdev
->
master
;
else
netdev
=
nesvnic
->
netdev
;
neigh
=
neigh_lookup
(
&
arp_tbl
,
&
rt
->
rt_gateway
,
netdev
);
if
(
neigh
)
{
if
(
neigh
)
{
if
(
neigh
->
nud_state
&
NUD_VALID
)
{
if
(
neigh
->
nud_state
&
NUD_VALID
)
{
nes_debug
(
NES_DBG_CM
,
"Neighbor MAC address for 0x%08X"
nes_debug
(
NES_DBG_CM
,
"Neighbor MAC address for 0x%08X"
...
...
drivers/infiniband/hw/nes/nes_hw.c
View file @
4790f4dc
...
@@ -2608,6 +2608,13 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number)
...
@@ -2608,6 +2608,13 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number)
netif_start_queue
(
nesvnic
->
netdev
);
netif_start_queue
(
nesvnic
->
netdev
);
nesvnic
->
linkup
=
1
;
nesvnic
->
linkup
=
1
;
netif_carrier_on
(
nesvnic
->
netdev
);
netif_carrier_on
(
nesvnic
->
netdev
);
spin_lock
(
&
nesvnic
->
port_ibevent_lock
);
if
(
nesdev
->
iw_status
==
0
)
{
nesdev
->
iw_status
=
1
;
nes_port_ibevent
(
nesvnic
);
}
spin_unlock
(
&
nesvnic
->
port_ibevent_lock
);
}
}
}
}
}
else
{
}
else
{
...
@@ -2633,9 +2640,23 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number)
...
@@ -2633,9 +2640,23 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number)
netif_stop_queue
(
nesvnic
->
netdev
);
netif_stop_queue
(
nesvnic
->
netdev
);
nesvnic
->
linkup
=
0
;
nesvnic
->
linkup
=
0
;
netif_carrier_off
(
nesvnic
->
netdev
);
netif_carrier_off
(
nesvnic
->
netdev
);
spin_lock
(
&
nesvnic
->
port_ibevent_lock
);
if
(
nesdev
->
iw_status
==
1
)
{
nesdev
->
iw_status
=
0
;
nes_port_ibevent
(
nesvnic
);
}
spin_unlock
(
&
nesvnic
->
port_ibevent_lock
);
}
}
}
}
}
}
if
(
nesadapter
->
phy_type
[
mac_index
]
==
NES_PHY_TYPE_SFP_D
)
{
if
(
nesdev
->
link_recheck
)
cancel_delayed_work
(
&
nesdev
->
work
);
nesdev
->
link_recheck
=
1
;
schedule_delayed_work
(
&
nesdev
->
work
,
NES_LINK_RECHECK_DELAY
);
}
}
}
spin_unlock_irqrestore
(
&
nesadapter
->
phy_lock
,
flags
);
spin_unlock_irqrestore
(
&
nesadapter
->
phy_lock
,
flags
);
...
@@ -2643,6 +2664,80 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number)
...
@@ -2643,6 +2664,80 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number)
nesadapter
->
mac_sw_state
[
mac_number
]
=
NES_MAC_SW_IDLE
;
nesadapter
->
mac_sw_state
[
mac_number
]
=
NES_MAC_SW_IDLE
;
}
}
void
nes_recheck_link_status
(
struct
work_struct
*
work
)
{
unsigned
long
flags
;
struct
nes_device
*
nesdev
=
container_of
(
work
,
struct
nes_device
,
work
.
work
);
struct
nes_adapter
*
nesadapter
=
nesdev
->
nesadapter
;
struct
nes_vnic
*
nesvnic
;
u32
mac_index
=
nesdev
->
mac_index
;
u16
phy_data
;
u16
temp_phy_data
;
spin_lock_irqsave
(
&
nesadapter
->
phy_lock
,
flags
);
/* check link status */
nes_read_10G_phy_reg
(
nesdev
,
nesadapter
->
phy_index
[
mac_index
],
1
,
0x9003
);
temp_phy_data
=
(
u16
)
nes_read_indexed
(
nesdev
,
NES_IDX_MAC_MDIO_CONTROL
);
nes_read_10G_phy_reg
(
nesdev
,
nesadapter
->
phy_index
[
mac_index
],
3
,
0x0021
);
nes_read_indexed
(
nesdev
,
NES_IDX_MAC_MDIO_CONTROL
);
nes_read_10G_phy_reg
(
nesdev
,
nesadapter
->
phy_index
[
mac_index
],
3
,
0x0021
);
phy_data
=
(
u16
)
nes_read_indexed
(
nesdev
,
NES_IDX_MAC_MDIO_CONTROL
);
phy_data
=
(
!
temp_phy_data
&&
(
phy_data
==
0x8000
))
?
0x4
:
0x0
;
nes_debug
(
NES_DBG_PHY
,
"%s: Phy data = 0x%04X, link was %s.
\n
"
,
__func__
,
phy_data
,
nesadapter
->
mac_link_down
[
mac_index
]
?
"DOWN"
:
"UP"
);
if
(
phy_data
&
0x0004
)
{
nesadapter
->
mac_link_down
[
mac_index
]
=
0
;
list_for_each_entry
(
nesvnic
,
&
nesadapter
->
nesvnic_list
[
mac_index
],
list
)
{
if
(
nesvnic
->
linkup
==
0
)
{
printk
(
PFX
"The Link is now up for port %s, netdev %p.
\n
"
,
nesvnic
->
netdev
->
name
,
nesvnic
->
netdev
);
if
(
netif_queue_stopped
(
nesvnic
->
netdev
))
netif_start_queue
(
nesvnic
->
netdev
);
nesvnic
->
linkup
=
1
;
netif_carrier_on
(
nesvnic
->
netdev
);
spin_lock
(
&
nesvnic
->
port_ibevent_lock
);
if
(
nesdev
->
iw_status
==
0
)
{
nesdev
->
iw_status
=
1
;
nes_port_ibevent
(
nesvnic
);
}
spin_unlock
(
&
nesvnic
->
port_ibevent_lock
);
}
}
}
else
{
nesadapter
->
mac_link_down
[
mac_index
]
=
1
;
list_for_each_entry
(
nesvnic
,
&
nesadapter
->
nesvnic_list
[
mac_index
],
list
)
{
if
(
nesvnic
->
linkup
==
1
)
{
printk
(
PFX
"The Link is now down for port %s, netdev %p.
\n
"
,
nesvnic
->
netdev
->
name
,
nesvnic
->
netdev
);
if
(
!
(
netif_queue_stopped
(
nesvnic
->
netdev
)))
netif_stop_queue
(
nesvnic
->
netdev
);
nesvnic
->
linkup
=
0
;
netif_carrier_off
(
nesvnic
->
netdev
);
spin_lock
(
&
nesvnic
->
port_ibevent_lock
);
if
(
nesdev
->
iw_status
==
1
)
{
nesdev
->
iw_status
=
0
;
nes_port_ibevent
(
nesvnic
);
}
spin_unlock
(
&
nesvnic
->
port_ibevent_lock
);
}
}
}
if
(
nesdev
->
link_recheck
++
<
NES_LINK_RECHECK_MAX
)
schedule_delayed_work
(
&
nesdev
->
work
,
NES_LINK_RECHECK_DELAY
);
else
nesdev
->
link_recheck
=
0
;
spin_unlock_irqrestore
(
&
nesadapter
->
phy_lock
,
flags
);
}
static
void
nes_nic_napi_ce_handler
(
struct
nes_device
*
nesdev
,
struct
nes_hw_nic_cq
*
cq
)
static
void
nes_nic_napi_ce_handler
(
struct
nes_device
*
nesdev
,
struct
nes_hw_nic_cq
*
cq
)
...
...
drivers/infiniband/hw/nes/nes_hw.h
View file @
4790f4dc
...
@@ -1193,6 +1193,8 @@ struct nes_listener {
...
@@ -1193,6 +1193,8 @@ struct nes_listener {
struct
nes_ib_device
;
struct
nes_ib_device
;
#define NES_EVENT_DELAY msecs_to_jiffies(100)
struct
nes_vnic
{
struct
nes_vnic
{
struct
nes_ib_device
*
nesibdev
;
struct
nes_ib_device
*
nesibdev
;
u64
sq_full
;
u64
sq_full
;
...
@@ -1247,6 +1249,10 @@ struct nes_vnic {
...
@@ -1247,6 +1249,10 @@ struct nes_vnic {
u32
lro_max_aggr
;
u32
lro_max_aggr
;
struct
net_lro_mgr
lro_mgr
;
struct
net_lro_mgr
lro_mgr
;
struct
net_lro_desc
lro_desc
[
NES_MAX_LRO_DESCRIPTORS
];
struct
net_lro_desc
lro_desc
[
NES_MAX_LRO_DESCRIPTORS
];
struct
timer_list
event_timer
;
enum
ib_event_type
delayed_event
;
enum
ib_event_type
last_dispatched_event
;
spinlock_t
port_ibevent_lock
;
};
};
struct
nes_ib_device
{
struct
nes_ib_device
{
...
@@ -1348,6 +1354,10 @@ struct nes_terminate_hdr {
...
@@ -1348,6 +1354,10 @@ struct nes_terminate_hdr {
#define BAD_FRAME_OFFSET 64
#define BAD_FRAME_OFFSET 64
#define CQE_MAJOR_DRV 0x8000
#define CQE_MAJOR_DRV 0x8000
/* Used for link status recheck after interrupt processing */
#define NES_LINK_RECHECK_DELAY msecs_to_jiffies(50)
#define NES_LINK_RECHECK_MAX 60
#define nes_vlan_rx vlan_hwaccel_receive_skb
#define nes_vlan_rx vlan_hwaccel_receive_skb
#define nes_netif_rx netif_receive_skb
#define nes_netif_rx netif_receive_skb
...
...
drivers/infiniband/hw/nes/nes_nic.c
View file @
4790f4dc
...
@@ -144,6 +144,7 @@ static int nes_netdev_open(struct net_device *netdev)
...
@@ -144,6 +144,7 @@ static int nes_netdev_open(struct net_device *netdev)
u32
nic_active_bit
;
u32
nic_active_bit
;
u32
nic_active
;
u32
nic_active
;
struct
list_head
*
list_pos
,
*
list_temp
;
struct
list_head
*
list_pos
,
*
list_temp
;
unsigned
long
flags
;
assert
(
nesdev
!=
NULL
);
assert
(
nesdev
!=
NULL
);
...
@@ -233,18 +234,36 @@ static int nes_netdev_open(struct net_device *netdev)
...
@@ -233,18 +234,36 @@ static int nes_netdev_open(struct net_device *netdev)
first_nesvnic
=
nesvnic
;
first_nesvnic
=
nesvnic
;
}
}
if
(
nesvnic
->
of_device_registered
)
{
nesdev
->
iw_status
=
1
;
nesdev
->
nesadapter
->
send_term_ok
=
1
;
nes_port_ibevent
(
nesvnic
);
}
if
(
first_nesvnic
->
linkup
)
{
if
(
first_nesvnic
->
linkup
)
{
/* Enable network packets */
/* Enable network packets */
nesvnic
->
linkup
=
1
;
nesvnic
->
linkup
=
1
;
netif_start_queue
(
netdev
);
netif_start_queue
(
netdev
);
netif_carrier_on
(
netdev
);
netif_carrier_on
(
netdev
);
}
}
spin_lock_irqsave
(
&
nesdev
->
nesadapter
->
phy_lock
,
flags
);
if
(
nesdev
->
nesadapter
->
phy_type
[
nesdev
->
mac_index
]
==
NES_PHY_TYPE_SFP_D
)
{
if
(
nesdev
->
link_recheck
)
cancel_delayed_work
(
&
nesdev
->
work
);
nesdev
->
link_recheck
=
1
;
schedule_delayed_work
(
&
nesdev
->
work
,
NES_LINK_RECHECK_DELAY
);
}
spin_unlock_irqrestore
(
&
nesdev
->
nesadapter
->
phy_lock
,
flags
);
spin_lock_irqsave
(
&
nesvnic
->
port_ibevent_lock
,
flags
);
if
(
nesvnic
->
of_device_registered
)
{
nesdev
->
nesadapter
->
send_term_ok
=
1
;
if
(
nesvnic
->
linkup
==
1
)
{
if
(
nesdev
->
iw_status
==
0
)
{
nesdev
->
iw_status
=
1
;
nes_port_ibevent
(
nesvnic
);
}
}
else
{
nesdev
->
iw_status
=
0
;
}
}
spin_unlock_irqrestore
(
&
nesvnic
->
port_ibevent_lock
,
flags
);
napi_enable
(
&
nesvnic
->
napi
);
napi_enable
(
&
nesvnic
->
napi
);
nesvnic
->
netdev_open
=
1
;
nesvnic
->
netdev_open
=
1
;
...
@@ -263,6 +282,7 @@ static int nes_netdev_stop(struct net_device *netdev)
...
@@ -263,6 +282,7 @@ static int nes_netdev_stop(struct net_device *netdev)
u32
nic_active
;
u32
nic_active
;
struct
nes_vnic
*
first_nesvnic
=
NULL
;
struct
nes_vnic
*
first_nesvnic
=
NULL
;
struct
list_head
*
list_pos
,
*
list_temp
;
struct
list_head
*
list_pos
,
*
list_temp
;
unsigned
long
flags
;
nes_debug
(
NES_DBG_SHUTDOWN
,
"nesvnic=%p, nesdev=%p, netdev=%p %s
\n
"
,
nes_debug
(
NES_DBG_SHUTDOWN
,
"nesvnic=%p, nesdev=%p, netdev=%p %s
\n
"
,
nesvnic
,
nesdev
,
netdev
,
netdev
->
name
);
nesvnic
,
nesdev
,
netdev
,
netdev
->
name
);
...
@@ -315,12 +335,17 @@ static int nes_netdev_stop(struct net_device *netdev)
...
@@ -315,12 +335,17 @@ static int nes_netdev_stop(struct net_device *netdev)
nic_active
&=
nic_active_mask
;
nic_active
&=
nic_active_mask
;
nes_write_indexed
(
nesdev
,
NES_IDX_NIC_BROADCAST_ON
,
nic_active
);
nes_write_indexed
(
nesdev
,
NES_IDX_NIC_BROADCAST_ON
,
nic_active
);
spin_lock_irqsave
(
&
nesvnic
->
port_ibevent_lock
,
flags
);
if
(
nesvnic
->
of_device_registered
)
{
if
(
nesvnic
->
of_device_registered
)
{
nesdev
->
nesadapter
->
send_term_ok
=
0
;
nesdev
->
nesadapter
->
send_term_ok
=
0
;
nesdev
->
iw_status
=
0
;
nesdev
->
iw_status
=
0
;
if
(
nesvnic
->
linkup
==
1
)
nes_port_ibevent
(
nesvnic
);
nes_port_ibevent
(
nesvnic
);
}
}
del_timer_sync
(
&
nesvnic
->
event_timer
);
nesvnic
->
event_timer
.
function
=
NULL
;
spin_unlock_irqrestore
(
&
nesvnic
->
port_ibevent_lock
,
flags
);
nes_destroy_nic_qp
(
nesvnic
);
nes_destroy_nic_qp
(
nesvnic
);
nesvnic
->
netdev_open
=
0
;
nesvnic
->
netdev_open
=
0
;
...
@@ -1750,7 +1775,10 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
...
@@ -1750,7 +1775,10 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
nesvnic
->
rdma_enabled
=
0
;
nesvnic
->
rdma_enabled
=
0
;
}
}
nesvnic
->
nic_cq
.
cq_number
=
nesvnic
->
nic
.
qp_id
;
nesvnic
->
nic_cq
.
cq_number
=
nesvnic
->
nic
.
qp_id
;
init_timer
(
&
nesvnic
->
event_timer
);
nesvnic
->
event_timer
.
function
=
NULL
;
spin_lock_init
(
&
nesvnic
->
tx_lock
);
spin_lock_init
(
&
nesvnic
->
tx_lock
);
spin_lock_init
(
&
nesvnic
->
port_ibevent_lock
);
nesdev
->
netdev
[
nesdev
->
netdev_count
]
=
netdev
;
nesdev
->
netdev
[
nesdev
->
netdev_count
]
=
netdev
;
nes_debug
(
NES_DBG_INIT
,
"Adding nesvnic (%p) to the adapters nesvnic_list for MAC%d.
\n
"
,
nes_debug
(
NES_DBG_INIT
,
"Adding nesvnic (%p) to the adapters nesvnic_list for MAC%d.
\n
"
,
...
@@ -1763,8 +1791,11 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
...
@@ -1763,8 +1791,11 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
(((
PCI_FUNC
(
nesdev
->
pcidev
->
devfn
)
==
1
)
&&
(
nesdev
->
mac_index
==
2
))
||
(((
PCI_FUNC
(
nesdev
->
pcidev
->
devfn
)
==
1
)
&&
(
nesdev
->
mac_index
==
2
))
||
((
PCI_FUNC
(
nesdev
->
pcidev
->
devfn
)
==
2
)
&&
(
nesdev
->
mac_index
==
1
))))))
{
((
PCI_FUNC
(
nesdev
->
pcidev
->
devfn
)
==
2
)
&&
(
nesdev
->
mac_index
==
1
))))))
{
u32
u32temp
;
u32
u32temp
;
u32
link_mask
;
u32
link_mask
=
0
;
u32
link_val
;
u32
link_val
=
0
;
u16
temp_phy_data
;
u16
phy_data
=
0
;
unsigned
long
flags
;
u32temp
=
nes_read_indexed
(
nesdev
,
NES_IDX_PHY_PCS_CONTROL_STATUS0
+
u32temp
=
nes_read_indexed
(
nesdev
,
NES_IDX_PHY_PCS_CONTROL_STATUS0
+
(
0x200
*
(
nesdev
->
mac_index
&
1
)));
(
0x200
*
(
nesdev
->
mac_index
&
1
)));
...
@@ -1786,6 +1817,23 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
...
@@ -1786,6 +1817,23 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
link_val
=
0x02020000
;
link_val
=
0x02020000
;
}
}
break
;
break
;
case
NES_PHY_TYPE_SFP_D
:
spin_lock_irqsave
(
&
nesdev
->
nesadapter
->
phy_lock
,
flags
);
nes_read_10G_phy_reg
(
nesdev
,
nesdev
->
nesadapter
->
phy_index
[
nesdev
->
mac_index
],
1
,
0x9003
);
temp_phy_data
=
(
u16
)
nes_read_indexed
(
nesdev
,
NES_IDX_MAC_MDIO_CONTROL
);
nes_read_10G_phy_reg
(
nesdev
,
nesdev
->
nesadapter
->
phy_index
[
nesdev
->
mac_index
],
3
,
0x0021
);
nes_read_indexed
(
nesdev
,
NES_IDX_MAC_MDIO_CONTROL
);
nes_read_10G_phy_reg
(
nesdev
,
nesdev
->
nesadapter
->
phy_index
[
nesdev
->
mac_index
],
3
,
0x0021
);
phy_data
=
(
u16
)
nes_read_indexed
(
nesdev
,
NES_IDX_MAC_MDIO_CONTROL
);
spin_unlock_irqrestore
(
&
nesdev
->
nesadapter
->
phy_lock
,
flags
);
phy_data
=
(
!
temp_phy_data
&&
(
phy_data
==
0x8000
))
?
0x4
:
0x0
;
break
;
default:
default:
link_mask
=
0x0f1f0000
;
link_mask
=
0x0f1f0000
;
link_val
=
0x0f0f0000
;
link_val
=
0x0f0f0000
;
...
@@ -1795,8 +1843,14 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
...
@@ -1795,8 +1843,14 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
u32temp
=
nes_read_indexed
(
nesdev
,
u32temp
=
nes_read_indexed
(
nesdev
,
NES_IDX_PHY_PCS_CONTROL_STATUS0
+
NES_IDX_PHY_PCS_CONTROL_STATUS0
+
(
0x200
*
(
nesdev
->
mac_index
&
1
)));
(
0x200
*
(
nesdev
->
mac_index
&
1
)));
if
(
phy_type
==
NES_PHY_TYPE_SFP_D
)
{
if
(
phy_data
&
0x0004
)
nesvnic
->
linkup
=
1
;
}
else
{
if
((
u32temp
&
link_mask
)
==
link_val
)
if
((
u32temp
&
link_mask
)
==
link_val
)
nesvnic
->
linkup
=
1
;
nesvnic
->
linkup
=
1
;
}
/* clear the MAC interrupt status, assumes direct logical to physical mapping */
/* clear the MAC interrupt status, assumes direct logical to physical mapping */
u32temp
=
nes_read_indexed
(
nesdev
,
NES_IDX_MAC_INT_STATUS
+
(
0x200
*
nesdev
->
mac_index
));
u32temp
=
nes_read_indexed
(
nesdev
,
NES_IDX_MAC_INT_STATUS
+
(
0x200
*
nesdev
->
mac_index
));
...
...
drivers/infiniband/hw/nes/nes_verbs.c
View file @
4790f4dc
...
@@ -3936,6 +3936,30 @@ struct nes_ib_device *nes_init_ofa_device(struct net_device *netdev)
...
@@ -3936,6 +3936,30 @@ struct nes_ib_device *nes_init_ofa_device(struct net_device *netdev)
return
nesibdev
;
return
nesibdev
;
}
}
/**
* nes_handle_delayed_event
*/
static
void
nes_handle_delayed_event
(
unsigned
long
data
)
{
struct
nes_vnic
*
nesvnic
=
(
void
*
)
data
;
if
(
nesvnic
->
delayed_event
!=
nesvnic
->
last_dispatched_event
)
{
struct
ib_event
event
;
event
.
device
=
&
nesvnic
->
nesibdev
->
ibdev
;
if
(
!
event
.
device
)
goto
stop_timer
;
event
.
event
=
nesvnic
->
delayed_event
;
event
.
element
.
port_num
=
nesvnic
->
logical_port
+
1
;
ib_dispatch_event
(
&
event
);
}
stop_timer:
nesvnic
->
event_timer
.
function
=
NULL
;
}
void
nes_port_ibevent
(
struct
nes_vnic
*
nesvnic
)
void
nes_port_ibevent
(
struct
nes_vnic
*
nesvnic
)
{
{
struct
nes_ib_device
*
nesibdev
=
nesvnic
->
nesibdev
;
struct
nes_ib_device
*
nesibdev
=
nesvnic
->
nesibdev
;
...
@@ -3944,7 +3968,18 @@ void nes_port_ibevent(struct nes_vnic *nesvnic)
...
@@ -3944,7 +3968,18 @@ void nes_port_ibevent(struct nes_vnic *nesvnic)
event
.
device
=
&
nesibdev
->
ibdev
;
event
.
device
=
&
nesibdev
->
ibdev
;
event
.
element
.
port_num
=
nesvnic
->
logical_port
+
1
;
event
.
element
.
port_num
=
nesvnic
->
logical_port
+
1
;
event
.
event
=
nesdev
->
iw_status
?
IB_EVENT_PORT_ACTIVE
:
IB_EVENT_PORT_ERR
;
event
.
event
=
nesdev
->
iw_status
?
IB_EVENT_PORT_ACTIVE
:
IB_EVENT_PORT_ERR
;
if
(
!
nesvnic
->
event_timer
.
function
)
{
ib_dispatch_event
(
&
event
);
ib_dispatch_event
(
&
event
);
nesvnic
->
last_dispatched_event
=
event
.
event
;
nesvnic
->
event_timer
.
function
=
nes_handle_delayed_event
;
nesvnic
->
event_timer
.
data
=
(
unsigned
long
)
nesvnic
;
nesvnic
->
event_timer
.
expires
=
jiffies
+
NES_EVENT_DELAY
;
add_timer
(
&
nesvnic
->
event_timer
);
}
else
{
mod_timer
(
&
nesvnic
->
event_timer
,
jiffies
+
NES_EVENT_DELAY
);
}
nesvnic
->
delayed_event
=
event
.
event
;
}
}
...
...
drivers/infiniband/ulp/srp/ib_srp.c
View file @
4790f4dc
...
@@ -1132,16 +1132,13 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)
...
@@ -1132,16 +1132,13 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)
spin_lock_irqsave
(
&
target
->
lock
,
flags
);
spin_lock_irqsave
(
&
target
->
lock
,
flags
);
iu
=
__srp_get_tx_iu
(
target
,
SRP_IU_CMD
);
iu
=
__srp_get_tx_iu
(
target
,
SRP_IU_CMD
);
if
(
iu
)
{
if
(
!
iu
)
req
=
list_first_entry
(
&
target
->
free_reqs
,
struct
srp_request
,
goto
err_unlock
;
list
);
req
=
list_first_entry
(
&
target
->
free_reqs
,
struct
srp_request
,
list
);
list_del
(
&
req
->
list
);
list_del
(
&
req
->
list
);
}
spin_unlock_irqrestore
(
&
target
->
lock
,
flags
);
spin_unlock_irqrestore
(
&
target
->
lock
,
flags
);
if
(
!
iu
)
goto
err
;
dev
=
target
->
srp_host
->
srp_dev
->
dev
;
dev
=
target
->
srp_host
->
srp_dev
->
dev
;
ib_dma_sync_single_for_cpu
(
dev
,
iu
->
dma
,
srp_max_iu_len
,
ib_dma_sync_single_for_cpu
(
dev
,
iu
->
dma
,
srp_max_iu_len
,
DMA_TO_DEVICE
);
DMA_TO_DEVICE
);
...
@@ -1185,6 +1182,8 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)
...
@@ -1185,6 +1182,8 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)
spin_lock_irqsave
(
&
target
->
lock
,
flags
);
spin_lock_irqsave
(
&
target
->
lock
,
flags
);
list_add
(
&
req
->
list
,
&
target
->
free_reqs
);
list_add
(
&
req
->
list
,
&
target
->
free_reqs
);
err_unlock:
spin_unlock_irqrestore
(
&
target
->
lock
,
flags
);
spin_unlock_irqrestore
(
&
target
->
lock
,
flags
);
err:
err:
...
...
drivers/net/mlx4/catas.c
View file @
4790f4dc
...
@@ -113,7 +113,7 @@ static void catas_reset(struct work_struct *work)
...
@@ -113,7 +113,7 @@ static void catas_reset(struct work_struct *work)
void
mlx4_start_catas_poll
(
struct
mlx4_dev
*
dev
)
void
mlx4_start_catas_poll
(
struct
mlx4_dev
*
dev
)
{
{
struct
mlx4_priv
*
priv
=
mlx4_priv
(
dev
);
struct
mlx4_priv
*
priv
=
mlx4_priv
(
dev
);
unsigned
long
addr
;
phys_addr_t
addr
;
INIT_LIST_HEAD
(
&
priv
->
catas_err
.
list
);
INIT_LIST_HEAD
(
&
priv
->
catas_err
.
list
);
init_timer
(
&
priv
->
catas_err
.
timer
);
init_timer
(
&
priv
->
catas_err
.
timer
);
...
@@ -124,8 +124,8 @@ void mlx4_start_catas_poll(struct mlx4_dev *dev)
...
@@ -124,8 +124,8 @@ void mlx4_start_catas_poll(struct mlx4_dev *dev)
priv
->
catas_err
.
map
=
ioremap
(
addr
,
priv
->
fw
.
catas_size
*
4
);
priv
->
catas_err
.
map
=
ioremap
(
addr
,
priv
->
fw
.
catas_size
*
4
);
if
(
!
priv
->
catas_err
.
map
)
{
if
(
!
priv
->
catas_err
.
map
)
{
mlx4_warn
(
dev
,
"Failed to map internal error buffer at 0x%lx
\n
"
,
mlx4_warn
(
dev
,
"Failed to map internal error buffer at 0x%l
l
x
\n
"
,
addr
);
(
unsigned
long
long
)
addr
);
return
;
return
;
}
}
...
...
drivers/net/mlx4/en_main.c
View file @
4790f4dc
...
@@ -202,7 +202,8 @@ static void *mlx4_en_add(struct mlx4_dev *dev)
...
@@ -202,7 +202,8 @@ static void *mlx4_en_add(struct mlx4_dev *dev)
if
(
mlx4_uar_alloc
(
dev
,
&
mdev
->
priv_uar
))
if
(
mlx4_uar_alloc
(
dev
,
&
mdev
->
priv_uar
))
goto
err_pd
;
goto
err_pd
;
mdev
->
uar_map
=
ioremap
(
mdev
->
priv_uar
.
pfn
<<
PAGE_SHIFT
,
PAGE_SIZE
);
mdev
->
uar_map
=
ioremap
((
phys_addr_t
)
mdev
->
priv_uar
.
pfn
<<
PAGE_SHIFT
,
PAGE_SIZE
);
if
(
!
mdev
->
uar_map
)
if
(
!
mdev
->
uar_map
)
goto
err_uar
;
goto
err_uar
;
spin_lock_init
(
&
mdev
->
uar_lock
);
spin_lock_init
(
&
mdev
->
uar_lock
);
...
...
drivers/net/mlx4/main.c
View file @
4790f4dc
...
@@ -829,7 +829,7 @@ static int mlx4_setup_hca(struct mlx4_dev *dev)
...
@@ -829,7 +829,7 @@ static int mlx4_setup_hca(struct mlx4_dev *dev)
goto
err_uar_table_free
;
goto
err_uar_table_free
;
}
}
priv
->
kar
=
ioremap
(
priv
->
driver_uar
.
pfn
<<
PAGE_SHIFT
,
PAGE_SIZE
);
priv
->
kar
=
ioremap
(
(
phys_addr_t
)
priv
->
driver_uar
.
pfn
<<
PAGE_SHIFT
,
PAGE_SIZE
);
if
(
!
priv
->
kar
)
{
if
(
!
priv
->
kar
)
{
mlx4_err
(
dev
,
"Couldn't map kernel access region, "
mlx4_err
(
dev
,
"Couldn't map kernel access region, "
"aborting.
\n
"
);
"aborting.
\n
"
);
...
...
drivers/net/mlx4/mcg.c
View file @
4790f4dc
...
@@ -95,7 +95,8 @@ static int mlx4_MGID_HASH(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox
...
@@ -95,7 +95,8 @@ static int mlx4_MGID_HASH(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox
* entry in hash chain and *mgm holds end of hash chain.
* entry in hash chain and *mgm holds end of hash chain.
*/
*/
static
int
find_mgm
(
struct
mlx4_dev
*
dev
,
static
int
find_mgm
(
struct
mlx4_dev
*
dev
,
u8
*
gid
,
struct
mlx4_cmd_mailbox
*
mgm_mailbox
,
u8
*
gid
,
enum
mlx4_protocol
protocol
,
struct
mlx4_cmd_mailbox
*
mgm_mailbox
,
u16
*
hash
,
int
*
prev
,
int
*
index
)
u16
*
hash
,
int
*
prev
,
int
*
index
)
{
{
struct
mlx4_cmd_mailbox
*
mailbox
;
struct
mlx4_cmd_mailbox
*
mailbox
;
...
@@ -134,7 +135,8 @@ static int find_mgm(struct mlx4_dev *dev,
...
@@ -134,7 +135,8 @@ static int find_mgm(struct mlx4_dev *dev,
return
err
;
return
err
;
}
}
if
(
!
memcmp
(
mgm
->
gid
,
gid
,
16
))
if
(
!
memcmp
(
mgm
->
gid
,
gid
,
16
)
&&
be32_to_cpu
(
mgm
->
members_count
)
>>
30
==
protocol
)
return
err
;
return
err
;
*
prev
=
*
index
;
*
prev
=
*
index
;
...
@@ -146,7 +148,7 @@ static int find_mgm(struct mlx4_dev *dev,
...
@@ -146,7 +148,7 @@ static int find_mgm(struct mlx4_dev *dev,
}
}
int
mlx4_multicast_attach
(
struct
mlx4_dev
*
dev
,
struct
mlx4_qp
*
qp
,
u8
gid
[
16
],
int
mlx4_multicast_attach
(
struct
mlx4_dev
*
dev
,
struct
mlx4_qp
*
qp
,
u8
gid
[
16
],
int
block_mcast_loopback
)
int
block_mcast_loopback
,
enum
mlx4_protocol
protocol
)
{
{
struct
mlx4_priv
*
priv
=
mlx4_priv
(
dev
);
struct
mlx4_priv
*
priv
=
mlx4_priv
(
dev
);
struct
mlx4_cmd_mailbox
*
mailbox
;
struct
mlx4_cmd_mailbox
*
mailbox
;
...
@@ -165,7 +167,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
...
@@ -165,7 +167,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
mutex_lock
(
&
priv
->
mcg_table
.
mutex
);
mutex_lock
(
&
priv
->
mcg_table
.
mutex
);
err
=
find_mgm
(
dev
,
gid
,
mailbox
,
&
hash
,
&
prev
,
&
index
);
err
=
find_mgm
(
dev
,
gid
,
protocol
,
mailbox
,
&
hash
,
&
prev
,
&
index
);
if
(
err
)
if
(
err
)
goto
out
;
goto
out
;
...
@@ -187,7 +189,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
...
@@ -187,7 +189,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
memcpy
(
mgm
->
gid
,
gid
,
16
);
memcpy
(
mgm
->
gid
,
gid
,
16
);
}
}
members_count
=
be32_to_cpu
(
mgm
->
members_count
);
members_count
=
be32_to_cpu
(
mgm
->
members_count
)
&
0xffffff
;
if
(
members_count
==
MLX4_QP_PER_MGM
)
{
if
(
members_count
==
MLX4_QP_PER_MGM
)
{
mlx4_err
(
dev
,
"MGM at index %x is full.
\n
"
,
index
);
mlx4_err
(
dev
,
"MGM at index %x is full.
\n
"
,
index
);
err
=
-
ENOMEM
;
err
=
-
ENOMEM
;
...
@@ -207,7 +209,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
...
@@ -207,7 +209,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
else
else
mgm
->
qp
[
members_count
++
]
=
cpu_to_be32
(
qp
->
qpn
&
MGM_QPN_MASK
);
mgm
->
qp
[
members_count
++
]
=
cpu_to_be32
(
qp
->
qpn
&
MGM_QPN_MASK
);
mgm
->
members_count
=
cpu_to_be32
(
members_count
);
mgm
->
members_count
=
cpu_to_be32
(
members_count
|
(
u32
)
protocol
<<
30
);
err
=
mlx4_WRITE_MCG
(
dev
,
index
,
mailbox
);
err
=
mlx4_WRITE_MCG
(
dev
,
index
,
mailbox
);
if
(
err
)
if
(
err
)
...
@@ -242,7 +244,8 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
...
@@ -242,7 +244,8 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
}
}
EXPORT_SYMBOL_GPL
(
mlx4_multicast_attach
);
EXPORT_SYMBOL_GPL
(
mlx4_multicast_attach
);
int
mlx4_multicast_detach
(
struct
mlx4_dev
*
dev
,
struct
mlx4_qp
*
qp
,
u8
gid
[
16
])
int
mlx4_multicast_detach
(
struct
mlx4_dev
*
dev
,
struct
mlx4_qp
*
qp
,
u8
gid
[
16
],
enum
mlx4_protocol
protocol
)
{
{
struct
mlx4_priv
*
priv
=
mlx4_priv
(
dev
);
struct
mlx4_priv
*
priv
=
mlx4_priv
(
dev
);
struct
mlx4_cmd_mailbox
*
mailbox
;
struct
mlx4_cmd_mailbox
*
mailbox
;
...
@@ -260,7 +263,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16])
...
@@ -260,7 +263,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16])
mutex_lock
(
&
priv
->
mcg_table
.
mutex
);
mutex_lock
(
&
priv
->
mcg_table
.
mutex
);
err
=
find_mgm
(
dev
,
gid
,
mailbox
,
&
hash
,
&
prev
,
&
index
);
err
=
find_mgm
(
dev
,
gid
,
protocol
,
mailbox
,
&
hash
,
&
prev
,
&
index
);
if
(
err
)
if
(
err
)
goto
out
;
goto
out
;
...
@@ -270,7 +273,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16])
...
@@ -270,7 +273,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16])
goto
out
;
goto
out
;
}
}
members_count
=
be32_to_cpu
(
mgm
->
members_count
);
members_count
=
be32_to_cpu
(
mgm
->
members_count
)
&
0xffffff
;
for
(
loc
=
-
1
,
i
=
0
;
i
<
members_count
;
++
i
)
for
(
loc
=
-
1
,
i
=
0
;
i
<
members_count
;
++
i
)
if
((
be32_to_cpu
(
mgm
->
qp
[
i
])
&
MGM_QPN_MASK
)
==
qp
->
qpn
)
if
((
be32_to_cpu
(
mgm
->
qp
[
i
])
&
MGM_QPN_MASK
)
==
qp
->
qpn
)
loc
=
i
;
loc
=
i
;
...
@@ -282,7 +285,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16])
...
@@ -282,7 +285,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16])
}
}
mgm
->
members_count
=
cpu_to_be32
(
--
members_count
);
mgm
->
members_count
=
cpu_to_be32
(
--
members_count
|
(
u32
)
protocol
<<
30
);
mgm
->
qp
[
loc
]
=
mgm
->
qp
[
i
-
1
];
mgm
->
qp
[
loc
]
=
mgm
->
qp
[
i
-
1
];
mgm
->
qp
[
i
-
1
]
=
0
;
mgm
->
qp
[
i
-
1
]
=
0
;
...
...
include/linux/mlx4/device.h
View file @
4790f4dc
...
@@ -144,6 +144,11 @@ enum {
...
@@ -144,6 +144,11 @@ enum {
MLX4_STAT_RATE_OFFSET
=
5
MLX4_STAT_RATE_OFFSET
=
5
};
};
enum
mlx4_protocol
{
MLX4_PROTOCOL_IB
,
MLX4_PROTOCOL_EN
,
};
enum
{
enum
{
MLX4_MTT_FLAG_PRESENT
=
1
MLX4_MTT_FLAG_PRESENT
=
1
};
};
...
@@ -500,8 +505,9 @@ int mlx4_INIT_PORT(struct mlx4_dev *dev, int port);
...
@@ -500,8 +505,9 @@ int mlx4_INIT_PORT(struct mlx4_dev *dev, int port);
int
mlx4_CLOSE_PORT
(
struct
mlx4_dev
*
dev
,
int
port
);
int
mlx4_CLOSE_PORT
(
struct
mlx4_dev
*
dev
,
int
port
);
int
mlx4_multicast_attach
(
struct
mlx4_dev
*
dev
,
struct
mlx4_qp
*
qp
,
u8
gid
[
16
],
int
mlx4_multicast_attach
(
struct
mlx4_dev
*
dev
,
struct
mlx4_qp
*
qp
,
u8
gid
[
16
],
int
block_mcast_loopback
);
int
block_mcast_loopback
,
enum
mlx4_protocol
protocol
);
int
mlx4_multicast_detach
(
struct
mlx4_dev
*
dev
,
struct
mlx4_qp
*
qp
,
u8
gid
[
16
]);
int
mlx4_multicast_detach
(
struct
mlx4_dev
*
dev
,
struct
mlx4_qp
*
qp
,
u8
gid
[
16
],
enum
mlx4_protocol
protocol
);
int
mlx4_register_mac
(
struct
mlx4_dev
*
dev
,
u8
port
,
u64
mac
,
int
*
index
);
int
mlx4_register_mac
(
struct
mlx4_dev
*
dev
,
u8
port
,
u64
mac
,
int
*
index
);
void
mlx4_unregister_mac
(
struct
mlx4_dev
*
dev
,
u8
port
,
int
index
);
void
mlx4_unregister_mac
(
struct
mlx4_dev
*
dev
,
u8
port
,
int
index
);
...
...
include/linux/mlx4/driver.h
View file @
4790f4dc
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#define MLX4_DRIVER_H
#define MLX4_DRIVER_H
#include <linux/device.h>
#include <linux/device.h>
#include <linux/mlx4/device.h>
struct
mlx4_dev
;
struct
mlx4_dev
;
...
@@ -44,11 +45,6 @@ enum mlx4_dev_event {
...
@@ -44,11 +45,6 @@ enum mlx4_dev_event {
MLX4_DEV_EVENT_PORT_REINIT
,
MLX4_DEV_EVENT_PORT_REINIT
,
};
};
enum
mlx4_protocol
{
MLX4_PROTOCOL_IB
,
MLX4_PROTOCOL_EN
,
};
struct
mlx4_interface
{
struct
mlx4_interface
{
void
*
(
*
add
)
(
struct
mlx4_dev
*
dev
);
void
*
(
*
add
)
(
struct
mlx4_dev
*
dev
);
void
(
*
remove
)(
struct
mlx4_dev
*
dev
,
void
*
context
);
void
(
*
remove
)(
struct
mlx4_dev
*
dev
,
void
*
context
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment