aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/ef10.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/sfc/ef10.c')
-rw-r--r--drivers/net/ethernet/sfc/ef10.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index 174a92f5fe51..21c20ea0dad0 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -162,8 +162,8 @@ static int efx_ef10_get_mac_address(struct efx_nic *efx, u8 *mac_address)
162 if (outlen < MC_CMD_GET_MAC_ADDRESSES_OUT_LEN) 162 if (outlen < MC_CMD_GET_MAC_ADDRESSES_OUT_LEN)
163 return -EIO; 163 return -EIO;
164 164
165 memcpy(mac_address, 165 ether_addr_copy(mac_address,
166 MCDI_PTR(outbuf, GET_MAC_ADDRESSES_OUT_MAC_ADDR_BASE), ETH_ALEN); 166 MCDI_PTR(outbuf, GET_MAC_ADDRESSES_OUT_MAC_ADDR_BASE));
167 return 0; 167 return 0;
168} 168}
169 169
@@ -172,8 +172,8 @@ static int efx_ef10_probe(struct efx_nic *efx)
172 struct efx_ef10_nic_data *nic_data; 172 struct efx_ef10_nic_data *nic_data;
173 int i, rc; 173 int i, rc;
174 174
175 /* We can have one VI for each 8K region. However we need 175 /* We can have one VI for each 8K region. However, until we
176 * multiple TX queues per channel. 176 * use TX option descriptors we need two TX queues per channel.
177 */ 177 */
178 efx->max_channels = 178 efx->max_channels =
179 min_t(unsigned int, 179 min_t(unsigned int,
@@ -565,10 +565,17 @@ static int efx_ef10_dimension_resources(struct efx_nic *efx)
565 * several of each (in fact that's the only option if host 565 * several of each (in fact that's the only option if host
566 * page size is >4K). So we may allocate some extra VIs just 566 * page size is >4K). So we may allocate some extra VIs just
567 * for writing PIO buffers through. 567 * for writing PIO buffers through.
568 *
569 * The UC mapping contains (min_vis - 1) complete VIs and the
570 * first half of the next VI. Then the WC mapping begins with
571 * the second half of this last VI.
568 */ 572 */
569 uc_mem_map_size = PAGE_ALIGN((min_vis - 1) * EFX_VI_PAGE_SIZE + 573 uc_mem_map_size = PAGE_ALIGN((min_vis - 1) * EFX_VI_PAGE_SIZE +
570 ER_DZ_TX_PIOBUF); 574 ER_DZ_TX_PIOBUF);
571 if (nic_data->n_piobufs) { 575 if (nic_data->n_piobufs) {
576 /* pio_write_vi_base rounds down to give the number of complete
577 * VIs inside the UC mapping.
578 */
572 pio_write_vi_base = uc_mem_map_size / EFX_VI_PAGE_SIZE; 579 pio_write_vi_base = uc_mem_map_size / EFX_VI_PAGE_SIZE;
573 wc_mem_map_size = (PAGE_ALIGN((pio_write_vi_base + 580 wc_mem_map_size = (PAGE_ALIGN((pio_write_vi_base +
574 nic_data->n_piobufs) * 581 nic_data->n_piobufs) *
@@ -1955,6 +1962,9 @@ static int efx_ef10_ev_process(struct efx_channel *channel, int quota)
1955 int tx_descs = 0; 1962 int tx_descs = 0;
1956 int spent = 0; 1963 int spent = 0;
1957 1964
1965 if (quota <= 0)
1966 return spent;
1967
1958 read_ptr = channel->eventq_read_ptr; 1968 read_ptr = channel->eventq_read_ptr;
1959 1969
1960 for (;;) { 1970 for (;;) {
@@ -3145,12 +3155,10 @@ static void efx_ef10_filter_sync_rx_mode(struct efx_nic *efx)
3145 table->dev_uc_count = -1; 3155 table->dev_uc_count = -1;
3146 } else { 3156 } else {
3147 table->dev_uc_count = 1 + netdev_uc_count(net_dev); 3157 table->dev_uc_count = 1 + netdev_uc_count(net_dev);
3148 memcpy(table->dev_uc_list[0].addr, net_dev->dev_addr, 3158 ether_addr_copy(table->dev_uc_list[0].addr, net_dev->dev_addr);
3149 ETH_ALEN);
3150 i = 1; 3159 i = 1;
3151 netdev_for_each_uc_addr(uc, net_dev) { 3160 netdev_for_each_uc_addr(uc, net_dev) {
3152 memcpy(table->dev_uc_list[i].addr, 3161 ether_addr_copy(table->dev_uc_list[i].addr, uc->addr);
3153 uc->addr, ETH_ALEN);
3154 i++; 3162 i++;
3155 } 3163 }
3156 } 3164 }
@@ -3162,8 +3170,7 @@ static void efx_ef10_filter_sync_rx_mode(struct efx_nic *efx)
3162 eth_broadcast_addr(table->dev_mc_list[0].addr); 3170 eth_broadcast_addr(table->dev_mc_list[0].addr);
3163 i = 1; 3171 i = 1;
3164 netdev_for_each_mc_addr(mc, net_dev) { 3172 netdev_for_each_mc_addr(mc, net_dev) {
3165 memcpy(table->dev_mc_list[i].addr, 3173 ether_addr_copy(table->dev_mc_list[i].addr, mc->addr);
3166 mc->addr, ETH_ALEN);
3167 i++; 3174 i++;
3168 } 3175 }
3169 } 3176 }