diff mbox series

[v6,net-next,14/14] pds_core: Kconfig and pds_core.rst

Message ID 20230324190243.27722-15-shannon.nelson@amd.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series pds_core driver | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 18 this patch: 18
netdev/cc_maintainers warning 6 maintainers not CCed: pabeni@redhat.com corbet@lwn.net linux-doc@vger.kernel.org anthony.l.nguyen@intel.com edumazet@google.com rrameshbabu@nvidia.com
netdev/build_clang success Errors and warnings before: 18 this patch: 18
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 18 this patch: 18
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 185 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Nelson, Shannon March 24, 2023, 7:02 p.m. UTC
Documentation and Kconfig hook for building the driver.

Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
---
 .../device_drivers/ethernet/amd/pds_core.rst  | 143 ++++++++++++++++++
 .../device_drivers/ethernet/index.rst         |   1 +
 MAINTAINERS                                   |   9 ++
 drivers/net/ethernet/amd/Kconfig              |  12 ++
 drivers/net/ethernet/amd/Makefile             |   1 +
 5 files changed, 166 insertions(+)
 create mode 100644 Documentation/networking/device_drivers/ethernet/amd/pds_core.rst

Comments

kernel test robot March 25, 2023, 8:40 p.m. UTC | #1
Hi Shannon,

I love your patch! Yet something to improve:

