From: kernel test robot <lkp@intel.com>
To: Michael Chan <michael.chan@broadcom.com>, davem@davemloft.net
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, andrew+netdev@lunn.ch,
pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com,
Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Subject: Re: [PATCH net-next 2/6] bnxt_en: Do not allow ethtool -m on an untrusted VF
Date: Mon, 16 Dec 2024 22:25:54 +0800 [thread overview]
Message-ID: <202412162242.yQ3MVnZ5-lkp@intel.com> (raw)
In-Reply-To: <20241215205943.2341612-3-michael.chan@broadcom.com>
Hi Michael,
kernel test robot noticed the following build warnings:
[auto build test WARNING on net-next/main]
url: https://github.com/intel-lab-lkp/linux/commits/Michael-Chan/bnxt_en-Use-FW-defined-resource-limits-for-RoCE/20241216-050303
base: net-next/main
patch link: https://lore.kernel.org/r/20241215205943.2341612-3-michael.chan%40broadcom.com
patch subject: [PATCH net-next 2/6] bnxt_en: Do not allow ethtool -m on an untrusted VF
config: riscv-randconfig-002-20241216 (https://download.01.org/0day-ci/archive/20241216/202412162242.yQ3MVnZ5-lkp@intel.com/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241216/202412162242.yQ3MVnZ5-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412162242.yQ3MVnZ5-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/net/ethernet/broadcom/bnxt/bnxt.c:8287:7: warning: variable 'flags' is uninitialized when used here [-Wuninitialized]
if (flags & FUNC_QCFG_RESP_FLAGS_TRUSTED_VF)
^~~~~
drivers/net/ethernet/broadcom/bnxt/bnxt.c:8269:11: note: initialize the variable 'flags' to silence this warning
u16 flags;
^
= 0
1 warning generated.
vim +/flags +8287 drivers/net/ethernet/broadcom/bnxt/bnxt.c
8264
8265 static int bnxt_hwrm_func_qcfg(struct bnxt *bp)
8266 {
8267 struct hwrm_func_qcfg_output *resp;
8268 struct hwrm_func_qcfg_input *req;
8269 u16 flags;
8270 int rc;
8271
8272 rc = hwrm_req_init(bp, req, HWRM_FUNC_QCFG);
8273 if (rc)
8274 return rc;
8275
8276 req->fid = cpu_to_le16(0xffff);
8277 resp = hwrm_req_hold(bp, req);
8278 rc = hwrm_req_send(bp, req);
8279 if (rc)
8280 goto func_qcfg_exit;
8281
8282 #ifdef CONFIG_BNXT_SRIOV
8283 if (BNXT_VF(bp)) {
8284 struct bnxt_vf_info *vf = &bp->vf;
8285
8286 vf->vlan = le16_to_cpu(resp->vlan) & VLAN_VID_MASK;
> 8287 if (flags & FUNC_QCFG_RESP_FLAGS_TRUSTED_VF)
8288 vf->flags |= BNXT_VF_TRUST;
8289 else
8290 vf->flags &= ~BNXT_VF_TRUST;
8291 } else {
8292 bp->pf.registered_vfs = le16_to_cpu(resp->registered_vfs);
8293 }
8294 #endif
8295 flags = le16_to_cpu(resp->flags);
8296 if (flags & (FUNC_QCFG_RESP_FLAGS_FW_DCBX_AGENT_ENABLED |
8297 FUNC_QCFG_RESP_FLAGS_FW_LLDP_AGENT_ENABLED)) {
8298 bp->fw_cap |= BNXT_FW_CAP_LLDP_AGENT;
8299 if (flags & FUNC_QCFG_RESP_FLAGS_FW_DCBX_AGENT_ENABLED)
8300 bp->fw_cap |= BNXT_FW_CAP_DCBX_AGENT;
8301 }
8302 if (BNXT_PF(bp) && (flags & FUNC_QCFG_RESP_FLAGS_MULTI_HOST))
8303 bp->flags |= BNXT_FLAG_MULTI_HOST;
8304
8305 if (flags & FUNC_QCFG_RESP_FLAGS_RING_MONITOR_ENABLED)
8306 bp->fw_cap |= BNXT_FW_CAP_RING_MONITOR;
8307
8308 if (flags & FUNC_QCFG_RESP_FLAGS_ENABLE_RDMA_SRIOV)
8309 bp->fw_cap |= BNXT_FW_CAP_ENABLE_RDMA_SRIOV;
8310
8311 switch (resp->port_partition_type) {
8312 case FUNC_QCFG_RESP_PORT_PARTITION_TYPE_NPAR1_0:
8313 case FUNC_QCFG_RESP_PORT_PARTITION_TYPE_NPAR1_5:
8314 case FUNC_QCFG_RESP_PORT_PARTITION_TYPE_NPAR2_0:
8315 bp->port_partition_type = resp->port_partition_type;
8316 break;
8317 }
8318 if (bp->hwrm_spec_code < 0x10707 ||
8319 resp->evb_mode == FUNC_QCFG_RESP_EVB_MODE_VEB)
8320 bp->br_mode = BRIDGE_MODE_VEB;
8321 else if (resp->evb_mode == FUNC_QCFG_RESP_EVB_MODE_VEPA)
8322 bp->br_mode = BRIDGE_MODE_VEPA;
8323 else
8324 bp->br_mode = BRIDGE_MODE_UNDEF;
8325
8326 bp->max_mtu = le16_to_cpu(resp->max_mtu_configured);
8327 if (!bp->max_mtu)
8328 bp->max_mtu = BNXT_MAX_MTU;
8329
8330 if (bp->db_size)
8331 goto func_qcfg_exit;
8332
8333 bp->db_offset = le16_to_cpu(resp->legacy_l2_db_size_kb) * 1024;
8334 if (BNXT_CHIP_P5(bp)) {
8335 if (BNXT_PF(bp))
8336 bp->db_offset = DB_PF_OFFSET_P5;
8337 else
8338 bp->db_offset = DB_VF_OFFSET_P5;
8339 }
8340 bp->db_size = PAGE_ALIGN(le16_to_cpu(resp->l2_doorbell_bar_size_kb) *
8341 1024);
8342 if (!bp->db_size || bp->db_size > pci_resource_len(bp->pdev, 2) ||
8343 bp->db_size <= bp->db_offset)
8344 bp->db_size = pci_resource_len(bp->pdev, 2);
8345
8346 func_qcfg_exit:
8347 hwrm_req_drop(bp, req);
8348 return rc;
8349 }
8350
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
parent reply other threads:[~2024-12-16 14:26 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20241215205943.2341612-3-michael.chan@broadcom.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202412162242.yQ3MVnZ5-lkp@intel.com \
--to=lkp@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew.gospodarek@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kalesh-anakkur.purayil@broadcom.com \
--cc=kuba@kernel.org \
--cc=llvm@lists.linux.dev \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox