ice_dcb_lib.c
Source contains low-bit mask syntaxAssigns a negative errno constant
SHA-2561377b674e15e81caa274dd61521edc5f277dab9f0d3f1db3b09c7317a5fdc166
MaleculeO(Er)H(Db₂)
Evidence
1// SPDX-License-Identifier: GPL-2.0
2/* Copyright (c) 2019, Intel Corporation. */
3
4#include "ice_dcb_lib.h"
5#include "ice_dcb_nl.h"
6#include "devlink/devlink.h"
7
8/**
9 * ice_dcb_get_ena_tc - return bitmap of enabled TCs
10 * @dcbcfg: DCB config to evaluate for enabled TCs
11 */
12static u8 ice_dcb_get_ena_tc(struct ice_dcbx_cfg *dcbcfg)
13{
14 u8 i, num_tc, ena_ …
315:8… _tc, total_bw = 0;
316 int i;
317
318 /* returns number of contigous TCs and 1 TC for non-contigous TCs,
319 * since at least 1 TC has to be configured
320 */
321 num_tc = ice_dcb_get_num_tc(dcbcfg);
322
323 /* no bandw …
337:21… dev(pf), "Invalid config, total bandwidth must equal 100\n");
338 return -EINVAL;
339 }
340
⋯7 lines
394:27… (pf);
395 if (!pf_vsi) {
396 dev_dbg(dev, "PF VSI doesn't exist\n");
397 ret = -EINVAL;
398 goto free_cfg;
399 }
400
401 /* Notify AUX drivers about impending change to TCs */
402 event = kzalloc_obj(*event);
403 if (!event) {
404 ret = -ENOMEM;
405 goto free_cfg;
406 }
⋯7 lines
418:22… cted by DCB changes */
419 ice_dcb_ena_dis_vsi(pf, false, true);
420
421 memcpy(curr_cfg, new_cfg, sizeof(*curr_cfg));
422 memcpy(&curr_cfg->etsrec, &curr_cfg->etscfg, sizeof(curr_cfg->etsrec));
423 memcpy(&new_cf …