diff options
Diffstat (limited to 'drivers/net/ehea')
-rw-r--r-- | drivers/net/ehea/ehea.h | 5 | ||||
-rw-r--r-- | drivers/net/ehea/ehea_ethtool.c | 2 | ||||
-rw-r--r-- | drivers/net/ehea/ehea_main.c | 31 | ||||
-rw-r--r-- | drivers/net/ehea/ehea_phyp.c | 2 | ||||
-rw-r--r-- | drivers/net/ehea/ehea_phyp.h | 6 | ||||
-rw-r--r-- | drivers/net/ehea/ehea_qmr.c | 17 |
6 files changed, 31 insertions, 32 deletions
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h index b40724fc6b74..39ad9f73d1ec 100644 --- a/drivers/net/ehea/ehea.h +++ b/drivers/net/ehea/ehea.h | |||
@@ -39,7 +39,7 @@ | |||
39 | #include <asm/io.h> | 39 | #include <asm/io.h> |
40 | 40 | ||
41 | #define DRV_NAME "ehea" | 41 | #define DRV_NAME "ehea" |
42 | #define DRV_VERSION "EHEA_0034" | 42 | #define DRV_VERSION "EHEA_0043" |
43 | 43 | ||
44 | #define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \ | 44 | #define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \ |
45 | | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR) | 45 | | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR) |
@@ -105,9 +105,6 @@ | |||
105 | #define EHEA_BCMC_VLANID_ALL 0x01 | 105 | #define EHEA_BCMC_VLANID_ALL 0x01 |
106 | #define EHEA_BCMC_VLANID_SINGLE 0x00 | 106 | #define EHEA_BCMC_VLANID_SINGLE 0x00 |
107 | 107 | ||
108 | /* Use this define to kmallocate pHYP control blocks */ | ||
109 | #define H_CB_ALIGNMENT 4096 | ||
110 | |||
111 | #define EHEA_CACHE_LINE 128 | 108 | #define EHEA_CACHE_LINE 128 |
112 | 109 | ||
113 | /* Memory Regions */ | 110 | /* Memory Regions */ |
diff --git a/drivers/net/ehea/ehea_ethtool.c b/drivers/net/ehea/ehea_ethtool.c index 82eb2fb8c75e..9f57c2e78ced 100644 --- a/drivers/net/ehea/ehea_ethtool.c +++ b/drivers/net/ehea/ehea_ethtool.c | |||
@@ -238,7 +238,7 @@ static void ehea_get_ethtool_stats(struct net_device *dev, | |||
238 | data[i++] = port->port_res[0].swqe_refill_th; | 238 | data[i++] = port->port_res[0].swqe_refill_th; |
239 | data[i++] = port->resets; | 239 | data[i++] = port->resets; |
240 | 240 | ||
241 | cb6 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); | 241 | cb6 = kzalloc(PAGE_SIZE, GFP_KERNEL); |
242 | if (!cb6) { | 242 | if (!cb6) { |
243 | ehea_error("no mem for cb6"); | 243 | ehea_error("no mem for cb6"); |
244 | return; | 244 | return; |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index eb7d44de59ff..6ad696101418 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -92,7 +92,7 @@ static struct net_device_stats *ehea_get_stats(struct net_device *dev) | |||
92 | 92 | ||
93 | memset(stats, 0, sizeof(*stats)); | 93 | memset(stats, 0, sizeof(*stats)); |
94 | 94 | ||
95 | cb2 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); | 95 | cb2 = kzalloc(PAGE_SIZE, GFP_KERNEL); |
96 | if (!cb2) { | 96 | if (!cb2) { |
97 | ehea_error("no mem for cb2"); | 97 | ehea_error("no mem for cb2"); |
98 | goto out; | 98 | goto out; |
@@ -586,8 +586,8 @@ int ehea_sense_port_attr(struct ehea_port *port) | |||
586 | u64 hret; | 586 | u64 hret; |
587 | struct hcp_ehea_port_cb0 *cb0; | 587 | struct hcp_ehea_port_cb0 *cb0; |
588 | 588 | ||
589 | cb0 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); | 589 | cb0 = kzalloc(PAGE_SIZE, GFP_ATOMIC); /* May be called via */ |
590 | if (!cb0) { | 590 | if (!cb0) { /* ehea_neq_tasklet() */ |
591 | ehea_error("no mem for cb0"); | 591 | ehea_error("no mem for cb0"); |
592 | ret = -ENOMEM; | 592 | ret = -ENOMEM; |
593 | goto out; | 593 | goto out; |
@@ -670,7 +670,7 @@ int ehea_set_portspeed(struct ehea_port *port, u32 port_speed) | |||
670 | u64 hret; | 670 | u64 hret; |
671 | int ret = 0; | 671 | int ret = 0; |
672 | 672 | ||
673 | cb4 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); | 673 | cb4 = kzalloc(PAGE_SIZE, GFP_KERNEL); |
674 | if (!cb4) { | 674 | if (!cb4) { |
675 | ehea_error("no mem for cb4"); | 675 | ehea_error("no mem for cb4"); |
676 | ret = -ENOMEM; | 676 | ret = -ENOMEM; |
@@ -765,8 +765,7 @@ static void ehea_parse_eqe(struct ehea_adapter *adapter, u64 eqe) | |||
765 | 765 | ||
766 | if (EHEA_BMASK_GET(NEQE_PORT_UP, eqe)) { | 766 | if (EHEA_BMASK_GET(NEQE_PORT_UP, eqe)) { |
767 | if (!netif_carrier_ok(port->netdev)) { | 767 | if (!netif_carrier_ok(port->netdev)) { |
768 | ret = ehea_sense_port_attr( | 768 | ret = ehea_sense_port_attr(port); |
769 | port); | ||
770 | if (ret) { | 769 | if (ret) { |
771 | ehea_error("failed resensing port " | 770 | ehea_error("failed resensing port " |
772 | "attributes"); | 771 | "attributes"); |
@@ -986,7 +985,7 @@ static int ehea_configure_port(struct ehea_port *port) | |||
986 | struct hcp_ehea_port_cb0 *cb0; | 985 | struct hcp_ehea_port_cb0 *cb0; |
987 | 986 | ||
988 | ret = -ENOMEM; | 987 | ret = -ENOMEM; |
989 | cb0 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); | 988 | cb0 = kzalloc(PAGE_SIZE, GFP_KERNEL); |
990 | if (!cb0) | 989 | if (!cb0) |
991 | goto out; | 990 | goto out; |
992 | 991 | ||
@@ -1444,7 +1443,7 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa) | |||
1444 | goto out; | 1443 | goto out; |
1445 | } | 1444 | } |
1446 | 1445 | ||
1447 | cb0 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); | 1446 | cb0 = kzalloc(PAGE_SIZE, GFP_KERNEL); |
1448 | if (!cb0) { | 1447 | if (!cb0) { |
1449 | ehea_error("no mem for cb0"); | 1448 | ehea_error("no mem for cb0"); |
1450 | ret = -ENOMEM; | 1449 | ret = -ENOMEM; |
@@ -1502,7 +1501,7 @@ static void ehea_promiscuous(struct net_device *dev, int enable) | |||
1502 | if ((enable && port->promisc) || (!enable && !port->promisc)) | 1501 | if ((enable && port->promisc) || (!enable && !port->promisc)) |
1503 | return; | 1502 | return; |
1504 | 1503 | ||
1505 | cb7 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); | 1504 | cb7 = kzalloc(PAGE_SIZE, GFP_ATOMIC); |
1506 | if (!cb7) { | 1505 | if (!cb7) { |
1507 | ehea_error("no mem for cb7"); | 1506 | ehea_error("no mem for cb7"); |
1508 | goto out; | 1507 | goto out; |
@@ -1606,7 +1605,7 @@ static void ehea_add_multicast_entry(struct ehea_port* port, u8* mc_mac_addr) | |||
1606 | struct ehea_mc_list *ehea_mcl_entry; | 1605 | struct ehea_mc_list *ehea_mcl_entry; |
1607 | u64 hret; | 1606 | u64 hret; |
1608 | 1607 | ||
1609 | ehea_mcl_entry = kzalloc(sizeof(*ehea_mcl_entry), GFP_KERNEL); | 1608 | ehea_mcl_entry = kzalloc(sizeof(*ehea_mcl_entry), GFP_ATOMIC); |
1610 | if (!ehea_mcl_entry) { | 1609 | if (!ehea_mcl_entry) { |
1611 | ehea_error("no mem for mcl_entry"); | 1610 | ehea_error("no mem for mcl_entry"); |
1612 | return; | 1611 | return; |
@@ -1871,7 +1870,7 @@ static void ehea_vlan_rx_register(struct net_device *dev, | |||
1871 | 1870 | ||
1872 | port->vgrp = grp; | 1871 | port->vgrp = grp; |
1873 | 1872 | ||
1874 | cb1 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); | 1873 | cb1 = kzalloc(PAGE_SIZE, GFP_KERNEL); |
1875 | if (!cb1) { | 1874 | if (!cb1) { |
1876 | ehea_error("no mem for cb1"); | 1875 | ehea_error("no mem for cb1"); |
1877 | goto out; | 1876 | goto out; |
@@ -1900,7 +1899,7 @@ static void ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | |||
1900 | int index; | 1899 | int index; |
1901 | u64 hret; | 1900 | u64 hret; |
1902 | 1901 | ||
1903 | cb1 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); | 1902 | cb1 = kzalloc(PAGE_SIZE, GFP_KERNEL); |
1904 | if (!cb1) { | 1903 | if (!cb1) { |
1905 | ehea_error("no mem for cb1"); | 1904 | ehea_error("no mem for cb1"); |
1906 | goto out; | 1905 | goto out; |
@@ -1936,7 +1935,7 @@ static void ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
1936 | if (port->vgrp) | 1935 | if (port->vgrp) |
1937 | port->vgrp->vlan_devices[vid] = NULL; | 1936 | port->vgrp->vlan_devices[vid] = NULL; |
1938 | 1937 | ||
1939 | cb1 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); | 1938 | cb1 = kzalloc(PAGE_SIZE, GFP_KERNEL); |
1940 | if (!cb1) { | 1939 | if (!cb1) { |
1941 | ehea_error("no mem for cb1"); | 1940 | ehea_error("no mem for cb1"); |
1942 | goto out; | 1941 | goto out; |
@@ -1969,7 +1968,7 @@ int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp) | |||
1969 | u64 dummy64 = 0; | 1968 | u64 dummy64 = 0; |
1970 | struct hcp_modify_qp_cb0* cb0; | 1969 | struct hcp_modify_qp_cb0* cb0; |
1971 | 1970 | ||
1972 | cb0 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); | 1971 | cb0 = kzalloc(PAGE_SIZE, GFP_KERNEL); |
1973 | if (!cb0) { | 1972 | if (!cb0) { |
1974 | ret = -ENOMEM; | 1973 | ret = -ENOMEM; |
1975 | goto out; | 1974 | goto out; |
@@ -2270,7 +2269,7 @@ int ehea_sense_adapter_attr(struct ehea_adapter *adapter) | |||
2270 | u64 hret; | 2269 | u64 hret; |
2271 | int ret; | 2270 | int ret; |
2272 | 2271 | ||
2273 | cb = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); | 2272 | cb = kzalloc(PAGE_SIZE, GFP_KERNEL); |
2274 | if (!cb) { | 2273 | if (!cb) { |
2275 | ret = -ENOMEM; | 2274 | ret = -ENOMEM; |
2276 | goto out; | 2275 | goto out; |
@@ -2341,7 +2340,7 @@ static int ehea_setup_single_port(struct ehea_port *port, | |||
2341 | goto out; | 2340 | goto out; |
2342 | 2341 | ||
2343 | /* Enable Jumbo frames */ | 2342 | /* Enable Jumbo frames */ |
2344 | cb4 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); | 2343 | cb4 = kzalloc(PAGE_SIZE, GFP_KERNEL); |
2345 | if (!cb4) { | 2344 | if (!cb4) { |
2346 | ehea_error("no mem for cb4"); | 2345 | ehea_error("no mem for cb4"); |
2347 | } else { | 2346 | } else { |
diff --git a/drivers/net/ehea/ehea_phyp.c b/drivers/net/ehea/ehea_phyp.c index 0b51a8cea077..0cfc2bc1a27b 100644 --- a/drivers/net/ehea/ehea_phyp.c +++ b/drivers/net/ehea/ehea_phyp.c | |||
@@ -506,7 +506,7 @@ u64 ehea_h_register_rpage_mr(const u64 adapter_handle, const u64 mr_handle, | |||
506 | const u8 pagesize, const u8 queue_type, | 506 | const u8 pagesize, const u8 queue_type, |
507 | const u64 log_pageaddr, const u64 count) | 507 | const u64 log_pageaddr, const u64 count) |
508 | { | 508 | { |
509 | if ((count > 1) && (log_pageaddr & 0xfff)) { | 509 | if ((count > 1) && (log_pageaddr & ~PAGE_MASK)) { |
510 | ehea_error("not on pageboundary"); | 510 | ehea_error("not on pageboundary"); |
511 | return H_PARAMETER; | 511 | return H_PARAMETER; |
512 | } | 512 | } |
diff --git a/drivers/net/ehea/ehea_phyp.h b/drivers/net/ehea/ehea_phyp.h index fa51e3b5bb05..919f94b75933 100644 --- a/drivers/net/ehea/ehea_phyp.h +++ b/drivers/net/ehea/ehea_phyp.h | |||
@@ -81,14 +81,16 @@ static inline u32 get_longbusy_msecs(int long_busy_ret_code) | |||
81 | static inline void hcp_epas_ctor(struct h_epas *epas, u64 paddr_kernel, | 81 | static inline void hcp_epas_ctor(struct h_epas *epas, u64 paddr_kernel, |
82 | u64 paddr_user) | 82 | u64 paddr_user) |
83 | { | 83 | { |
84 | epas->kernel.addr = ioremap(paddr_kernel, PAGE_SIZE); | 84 | /* To support 64k pages we must round to 64k page boundary */ |
85 | epas->kernel.addr = ioremap((paddr_kernel & PAGE_MASK), PAGE_SIZE) + | ||
86 | (paddr_kernel & ~PAGE_MASK); | ||
85 | epas->user.addr = paddr_user; | 87 | epas->user.addr = paddr_user; |
86 | } | 88 | } |
87 | 89 | ||
88 | static inline void hcp_epas_dtor(struct h_epas *epas) | 90 | static inline void hcp_epas_dtor(struct h_epas *epas) |
89 | { | 91 | { |
90 | if (epas->kernel.addr) | 92 | if (epas->kernel.addr) |
91 | iounmap(epas->kernel.addr); | 93 | iounmap((void __iomem*)((u64)epas->kernel.addr & PAGE_MASK)); |
92 | 94 | ||
93 | epas->user.addr = 0; | 95 | epas->user.addr = 0; |
94 | epas->kernel.addr = 0; | 96 | epas->kernel.addr = 0; |
diff --git a/drivers/net/ehea/ehea_qmr.c b/drivers/net/ehea/ehea_qmr.c index 3e1862326c88..72ef7bde3346 100644 --- a/drivers/net/ehea/ehea_qmr.c +++ b/drivers/net/ehea/ehea_qmr.c | |||
@@ -209,11 +209,11 @@ int ehea_destroy_cq(struct ehea_cq *cq) | |||
209 | { | 209 | { |
210 | u64 adapter_handle, hret; | 210 | u64 adapter_handle, hret; |
211 | 211 | ||
212 | adapter_handle = cq->adapter->handle; | ||
213 | |||
214 | if (!cq) | 212 | if (!cq) |
215 | return 0; | 213 | return 0; |
216 | 214 | ||
215 | adapter_handle = cq->adapter->handle; | ||
216 | |||
217 | /* deregister all previous registered pages */ | 217 | /* deregister all previous registered pages */ |
218 | hret = ehea_h_free_resource(adapter_handle, cq->fw_handle); | 218 | hret = ehea_h_free_resource(adapter_handle, cq->fw_handle); |
219 | if (hret != H_SUCCESS) { | 219 | if (hret != H_SUCCESS) { |
@@ -512,7 +512,7 @@ int ehea_reg_mr_adapter(struct ehea_adapter *adapter) | |||
512 | 512 | ||
513 | start = KERNELBASE; | 513 | start = KERNELBASE; |
514 | end = (u64)high_memory; | 514 | end = (u64)high_memory; |
515 | nr_pages = (end - start) / PAGE_SIZE; | 515 | nr_pages = (end - start) / EHEA_PAGESIZE; |
516 | 516 | ||
517 | pt = kzalloc(PAGE_SIZE, GFP_KERNEL); | 517 | pt = kzalloc(PAGE_SIZE, GFP_KERNEL); |
518 | if (!pt) { | 518 | if (!pt) { |
@@ -538,9 +538,9 @@ int ehea_reg_mr_adapter(struct ehea_adapter *adapter) | |||
538 | if (nr_pages > 1) { | 538 | if (nr_pages > 1) { |
539 | u64 num_pages = min(nr_pages, (u64)512); | 539 | u64 num_pages = min(nr_pages, (u64)512); |
540 | for (i = 0; i < num_pages; i++) | 540 | for (i = 0; i < num_pages; i++) |
541 | pt[i] = virt_to_abs((void*)(((u64)start) | 541 | pt[i] = virt_to_abs((void*)(((u64)start) + |
542 | + ((k++) * | 542 | ((k++) * |
543 | PAGE_SIZE))); | 543 | EHEA_PAGESIZE))); |
544 | 544 | ||
545 | hret = ehea_h_register_rpage_mr(adapter->handle, | 545 | hret = ehea_h_register_rpage_mr(adapter->handle, |
546 | adapter->mr.handle, 0, | 546 | adapter->mr.handle, 0, |
@@ -548,8 +548,9 @@ int ehea_reg_mr_adapter(struct ehea_adapter *adapter) | |||
548 | num_pages); | 548 | num_pages); |
549 | nr_pages -= num_pages; | 549 | nr_pages -= num_pages; |
550 | } else { | 550 | } else { |
551 | u64 abs_adr = virt_to_abs((void*)(((u64)start) | 551 | u64 abs_adr = virt_to_abs((void*)(((u64)start) + |
552 | + (k * PAGE_SIZE))); | 552 | (k * EHEA_PAGESIZE))); |
553 | |||
553 | hret = ehea_h_register_rpage_mr(adapter->handle, | 554 | hret = ehea_h_register_rpage_mr(adapter->handle, |
554 | adapter->mr.handle, 0, | 555 | adapter->mr.handle, 0, |
555 | 0, abs_adr,1); | 556 | 0, abs_adr,1); |