[auto build test ERROR on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Shannon-Nelson/pds_core-initial-framework-for-pds_core-PF-driver/20230325-030501
patch link:    https://lore.kernel.org/r/20230324190243.27722-15-shannon.nelson%40amd.com
patch subject: [PATCH v6 net-next 14/14] pds_core: Kconfig and pds_core.rst
config: mips-randconfig-r006-20230326 (https://download.01.org/0day-ci/archive/20230326/202303260420.Tgq0qobF-lkp@intel.com/config)
compiler: mips64-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/dd8c8b0ffae4db2f83e11b696198afa72d99c1b0
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Shannon-Nelson/pds_core-initial-framework-for-pds_core-PF-driver/20230325-030501
        git checkout dd8c8b0ffae4db2f83e11b696198afa72d99c1b0
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/net/ethernet/amd/pds_core/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303260420.Tgq0qobF-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   drivers/net/ethernet/amd/pds_core/core.c: In function 'pdsc_qcq_free':
>> drivers/net/ethernet/amd/pds_core/core.c:161:17: error: implicit declaration of function 'vfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration]
     161 |                 vfree(qcq->cq.info);
         |                 ^~~~~
         |                 kvfree
   drivers/net/ethernet/amd/pds_core/core.c: In function 'pdsc_qcq_alloc':
>> drivers/net/ethernet/amd/pds_core/core.c:209:23: error: implicit declaration of function 'vzalloc'; did you mean 'kvzalloc'? [-Werror=implicit-function-declaration]
     209 |         qcq->q.info = vzalloc(num_descs * sizeof(*qcq->q.info));
         |                       ^~~~~~~
         |                       kvzalloc
>> drivers/net/ethernet/amd/pds_core/core.c:209:21: warning: assignment to 'struct pdsc_q_info *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     209 |         qcq->q.info = vzalloc(num_descs * sizeof(*qcq->q.info));
         |                     ^
>> drivers/net/ethernet/amd/pds_core/core.c:232:22: warning: assignment to 'struct pdsc_cq_info *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     232 |         qcq->cq.info = vzalloc(num_descs * sizeof(*qcq->cq.info));
         |                      ^
   cc1: some warnings being treated as errors


vim +161 drivers/net/ethernet/amd/pds_core/core.c

520bb62de695d83 Shannon Nelson 2023-03-24  134  
520bb62de695d83 Shannon Nelson 2023-03-24  135  void pdsc_qcq_free(struct pdsc *pdsc, struct pdsc_qcq *qcq)
520bb62de695d83 Shannon Nelson 2023-03-24  136  {
520bb62de695d83 Shannon Nelson 2023-03-24  137  	struct device *dev = pdsc->dev;
520bb62de695d83 Shannon Nelson 2023-03-24  138  
520bb62de695d83 Shannon Nelson 2023-03-24  139  	if (!(qcq && qcq->pdsc))
520bb62de695d83 Shannon Nelson 2023-03-24  140  		return;
520bb62de695d83 Shannon Nelson 2023-03-24  141  
520bb62de695d83 Shannon Nelson 2023-03-24  142  	pdsc_debugfs_del_qcq(qcq);
520bb62de695d83 Shannon Nelson 2023-03-24  143  
520bb62de695d83 Shannon Nelson 2023-03-24  144  	pdsc_qcq_intr_free(pdsc, qcq);
520bb62de695d83 Shannon Nelson 2023-03-24  145  
520bb62de695d83 Shannon Nelson 2023-03-24  146  	if (qcq->q_base) {
520bb62de695d83 Shannon Nelson 2023-03-24  147  		dma_free_coherent(dev, qcq->q_size,
520bb62de695d83 Shannon Nelson 2023-03-24  148  				  qcq->q_base, qcq->q_base_pa);
520bb62de695d83 Shannon Nelson 2023-03-24  149  		qcq->q_base = NULL;
520bb62de695d83 Shannon Nelson 2023-03-24  150  		qcq->q_base_pa = 0;
520bb62de695d83 Shannon Nelson 2023-03-24  151  	}
520bb62de695d83 Shannon Nelson 2023-03-24  152  
520bb62de695d83 Shannon Nelson 2023-03-24  153  	if (qcq->cq_base) {
520bb62de695d83 Shannon Nelson 2023-03-24  154  		dma_free_coherent(dev, qcq->cq_size,
520bb62de695d83 Shannon Nelson 2023-03-24  155  				  qcq->cq_base, qcq->cq_base_pa);
520bb62de695d83 Shannon Nelson 2023-03-24  156  		qcq->cq_base = NULL;
520bb62de695d83 Shannon Nelson 2023-03-24  157  		qcq->cq_base_pa = 0;
520bb62de695d83 Shannon Nelson 2023-03-24  158  	}
520bb62de695d83 Shannon Nelson 2023-03-24  159  
520bb62de695d83 Shannon Nelson 2023-03-24  160  	if (qcq->cq.info) {
520bb62de695d83 Shannon Nelson 2023-03-24 @161  		vfree(qcq->cq.info);
520bb62de695d83 Shannon Nelson 2023-03-24  162  		qcq->cq.info = NULL;
520bb62de695d83 Shannon Nelson 2023-03-24  163  	}
520bb62de695d83 Shannon Nelson 2023-03-24  164  	if (qcq->q.info) {
520bb62de695d83 Shannon Nelson 2023-03-24  165  		vfree(qcq->q.info);
520bb62de695d83 Shannon Nelson 2023-03-24  166  		qcq->q.info = NULL;
520bb62de695d83 Shannon Nelson 2023-03-24  167  	}
520bb62de695d83 Shannon Nelson 2023-03-24  168  
520bb62de695d83 Shannon Nelson 2023-03-24  169  	qcq->pdsc = NULL;
520bb62de695d83 Shannon Nelson 2023-03-24  170  	memset(&qcq->q, 0, sizeof(qcq->q));
520bb62de695d83 Shannon Nelson 2023-03-24  171  	memset(&qcq->cq, 0, sizeof(qcq->cq));
520bb62de695d83 Shannon Nelson 2023-03-24  172  }
520bb62de695d83 Shannon Nelson 2023-03-24  173  
520bb62de695d83 Shannon Nelson 2023-03-24  174  static void pdsc_q_map(struct pdsc_queue *q, void *base, dma_addr_t base_pa)
520bb62de695d83 Shannon Nelson 2023-03-24  175  {
520bb62de695d83 Shannon Nelson 2023-03-24  176  	struct pdsc_q_info *cur;
520bb62de695d83 Shannon Nelson 2023-03-24  177  	unsigned int i;
520bb62de695d83 Shannon Nelson 2023-03-24  178  
520bb62de695d83 Shannon Nelson 2023-03-24  179  	q->base = base;
520bb62de695d83 Shannon Nelson 2023-03-24  180  	q->base_pa = base_pa;
520bb62de695d83 Shannon Nelson 2023-03-24  181  
520bb62de695d83 Shannon Nelson 2023-03-24  182  	for (i = 0, cur = q->info; i < q->num_descs; i++, cur++)
520bb62de695d83 Shannon Nelson 2023-03-24  183  		cur->desc = base + (i * q->desc_size);
520bb62de695d83 Shannon Nelson 2023-03-24  184  }
520bb62de695d83 Shannon Nelson 2023-03-24  185  
520bb62de695d83 Shannon Nelson 2023-03-24  186  static void pdsc_cq_map(struct pdsc_cq *cq, void *base, dma_addr_t base_pa)
520bb62de695d83 Shannon Nelson 2023-03-24  187  {
520bb62de695d83 Shannon Nelson 2023-03-24  188  	struct pdsc_cq_info *cur;
520bb62de695d83 Shannon Nelson 2023-03-24  189  	unsigned int i;
520bb62de695d83 Shannon Nelson 2023-03-24  190  
520bb62de695d83 Shannon Nelson 2023-03-24  191  	cq->base = base;
520bb62de695d83 Shannon Nelson 2023-03-24  192  	cq->base_pa = base_pa;
520bb62de695d83 Shannon Nelson 2023-03-24  193  
520bb62de695d83 Shannon Nelson 2023-03-24  194  	for (i = 0, cur = cq->info; i < cq->num_descs; i++, cur++)
520bb62de695d83 Shannon Nelson 2023-03-24  195  		cur->comp = base + (i * cq->desc_size);
520bb62de695d83 Shannon Nelson 2023-03-24  196  }
520bb62de695d83 Shannon Nelson 2023-03-24  197  
520bb62de695d83 Shannon Nelson 2023-03-24  198  int pdsc_qcq_alloc(struct pdsc *pdsc, unsigned int type, unsigned int index,
520bb62de695d83 Shannon Nelson 2023-03-24  199  		   const char *name, unsigned int flags, unsigned int num_descs,
520bb62de695d83 Shannon Nelson 2023-03-24  200  		   unsigned int desc_size, unsigned int cq_desc_size,
520bb62de695d83 Shannon Nelson 2023-03-24  201  		   unsigned int pid, struct pdsc_qcq *qcq)
520bb62de695d83 Shannon Nelson 2023-03-24  202  {
520bb62de695d83 Shannon Nelson 2023-03-24  203  	struct device *dev = pdsc->dev;
520bb62de695d83 Shannon Nelson 2023-03-24  204  	dma_addr_t cq_base_pa = 0;
520bb62de695d83 Shannon Nelson 2023-03-24  205  	dma_addr_t q_base_pa = 0;
520bb62de695d83 Shannon Nelson 2023-03-24  206  	void *q_base, *cq_base;
520bb62de695d83 Shannon Nelson 2023-03-24  207  	int err;
520bb62de695d83 Shannon Nelson 2023-03-24  208  
520bb62de695d83 Shannon Nelson 2023-03-24 @209  	qcq->q.info = vzalloc(num_descs * sizeof(*qcq->q.info));
520bb62de695d83 Shannon Nelson 2023-03-24  210  	if (!qcq->q.info) {
520bb62de695d83 Shannon Nelson 2023-03-24  211  		err = -ENOMEM;
520bb62de695d83 Shannon Nelson 2023-03-24  212  		goto err_out;
520bb62de695d83 Shannon Nelson 2023-03-24  213  	}
520bb62de695d83 Shannon Nelson 2023-03-24  214  
520bb62de695d83 Shannon Nelson 2023-03-24  215  	qcq->pdsc = pdsc;
520bb62de695d83 Shannon Nelson 2023-03-24  216  	qcq->flags = flags;
520bb62de695d83 Shannon Nelson 2023-03-24  217  	INIT_WORK(&qcq->work, pdsc_work_thread);
520bb62de695d83 Shannon Nelson 2023-03-24  218  
520bb62de695d83 Shannon Nelson 2023-03-24  219  	qcq->q.type = type;
520bb62de695d83 Shannon Nelson 2023-03-24  220  	qcq->q.index = index;
520bb62de695d83 Shannon Nelson 2023-03-24  221  	qcq->q.num_descs = num_descs;
520bb62de695d83 Shannon Nelson 2023-03-24  222  	qcq->q.desc_size = desc_size;
520bb62de695d83 Shannon Nelson 2023-03-24  223  	qcq->q.tail_idx = 0;
520bb62de695d83 Shannon Nelson 2023-03-24  224  	qcq->q.head_idx = 0;
520bb62de695d83 Shannon Nelson 2023-03-24  225  	qcq->q.pid = pid;
520bb62de695d83 Shannon Nelson 2023-03-24  226  	snprintf(qcq->q.name, sizeof(qcq->q.name), "%s%u", name, index);
520bb62de695d83 Shannon Nelson 2023-03-24  227  
520bb62de695d83 Shannon Nelson 2023-03-24  228  	err = pdsc_qcq_intr_alloc(pdsc, qcq);
520bb62de695d83 Shannon Nelson 2023-03-24  229  	if (err)
520bb62de695d83 Shannon Nelson 2023-03-24  230  		goto err_out_free_q_info;
520bb62de695d83 Shannon Nelson 2023-03-24  231  
520bb62de695d83 Shannon Nelson 2023-03-24 @232  	qcq->cq.info = vzalloc(num_descs * sizeof(*qcq->cq.info));
520bb62de695d83 Shannon Nelson 2023-03-24  233  	if (!qcq->cq.info) {
520bb62de695d83 Shannon Nelson 2023-03-24  234  		err = -ENOMEM;
520bb62de695d83 Shannon Nelson 2023-03-24  235  		goto err_out_free_irq;
520bb62de695d83 Shannon Nelson 2023-03-24  236  	}
520bb62de695d83 Shannon Nelson 2023-03-24  237  
520bb62de695d83 Shannon Nelson 2023-03-24  238  	qcq->cq.bound_intr = &pdsc->intr_info[qcq->intx];
520bb62de695d83 Shannon Nelson 2023-03-24  239  	qcq->cq.num_descs = num_descs;
520bb62de695d83 Shannon Nelson 2023-03-24  240  	qcq->cq.desc_size = cq_desc_size;
520bb62de695d83 Shannon Nelson 2023-03-24  241  	qcq->cq.tail_idx = 0;
520bb62de695d83 Shannon Nelson 2023-03-24  242  	qcq->cq.done_color = 1;
520bb62de695d83 Shannon Nelson 2023-03-24  243  
520bb62de695d83 Shannon Nelson 2023-03-24  244  	if (flags & PDS_CORE_QCQ_F_NOTIFYQ) {
520bb62de695d83 Shannon Nelson 2023-03-24  245  		/* q & cq need to be contiguous in case of notifyq */
520bb62de695d83 Shannon Nelson 2023-03-24  246  		qcq->q_size = PDS_PAGE_SIZE +
520bb62de695d83 Shannon Nelson 2023-03-24  247  			      ALIGN(num_descs * desc_size, PDS_PAGE_SIZE) +
520bb62de695d83 Shannon Nelson 2023-03-24  248  			      ALIGN(num_descs * cq_desc_size, PDS_PAGE_SIZE);
520bb62de695d83 Shannon Nelson 2023-03-24  249  		qcq->q_base = dma_alloc_coherent(dev,
520bb62de695d83 Shannon Nelson 2023-03-24  250  						 qcq->q_size + qcq->cq_size,
520bb62de695d83 Shannon Nelson 2023-03-24  251  						 &qcq->q_base_pa,
520bb62de695d83 Shannon Nelson 2023-03-24  252  						 GFP_KERNEL);
520bb62de695d83 Shannon Nelson 2023-03-24  253  		if (!qcq->q_base) {
520bb62de695d83 Shannon Nelson 2023-03-24  254  			err = -ENOMEM;
520bb62de695d83 Shannon Nelson 2023-03-24  255  			goto err_out_free_cq_info;
520bb62de695d83 Shannon Nelson 2023-03-24  256  		}
520bb62de695d83 Shannon Nelson 2023-03-24  257  		q_base = PTR_ALIGN(qcq->q_base, PDS_PAGE_SIZE);
520bb62de695d83 Shannon Nelson 2023-03-24  258  		q_base_pa = ALIGN(qcq->q_base_pa, PDS_PAGE_SIZE);
520bb62de695d83 Shannon Nelson 2023-03-24  259  		pdsc_q_map(&qcq->q, q_base, q_base_pa);
520bb62de695d83 Shannon Nelson 2023-03-24  260  
520bb62de695d83 Shannon Nelson 2023-03-24  261  		cq_base = PTR_ALIGN(q_base +
520bb62de695d83 Shannon Nelson 2023-03-24  262  				    ALIGN(num_descs * desc_size, PDS_PAGE_SIZE),
520bb62de695d83 Shannon Nelson 2023-03-24  263  				    PDS_PAGE_SIZE);
520bb62de695d83 Shannon Nelson 2023-03-24  264  		cq_base_pa = ALIGN(qcq->q_base_pa +
520bb62de695d83 Shannon Nelson 2023-03-24  265  				   ALIGN(num_descs * desc_size, PDS_PAGE_SIZE),
520bb62de695d83 Shannon Nelson 2023-03-24  266  				   PDS_PAGE_SIZE);
520bb62de695d83 Shannon Nelson 2023-03-24  267  
520bb62de695d83 Shannon Nelson 2023-03-24  268  	} else {
520bb62de695d83 Shannon Nelson 2023-03-24  269  		/* q DMA descriptors */
520bb62de695d83 Shannon Nelson 2023-03-24  270  		qcq->q_size = PDS_PAGE_SIZE + (num_descs * desc_size);
520bb62de695d83 Shannon Nelson 2023-03-24  271  		qcq->q_base = dma_alloc_coherent(dev, qcq->q_size,
520bb62de695d83 Shannon Nelson 2023-03-24  272  						 &qcq->q_base_pa,
520bb62de695d83 Shannon Nelson 2023-03-24  273  						 GFP_KERNEL);
520bb62de695d83 Shannon Nelson 2023-03-24  274  		if (!qcq->q_base) {
520bb62de695d83 Shannon Nelson 2023-03-24  275  			err = -ENOMEM;
520bb62de695d83 Shannon Nelson 2023-03-24  276  			goto err_out_free_cq_info;
520bb62de695d83 Shannon Nelson 2023-03-24  277  		}
520bb62de695d83 Shannon Nelson 2023-03-24  278  		q_base = PTR_ALIGN(qcq->q_base, PDS_PAGE_SIZE);
520bb62de695d83 Shannon Nelson 2023-03-24  279  		q_base_pa = ALIGN(qcq->q_base_pa, PDS_PAGE_SIZE);
520bb62de695d83 Shannon Nelson 2023-03-24  280  		pdsc_q_map(&qcq->q, q_base, q_base_pa);
520bb62de695d83 Shannon Nelson 2023-03-24  281  
520bb62de695d83 Shannon Nelson 2023-03-24  282  		/* cq DMA descriptors */
520bb62de695d83 Shannon Nelson 2023-03-24  283  		qcq->cq_size = PDS_PAGE_SIZE + (num_descs * cq_desc_size);
520bb62de695d83 Shannon Nelson 2023-03-24  284  		qcq->cq_base = dma_alloc_coherent(dev, qcq->cq_size,
520bb62de695d83 Shannon Nelson 2023-03-24  285  						  &qcq->cq_base_pa,
520bb62de695d83 Shannon Nelson 2023-03-24  286  						  GFP_KERNEL);
520bb62de695d83 Shannon Nelson 2023-03-24  287  		if (!qcq->cq_base) {
520bb62de695d83 Shannon Nelson 2023-03-24  288  			err = -ENOMEM;
520bb62de695d83 Shannon Nelson 2023-03-24  289  			goto err_out_free_q;
520bb62de695d83 Shannon Nelson 2023-03-24  290  		}
520bb62de695d83 Shannon Nelson 2023-03-24  291  		cq_base = PTR_ALIGN(qcq->cq_base, PDS_PAGE_SIZE);
520bb62de695d83 Shannon Nelson 2023-03-24  292  		cq_base_pa = ALIGN(qcq->cq_base_pa, PDS_PAGE_SIZE);
520bb62de695d83 Shannon Nelson 2023-03-24  293  	}
520bb62de695d83 Shannon Nelson 2023-03-24  294  
520bb62de695d83 Shannon Nelson 2023-03-24  295  	pdsc_cq_map(&qcq->cq, cq_base, cq_base_pa);
520bb62de695d83 Shannon Nelson 2023-03-24  296  	qcq->cq.bound_q = &qcq->q;
520bb62de695d83 Shannon Nelson 2023-03-24  297  
520bb62de695d83 Shannon Nelson 2023-03-24  298  	pdsc_debugfs_add_qcq(pdsc, qcq);
520bb62de695d83 Shannon Nelson 2023-03-24  299  
520bb62de695d83 Shannon Nelson 2023-03-24  300  	return 0;
520bb62de695d83 Shannon Nelson 2023-03-24  301  
520bb62de695d83 Shannon Nelson 2023-03-24  302  err_out_free_q:
520bb62de695d83 Shannon Nelson 2023-03-24  303  	dma_free_coherent(dev, qcq->q_size, qcq->q_base, qcq->q_base_pa);
520bb62de695d83 Shannon Nelson 2023-03-24  304  err_out_free_cq_info:
520bb62de695d83 Shannon Nelson 2023-03-24  305  	vfree(qcq->cq.info);
520bb62de695d83 Shannon Nelson 2023-03-24  306  err_out_free_irq:
520bb62de695d83 Shannon Nelson 2023-03-24  307  	pdsc_qcq_intr_free(pdsc, qcq);
520bb62de695d83 Shannon Nelson 2023-03-24  308  err_out_free_q_info:
520bb62de695d83 Shannon Nelson 2023-03-24  309  	vfree(qcq->q.info);
520bb62de695d83 Shannon Nelson 2023-03-24  310  	memset(qcq, 0, sizeof(*qcq));
520bb62de695d83 Shannon Nelson 2023-03-24  311  err_out:
520bb62de695d83 Shannon Nelson 2023-03-24  312  	dev_err(dev, "qcq alloc of %s%d failed %d\n", name, index, err);
520bb62de695d83 Shannon Nelson 2023-03-24  313  	return err;
520bb62de695d83 Shannon Nelson 2023-03-24  314  }
520bb62de695d83 Shannon Nelson 2023-03-24  315
diff mbox series

Patch

diff --git a/Documentation/networking/device_drivers/ethernet/amd/pds_core.rst b/Documentation/networking/device_drivers/ethernet/amd/pds_core.rst
new file mode 100644
index 000000000000..16ed45baa81b
--- /dev/null
+++ b/Documentation/networking/device_drivers/ethernet/amd/pds_core.rst
@@ -0,0 +1,143 @@ 
+.. SPDX-License-Identifier: GPL-2.0+
+
+========================================================
+Linux Driver for the AMD/Pensando(R) DSC adapter family
+========================================================
+
+Copyright(c) 2023 Advanced Micro Devices, Inc
+
+Identifying the Adapter
+=======================
+
+To find if one or more AMD/Pensando PCI Core devices are installed on the
+host, check for the PCI devices::
+
+  # lspci -d 1dd8:100c
+  b5:00.0 Processing accelerators: Pensando Systems Device 100c
+  b6:00.0 Processing accelerators: Pensando Systems Device 100c
+
+If such devices are listed as above, then the pds_core.ko driver should find
+and configure them for use.  There should be log entries in the kernel
+messages such as these::
+
+  $ dmesg | grep pds_core
+  pds_core 0000:b5:00.0: 252.048 Gb/s available PCIe bandwidth (16.0 GT/s PCIe x16 link)
+  pds_core 0000:b5:00.0: FW: 1.60.0-73
+  pds_core 0000:b6:00.0: 252.048 Gb/s available PCIe bandwidth (16.0 GT/s PCIe x16 link)
+  pds_core 0000:b6:00.0: FW: 1.60.0-73
+
+Driver and firmware version information can be gathered with devlink::
+
+  $ devlink dev info pci/0000:b5:00.0
+  pci/0000:b5:00.0:
+    driver pds_core
+    serial_number FLM18420073
+    versions:
+        fixed:
+          asic.id 0x0
+          asic.rev 0x0
+        running:
+          fw 1.51.0-73
+        stored:
+          fw.goldfw 1.15.9-C-22
+          fw.mainfwa 1.60.0-73
+          fw.mainfwb 1.60.0-57
+
+
+Info versions
+=============
+
+The ``pds_core`` driver reports the following versions
+
+.. list-table:: devlink info versions implemented
+   :widths: 5 5 90
+
+   * - Name
+     - Type
+     - Description
+   * - ``fw``
+     - running
+     - Version of firmware running on the device
+   * - ``fw.goldfw``
+     - stored
+     - Version of firmware stored in the goldfw slot
+   * - ``fw.mainfwa``
+     - stored
+     - Version of firmware stored in the mainfwa slot
+   * - ``fw.mainfwb``
+     - stored
+     - Version of firmware stored in the mainfwb slot
+   * - ``asic.id``
+     - fixed
+     - The ASIC type for this device
+   * - ``asic.rev``
+     - fixed
+     - The revision of the ASIC for this device
+
+
+Parameters
+==========
+
+The ``pds_core`` driver implements the following generic
+parameters for controlling the functionality to be made available
+as auxiliary_bus devices.
+
+.. list-table:: Generic parameters implemented
+   :widths: 5 5 8 82
+
+   * - Name
+     - Mode
+     - Type
+     - Description
+   * - ``enable_vnet``
+     - runtime
+     - Boolean
+     - Enables vDPA functionality through an auxiliary_bus device
+
+
+Firmware Management
+===================
+
+The ``flash`` command can update a the DSC firmware.  The downloaded firmware
+will be saved into either of firmware bank 1 or bank 2, whichever is not
+currrently in use, and that bank will be then selected for the next boot.
+
+Health Reporters
+================
+
+The driver supports a devlink health reporter for FW status::
+
+  # devlink health show pci/0000:2b:00.0 reporter fw
+  pci/0000:2b:00.0:
+    reporter fw
+      state healthy error 0 recover 0
+
+
+Enabling the driver
+===================
+
+The driver is enabled via the standard kernel configuration system,
+using the make command::
+
+  make oldconfig/menuconfig/etc.
+
+The driver is located in the menu structure at:
+
+  -> Device Drivers
+    -> Network device support (NETDEVICES [=y])
+      -> Ethernet driver support
+        -> AMD devices
+          -> AMD/Pensando Ethernet PDS_CORE Support
+
+Support
+=======
+
+For general Linux networking support, please use the netdev mailing
+list, which is monitored by AMD/Pensando personnel::
+
+  netdev@vger.kernel.org
+
+For more specific support needs, please use the AMD/Pensando driver support
+email::
+
+  drivers@pensando.io
diff --git a/Documentation/networking/device_drivers/ethernet/index.rst b/Documentation/networking/device_drivers/ethernet/index.rst
index 6e9e7012d000..eaaf284e69e6 100644
--- a/Documentation/networking/device_drivers/ethernet/index.rst
+++ b/Documentation/networking/device_drivers/ethernet/index.rst
@@ -13,6 +13,7 @@  Contents:
    3com/3c509
    3com/vortex
    amazon/ena
+   amd/pds_core
    altera/altera_tse
    aquantia/atlantic
    chelsio/cxgb
diff --git a/MAINTAINERS b/MAINTAINERS
index 30ca644d704f..95b5f25a2c06 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1041,6 +1041,15 @@  F:	drivers/gpu/drm/amd/include/vi_structs.h
 F:	include/uapi/linux/kfd_ioctl.h
 F:	include/uapi/linux/kfd_sysfs.h
 
+AMD PDS CORE DRIVER
+M:	Shannon Nelson <shannon.nelson@amd.com>
+M:	Brett Creeley <brett.creeley@amd.com>
+M:	drivers@pensando.io
+L:	netdev@vger.kernel.org
+S:	Supported
+F:	Documentation/networking/device_drivers/ethernet/amd/pds_core.rst
+F:	drivers/net/ethernet/amd/pds_core/
+
 AMD SPI DRIVER
 M:	Sanjay R Mehta <sanju.mehta@amd.com>
 S:	Maintained
diff --git a/drivers/net/ethernet/amd/Kconfig b/drivers/net/ethernet/amd/Kconfig
index ab42f75b9413..235fcacef5c5 100644
--- a/drivers/net/ethernet/amd/Kconfig
+++ b/drivers/net/ethernet/amd/Kconfig
@@ -186,4 +186,16 @@  config AMD_XGBE_HAVE_ECC
 	bool
 	default n
 
+config PDS_CORE
+	tristate "AMD/Pensando Data Systems Core Device Support"
+	depends on 64BIT && PCI
+	help
+	  This enables the support for the AMD/Pensando Core device family of
+	  adapters.  More specific information on this driver can be
+	  found in
+	  <file:Documentation/networking/device_drivers/ethernet/amd/pds_core.rst>.
+
+	  To compile this driver as a module, choose M here. The module
+	  will be called pds_core.
+
 endif # NET_VENDOR_AMD
diff --git a/drivers/net/ethernet/amd/Makefile b/drivers/net/ethernet/amd/Makefile
index 42742afe9115..2dcfb84731e1 100644
--- a/drivers/net/ethernet/amd/Makefile
+++ b/drivers/net/ethernet/amd/Makefile
@@ -17,3 +17,4 @@  obj-$(CONFIG_PCNET32) += pcnet32.o
 obj-$(CONFIG_SUN3LANCE) += sun3lance.o
 obj-$(CONFIG_SUNLANCE) += sunlance.o
 obj-$(CONFIG_AMD_XGBE) += xgbe/
+obj-$(CONFIG_PDS_CORE) += pds_core/