Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/137099/?format=api
https://patches.dpdk.org/api/patches/137099/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20240223140056.130844-1-mb@smartsharesystems.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": "<20240223140056.130844-1-mb@smartsharesystems.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20240223140056.130844-1-mb@smartsharesystems.com", "date": "2024-02-23T14:00:56", "name": "[v9] net/bnx2x: fix warnings about rte_memcpy lengths", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "9f519f2f0e7ea855434bbb096f58554a999a4d06", "submitter": { "id": 591, "url": "https://patches.dpdk.org/api/people/591/?format=api", "name": "Morten Brørup", "email": "mb@smartsharesystems.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/20240223140056.130844-1-mb@smartsharesystems.com/mbox/", "series": [ { "id": 31202, "url": "https://patches.dpdk.org/api/series/31202/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=31202", "date": "2024-02-23T14:00:56", "name": "[v9] net/bnx2x: fix warnings about rte_memcpy lengths", "version": 9, "mbox": "https://patches.dpdk.org/series/31202/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/137099/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/137099/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 2D0A443BA8;\n\tFri, 23 Feb 2024 15:01:01 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id DA9774027C;\n\tFri, 23 Feb 2024 15:01:00 +0100 (CET)", "from dkmailrelay1.smartsharesystems.com\n (smartserver.smartsharesystems.com [77.243.40.215])\n by mails.dpdk.org (Postfix) with ESMTP id AD9DB4021E\n for <dev@dpdk.org>; Fri, 23 Feb 2024 15:00:59 +0100 (CET)", "from smartserver.smartsharesystems.com\n (smartserver.smartsharesys.local [192.168.4.10])\n by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 885712011D;\n Fri, 23 Feb 2024 15:00:59 +0100 (CET)", "from dkrd2.smartsharesys.local ([192.168.4.12]) by\n smartserver.smartsharesystems.com with Microsoft SMTPSVC(6.0.3790.4675);\n Fri, 23 Feb 2024 15:00:59 +0100" ], "From": "=?utf-8?q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>", "To": "julien_dpdk@jaube.fr,\n\tjerinjacobk@gmail.com", "Cc": "dev@dpdk.org, =?utf-8?q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>,\n stephen@networkplumber.org, rmody@marvell.com, shshaikh@marvell.com,\n palok@marvell.com", "Subject": "[PATCH v9] net/bnx2x: fix warnings about rte_memcpy lengths", "Date": "Fri, 23 Feb 2024 15:00:56 +0100", "Message-Id": "<20240223140056.130844-1-mb@smartsharesystems.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "\n <CALBAE1O9P82i9pgwW8HuH44zfoDCS=eEEWJfyKfX=wf0y-XaOA@mail.gmail.com>", "References": "\n <CALBAE1O9P82i9pgwW8HuH44zfoDCS=eEEWJfyKfX=wf0y-XaOA@mail.gmail.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "X-OriginalArrivalTime": "23 Feb 2024 14:00:59.0272 (UTC)\n FILETIME=[BA806080:01DA6660]", "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" }, "content": "Bugfix: The vlan in the bulletin does not contain a VLAN header, only the\nVLAN ID, so only copy 2 byte, not 4. The target structure has padding\nafter the field, so copying 2 byte too many is effectively harmless.\nThere is no need to backport this patch.\n\nUse RTE_PTR_ADD where copying arrays to the offset of a first field in a\nstructure holding multiple fields, to avoid compiler warnings with\ndecorated rte_memcpy.\n\nBugzilla ID: 1146\n\nFixes: 540a211084a7695a1c7bc43068934c140d6989be (\"bnx2x: driver core\")\nCc: stephen@networkplumber.org\nCc: rmody@marvell.com\nCc: shshaikh@marvell.com\nCc: palok@marvell.com\n\nSigned-off-by: Morten Brørup <mb@smartsharesystems.com>\nAcked-by: Devendra Singh Rawat <dsinghrawat@marvell.com>\n---\nv9:\n* Fix checkpatch warning about spaces.\nv8:\n* Use memcpy instead of rte_memcpy in slow path. (Stephen Hemminger)\nv7:\n* No changes.\nv6:\n* Add Fixes to patch description.\n* Fix checkpatch warnings.\nv5:\n* No changes.\nv4:\n* Type casting did not fix the warnings, so use RTE_PTR_ADD instead.\nv3:\n* First patch in series.\n---\n drivers/net/bnx2x/bnx2x_stats.c | 14 ++++++++------\n drivers/net/bnx2x/bnx2x_vfpf.c | 14 +++++++-------\n 2 files changed, 15 insertions(+), 13 deletions(-)", "diff": "diff --git a/drivers/net/bnx2x/bnx2x_stats.c b/drivers/net/bnx2x/bnx2x_stats.c\nindex c07b01510a..8105375d44 100644\n--- a/drivers/net/bnx2x/bnx2x_stats.c\n+++ b/drivers/net/bnx2x/bnx2x_stats.c\n@@ -114,7 +114,7 @@ bnx2x_hw_stats_post(struct bnx2x_softc *sc)\n \n \t/* Update MCP's statistics if possible */\n \tif (sc->func_stx) {\n-\t\trte_memcpy(BNX2X_SP(sc, func_stats), &sc->func_stats,\n+\t\tmemcpy(BNX2X_SP(sc, func_stats), &sc->func_stats,\n \t\t\t\tsizeof(sc->func_stats));\n \t}\n \n@@ -817,10 +817,10 @@ bnx2x_hw_stats_update(struct bnx2x_softc *sc)\n \t\t\t etherstatspktsover1522octets);\n }\n \n- rte_memcpy(old, new, sizeof(struct nig_stats));\n+\tmemcpy(old, new, sizeof(struct nig_stats));\n \n- rte_memcpy(&(estats->rx_stat_ifhcinbadoctets_hi), &(pstats->mac_stx[1]),\n-\t sizeof(struct mac_stx));\n+\tmemcpy(RTE_PTR_ADD(estats, offsetof(struct bnx2x_eth_stats, rx_stat_ifhcinbadoctets_hi)),\n+\t\t\t&pstats->mac_stx[1], sizeof(struct mac_stx));\n estats->brb_drop_hi = pstats->brb_drop_hi;\n estats->brb_drop_lo = pstats->brb_drop_lo;\n \n@@ -1492,9 +1492,11 @@ bnx2x_stats_init(struct bnx2x_softc *sc)\n \t\tREG_RD(sc, NIG_REG_STAT0_BRB_TRUNCATE + port*0x38);\n \tif (!CHIP_IS_E3(sc)) {\n \t\tREG_RD_DMAE(sc, NIG_REG_STAT0_EGRESS_MAC_PKT0 + port*0x50,\n-\t\t\t\t&(sc->port.old_nig_stats.egress_mac_pkt0_lo), 2);\n+\t\t\t\tRTE_PTR_ADD(&sc->port.old_nig_stats,\n+\t\t\t\toffsetof(struct nig_stats, egress_mac_pkt0_lo)), 2);\n \t\tREG_RD_DMAE(sc, NIG_REG_STAT0_EGRESS_MAC_PKT1 + port*0x50,\n-\t\t\t\t&(sc->port.old_nig_stats.egress_mac_pkt1_lo), 2);\n+\t\t\t\tRTE_PTR_ADD(&sc->port.old_nig_stats,\n+\t\t\t\toffsetof(struct nig_stats, egress_mac_pkt1_lo)), 2);\n \t}\n \n \t/* function stats */\ndiff --git a/drivers/net/bnx2x/bnx2x_vfpf.c b/drivers/net/bnx2x/bnx2x_vfpf.c\nindex 63953c2979..5411df3a38 100644\n--- a/drivers/net/bnx2x/bnx2x_vfpf.c\n+++ b/drivers/net/bnx2x/bnx2x_vfpf.c\n@@ -52,9 +52,9 @@ bnx2x_check_bull(struct bnx2x_softc *sc)\n \n \t/* check the mac address and VLAN and allocate memory if valid */\n \tif (valid_bitmap & (1 << MAC_ADDR_VALID) && memcmp(bull->mac, sc->old_bulletin.mac, ETH_ALEN))\n-\t\trte_memcpy(&sc->link_params.mac_addr, bull->mac, ETH_ALEN);\n+\t\tmemcpy(&sc->link_params.mac_addr, bull->mac, ETH_ALEN);\n \tif (valid_bitmap & (1 << VLAN_VALID))\n-\t\trte_memcpy(&bull->vlan, &sc->old_bulletin.vlan, RTE_VLAN_HLEN);\n+\t\tmemcpy(&bull->vlan, &sc->old_bulletin.vlan, sizeof(bull->vlan));\n \n \tsc->old_bulletin = *bull;\n \n@@ -569,7 +569,7 @@ bnx2x_vf_set_mac(struct bnx2x_softc *sc, int set)\n \n \tbnx2x_check_bull(sc);\n \n-\trte_memcpy(query->filters[0].mac, sc->link_params.mac_addr, ETH_ALEN);\n+\tmemcpy(query->filters[0].mac, sc->link_params.mac_addr, ETH_ALEN);\n \n \tbnx2x_add_tlv(sc, query, query->first_tlv.tl.length,\n \t\t BNX2X_VF_TLV_LIST_END,\n@@ -583,9 +583,9 @@ bnx2x_vf_set_mac(struct bnx2x_softc *sc, int set)\n \twhile (BNX2X_VF_STATUS_FAILURE == reply->status &&\n \t\t\tbnx2x_check_bull(sc)) {\n \t\t/* A new mac was configured by PF for us */\n-\t\trte_memcpy(sc->link_params.mac_addr, sc->pf2vf_bulletin->mac,\n+\t\tmemcpy(sc->link_params.mac_addr, sc->pf2vf_bulletin->mac,\n \t\t\t\tETH_ALEN);\n-\t\trte_memcpy(query->filters[0].mac, sc->pf2vf_bulletin->mac,\n+\t\tmemcpy(query->filters[0].mac, sc->pf2vf_bulletin->mac,\n \t\t\t\tETH_ALEN);\n \n \t\trc = bnx2x_do_req4pf(sc, sc->vf2pf_mbox_mapping.paddr);\n@@ -622,10 +622,10 @@ bnx2x_vf_config_rss(struct bnx2x_softc *sc,\n \t\t BNX2X_VF_TLV_LIST_END,\n \t\t sizeof(struct channel_list_end_tlv));\n \n-\trte_memcpy(query->rss_key, params->rss_key, sizeof(params->rss_key));\n+\tmemcpy(query->rss_key, params->rss_key, sizeof(params->rss_key));\n \tquery->rss_key_size = T_ETH_RSS_KEY;\n \n-\trte_memcpy(query->ind_table, params->ind_table, T_ETH_INDIRECTION_TABLE_SIZE);\n+\tmemcpy(query->ind_table, params->ind_table, T_ETH_INDIRECTION_TABLE_SIZE);\n \tquery->ind_table_size = T_ETH_INDIRECTION_TABLE_SIZE;\n \n \tquery->rss_result_mask = params->rss_result_mask;\n", "prefixes": [ "v9" ] }{ "id": 137099, "url": "