Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

RDMA/bnxt_re: Avoid GID level QoS update from the driver

The driver inserts a VLAN header into RoCE packets when the
traffic was untagged by modifying the existing GID entries.
This has caused the firmware to enforce only VLAN-based
priority mappings, ignoring other valid priority configurations
set via APP TLVs (e.g., DSCP selectors).

Driver now has support for selecting the service level (vlan id)
and traffic class (dscp) during modify_qp. So no need to override
the priority update using the update gid method. Hence removing
the code that handles the above operation.

Signed-off-by: Shravya KN <shravya.k-n@broadcom.com>
Link: https://patch.msgid.link/20250908094516.18222-3-kalesh-anakkur.purayil@broadcom.com
Reviewed-by: Saravanan Vajravel <saravanan.vajravel@broadcom.com>
Reviewed-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>

authored by

Shravya KN and committed by
Leon Romanovsky
eba165b2 72d0b87e

-141
-4
drivers/infiniband/hw/bnxt_re/bnxt_re.h
··· 175 175 #define BNXT_RE_FLAG_STATS_CTX3_ALLOC 1 176 176 #define BNXT_RE_FLAG_HAVE_L2_REF 3 177 177 #define BNXT_RE_FLAG_RCFW_CHANNEL_EN 4 178 - #define BNXT_RE_FLAG_QOS_WORK_REG 5 179 178 #define BNXT_RE_FLAG_RESOURCES_ALLOCATED 7 180 179 #define BNXT_RE_FLAG_RESOURCES_INITIALIZED 8 181 180 #define BNXT_RE_FLAG_ERR_DEVICE_DETACHED 17 ··· 186 187 struct bnxt_en_dev *en_dev; 187 188 188 189 int id; 189 - 190 - struct delayed_work worker; 191 - u8 cur_prio_map; 192 190 193 191 /* RCFW Channel */ 194 192 struct bnxt_qplib_rcfw rcfw;
-97
drivers/infiniband/hw/bnxt_re/main.c
··· 1927 1927 mutex_unlock(&rdev->qp_lock); 1928 1928 } 1929 1929 1930 - static int bnxt_re_update_gid(struct bnxt_re_dev *rdev) 1931 - { 1932 - struct bnxt_qplib_sgid_tbl *sgid_tbl = &rdev->qplib_res.sgid_tbl; 1933 - struct bnxt_qplib_gid gid; 1934 - u16 gid_idx, index; 1935 - int rc = 0; 1936 - 1937 - if (!ib_device_try_get(&rdev->ibdev)) 1938 - return 0; 1939 - 1940 - for (index = 0; index < sgid_tbl->active; index++) { 1941 - gid_idx = sgid_tbl->hw_id[index]; 1942 - 1943 - if (!memcmp(&sgid_tbl->tbl[index], &bnxt_qplib_gid_zero, 1944 - sizeof(bnxt_qplib_gid_zero))) 1945 - continue; 1946 - /* need to modify the VLAN enable setting of non VLAN GID only 1947 - * as setting is done for VLAN GID while adding GID 1948 - */ 1949 - if (sgid_tbl->vlan[index]) 1950 - continue; 1951 - 1952 - memcpy(&gid, &sgid_tbl->tbl[index], sizeof(gid)); 1953 - 1954 - rc = bnxt_qplib_update_sgid(sgid_tbl, &gid, gid_idx, 1955 - rdev->qplib_res.netdev->dev_addr); 1956 - } 1957 - 1958 - ib_device_put(&rdev->ibdev); 1959 - return rc; 1960 - } 1961 - 1962 - static u32 bnxt_re_get_priority_mask(struct bnxt_re_dev *rdev) 1963 - { 1964 - u32 prio_map = 0, tmp_map = 0; 1965 - struct net_device *netdev; 1966 - struct dcb_app app = {}; 1967 - 1968 - netdev = rdev->netdev; 1969 - 1970 - app.selector = IEEE_8021QAZ_APP_SEL_ETHERTYPE; 1971 - app.protocol = ETH_P_IBOE; 1972 - tmp_map = dcb_ieee_getapp_mask(netdev, &app); 1973 - prio_map = tmp_map; 1974 - 1975 - app.selector = IEEE_8021QAZ_APP_SEL_DGRAM; 1976 - app.protocol = ROCE_V2_UDP_DPORT; 1977 - tmp_map = dcb_ieee_getapp_mask(netdev, &app); 1978 - prio_map |= tmp_map; 1979 - 1980 - return prio_map; 1981 - } 1982 - 1983 - static int bnxt_re_setup_qos(struct bnxt_re_dev *rdev) 1984 - { 1985 - u8 prio_map = 0; 1986 - 1987 - /* Get priority for roce */ 1988 - prio_map = bnxt_re_get_priority_mask(rdev); 1989 - 1990 - if (prio_map == rdev->cur_prio_map) 1991 - return 0; 1992 - rdev->cur_prio_map = prio_map; 1993 - /* Actual priorities are not programmed as they are already 1994 - * done by L2 driver; just enable or disable priority vlan tagging 1995 - */ 1996 - if ((prio_map == 0 && rdev->qplib_res.prio) || 1997 - (prio_map != 0 && !rdev->qplib_res.prio)) { 1998 - rdev->qplib_res.prio = prio_map; 1999 - bnxt_re_update_gid(rdev); 2000 - } 2001 - 2002 - return 0; 2003 - } 2004 - 2005 1930 static void bnxt_re_net_unregister_async_event(struct bnxt_re_dev *rdev) 2006 1931 { 2007 1932 if (rdev->is_virtfn) ··· 2122 2197 bnxt_re_net_unregister_async_event(rdev); 2123 2198 bnxt_re_uninit_dcb_wq(rdev); 2124 2199 2125 - if (test_and_clear_bit(BNXT_RE_FLAG_QOS_WORK_REG, &rdev->flags)) 2126 - cancel_delayed_work_sync(&rdev->worker); 2127 - 2128 2200 bnxt_re_put_stats3_ctx(rdev); 2129 2201 2130 2202 if (test_and_clear_bit(BNXT_RE_FLAG_RESOURCES_INITIALIZED, ··· 2154 2232 if (test_and_clear_bit(BNXT_RE_FLAG_NETDEV_REGISTERED, &rdev->flags)) 2155 2233 bnxt_unregister_dev(rdev->en_dev); 2156 2234 } 2157 - } 2158 - 2159 - /* worker thread for polling periodic events. Now used for QoS programming*/ 2160 - static void bnxt_re_worker(struct work_struct *work) 2161 - { 2162 - struct bnxt_re_dev *rdev = container_of(work, struct bnxt_re_dev, 2163 - worker.work); 2164 - 2165 - bnxt_re_setup_qos(rdev); 2166 - schedule_delayed_work(&rdev->worker, msecs_to_jiffies(30000)); 2167 2235 } 2168 2236 2169 2237 static int bnxt_re_dev_init(struct bnxt_re_dev *rdev, u8 op_type) ··· 2310 2398 rc = bnxt_qplib_query_cc_param(&rdev->qplib_res, &rdev->cc_param); 2311 2399 if (rc) 2312 2400 ibdev_warn(&rdev->ibdev, "Failed to query CC defaults\n"); 2313 - 2314 - rc = bnxt_re_setup_qos(rdev); 2315 - if (rc) 2316 - ibdev_info(&rdev->ibdev, 2317 - "RoCE priority not yet configured\n"); 2318 - 2319 - INIT_DELAYED_WORK(&rdev->worker, bnxt_re_worker); 2320 - set_bit(BNXT_RE_FLAG_QOS_WORK_REG, &rdev->flags); 2321 - schedule_delayed_work(&rdev->worker, msecs_to_jiffies(30000)); 2322 2401 2323 2402 if (!(rdev->qplib_res.en_dev->flags & BNXT_EN_FLAG_ROCE_VF_RES_MGMT)) 2324 2403 bnxt_re_vf_res_config(rdev);
-40
drivers/infiniband/hw/bnxt_re/qplib_sp.c
··· 400 400 return 0; 401 401 } 402 402 403 - int bnxt_qplib_update_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, 404 - struct bnxt_qplib_gid *gid, u16 gid_idx, 405 - const u8 *smac) 406 - { 407 - struct bnxt_qplib_res *res = to_bnxt_qplib(sgid_tbl, 408 - struct bnxt_qplib_res, 409 - sgid_tbl); 410 - struct bnxt_qplib_rcfw *rcfw = res->rcfw; 411 - struct creq_modify_gid_resp resp = {}; 412 - struct bnxt_qplib_cmdqmsg msg = {}; 413 - struct cmdq_modify_gid req = {}; 414 - int rc; 415 - 416 - bnxt_qplib_rcfw_cmd_prep((struct cmdq_base *)&req, 417 - CMDQ_BASE_OPCODE_MODIFY_GID, 418 - sizeof(req)); 419 - 420 - req.gid[0] = cpu_to_be32(((u32 *)gid->data)[3]); 421 - req.gid[1] = cpu_to_be32(((u32 *)gid->data)[2]); 422 - req.gid[2] = cpu_to_be32(((u32 *)gid->data)[1]); 423 - req.gid[3] = cpu_to_be32(((u32 *)gid->data)[0]); 424 - if (res->prio) { 425 - req.vlan |= cpu_to_le16 426 - (CMDQ_ADD_GID_VLAN_TPID_TPID_8100 | 427 - CMDQ_ADD_GID_VLAN_VLAN_EN); 428 - } 429 - 430 - /* MAC in network format */ 431 - req.src_mac[0] = cpu_to_be16(((u16 *)smac)[0]); 432 - req.src_mac[1] = cpu_to_be16(((u16 *)smac)[1]); 433 - req.src_mac[2] = cpu_to_be16(((u16 *)smac)[2]); 434 - 435 - req.gid_index = cpu_to_le16(gid_idx); 436 - 437 - bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req), 438 - sizeof(resp), 0); 439 - rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); 440 - return rc; 441 - } 442 - 443 403 /* AH */ 444 404 int bnxt_qplib_create_ah(struct bnxt_qplib_res *res, struct bnxt_qplib_ah *ah, 445 405 bool block)