diff options
| author | Lendacky, Thomas <Thomas.Lendacky@amd.com> | 2014-07-29 09:57:55 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-07-30 21:46:53 -0400 |
| commit | fca2d99428473884e67ef8ea1586e58151ed6ac3 (patch) | |
| tree | e6bcfb2af38d8f8a7eabbbaaef6e5f004bd67dd6 | |
| parent | b668a3aefd48ea4cc3fdcb730989e362f13ed431 (diff) | |
amd-xgbe: Add traffic class support
This patch adds support for traffic classes as well as support
for Data Center Bridging interfaces related to traffic classes
and priority flow control.
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | drivers/net/ethernet/amd/Kconfig | 10 | ||||
| -rw-r--r-- | drivers/net/ethernet/amd/xgbe/Makefile | 1 | ||||
| -rw-r--r-- | drivers/net/ethernet/amd/xgbe/xgbe-common.h | 22 | ||||
| -rw-r--r-- | drivers/net/ethernet/amd/xgbe/xgbe-dcb.c | 270 | ||||
| -rw-r--r-- | drivers/net/ethernet/amd/xgbe/xgbe-dev.c | 180 | ||||
| -rw-r--r-- | drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 29 | ||||
| -rw-r--r-- | drivers/net/ethernet/amd/xgbe/xgbe-main.c | 5 | ||||
| -rw-r--r-- | drivers/net/ethernet/amd/xgbe/xgbe.h | 18 |
8 files changed, 508 insertions, 27 deletions
diff --git a/drivers/net/ethernet/amd/Kconfig b/drivers/net/ethernet/amd/Kconfig index 98ef8ff8fa08..8319c99331b0 100644 --- a/drivers/net/ethernet/amd/Kconfig +++ b/drivers/net/ethernet/amd/Kconfig | |||
| @@ -192,4 +192,14 @@ config AMD_XGBE | |||
| 192 | To compile this driver as a module, choose M here: the module | 192 | To compile this driver as a module, choose M here: the module |
| 193 | will be called amd-xgbe. | 193 | will be called amd-xgbe. |
| 194 | 194 | ||
| 195 | config AMD_XGBE_DCB | ||
| 196 | bool "Data Center Bridging (DCB) support" | ||
| 197 | default n | ||
| 198 | depends on AMD_XGBE && DCB | ||
| 199 | ---help--- | ||
| 200 | Say Y here to enable Data Center Bridging (DCB) support in the | ||
| 201 | driver. | ||
| 202 | |||
| 203 | If unsure, say N. | ||
| 204 | |||
| 195 | endif # NET_VENDOR_AMD | 205 | endif # NET_VENDOR_AMD |
diff --git a/drivers/net/ethernet/amd/xgbe/Makefile b/drivers/net/ethernet/amd/xgbe/Makefile index 66c49b43e5f2..171a7e68048d 100644 --- a/drivers/net/ethernet/amd/xgbe/Makefile +++ b/drivers/net/ethernet/amd/xgbe/Makefile | |||
| @@ -4,4 +4,5 @@ amd-xgbe-objs := xgbe-main.o xgbe-drv.o xgbe-dev.o \ | |||
| 4 | xgbe-desc.o xgbe-ethtool.o xgbe-mdio.o \ | 4 | xgbe-desc.o xgbe-ethtool.o xgbe-mdio.o \ |
| 5 | xgbe-ptp.o | 5 | xgbe-ptp.o |
| 6 | 6 | ||
| 7 | amd-xgbe-$(CONFIG_AMD_XGBE_DCB) += xgbe-dcb.o | ||
| 7 | amd-xgbe-$(CONFIG_DEBUG_FS) += xgbe-debugfs.o | 8 | amd-xgbe-$(CONFIG_DEBUG_FS) += xgbe-debugfs.o |
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-common.h b/drivers/net/ethernet/amd/xgbe/xgbe-common.h index 646702cd75fb..cc25a3a9e7cf 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-common.h +++ b/drivers/net/ethernet/amd/xgbe/xgbe-common.h | |||
| @@ -322,6 +322,9 @@ | |||
| 322 | #define MAC_MACA_INC 4 | 322 | #define MAC_MACA_INC 4 |
| 323 | #define MAC_HTR_INC 4 | 323 | #define MAC_HTR_INC 4 |
| 324 | 324 | ||
| 325 | #define MAC_RQC2_INC 4 | ||
| 326 | #define MAC_RQC2_Q_PER_REG 4 | ||
| 327 | |||
| 325 | /* MAC register entry bit positions and sizes */ | 328 | /* MAC register entry bit positions and sizes */ |
| 326 | #define MAC_HWF0R_ADDMACADRSEL_INDEX 18 | 329 | #define MAC_HWF0R_ADDMACADRSEL_INDEX 18 |
| 327 | #define MAC_HWF0R_ADDMACADRSEL_WIDTH 5 | 330 | #define MAC_HWF0R_ADDMACADRSEL_WIDTH 5 |
| @@ -361,6 +364,8 @@ | |||
| 361 | #define MAC_HWF1R_HASHTBLSZ_WIDTH 3 | 364 | #define MAC_HWF1R_HASHTBLSZ_WIDTH 3 |
| 362 | #define MAC_HWF1R_L3L4FNUM_INDEX 27 | 365 | #define MAC_HWF1R_L3L4FNUM_INDEX 27 |
| 363 | #define MAC_HWF1R_L3L4FNUM_WIDTH 4 | 366 | #define MAC_HWF1R_L3L4FNUM_WIDTH 4 |
| 367 | #define MAC_HWF1R_NUMTC_INDEX 21 | ||
| 368 | #define MAC_HWF1R_NUMTC_WIDTH 3 | ||
| 364 | #define MAC_HWF1R_RSSEN_INDEX 20 | 369 | #define MAC_HWF1R_RSSEN_INDEX 20 |
| 365 | #define MAC_HWF1R_RSSEN_WIDTH 1 | 370 | #define MAC_HWF1R_RSSEN_WIDTH 1 |
| 366 | #define MAC_HWF1R_RXFIFOSIZE_INDEX 0 | 371 | #define MAC_HWF1R_RXFIFOSIZE_INDEX 0 |
| @@ -433,8 +438,12 @@ | |||
| 433 | #define MAC_RCR_LM_WIDTH 1 | 438 | #define MAC_RCR_LM_WIDTH 1 |
| 434 | #define MAC_RCR_RE_INDEX 0 | 439 | #define MAC_RCR_RE_INDEX 0 |
| 435 | #define MAC_RCR_RE_WIDTH 1 | 440 | #define MAC_RCR_RE_WIDTH 1 |
| 441 | #define MAC_RFCR_PFCE_INDEX 8 | ||
| 442 | #define MAC_RFCR_PFCE_WIDTH 1 | ||
| 436 | #define MAC_RFCR_RFE_INDEX 0 | 443 | #define MAC_RFCR_RFE_INDEX 0 |
| 437 | #define MAC_RFCR_RFE_WIDTH 1 | 444 | #define MAC_RFCR_RFE_WIDTH 1 |
| 445 | #define MAC_RFCR_UP_INDEX 1 | ||
| 446 | #define MAC_RFCR_UP_WIDTH 1 | ||
| 438 | #define MAC_RQC0R_RXQ0EN_INDEX 0 | 447 | #define MAC_RQC0R_RXQ0EN_INDEX 0 |
| 439 | #define MAC_RQC0R_RXQ0EN_WIDTH 2 | 448 | #define MAC_RQC0R_RXQ0EN_WIDTH 2 |
| 440 | #define MAC_SSIR_SNSINC_INDEX 8 | 449 | #define MAC_SSIR_SNSINC_INDEX 8 |
| @@ -704,6 +713,8 @@ | |||
| 704 | 713 | ||
| 705 | #define MTL_RQDCM_INC 4 | 714 | #define MTL_RQDCM_INC 4 |
| 706 | #define MTL_RQDCM_Q_PER_REG 4 | 715 | #define MTL_RQDCM_Q_PER_REG 4 |
| 716 | #define MTL_TCPM_INC 4 | ||
| 717 | #define MTL_TCPM_TC_PER_REG 4 | ||
| 707 | 718 | ||
| 708 | /* MTL register entry bit positions and sizes */ | 719 | /* MTL register entry bit positions and sizes */ |
| 709 | #define MTL_OMR_ETSALG_INDEX 5 | 720 | #define MTL_OMR_ETSALG_INDEX 5 |
| @@ -722,9 +733,6 @@ | |||
| 722 | #define MTL_Q_TQOMR 0x00 | 733 | #define MTL_Q_TQOMR 0x00 |
| 723 | #define MTL_Q_TQUR 0x04 | 734 | #define MTL_Q_TQUR 0x04 |
| 724 | #define MTL_Q_TQDR 0x08 | 735 | #define MTL_Q_TQDR 0x08 |
| 725 | #define MTL_Q_TCECR 0x10 | ||
| 726 | #define MTL_Q_TCESR 0x14 | ||
| 727 | #define MTL_Q_TCQWR 0x18 | ||
| 728 | #define MTL_Q_RQOMR 0x40 | 736 | #define MTL_Q_RQOMR 0x40 |
| 729 | #define MTL_Q_RQMPOCR 0x44 | 737 | #define MTL_Q_RQMPOCR 0x44 |
| 730 | #define MTL_Q_RQDR 0x4c | 738 | #define MTL_Q_RQDR 0x4c |
| @@ -732,8 +740,6 @@ | |||
| 732 | #define MTL_Q_ISR 0x74 | 740 | #define MTL_Q_ISR 0x74 |
| 733 | 741 | ||
| 734 | /* MTL queue register entry bit positions and sizes */ | 742 | /* MTL queue register entry bit positions and sizes */ |
| 735 | #define MTL_Q_TCQWR_QW_INDEX 0 | ||
| 736 | #define MTL_Q_TCQWR_QW_WIDTH 21 | ||
| 737 | #define MTL_Q_RQOMR_EHFC_INDEX 7 | 743 | #define MTL_Q_RQOMR_EHFC_INDEX 7 |
| 738 | #define MTL_Q_RQOMR_EHFC_WIDTH 1 | 744 | #define MTL_Q_RQOMR_EHFC_WIDTH 1 |
| 739 | #define MTL_Q_RQOMR_RFA_INDEX 8 | 745 | #define MTL_Q_RQOMR_RFA_INDEX 8 |
| @@ -748,6 +754,8 @@ | |||
| 748 | #define MTL_Q_RQOMR_RTC_WIDTH 2 | 754 | #define MTL_Q_RQOMR_RTC_WIDTH 2 |
| 749 | #define MTL_Q_TQOMR_FTQ_INDEX 0 | 755 | #define MTL_Q_TQOMR_FTQ_INDEX 0 |
| 750 | #define MTL_Q_TQOMR_FTQ_WIDTH 1 | 756 | #define MTL_Q_TQOMR_FTQ_WIDTH 1 |
| 757 | #define MTL_Q_TQOMR_Q2TCMAP_INDEX 8 | ||
| 758 | #define MTL_Q_TQOMR_Q2TCMAP_WIDTH 3 | ||
| 751 | #define MTL_Q_TQOMR_TQS_INDEX 16 | 759 | #define MTL_Q_TQOMR_TQS_INDEX 16 |
| 752 | #define MTL_Q_TQOMR_TQS_WIDTH 10 | 760 | #define MTL_Q_TQOMR_TQS_WIDTH 10 |
| 753 | #define MTL_Q_TQOMR_TSF_INDEX 1 | 761 | #define MTL_Q_TQOMR_TSF_INDEX 1 |
| @@ -794,10 +802,14 @@ | |||
| 794 | #define MTL_TC_INC MTL_Q_INC | 802 | #define MTL_TC_INC MTL_Q_INC |
| 795 | 803 | ||
| 796 | #define MTL_TC_ETSCR 0x10 | 804 | #define MTL_TC_ETSCR 0x10 |
| 805 | #define MTL_TC_ETSSR 0x14 | ||
| 806 | #define MTL_TC_QWR 0x18 | ||
| 797 | 807 | ||
| 798 | /* MTL traffic class register entry bit positions and sizes */ | 808 | /* MTL traffic class register entry bit positions and sizes */ |
| 799 | #define MTL_TC_ETSCR_TSA_INDEX 0 | 809 | #define MTL_TC_ETSCR_TSA_INDEX 0 |
| 800 | #define MTL_TC_ETSCR_TSA_WIDTH 2 | 810 | #define MTL_TC_ETSCR_TSA_WIDTH 2 |
| 811 | #define MTL_TC_QWR_QW_INDEX 0 | ||
| 812 | #define MTL_TC_QWR_QW_WIDTH 21 | ||
| 801 | 813 | ||
| 802 | /* MTL traffic class register value */ | 814 | /* MTL traffic class register value */ |
| 803 | #define MTL_TSA_SP 0x00 | 815 | #define MTL_TSA_SP 0x00 |
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-dcb.c b/drivers/net/ethernet/amd/xgbe/xgbe-dcb.c new file mode 100644 index 000000000000..7d6a49b24321 --- /dev/null +++ b/drivers/net/ethernet/amd/xgbe/xgbe-dcb.c | |||
| @@ -0,0 +1,270 @@ | |||
| 1 | /* | ||
| 2 | * AMD 10Gb Ethernet driver | ||
| 3 | * | ||
| 4 | * This file is available to you under your choice of the following two | ||
| 5 | * licenses: | ||
| 6 | * | ||
| 7 | * License 1: GPLv2 | ||
| 8 | * | ||
| 9 | * Copyright (c) 2014 Advanced Micro Devices, Inc. | ||
| 10 | * | ||
| 11 | * This file is free software; you may copy, redistribute and/or modify | ||
| 12 | * it under the terms of the GNU General Public License as published by | ||
| 13 | * the Free Software Foundation, either version 2 of the License, or (at | ||
| 14 | * your option) any later version. | ||
| 15 | * | ||
| 16 | * This file is distributed in the hope that it will be useful, but | ||
| 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 19 | * General Public License for more details. | ||
| 20 | * | ||
| 21 | * You should have received a copy of the GNU General Public License | ||
| 22 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 23 | * | ||
| 24 | * This file incorporates work covered by the following copyright and | ||
| 25 | * permission notice: | ||
| 26 | * The Synopsys DWC ETHER XGMAC Software Driver and documentation | ||
| 27 | * (hereinafter "Software") is an unsupported proprietary work of Synopsys, | ||
| 28 | * Inc. unless otherwise expressly agreed to in writing between Synopsys | ||
| 29 | * and you. | ||
| 30 | * | ||
| 31 | * The Software IS NOT an item of Licensed Software or Licensed Product | ||
