get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 52413,
    "url": "http://patches.dpdk.org/api/patches/52413/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1554745507-15089-9-git-send-email-g.singh@nxp.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<1554745507-15089-9-git-send-email-g.singh@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1554745507-15089-9-git-send-email-g.singh@nxp.com",
    "date": "2019-04-08T11:22:41",
    "name": "[08/13] net/enetc: enable promiscuous and allmulticast feature",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ac5dd8376336e921f5f28a7917fd0dc198f18880",
    "submitter": {
        "id": 1068,
        "url": "http://patches.dpdk.org/api/people/1068/?format=api",
        "name": "Gagandeep Singh",
        "email": "g.singh@nxp.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1554745507-15089-9-git-send-email-g.singh@nxp.com/mbox/",
    "series": [
        {
            "id": 4173,
            "url": "http://patches.dpdk.org/api/series/4173/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4173",
            "date": "2019-04-08T11:22:28",
            "name": "ENETC PMD basic features and bug fixes",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/4173/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/52413/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/52413/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 0A2ED5B1C;\n\tMon,  8 Apr 2019 13:23:03 +0200 (CEST)",
            "from EUR02-AM5-obe.outbound.protection.outlook.com\n\t(mail-eopbgr00073.outbound.protection.outlook.com [40.107.0.73])\n\tby dpdk.org (Postfix) with ESMTP id CE87D4F90\n\tfor <dev@dpdk.org>; Mon,  8 Apr 2019 13:22:42 +0200 (CEST)",
            "from VE1PR04MB6365.eurprd04.prod.outlook.com (10.255.118.78) by\n\tVE1PR04MB6606.eurprd04.prod.outlook.com (20.179.235.10) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\t15.20.1771.13; Mon, 8 Apr 2019 11:22:41 +0000",
            "from VE1PR04MB6365.eurprd04.prod.outlook.com\n\t([fe80::f5ad:f178:4c55:13e0]) by\n\tVE1PR04MB6365.eurprd04.prod.outlook.com\n\t([fe80::f5ad:f178:4c55:13e0%3]) with mapi id 15.20.1771.016;\n\tMon, 8 Apr 2019 11:22:41 +0000"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n\tbh=s5DsrZGrgAekhq7XCVDpdrpnjWNDk7G0U+0Kr93JIKo=;\n\tb=PmsfTjh9UrhuriCoeprKNdIiJv1pS+uaDgsnFINotQtWgnOQzAGJMmaSO0FHi8wNq6w4cpYQa0/DlonPj1X2cmtqf5uX5Fmw691pUVvtcXqsnWGWk7KoxtY0zONQCuozifqAOujjEoKlrD7AWPl3dLNk43yl+1q/ibMhs3ioN30=",
        "From": "Gagandeep Singh <G.Singh@nxp.com>",
        "To": "\"dev@dpdk.org\" <dev@dpdk.org>, \"ferruh.yigit@intel.com\"\n\t<ferruh.yigit@intel.com>",
        "CC": "Gagandeep Singh <G.Singh@nxp.com>",
        "Thread-Topic": "[PATCH 08/13] net/enetc: enable promiscuous and allmulticast\n\tfeature",
        "Thread-Index": "AQHU7f1gfkJBxqYXFUGGuWgLAUN9sw==",
        "Date": "Mon, 8 Apr 2019 11:22:41 +0000",
        "Message-ID": "<1554745507-15089-9-git-send-email-g.singh@nxp.com>",
        "References": "<1554745507-15089-1-git-send-email-g.singh@nxp.com>",
        "In-Reply-To": "<1554745507-15089-1-git-send-email-g.singh@nxp.com>",
        "Accept-Language": "en-US",
        "Content-Language": "en-US",
        "X-MS-Has-Attach": "",
        "X-MS-TNEF-Correlator": "",
        "x-clientproxiedby": "BM1PR0101CA0003.INDPRD01.PROD.OUTLOOK.COM\n\t(2603:1096:b00:18::13) To VE1PR04MB6365.eurprd04.prod.outlook.com\n\t(2603:10a6:803:12a::14)",
        "x-mailer": "git-send-email 1.9.1",
        "authentication-results": "spf=none (sender IP is )\n\tsmtp.mailfrom=G.Singh@nxp.com; ",
        "x-ms-exchange-messagesentrepresentingtype": "1",
        "x-originating-ip": "[92.120.1.67]",
        "x-ms-publictraffictype": "Email",
        "x-ms-office365-filtering-correlation-id": "cf9646c0-001d-4936-3d51-08d6bc148334",
        "x-ms-office365-filtering-ht": "Tenant",
        "x-microsoft-antispam": "BCL:0; PCL:0;\n\tRULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020);\n\tSRVR:VE1PR04MB6606; ",
        "x-ms-traffictypediagnostic": "VE1PR04MB6606:",
        "x-microsoft-antispam-prvs": "<VE1PR04MB6606B0AE8E4F34BDEC1E8B3AE12C0@VE1PR04MB6606.eurprd04.prod.outlook.com>",
        "x-forefront-prvs": "0001227049",
        "x-forefront-antispam-report": "SFV:NSPM;\n\tSFS:(10009020)(366004)(376002)(346002)(39860400002)(396003)(136003)(199004)(189003)(76176011)(97736004)(81156014)(71200400001)(71190400001)(72206003)(3846002)(25786009)(81166006)(53936002)(2616005)(5660300002)(6116002)(8676002)(7736002)(446003)(478600001)(8936002)(11346002)(305945005)(2906002)(256004)(14444005)(66066001)(6512007)(476003)(6436002)(486006)(50226002)(2501003)(99286004)(106356001)(86362001)(110136005)(4326008)(6486002)(68736007)(105586002)(6506007)(52116002)(316002)(26005)(386003)(14454004)(186003)(36756003)(102836004);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR04MB6606;\n\tH:VE1PR04MB6365.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en;\n\tPTR:InfoNoRecords; A:1; MX:1; ",
        "received-spf": "None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)",
        "x-ms-exchange-senderadcheck": "1",
        "x-microsoft-antispam-message-info": "NzplWAOB0GsFqGMczb01SEYv343HRMLSxvMOqEei5+mQfBveGQEy+ei2u0y/8FxfqgAVxC4nqnilVhib7Nn4MfexZXSp6qzkgIByTI7mLqA9AeW1uzg/OwKdWhfULE6ZqoBn9xSMav+638OMr8kON42enidEba7D3VBvbiWccEPYINAtZzC2bl/qgw8OpGCSHrtiOpVG6HvlPIf0OSZz5rWpQFqBwPtmNm4m7bVnh2kdntbhz6rYeL5WpDaKCtco8yjWdexGomux/qIfoRzZDq2OyN978PXuf3JCH2joDHTZ4LlCY7dsLECvDrYsm/CZe9FGD5/Sl4X9i/myYpxCUMSUknz2qzOrlm211+XtC7ZEI9sdZKhdwAdfguppjUB7odmqYZJ19LDrELiuy+7hNRXpQtSw/n+6IZremFqExDI=",
        "Content-Type": "text/plain; charset=\"iso-8859-1\"",
        "Content-Transfer-Encoding": "quoted-printable",
        "MIME-Version": "1.0",
        "X-OriginatorOrg": "nxp.com",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "cf9646c0-001d-4936-3d51-08d6bc148334",
        "X-MS-Exchange-CrossTenant-originalarrivaltime": "08 Apr 2019 11:22:41.0423\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-fromentityheader": "Hosted",
        "X-MS-Exchange-CrossTenant-id": "686ea1d3-bc2b-4c6f-a92c-d99c5c301635",
        "X-MS-Exchange-CrossTenant-mailboxtype": "HOSTED",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "VE1PR04MB6606",
        "Subject": "[dpdk-dev] [PATCH 08/13] net/enetc: enable promiscuous and\n\tallmulticast feature",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Promiscuous and allmulticast enable/disable APIs added.\n\nSigned-off-by: Gagandeep Singh <g.singh@nxp.com>\n---\n doc/guides/nics/enetc.rst          |  2 +\n doc/guides/nics/features/enetc.ini |  2 +\n drivers/net/enetc/base/enetc_hw.h  |  3 +-\n drivers/net/enetc/enetc_ethdev.c   | 90 ++++++++++++++++++++++++++++++++------\n 4 files changed, 81 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/enetc.rst b/doc/guides/nics/enetc.rst\nindex 9f575d2..ab13211 100644\n--- a/doc/guides/nics/enetc.rst\n+++ b/doc/guides/nics/enetc.rst\n@@ -47,6 +47,8 @@ ENETC Features\n - Link Status\n - Packet type information\n - Basic stats\n+- Promiscuous\n+- Multicast\n \n NIC Driver (PMD)\n ~~~~~~~~~~~~~~~~\ndiff --git a/doc/guides/nics/features/enetc.ini b/doc/guides/nics/features/enetc.ini\nindex d8bd567..6b7bbfb 100644\n--- a/doc/guides/nics/features/enetc.ini\n+++ b/doc/guides/nics/features/enetc.ini\n@@ -7,6 +7,8 @@\n Packet type parsing  = Y\n Link status          = Y\n Basic stats          = Y\n+Promiscuous mode     = Y\n+Allmulticast mode    = Y\n Linux VFIO           = Y\n ARMv8                = Y\n Usage doc            = Y\ndiff --git a/drivers/net/enetc/base/enetc_hw.h b/drivers/net/enetc/base/enetc_hw.h\nindex 3f0a2a9..90a383a 100644\n--- a/drivers/net/enetc/base/enetc_hw.h\n+++ b/drivers/net/enetc/base/enetc_hw.h\n@@ -78,8 +78,7 @@\n #define ENETC_PSR\t\t\t0x00004 /* RO */\n #define ENETC_PSIPMR\t\t\t0x00018\n #define ENETC_PSIPMR_SET_UP(n)\t\t(0x1 << (n)) /* n = SI index */\n-#define ENETC_PSIPMR_SET_MP(n)\t\t(0x1 << ((n) + 8))\n-#define ENETC_PSIPMR_SET_VLAN_MP(n)\t(0x1 << ((n) + 16))\n+#define ENETC_PSIPMR_SET_MP(n)\t\t(0x1 << ((n) + 16))\n #define ENETC_PSIPMAR0(n)\t\t(0x00100 + (n) * 0x20)\n #define ENETC_PSIPMAR1(n)\t\t(0x00104 + (n) * 0x20)\n #define ENETC_PCAPR0\t\t\t0x00900\ndiff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c\nindex f8b9510..0bb3b2c 100644\n--- a/drivers/net/enetc/enetc_ethdev.c\n+++ b/drivers/net/enetc/enetc_ethdev.c\n@@ -133,8 +133,8 @@\n static int\n enetc_hardware_init(struct enetc_eth_hw *hw)\n {\n-\tuint32_t psipmr = 0;\n \tstruct enetc_hw *enetc_hw = &hw->hw;\n+\tuint32_t *mac = (uint32_t *)hw->mac.addr;\n \n \tPMD_INIT_FUNC_TRACE();\n \t/* Calculating and storing the base HW addresses */\n@@ -144,19 +144,9 @@\n \t/* Enabling Station Interface */\n \tenetc_wr(enetc_hw, ENETC_SIMR, ENETC_SIMR_EN);\n \n-\t/* Setting to accept broadcast packets for each inetrface */\n-\tpsipmr |= ENETC_PSIPMR_SET_UP(0) | ENETC_PSIPMR_SET_MP(0) |\n-\t\t  ENETC_PSIPMR_SET_VLAN_MP(0);\n-\tpsipmr |= ENETC_PSIPMR_SET_UP(1) | ENETC_PSIPMR_SET_MP(1) |\n-\t\t  ENETC_PSIPMR_SET_VLAN_MP(1);\n-\tpsipmr |= ENETC_PSIPMR_SET_UP(2) | ENETC_PSIPMR_SET_MP(2) |\n-\t\t  ENETC_PSIPMR_SET_VLAN_MP(2);\n-\n-\tenetc_port_wr(enetc_hw, ENETC_PSIPMR, psipmr);\n-\n-\t/* Enabling broadcast address */\n-\tenetc_port_wr(enetc_hw, ENETC_PSIPMAR0(0), 0xFFFFFFFF);\n-\tenetc_port_wr(enetc_hw, ENETC_PSIPMAR1(0), 0xFFFF << 16);\n+\t*mac = (uint32_t)enetc_port_rd(enetc_hw, ENETC_PSIPMAR0(0));\n+\tmac++;\n+\t*mac = (uint16_t)enetc_port_rd(enetc_hw, ENETC_PSIPMAR1(0));\n \n \treturn 0;\n }\n@@ -544,6 +534,74 @@ int enetc_stats_get(struct rte_eth_dev *dev,\n \tdev->data->nb_tx_queues = 0;\n }\n \n+static void\n+enetc_promiscuous_enable(struct rte_eth_dev *dev)\n+{\n+\tstruct enetc_eth_hw *hw =\n+\t\tENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct enetc_hw *enetc_hw = &hw->hw;\n+\tuint32_t psipmr = 0;\n+\n+\tpsipmr = enetc_port_rd(enetc_hw, ENETC_PSIPMR);\n+\n+\t/* Setting to enable promiscuous mode*/\n+\tpsipmr |= ENETC_PSIPMR_SET_UP(0) | ENETC_PSIPMR_SET_MP(0);\n+\n+\tenetc_port_wr(enetc_hw, ENETC_PSIPMR, psipmr);\n+}\n+\n+static void\n+enetc_promiscuous_disable(struct rte_eth_dev *dev)\n+{\n+\tstruct enetc_eth_hw *hw =\n+\t\tENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct enetc_hw *enetc_hw = &hw->hw;\n+\tuint32_t psipmr = 0;\n+\n+\t/* Setting to disable promiscuous mode for SI0*/\n+\tpsipmr = enetc_port_rd(enetc_hw, ENETC_PSIPMR);\n+\tpsipmr &= (~ENETC_PSIPMR_SET_UP(0));\n+\n+\tif (dev->data->all_multicast == 0)\n+\t\tpsipmr &= (~ENETC_PSIPMR_SET_MP(0));\n+\n+\tenetc_port_wr(enetc_hw, ENETC_PSIPMR, psipmr);\n+}\n+\n+static void\n+enetc_allmulticast_enable(struct rte_eth_dev *dev)\n+{\n+\tstruct enetc_eth_hw *hw =\n+\t\tENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct enetc_hw *enetc_hw = &hw->hw;\n+\tuint32_t psipmr = 0;\n+\n+\tpsipmr = enetc_port_rd(enetc_hw, ENETC_PSIPMR);\n+\n+\t/* Setting to enable allmulticast mode for SI0*/\n+\tpsipmr |= ENETC_PSIPMR_SET_MP(0);\n+\n+\tenetc_port_wr(enetc_hw, ENETC_PSIPMR, psipmr);\n+}\n+\n+static void\n+enetc_allmulticast_disable(struct rte_eth_dev *dev)\n+{\n+\tstruct enetc_eth_hw *hw =\n+\t\tENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct enetc_hw *enetc_hw = &hw->hw;\n+\tuint32_t psipmr = 0;\n+\n+\tif (dev->data->promiscuous == 1)\n+\t\treturn; /* must remain in all_multicast mode */\n+\n+\t/* Setting to disable all multicast mode for SI0*/\n+\tpsipmr = enetc_port_rd(enetc_hw, ENETC_PSIPMR) &\n+\t\t\t       ~(ENETC_PSIPMR_SET_MP(0));\n+\n+\tenetc_port_wr(enetc_hw, ENETC_PSIPMR, psipmr);\n+}\n+\n /*\n  * The set of PCI devices this driver supports\n  */\n@@ -562,6 +620,10 @@ int enetc_stats_get(struct rte_eth_dev *dev,\n \t.link_update          = enetc_link_update,\n \t.stats_get            = enetc_stats_get,\n \t.stats_reset          = enetc_stats_reset,\n+\t.promiscuous_enable   = enetc_promiscuous_enable,\n+\t.promiscuous_disable  = enetc_promiscuous_disable,\n+\t.allmulticast_enable  = enetc_allmulticast_enable,\n+\t.allmulticast_disable = enetc_allmulticast_disable,\n \t.dev_infos_get        = enetc_dev_infos_get,\n \t.rx_queue_setup       = enetc_rx_queue_setup,\n \t.rx_queue_release     = enetc_rx_queue_release,\n",
    "prefixes": [
        "08/13"
    ]
}