Skip to content

Commit f5b2650

Browse files
committed
Merge branch 'xgbe-next'
Tom Lendacky says: ==================== amd-xgbe: AMD 10Gb Ethernet driver updates The following series fixes some bugs and provides new/changed support in the driver. - Make all the defines in the xgbe.h file unique by prefixing them with XGBE_ if they are not currently using the prefix. - VLAN CTAGs are supplied in context descriptors. Tell the hardware to look in the Tx context descriptor, and not a register, for the VLAN CTAG to be inserted in the packet. - The hardware will indicate a VLAN packet has been received even if VLAN CTAG stripping is currently disabled. Only indicate that a VLAN CTAG has been stripped for the current packet if stripping is enabled. - Add support for VLAN filtering - Modify destination address filtering to use the hardware hash tables - Eliminate a checkpatch warning by replacing sscanf with kstrtouint This patch series is based on net-next. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 9b8d90b + 66f95c3 commit f5b2650

File tree

8 files changed

+398
-189
lines changed

8 files changed

+398
-189
lines changed

drivers/net/ethernet/amd/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ config AMD_XGBE
182182
depends on OF_NET
183183
select PHYLIB
184184
select AMD_XGBE_PHY
185+
select BITREVERSE
186+
select CRC32
185187
---help---
186188
This driver supports the AMD 10GbE Ethernet device found on an
187189
AMD SoC.

drivers/net/ethernet/amd/xgbe/xgbe-common.h

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,6 @@
276276
#define MAC_PFR 0x0008
277277
#define MAC_WTR 0x000c
278278
#define MAC_HTR0 0x0010
279-
#define MAC_HTR1 0x0014
280-
#define MAC_HTR2 0x0018
281-
#define MAC_HTR3 0x001c
282-
#define MAC_HTR4 0x0020
283-
#define MAC_HTR5 0x0024
284-
#define MAC_HTR6 0x0028
285-
#define MAC_HTR7 0x002c
286279
#define MAC_VLANTR 0x0050
287280
#define MAC_VLANHTR 0x0058
288281
#define MAC_VLANIR 0x0060
@@ -315,6 +308,7 @@
315308

316309
#define MAC_QTFCR_INC 4
317310
#define MAC_MACA_INC 4
311+
#define MAC_HTR_INC 4
318312

319313
/* MAC register entry bit positions and sizes */
320314
#define MAC_HWF0R_ADDMACADRSEL_INDEX 18
@@ -387,12 +381,16 @@
387381
#define MAC_MACA1HR_AE_WIDTH 1
388382
#define MAC_PFR_HMC_INDEX 2
389383
#define MAC_PFR_HMC_WIDTH 1
384+
#define MAC_PFR_HPF_INDEX 10
385+
#define MAC_PFR_HPF_WIDTH 1
390386
#define MAC_PFR_HUC_INDEX 1
391387
#define MAC_PFR_HUC_WIDTH 1
392388
#define MAC_PFR_PM_INDEX 4
393389
#define MAC_PFR_PM_WIDTH 1
394390
#define MAC_PFR_PR_INDEX 0
395391
#define MAC_PFR_PR_WIDTH 1
392+
#define MAC_PFR_VTFE_INDEX 16
393+
#define MAC_PFR_VTFE_WIDTH 1
396394
#define MAC_PMTCSR_MGKPKTEN_INDEX 1
397395
#define MAC_PMTCSR_MGKPKTEN_WIDTH 1
398396
#define MAC_PMTCSR_PWRDWN_INDEX 0
@@ -427,16 +425,30 @@
427425
#define MAC_TCR_SS_WIDTH 2
428426
#define MAC_TCR_TE_INDEX 0
429427
#define MAC_TCR_TE_WIDTH 1
428+
#define MAC_VLANHTR_VLHT_INDEX 0
429+
#define MAC_VLANHTR_VLHT_WIDTH 16
430+
#define MAC_VLANIR_VLTI_INDEX 20
431+
#define MAC_VLANIR_VLTI_WIDTH 1
432+
#define MAC_VLANIR_CSVL_INDEX 19
433+
#define MAC_VLANIR_CSVL_WIDTH 1
430434
#define MAC_VLANTR_DOVLTC_INDEX 20
431435
#define MAC_VLANTR_DOVLTC_WIDTH 1
432436
#define MAC_VLANTR_ERSVLM_INDEX 19
433437
#define MAC_VLANTR_ERSVLM_WIDTH 1
434438
#define MAC_VLANTR_ESVL_INDEX 18
435439
#define MAC_VLANTR_ESVL_WIDTH 1
440+
#define MAC_VLANTR_ETV_INDEX 16
441+
#define MAC_VLANTR_ETV_WIDTH 1
436442
#define MAC_VLANTR_EVLS_INDEX 21
437443
#define MAC_VLANTR_EVLS_WIDTH 2
438444
#define MAC_VLANTR_EVLRXS_INDEX 24
439445
#define MAC_VLANTR_EVLRXS_WIDTH 1
446+
#define MAC_VLANTR_VL_INDEX 0
447+
#define MAC_VLANTR_VL_WIDTH 16
448+
#define MAC_VLANTR_VTHM_INDEX 25
449+
#define MAC_VLANTR_VTHM_WIDTH 1
450+
#define MAC_VLANTR_VTIM_INDEX 17
451+
#define MAC_VLANTR_VTIM_WIDTH 1
440452
#define MAC_VR_DEVID_INDEX 8
441453
#define MAC_VR_DEVID_WIDTH 8
442454
#define MAC_VR_SNPSVER_INDEX 0

drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ static ssize_t xgbe_common_write(const char __user *buffer, size_t count,
151151
{
152152
char workarea[32];
153153
ssize_t len;
154-
unsigned int scan_value;
154+
int ret;
155155

156156
if (*ppos != 0)
157157
return 0;
@@ -165,10 +165,9 @@ static ssize_t xgbe_common_write(const char __user *buffer, size_t count,
165165
return len;
166166

167167
workarea[len] = '\0';
168-
if (sscanf(workarea, "%x", &scan_value) == 1)
169-
*value = scan_value;
170-
else
171-
return -EIO;
168+
ret = kstrtouint(workarea, 0, value);
169+
if (ret)
170+
return ret;
172171

173172
return len;
174173
}

drivers/net/ethernet/amd/xgbe/xgbe-desc.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ static void xgbe_free_ring(struct xgbe_prv_data *pdata,
131131

132132
if (ring->rdata) {
133133
for (i = 0; i < ring->rdesc_count; i++) {
134-
rdata = GET_DESC_DATA(ring, i);
134+
rdata = XGBE_GET_DESC_DATA(ring, i);
135135
xgbe_unmap_skb(pdata, rdata);
136136
}
137137

@@ -256,7 +256,7 @@ static void xgbe_wrapper_tx_descriptor_init(struct xgbe_prv_data *pdata)
256256
rdesc_dma = ring->rdesc_dma;
257257

258258
for (j = 0; j < ring->rdesc_count; j++) {
259-
rdata = GET_DESC_DATA(ring, j);
259+
rdata = XGBE_GET_DESC_DATA(ring, j);
260260

261261
rdata->rdesc = rdesc;
262262
rdata->rdesc_dma = rdesc_dma;
@@ -298,7 +298,7 @@ static void xgbe_wrapper_rx_descriptor_init(struct xgbe_prv_data *pdata)
298298
rdesc_dma = ring->rdesc_dma;
299299

300300
for (j = 0; j < ring->rdesc_count; j++) {
301-
rdata = GET_DESC_DATA(ring, j);
301+
rdata = XGBE_GET_DESC_DATA(ring, j);
302302

303303
rdata->rdesc = rdesc;
304304
rdata->rdesc_dma = rdesc_dma;
@@ -392,7 +392,7 @@ static int xgbe_map_tx_skb(struct xgbe_channel *channel, struct sk_buff *skb)
392392
if ((tso && (packet->mss != ring->tx.cur_mss)) ||
393393
(vlan && (packet->vlan_ctag != ring->tx.cur_vlan_ctag)))
394394
cur_index++;
395-
rdata = GET_DESC_DATA(ring, cur_index);
395+
rdata = XGBE_GET_DESC_DATA(ring, cur_index);
396396

397397
if (tso) {
398398
DBGPR(" TSO packet\n");
@@ -413,12 +413,12 @@ static int xgbe_map_tx_skb(struct xgbe_channel *channel, struct sk_buff *skb)
413413
packet->length += packet->header_len;
414414

415415
cur_index++;
416-
rdata = GET_DESC_DATA(ring, cur_index);
416+
rdata = XGBE_GET_DESC_DATA(ring, cur_index);
417417
}
418418

419419
/* Map the (remainder of the) packet */
420420
for (datalen = skb_headlen(skb) - offset; datalen; ) {
421-
len = min_t(unsigned int, datalen, TX_MAX_BUF_SIZE);
421+
len = min_t(unsigned int, datalen, XGBE_TX_MAX_BUF_SIZE);
422422

423423
skb_dma = dma_map_single(pdata->dev, skb->data + offset, len,
424424
DMA_TO_DEVICE);
@@ -437,7 +437,7 @@ static int xgbe_map_tx_skb(struct xgbe_channel *channel, struct sk_buff *skb)
437437
packet->length += len;
438438

439439
cur_index++;
440-
rdata = GET_DESC_DATA(ring, cur_index);
440+
rdata = XGBE_GET_DESC_DATA(ring, cur_index);
441441
}
442442

443443
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
@@ -447,7 +447,8 @@ static int xgbe_map_tx_skb(struct xgbe_channel *channel, struct sk_buff *skb)
447447
offset = 0;
448448

449449
for (datalen = skb_frag_size(frag); datalen; ) {
450-
len = min_t(unsigned int, datalen, TX_MAX_BUF_SIZE);
450+
len = min_t(unsigned int, datalen,
451+
XGBE_TX_MAX_BUF_SIZE);
451452

452453
skb_dma = skb_frag_dma_map(pdata->dev, frag, offset,
453454
len, DMA_TO_DEVICE);
@@ -468,7 +469,7 @@ static int xgbe_map_tx_skb(struct xgbe_channel *channel, struct sk_buff *skb)
468469
packet->length += len;
469470

470471
cur_index++;
471-
rdata = GET_DESC_DATA(ring, cur_index);
472+
rdata = XGBE_GET_DESC_DATA(ring, cur_index);
472473
}
473474
}
474475

@@ -484,7 +485,7 @@ static int xgbe_map_tx_skb(struct xgbe_channel *channel, struct sk_buff *skb)
484485

485486
err_out:
486487
while (start_index < cur_index) {
487-
rdata = GET_DESC_DATA(ring, start_index++);
488+
rdata = XGBE_GET_DESC_DATA(ring, start_index++);
488489
xgbe_unmap_skb(pdata, rdata);
489490
}
490491

@@ -507,7 +508,7 @@ static void xgbe_realloc_skb(struct xgbe_channel *channel)
507508
ring->rx.realloc_index);
508509

509510
for (i = 0; i < ring->dirty; i++) {
510-
rdata = GET_DESC_DATA(ring, ring->rx.realloc_index);
511+
rdata = XGBE_GET_DESC_DATA(ring, ring->rx.realloc_index);
511512

512513
/* Reset rdata values */
513514
xgbe_unmap_skb(pdata, rdata);

0 commit comments

Comments
 (0)