Show a patch.

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

{
    "id": 253,
    "url": "http://patches.dpdk.org/api/patches/253/",
    "web_url": "http://patches.dpdk.org/patch/253/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<1409154628-30825-6-git-send-email-bruce.richardson@intel.com>",
    "date": "2014-08-27T15:50:27",
    "name": "[dpdk-dev,5/6] mbuf: rename in_port to just port",
    "commit_ref": "",
    "pull_url": "",
    "state": "superseded",
    "archived": true,
    "hash": "eb62deef574b0cac8b97a56a08cd0caa48e59e12",
    "submitter": {
        "id": 20,
        "url": "http://patches.dpdk.org/api/people/20/",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/patch/253/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/253/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/253/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<bricha3@ecsmtp.ir.intel.com>",
        "References": "<1409154628-30825-1-git-send-email-bruce.richardson@intel.com>",
        "X-Mailman-Version": "2.1.15",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,412,1406617200\"; d=\"scan'208\";a=\"590649278\"",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "X-List-Received-Date": "Wed, 27 Aug 2014 15:46:44 -0000",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<1409154628-30825-6-git-send-email-bruce.richardson@intel.com>",
        "Received": [
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\r\n\tby dpdk.org (Postfix) with ESMTP id 36EF5B379\r\n\tfor <dev@dpdk.org>; Wed, 27 Aug 2014 17:46:43 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\r\n\tby fmsmga101.fm.intel.com with ESMTP; 27 Aug 2014 08:50:31 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\r\n\tby fmsmga002.fm.intel.com with ESMTP; 27 Aug 2014 08:50:30 -0700",
            "from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com\r\n\t[10.237.217.46])\r\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\r\n\ts7RFoTCG026043; Wed, 27 Aug 2014 16:50:29 +0100",
            "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\r\n\tby sivswdev02.ir.intel.com with ESMTP id s7RFoTQZ031325;\r\n\tWed, 27 Aug 2014 16:50:29 +0100",
            "(from bricha3@localhost)\r\n\tby sivswdev02.ir.intel.com with  id s7RFoTpa031320;\r\n\tWed, 27 Aug 2014 16:50:29 +0100"
        ],
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "Precedence": "list",
        "Date": "Wed, 27 Aug 2014 16:50:27 +0100",
        "Subject": "[dpdk-dev] [PATCH 5/6] mbuf: rename in_port to just port",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "X-ExtLoop1": "1",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\r\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "In-Reply-To": "<1409154628-30825-1-git-send-email-bruce.richardson@intel.com>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\r\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "To": "dev@dpdk.org"
    },
    "content": "In some cases we may want to tag a packet for a particular destination\nor output port, so rename the \"in_port\" field in the mbuf to just \"port\"\nso that it can be re-used for this purpose if an application needs it.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n examples/dpdk_qat/main.c                                   | 2 +-\n examples/ipv4_multicast/main.c                             | 2 +-\n examples/load_balancer/runtime.c                           | 2 +-\n examples/multi_process/client_server_mp/mp_client/client.c | 2 +-\n lib/librte_mbuf/rte_mbuf.c                                 | 4 ++--\n lib/librte_mbuf/rte_mbuf.h                                 | 6 +++---\n lib/librte_pmd_e1000/em_rxtx.c                             | 4 ++--\n lib/librte_pmd_e1000/igb_rxtx.c                            | 4 ++--\n lib/librte_pmd_i40e/i40e_rxtx.c                            | 8 ++++----\n lib/librte_pmd_ixgbe/ixgbe_rxtx.c                          | 8 ++++----\n lib/librte_pmd_virtio/virtio_rxtx.c                        | 2 +-\n lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c                      | 4 ++--\n lib/librte_pmd_xenvirt/rte_eth_xenvirt.c                   | 2 +-\n 13 files changed, 25 insertions(+), 25 deletions(-)",
    "diff": "diff --git a/examples/dpdk_qat/main.c b/examples/dpdk_qat/main.c\r\nindex 75c9876..1599a0a 100644\r\n--- a/examples/dpdk_qat/main.c\r\n+++ b/examples/dpdk_qat/main.c\r\n@@ -384,7 +384,7 @@ main_loop(__attribute__((unused)) void *dummy)\r\n \t\t\t}\r\n \t\t}\r\n \r\n-\t\tport = dst_ports[pkt->in_port];\r\n+\t\tport = dst_ports[pkt->port];\r\n \r\n \t\t/* Transmit the packet */\r\n \t\tnic_tx_send_packet(pkt, (uint8_t)port);\r\ndiff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c\r\nindex cc12d9d..2232851 100644\r\n--- a/examples/ipv4_multicast/main.c\r\n+++ b/examples/ipv4_multicast/main.c\r\n@@ -337,7 +337,7 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone)\r\n \thdr->nb_segs = (uint8_t)(pkt->nb_segs + 1);\r\n \r\n \t/* copy metadata from source packet*/\r\n-\thdr->in_port = pkt->in_port;\r\n+\thdr->port = pkt->port;\r\n \thdr->vlan_macip = pkt->vlan_macip;\r\n \thdr->hash = pkt->hash;\r\n \r\ndiff --git a/examples/load_balancer/runtime.c b/examples/load_balancer/runtime.c\r\nindex b69917b..a53f33f 100644\r\n--- a/examples/load_balancer/runtime.c\r\n+++ b/examples/load_balancer/runtime.c\r\n@@ -540,7 +540,7 @@ app_lcore_worker(\r\n \t\t\tipv4_dst = rte_be_to_cpu_32(ipv4_hdr->dst_addr);\r\n \r\n \t\t\tif (unlikely(rte_lpm_lookup(lp->lpm_table, ipv4_dst, &port) != 0)) {\r\n-\t\t\t\tport = pkt->in_port;\r\n+\t\t\t\tport = pkt->port;\r\n \t\t\t}\r\n \r\n \t\t\tpos = lp->mbuf_out[port].n_mbufs;\r\ndiff --git a/examples/multi_process/client_server_mp/mp_client/client.c b/examples/multi_process/client_server_mp/mp_client/client.c\r\nindex 71e4a48..ee2338c 100644\r\n--- a/examples/multi_process/client_server_mp/mp_client/client.c\r\n+++ b/examples/multi_process/client_server_mp/mp_client/client.c\r\n@@ -211,7 +211,7 @@ enqueue_packet(struct rte_mbuf *buf, uint8_t port)\r\n static void\r\n handle_packet(struct rte_mbuf *buf)\r\n {\r\n-\tconst uint8_t in_port = buf->in_port;\r\n+\tconst uint8_t in_port = buf->port;\r\n \tconst uint8_t out_port = output_ports[in_port];\r\n \r\n \tenqueue_packet(buf, out_port);\r\ndiff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c\r\nindex 967e4d8..b8b6bbe 100644\r\n--- a/lib/librte_mbuf/rte_mbuf.c\r\n+++ b/lib/librte_mbuf/rte_mbuf.c\r\n@@ -122,7 +122,7 @@ rte_pktmbuf_init(struct rte_mempool *mp,\r\n \t/* init some constant fields */\r\n \tm->pool = mp;\r\n \tm->nb_segs = 1;\r\n-\tm->in_port = 0xff;\r\n+\tm->port = 0xff;\r\n }\r\n \r\n /* do some sanity checks on a mbuf: panic if it fails */\r\n@@ -176,7 +176,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)\r\n \t       m, (uint64_t)m->buf_physaddr, (unsigned)m->buf_len);\r\n \tfprintf(f, \"  pkt_len=%\"PRIu32\", ol_flags=%\"PRIx16\", nb_segs=%u, \"\r\n \t       \"in_port=%u\\n\", m->pkt_len, m->ol_flags,\r\n-\t       (unsigned)m->nb_segs, (unsigned)m->in_port);\r\n+\t       (unsigned)m->nb_segs, (unsigned)m->port);\r\n \tnb_segs = m->nb_segs;\r\n \r\n \twhile (m && nb_segs != 0) {\r\ndiff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h\r\nindex d5b9a50..fc35006 100644\r\n--- a/lib/librte_mbuf/rte_mbuf.h\r\n+++ b/lib/librte_mbuf/rte_mbuf.h\r\n@@ -166,7 +166,7 @@ struct rte_mbuf {\r\n \r\n \t/* these fields are valid for first segment only */\r\n \tuint8_t nb_segs;        /**< Number of segments. */\r\n-\tuint8_t in_port;        /**< Input port. */\r\n+\tuint8_t port;           /**< Input port. */\r\n \tuint32_t pkt_len;       /**< Total pkt len: sum of all segment data_len. */\r\n \r\n \t/* offload features, valid for first segment only */\r\n@@ -542,7 +542,7 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf *m)\r\n \tm->pkt_len = 0;\r\n \tm->vlan_macip.data = 0;\r\n \tm->nb_segs = 1;\r\n-\tm->in_port = 0xff;\r\n+\tm->port = 0xff;\r\n \r\n \tm->ol_flags = 0;\r\n \tbuf_ofs = (RTE_PKTMBUF_HEADROOM <= m->buf_len) ?\r\n@@ -606,7 +606,7 @@ static inline void rte_pktmbuf_attach(struct rte_mbuf *mi, struct rte_mbuf *md)\r\n \tmi->next = md->next;\r\n \tmi->data = md->data;\r\n \tmi->data_len = md->data_len;\r\n-\tmi->in_port = md->in_port;\r\n+\tmi->port = md->port;\r\n \tmi->vlan_macip = md->vlan_macip;\r\n \tmi->hash = md->hash;\r\n \r\ndiff --git a/lib/librte_pmd_e1000/em_rxtx.c b/lib/librte_pmd_e1000/em_rxtx.c\r\nindex 058e1bd..074c9b3 100644\r\n--- a/lib/librte_pmd_e1000/em_rxtx.c\r\n+++ b/lib/librte_pmd_e1000/em_rxtx.c\r\n@@ -777,7 +777,7 @@ eth_em_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\trxm->next = NULL;\r\n \t\trxm->pkt_len = pkt_len;\r\n \t\trxm->data_len = pkt_len;\r\n-\t\trxm->in_port = rxq->port_id;\r\n+\t\trxm->port = rxq->port_id;\r\n \r\n \t\trxm->ol_flags = rx_desc_status_to_pkt_flags(status);\r\n \t\trxm->ol_flags = (uint16_t)(rxm->ol_flags |\r\n@@ -1003,7 +1003,7 @@ eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\t *      - IP checksum flag,\r\n \t\t *      - error flags.\r\n \t\t */\r\n-\t\tfirst_seg->in_port = rxq->port_id;\r\n+\t\tfirst_seg->port = rxq->port_id;\r\n \r\n \t\tfirst_seg->ol_flags = rx_desc_status_to_pkt_flags(status);\r\n \t\tfirst_seg->ol_flags = (uint16_t)(first_seg->ol_flags |\r\ndiff --git a/lib/librte_pmd_e1000/igb_rxtx.c b/lib/librte_pmd_e1000/igb_rxtx.c\r\nindex 99bb9d9..8b33b6d 100644\r\n--- a/lib/librte_pmd_e1000/igb_rxtx.c\r\n+++ b/lib/librte_pmd_e1000/igb_rxtx.c\r\n@@ -759,7 +759,7 @@ eth_igb_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\trxm->next = NULL;\r\n \t\trxm->pkt_len = pkt_len;\r\n \t\trxm->data_len = pkt_len;\r\n-\t\trxm->in_port = rxq->port_id;\r\n+\t\trxm->port = rxq->port_id;\r\n \r\n \t\trxm->hash.rss = rxd.wb.lower.hi_dword.rss;\r\n \t\thlen_type_rss = rte_le_to_cpu_32(rxd.wb.lower.lo_dword.data);\r\n@@ -994,7 +994,7 @@ eth_igb_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\t *      - VLAN TCI, if any,\r\n \t\t *      - error flags.\r\n \t\t */\r\n-\t\tfirst_seg->in_port = rxq->port_id;\r\n+\t\tfirst_seg->port = rxq->port_id;\r\n \t\tfirst_seg->hash.rss = rxd.wb.lower.hi_dword.rss;\r\n \r\n \t\t/*\r\ndiff --git a/lib/librte_pmd_i40e/i40e_rxtx.c b/lib/librte_pmd_i40e/i40e_rxtx.c\r\nindex faf6095..9b84edb 100644\r\n--- a/lib/librte_pmd_i40e/i40e_rxtx.c\r\n+++ b/lib/librte_pmd_i40e/i40e_rxtx.c\r\n@@ -690,7 +690,7 @@ i40e_rx_alloc_bufs(struct i40e_rx_queue *rxq)\r\n \t\tmb->next = NULL;\r\n \t\tmb->data = (char *)mb->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n \t\tmb->nb_segs = 1;\r\n-\t\tmb->in_port = rxq->port_id;\r\n+\t\tmb->port = rxq->port_id;\r\n \t\tdma_addr = rte_cpu_to_le_64(\\\r\n \t\t\tRTE_MBUF_DATA_DMA_ADDR_DEFAULT(mb));\r\n \t\trxdp[i].read.hdr_addr = dma_addr;\r\n@@ -851,7 +851,7 @@ i40e_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\r\n \t\trxm->next = NULL;\r\n \t\trxm->pkt_len = rx_packet_len;\r\n \t\trxm->data_len = rx_packet_len;\r\n-\t\trxm->in_port = rxq->port_id;\r\n+\t\trxm->port = rxq->port_id;\r\n \r\n \t\trxm->vlan_macip.f.vlan_tci = rx_status &\r\n \t\t\t(1 << I40E_RX_DESC_STATUS_L2TAG1P_SHIFT) ?\r\n@@ -1005,7 +1005,7 @@ i40e_recv_scattered_pkts(void *rx_queue,\r\n \t\t\t\t\t\t\t\tETHER_CRC_LEN);\r\n \t\t}\r\n \r\n-\t\tfirst_seg->in_port = rxq->port_id;\r\n+\t\tfirst_seg->port = rxq->port_id;\r\n \t\tfirst_seg->vlan_macip.f.vlan_tci = (rx_status &\r\n \t\t\t(1 << I40E_RX_DESC_STATUS_L2TAG1P_SHIFT)) ?\r\n \t\t\trte_le_to_cpu_16(rxd.wb.qword0.lo_dword.l2tag1) : 0;\r\n@@ -2022,7 +2022,7 @@ i40e_alloc_rx_queue_mbufs(struct i40e_rx_queue *rxq)\r\n \t\tmbuf->next = NULL;\r\n \t\tmbuf->data = (char *)mbuf->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n \t\tmbuf->nb_segs = 1;\r\n-\t\tmbuf->in_port = rxq->port_id;\r\n+\t\tmbuf->port = rxq->port_id;\r\n \r\n \t\tdma_addr =\r\n \t\t\trte_cpu_to_le_64(RTE_MBUF_DATA_DMA_ADDR_DEFAULT(mbuf));\r\ndiff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c\r\nindex c95e117..eec1458 100644\r\n--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c\r\n+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c\r\n@@ -998,7 +998,7 @@ ixgbe_rx_alloc_bufs(struct igb_rx_queue *rxq)\r\n \t\tmb->next = NULL;\r\n \t\tmb->data = (char *)mb->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n \t\tmb->nb_segs = 1;\r\n-\t\tmb->in_port = rxq->port_id;\r\n+\t\tmb->port = rxq->port_id;\r\n \r\n \t\t/* populate the descriptors */\r\n \t\tdma_addr = (uint64_t)mb->buf_physaddr + RTE_PKTMBUF_HEADROOM;\r\n@@ -1253,7 +1253,7 @@ ixgbe_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\trxm->next = NULL;\r\n \t\trxm->pkt_len = pkt_len;\r\n \t\trxm->data_len = pkt_len;\r\n-\t\trxm->in_port = rxq->port_id;\r\n+\t\trxm->port = rxq->port_id;\r\n \r\n \t\thlen_type_rss = rte_le_to_cpu_32(rxd.wb.lower.lo_dword.data);\r\n \t\t/* Only valid if PKT_RX_VLAN_PKT set in pkt_flags */\r\n@@ -1496,7 +1496,7 @@ ixgbe_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\t *      - VLAN TCI, if any,\r\n \t\t *      - error flags.\r\n \t\t */\r\n-\t\tfirst_seg->in_port = rxq->port_id;\r\n+\t\tfirst_seg->port = rxq->port_id;\r\n \r\n \t\t/*\r\n \t\t * The vlan_tci field is only valid when PKT_RX_VLAN_PKT is\r\n@@ -3215,7 +3215,7 @@ ixgbe_alloc_rx_queue_mbufs(struct igb_rx_queue *rxq)\r\n \t\tmbuf->next = NULL;\r\n \t\tmbuf->data = (char *)mbuf->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n \t\tmbuf->nb_segs = 1;\r\n-\t\tmbuf->in_port = rxq->port_id;\r\n+\t\tmbuf->port = rxq->port_id;\r\n \r\n \t\tdma_addr =\r\n \t\t\trte_cpu_to_le_64(RTE_MBUF_DATA_DMA_ADDR_DEFAULT(mbuf));\r\ndiff --git a/lib/librte_pmd_virtio/virtio_rxtx.c b/lib/librte_pmd_virtio/virtio_rxtx.c\r\nindex 07bc7b2..2d043cb 100644\r\n--- a/lib/librte_pmd_virtio/virtio_rxtx.c\r\n+++ b/lib/librte_pmd_virtio/virtio_rxtx.c\r\n@@ -469,7 +469,7 @@ virtio_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\r\n \t\t\tcontinue;\r\n \t\t}\r\n \r\n-\t\trxm->in_port = rxvq->port_id;\r\n+\t\trxm->port = rxvq->port_id;\r\n \t\trxm->data = (char *)rxm->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n \t\trxm->nb_segs = 1;\r\n \t\trxm->next = NULL;\r\ndiff --git a/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c b/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c\r\nindex 7dd5a98..3536765 100644\r\n--- a/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c\r\n+++ b/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c\r\n@@ -557,12 +557,12 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\r\n \t\t\t\trxm->ol_flags = 0;\r\n \r\n \t\t\t/* Initialize newly received packet buffer */\r\n-\t\t\trxm->in_port = rxq->port_id;\r\n+\t\t\trxm->port = rxq->port_id;\r\n \t\t\trxm->nb_segs = 1;\r\n \t\t\trxm->next = NULL;\r\n \t\t\trxm->pkt_len = (uint16_t)rcd->len;\r\n \t\t\trxm->data_len = (uint16_t)rcd->len;\r\n-\t\t\trxm->in_port = rxq->port_id;\r\n+\t\t\trxm->port = rxq->port_id;\r\n \t\t\trxm->vlan_macip.f.vlan_tci = 0;\r\n \t\t\trxm->data = (char *)rxm->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n \r\ndiff --git a/lib/librte_pmd_xenvirt/rte_eth_xenvirt.c b/lib/librte_pmd_xenvirt/rte_eth_xenvirt.c\r\nindex c118652..22215ed 100644\r\n--- a/lib/librte_pmd_xenvirt/rte_eth_xenvirt.c\r\n+++ b/lib/librte_pmd_xenvirt/rte_eth_xenvirt.c\r\n@@ -113,7 +113,7 @@ eth_xenvirt_rx(void *q, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\r\n \t\trxm->data = (char *)rxm->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n \t\trxm->data_len = (uint16_t)(len[i] - sizeof(struct virtio_net_hdr));\r\n \t\trxm->nb_segs = 1;\r\n-\t\trxm->in_port = pi->port_id;\r\n+\t\trxm->port = pi->port_id;\r\n \t\trxm->pkt_len  = (uint32_t)(len[i] - sizeof(struct virtio_net_hdr));\r\n \t}\r\n \t/* allocate new mbuf for the used descriptor */\r\n",
    "prefixes": [
        "dpdk-dev",
        "5/6"
    ]
}