get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/94757/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 94757,
    "url": "https://patches.dpdk.org/api/patches/94757/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210623044702.4240-62-ndabilpuram@marvell.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20210623044702.4240-62-ndabilpuram@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210623044702.4240-62-ndabilpuram@marvell.com",
    "date": "2021-06-23T04:47:01",
    "name": "[v4,61/62] net/cnxk: support multicast filter",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "b70221bb1622634dac14fb18e66f6aff5cfd5b7d",
    "submitter": {
        "id": 1202,
        "url": "https://patches.dpdk.org/api/people/1202/?format=api",
        "name": "Nithin Dabilpuram",
        "email": "ndabilpuram@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "https://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210623044702.4240-62-ndabilpuram@marvell.com/mbox/",
    "series": [
        {
            "id": 17449,
            "url": "https://patches.dpdk.org/api/series/17449/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=17449",
            "date": "2021-06-23T04:46:00",
            "name": "Marvell CNXK Ethdev Driver",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/17449/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/94757/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/94757/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 2795DA0C41;\n\tWed, 23 Jun 2021 06:54:00 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 403414120D;\n\tWed, 23 Jun 2021 06:50:39 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 3C88F411EB\n for <dev@dpdk.org>; Wed, 23 Jun 2021 06:50:37 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id\n 15N4krg7026329 for <dev@dpdk.org>; Tue, 22 Jun 2021 21:50:36 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com with ESMTP id 39bptj1gxj-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Tue, 22 Jun 2021 21:50:36 -0700",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Tue, 22 Jun 2021 21:50:34 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend\n Transport; Tue, 22 Jun 2021 21:50:34 -0700",
            "from hyd1588t430.marvell.com (unknown [10.29.52.204])\n by maili.marvell.com (Postfix) with ESMTP id D36225B6938;\n Tue, 22 Jun 2021 21:50:31 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-type; s=pfpt0220; bh=hwqayxlyVxI5JdE9RtKr00rePsfLgidHOBmzdFm1lsE=;\n b=OgX9rZ2hqYlycNdeYROHMbN+1l8h72uFZbJPcCi9uFeAHWjfe0Jq6YKQCuIsASwoB1ht\n Zuqiuh3ZSB0s6skyJD5spjDmtr/IlYnKY2G/Y7mI7oLHNW0Qyhbud6gGxp9/izyFJhrH\n /dHQWd1d/JDvdSnQXP1i0rBUWGdNVm4FDHxRLYvNpYm/h299ti2gs7P0YwU+ifIH5o9I\n xDlGheX6qM9cNhajp7ne2NKbru9LJumrSW1a4bf00L2zRNLE6kkmvd17K230mYTYeVu3\n LQ/89rRbwG4YKWNPr2y0hk5fzkc406dBn2n4qIHh2HT3rTt49OhVDSayMfWY3DKXmCM0 nA==",
        "From": "Nithin Dabilpuram <ndabilpuram@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<jerinj@marvell.com>, <skori@marvell.com>, <skoteshwar@marvell.com>,\n <pbhagavatula@marvell.com>, <kirankumark@marvell.com>,\n <psatheesh@marvell.com>, <asekhar@marvell.com>, <hkalra@marvell.com>",
        "Date": "Wed, 23 Jun 2021 10:17:01 +0530",
        "Message-ID": "<20210623044702.4240-62-ndabilpuram@marvell.com>",
        "X-Mailer": "git-send-email 2.8.4",
        "In-Reply-To": "<20210623044702.4240-1-ndabilpuram@marvell.com>",
        "References": "<20210306153404.10781-1-ndabilpuram@marvell.com>\n <20210623044702.4240-1-ndabilpuram@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "rEMCS7iXqSY2cQXZy5mCy34TCm8aUPIx",
        "X-Proofpoint-GUID": "rEMCS7iXqSY2cQXZy5mCy34TCm8aUPIx",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790\n definitions=2021-06-23_01:2021-06-22,\n 2021-06-23 signatures=0",
        "Subject": "[dpdk-dev] [PATCH v4 61/62] net/cnxk: support multicast filter",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Sunil Kumar Kori <skori@marvell.com>\n\nPatch adds multicast filter support for cn9k and cn10k platforms.\n\nCGX DMAC filter table(32 entries) is divided among all LMACs\nconnected to it i.e. if CGX has 4 LMACs then each LMAC can have\nup to 8 filters. If CGX has 1 LMAC then it can have up to 32\nfilters.\n\nAbove mentioned filter table is used to install unicast and multicast\nDMAC address filters. Unicast filters are installed via\nrte_eth_dev_mac_addr_add API while multicast filters are installed\nvia rte_eth_dev_set_mc_addr_list API.\n\nSo in total, supported MAC filters are equal to DMAC filters plus\nmcast filters.\n\nSigned-off-by: Sunil Kumar Kori <skori@marvell.com>\n---\n doc/guides/nics/features/cnxk.ini     |  1 +\n doc/guides/nics/features/cnxk_vec.ini |  1 +\n drivers/net/cnxk/cnxk_ethdev.c        |  2 ++\n drivers/net/cnxk/cnxk_ethdev.h        |  4 +++\n drivers/net/cnxk/cnxk_ethdev_ops.c    | 65 +++++++++++++++++++++++++++++++++++\n 5 files changed, 73 insertions(+)",
    "diff": "diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini\nindex 9945af9..c686ceb 100644\n--- a/doc/guides/nics/features/cnxk.ini\n+++ b/doc/guides/nics/features/cnxk.ini\n@@ -22,6 +22,7 @@ TSO                  = Y\n Promiscuous mode     = Y\n Allmulticast mode    = Y\n Unicast MAC filter   = Y\n+Multicast MAC filter = Y\n RSS hash             = Y\n RSS key update       = Y\n RSS reta update      = Y\ndiff --git a/doc/guides/nics/features/cnxk_vec.ini b/doc/guides/nics/features/cnxk_vec.ini\nindex 77d63c4..018d09e 100644\n--- a/doc/guides/nics/features/cnxk_vec.ini\n+++ b/doc/guides/nics/features/cnxk_vec.ini\n@@ -21,6 +21,7 @@ MTU update           = Y\n Promiscuous mode     = Y\n Allmulticast mode    = Y\n Unicast MAC filter   = Y\n+Multicast MAC filter = Y\n RSS hash             = Y\n RSS key update       = Y\n RSS reta update      = Y\ndiff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c\nindex abd9bf1..b7872cc 100644\n--- a/drivers/net/cnxk/cnxk_ethdev.c\n+++ b/drivers/net/cnxk/cnxk_ethdev.c\n@@ -1270,6 +1270,7 @@ struct eth_dev_ops cnxk_eth_dev_ops = {\n \t.reta_query = cnxk_nix_reta_query,\n \t.rss_hash_update = cnxk_nix_rss_hash_update,\n \t.rss_hash_conf_get = cnxk_nix_rss_hash_conf_get,\n+\t.set_mc_addr_list = cnxk_nix_mc_addr_list_configure,\n };\n \n static int\n@@ -1334,6 +1335,7 @@ cnxk_eth_dev_init(struct rte_eth_dev *eth_dev)\n \t}\n \n \tdev->max_mac_entries = max_entries;\n+\tdev->dmac_filter_count = 1;\n \n \t/* Get mac address */\n \trc = roc_nix_npc_mac_addr_get(nix, dev->mac_addr);\ndiff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h\nindex cd08e3a..c07e988 100644\n--- a/drivers/net/cnxk/cnxk_ethdev.h\n+++ b/drivers/net/cnxk/cnxk_ethdev.h\n@@ -162,6 +162,7 @@ struct cnxk_eth_dev {\n \tuint8_t configured;\n \n \t/* Max macfilter entries */\n+\tuint8_t dmac_filter_count;\n \tuint8_t max_mac_entries;\n \tbool dmac_filter_enable;\n \n@@ -265,6 +266,9 @@ int cnxk_nix_probe(struct rte_pci_driver *pci_drv,\n \t\t   struct rte_pci_device *pci_dev);\n int cnxk_nix_remove(struct rte_pci_device *pci_dev);\n int cnxk_nix_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu);\n+int cnxk_nix_mc_addr_list_configure(struct rte_eth_dev *eth_dev,\n+\t\t\t\t    struct rte_ether_addr *mc_addr_set,\n+\t\t\t\t    uint32_t nb_mc_addr);\n int cnxk_nix_mac_addr_add(struct rte_eth_dev *eth_dev,\n \t\t\t  struct rte_ether_addr *addr, uint32_t index,\n \t\t\t  uint32_t pool);\ndiff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c\nindex d257763..b6cc528 100644\n--- a/drivers/net/cnxk/cnxk_ethdev_ops.c\n+++ b/drivers/net/cnxk/cnxk_ethdev_ops.c\n@@ -359,6 +359,7 @@ cnxk_nix_mac_addr_add(struct rte_eth_dev *eth_dev, struct rte_ether_addr *addr,\n \troc_nix_npc_promisc_ena_dis(nix, true);\n \tdev->dmac_filter_enable = true;\n \teth_dev->data->promiscuous = false;\n+\tdev->dmac_filter_count++;\n \n \treturn 0;\n }\n@@ -373,6 +374,8 @@ cnxk_nix_mac_addr_del(struct rte_eth_dev *eth_dev, uint32_t index)\n \trc = roc_nix_mac_addr_del(nix, index);\n \tif (rc)\n \t\tplt_err(\"Failed to delete mac address, rc=%d\", rc);\n+\n+\tdev->dmac_filter_count--;\n }\n \n int\n@@ -845,3 +848,65 @@ cnxk_nix_rss_hash_conf_get(struct rte_eth_dev *eth_dev,\n \n \treturn 0;\n }\n+\n+int\n+cnxk_nix_mc_addr_list_configure(struct rte_eth_dev *eth_dev,\n+\t\t\t\tstruct rte_ether_addr *mc_addr_set,\n+\t\t\t\tuint32_t nb_mc_addr)\n+{\n+\tstruct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);\n+\tstruct rte_eth_dev_data *data = eth_dev->data;\n+\tstruct rte_ether_addr null_mac_addr;\n+\tstruct roc_nix *nix = &dev->nix;\n+\tint rc, index;\n+\tuint32_t i;\n+\n+\tmemset(&null_mac_addr, 0, sizeof(null_mac_addr));\n+\n+\t/* All configured multicast filters should be flushed first */\n+\tfor (i = 0; i < dev->max_mac_entries; i++) {\n+\t\tif (rte_is_multicast_ether_addr(&data->mac_addrs[i])) {\n+\t\t\trc = roc_nix_mac_addr_del(nix, i);\n+\t\t\tif (rc) {\n+\t\t\t\tplt_err(\"Failed to flush mcast address, rc=%d\",\n+\t\t\t\t\trc);\n+\t\t\t\treturn rc;\n+\t\t\t}\n+\n+\t\t\tdev->dmac_filter_count--;\n+\t\t\t/* Update address in NIC data structure */\n+\t\t\trte_ether_addr_copy(&null_mac_addr,\n+\t\t\t\t\t    &data->mac_addrs[i]);\n+\t\t}\n+\t}\n+\n+\tif (!mc_addr_set || !nb_mc_addr)\n+\t\treturn 0;\n+\n+\t/* Check for available space */\n+\tif (nb_mc_addr >\n+\t    ((uint32_t)(dev->max_mac_entries - dev->dmac_filter_count))) {\n+\t\tplt_err(\"No space is available to add multicast filters\");\n+\t\treturn -ENOSPC;\n+\t}\n+\n+\t/* Multicast addresses are to be installed */\n+\tfor (i = 0; i < nb_mc_addr; i++) {\n+\t\tindex = roc_nix_mac_addr_add(nix, mc_addr_set[i].addr_bytes);\n+\t\tif (index < 0) {\n+\t\t\tplt_err(\"Failed to add mcast mac address, rc=%d\",\n+\t\t\t\tindex);\n+\t\t\treturn index;\n+\t\t}\n+\n+\t\tdev->dmac_filter_count++;\n+\t\t/* Update address in NIC data structure */\n+\t\trte_ether_addr_copy(&mc_addr_set[i], &data->mac_addrs[index]);\n+\t}\n+\n+\troc_nix_npc_promisc_ena_dis(nix, true);\n+\tdev->dmac_filter_enable = true;\n+\teth_dev->data->promiscuous = false;\n+\n+\treturn 0;\n+}\n",
    "prefixes": [
        "v4",
        "61/62"
    ]
}