diff options
author | David S. Miller <davem@davemloft.net> | 2012-02-23 14:30:46 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-23 14:30:46 -0500 |
commit | 32d219ed61a97f6591a941e23673b2c1dd8628e7 (patch) | |
tree | 6d38e3cb0bd7bd4141185ea9854c75f48f4f79e1 /drivers | |
parent | 21f7638e6f05c36b35a36cd4311e08be5dc00bb1 (diff) | |
parent | 73e0026fb2bee4f2ca85c702040e143ec504eaa6 (diff) |
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/sfc/bitfield.h | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/efx.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/mcdi_mon.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/net_driver.h | 9 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/siena_sriov.c | 11 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/tx.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/vfdi.h | 3 |
7 files changed, 24 insertions, 14 deletions
diff --git a/drivers/net/ethernet/sfc/bitfield.h b/drivers/net/ethernet/sfc/bitfield.h index a2a9f40b90cf..b26a954c27fc 100644 --- a/drivers/net/ethernet/sfc/bitfield.h +++ b/drivers/net/ethernet/sfc/bitfield.h | |||
@@ -531,8 +531,8 @@ typedef union efx_oword { | |||
531 | 531 | ||
532 | 532 | ||
533 | /* Static initialiser */ | 533 | /* Static initialiser */ |
534 | #define EFX_OWORD32(a, b, c, d) \ | 534 | #define EFX_OWORD32(a, b, c, d) \ |
535 | { .u32 = { cpu_to_le32(a), cpu_to_le32(b), \ | 535 | { .u32 = { cpu_to_le32(a), cpu_to_le32(b), \ |
536 | cpu_to_le32(c), cpu_to_le32(d) } } | 536 | cpu_to_le32(c), cpu_to_le32(d) } } |
537 | 537 | ||
538 | #endif /* EFX_BITFIELD_H */ | 538 | #endif /* EFX_BITFIELD_H */ |
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index ac571cf14485..c7004dcb5838 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c | |||
@@ -585,7 +585,12 @@ static int efx_probe_channels(struct efx_nic *efx) | |||
585 | /* Restart special buffer allocation */ | 585 | /* Restart special buffer allocation */ |
586 | efx->next_buffer_table = 0; | 586 | efx->next_buffer_table = 0; |
587 | 587 | ||
588 | efx_for_each_channel(channel, efx) { | 588 | /* Probe channels in reverse, so that any 'extra' channels |
589 | * use the start of the buffer table. This allows the traffic | ||
590 | * channels to be resized without moving them or wasting the | ||
591 | * entries before them. | ||
592 | */ | ||
593 | efx_for_each_channel_rev(channel, efx) { | ||
589 | rc = efx_probe_channel(channel); | 594 | rc = efx_probe_channel(channel); |
590 | if (rc) { | 595 | if (rc) { |
591 | netif_err(efx, probe, efx->net_dev, | 596 | netif_err(efx, probe, efx->net_dev, |
diff --git a/drivers/net/ethernet/sfc/mcdi_mon.c b/drivers/net/ethernet/sfc/mcdi_mon.c index 8a72c10b9a6c..fb7f65b59eb8 100644 --- a/drivers/net/ethernet/sfc/mcdi_mon.c +++ b/drivers/net/ethernet/sfc/mcdi_mon.c | |||
@@ -37,7 +37,7 @@ static const struct { | |||
37 | SENSOR(PHY0_TEMP, "PHY temp.", EFX_HWMON_TEMP, 0), | 37 | SENSOR(PHY0_TEMP, "PHY temp.", EFX_HWMON_TEMP, 0), |
38 | SENSOR(PHY0_COOLING, "PHY cooling", EFX_HWMON_COOL, 0), | 38 | SENSOR(PHY0_COOLING, "PHY cooling", EFX_HWMON_COOL, 0), |
39 | SENSOR(PHY1_TEMP, "PHY temp.", EFX_HWMON_TEMP, 1), | 39 | SENSOR(PHY1_TEMP, "PHY temp.", EFX_HWMON_TEMP, 1), |
40 | SENSOR(PHY1_COOLING, "PHY cooling", EFX_HWMON_COOL, 1), | 40 | SENSOR(PHY1_COOLING, "PHY cooling", EFX_HWMON_COOL, 1), |
41 | SENSOR(IN_1V0, "1.0V supply", EFX_HWMON_IN, -1), | 41 | SENSOR(IN_1V0, "1.0V supply", EFX_HWMON_IN, -1), |
42 | SENSOR(IN_1V2, "1.2V supply", EFX_HWMON_IN, -1), | 42 | SENSOR(IN_1V2, "1.2V supply", EFX_HWMON_IN, -1), |
43 | SENSOR(IN_1V8, "1.8V supply", EFX_HWMON_IN, -1), | 43 | SENSOR(IN_1V8, "1.8V supply", EFX_HWMON_IN, -1), |
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index 3fbec458c323..0b95505e8968 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h | |||
@@ -1030,9 +1030,12 @@ static inline bool efx_tx_queue_used(struct efx_tx_queue *tx_queue) | |||
1030 | 1030 | ||
1031 | /* Iterate over all possible TX queues belonging to a channel */ | 1031 | /* Iterate over all possible TX queues belonging to a channel */ |
1032 | #define efx_for_each_possible_channel_tx_queue(_tx_queue, _channel) \ | 1032 | #define efx_for_each_possible_channel_tx_queue(_tx_queue, _channel) \ |
1033 | for (_tx_queue = (_channel)->tx_queue; \ | 1033 | if (!efx_channel_has_tx_queues(_channel)) \ |
1034 | _tx_queue < (_channel)->tx_queue + EFX_TXQ_TYPES; \ | 1034 | ; \ |
1035 | _tx_queue++) | 1035 | else \ |
1036 | for (_tx_queue = (_channel)->tx_queue; \ | ||
1037 | _tx_queue < (_channel)->tx_queue + EFX_TXQ_TYPES; \ | ||
1038 | _tx_queue++) | ||
1036 | 1039 | ||
1037 | static inline bool efx_channel_has_rx_queue(struct efx_channel *channel) | 1040 | static inline bool efx_channel_has_rx_queue(struct efx_channel *channel) |
1038 | { | 1041 | { |
diff --git a/drivers/net/ethernet/sfc/siena_sriov.c b/drivers/net/ethernet/sfc/siena_sriov.c index 5c6839ec3a83..80976e84eee6 100644 --- a/drivers/net/ethernet/sfc/siena_sriov.c +++ b/drivers/net/ethernet/sfc/siena_sriov.c | |||
@@ -796,12 +796,13 @@ static int efx_vfdi_set_status_page(struct efx_vf *vf) | |||
796 | { | 796 | { |
797 | struct efx_nic *efx = vf->efx; | 797 | struct efx_nic *efx = vf->efx; |
798 | struct vfdi_req *req = vf->buf.addr; | 798 | struct vfdi_req *req = vf->buf.addr; |
799 | unsigned int page_count; | 799 | u64 page_count = req->u.set_status_page.peer_page_count; |
800 | u64 max_page_count = | ||
801 | (EFX_PAGE_SIZE - | ||
802 | offsetof(struct vfdi_req, u.set_status_page.peer_page_addr[0])) | ||
803 | / sizeof(req->u.set_status_page.peer_page_addr[0]); | ||
800 | 804 | ||
801 | page_count = req->u.set_status_page.peer_page_count; | 805 | if (!req->u.set_status_page.dma_addr || page_count > max_page_count) { |
802 | if (!req->u.set_status_page.dma_addr || EFX_PAGE_SIZE < | ||
803 | offsetof(struct vfdi_req, | ||
804 | u.set_status_page.peer_page_addr[page_count])) { | ||
805 | if (net_ratelimit()) | 806 | if (net_ratelimit()) |
806 | netif_err(efx, hw, efx->net_dev, | 807 | netif_err(efx, hw, efx->net_dev, |
807 | "ERROR: Invalid SET_STATUS_PAGE from %s\n", | 808 | "ERROR: Invalid SET_STATUS_PAGE from %s\n", |
diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c index a096e287e95f..94d0365b31cd 100644 --- a/drivers/net/ethernet/sfc/tx.c +++ b/drivers/net/ethernet/sfc/tx.c | |||
@@ -339,7 +339,7 @@ static void efx_dequeue_buffers(struct efx_tx_queue *tx_queue, | |||
339 | * OS to free the skb. | 339 | * OS to free the skb. |
340 | */ | 340 | */ |
341 | netdev_tx_t efx_hard_start_xmit(struct sk_buff *skb, | 341 | netdev_tx_t efx_hard_start_xmit(struct sk_buff *skb, |
342 | struct net_device *net_dev) | 342 | struct net_device *net_dev) |
343 | { | 343 | { |
344 | struct efx_nic *efx = netdev_priv(net_dev); | 344 | struct efx_nic *efx = netdev_priv(net_dev); |
345 | struct efx_tx_queue *tx_queue; | 345 | struct efx_tx_queue *tx_queue; |
diff --git a/drivers/net/ethernet/sfc/vfdi.h b/drivers/net/ethernet/sfc/vfdi.h index 656fa70f9993..225557caaf5a 100644 --- a/drivers/net/ethernet/sfc/vfdi.h +++ b/drivers/net/ethernet/sfc/vfdi.h | |||
@@ -152,7 +152,8 @@ enum vfdi_op { | |||
152 | * all traffic at this receive queue. | 152 | * all traffic at this receive queue. |
153 | * @u.mac_filter.flags: MAC filter flags. | 153 | * @u.mac_filter.flags: MAC filter flags. |
154 | * @u.set_status_page.dma_addr: Base address for the &struct vfdi_status. | 154 | * @u.set_status_page.dma_addr: Base address for the &struct vfdi_status. |
155 | * This address must be such that the structure fits within a page. | 155 | * This address must be page-aligned and the PF may write up to a |
156 | * whole page (allowing for extension of the structure). | ||
156 | * @u.set_status_page.peer_page_count: Number of additional pages the VF | 157 | * @u.set_status_page.peer_page_count: Number of additional pages the VF |
157 | * has provided into which peer addresses may be DMAd. | 158 | * has provided into which peer addresses may be DMAd. |
158 | * @u.set_status_page.peer_page_addr: Array of DMA addresses of pages. | 159 | * @u.set_status_page.peer_page_addr: Array of DMA addresses of pages. |