[PATCH v5 10/16] lpfc: vmid: Functions to manage vmids
kernel test robot
lkp at intel.com
Sat Dec 19 15:20:39 EST 2020
Hi Muneendra,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201218]
[cannot apply to cgroup/for-next v5.10]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: powerpc64-randconfig-r023-20201217 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cee1e7d14f4628d6174b33640d502bff3b54ae45)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://github.com/0day-ci/linux/commit/8417ca99565475d5bf5493657fcf90922607f1b1
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201216-202913
git checkout 8417ca99565475d5bf5493657fcf90922607f1b1
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>
All warnings (new ones prefixed by >>):
>> drivers/scsi/lpfc/lpfc_scsi.c:5179:1: warning: no previous prototype for function 'lpfc_put_vmid_in_hashtable' [-Wmissing-prototypes]
lpfc_put_vmid_in_hashtable(struct lpfc_vport *vport, u32 hash,
^
drivers/scsi/lpfc/lpfc_scsi.c:5178:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int
^
static
>> drivers/scsi/lpfc/lpfc_scsi.c:5233:6: warning: no previous prototype for function 'lpfc_vmid_update_entry' [-Wmissing-prototypes]
void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
^
drivers/scsi/lpfc/lpfc_scsi.c:5233:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
^
static
>> drivers/scsi/lpfc/lpfc_scsi.c:5254:6: warning: no previous prototype for function 'lpfc_vmid_assign_cs_ctl' [-Wmissing-prototypes]
void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
^
drivers/scsi/lpfc/lpfc_scsi.c:5254:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
^
static
In file included from drivers/scsi/lpfc/lpfc_scsi.c:31:
In file included from include/linux/blk-cgroup.h:17:
include/linux/cgroup.h:748:23: warning: unused function 'cgroup_get_from_id' [-Wunused-function]
static struct cgroup *cgroup_get_from_id(u64 id)
^
4 warnings generated.
vim +/lpfc_put_vmid_in_hashtable +5179 drivers/scsi/lpfc/lpfc_scsi.c
5168
5169 /*
5170 * lpfc_put_vmid_from_hastable - put the VMID in the hash table
5171 * @vport: The virtual port for which this call is being executed.
5172 * @hash - calculated hash value
5173 * @vmp: Pointer to a VMID entry representing a VM sending IO
5174 *
5175 * This routine will insert the newly acquired vmid entity in the hash table.
5176 * Make sure to acquire the appropriate lock before invoking this routine.
5177 */
5178 int
> 5179 lpfc_put_vmid_in_hashtable(struct lpfc_vport *vport, u32 hash,
5180 struct lpfc_vmid *vmp)
5181 {
5182 int count = 0;
5183
5184 while (count < LPFC_VMID_HASH_SIZE) {
5185 if (!vport->hash_table[hash]) {
5186 vport->hash_table[hash] = vmp;
5187 vmp->hash_index = hash;
5188 return FAILURE;
5189 }
5190 /* if the slot is already occupied, a collision has occurred. */
5191 /* Store in the next available slot */
5192 count++;
5193 hash++;
5194 /* table is full */
5195 if (hash == LPFC_VMID_HASH_SIZE)
5196 hash = 0;
5197 }
5198 return 0;
5199 }
5200
5201 /*
5202 * lpfc_vmid_hash_fn- creates a hash value of the UUID
5203 * @uuid: uuid associated with the VE
5204 * @len: length of the UUID
5205 * Returns the calculated hash value
5206 */
5207 int lpfc_vmid_hash_fn(char *vmid, int len)
5208 {
5209 int c;
5210 int hash = 0;
5211
5212 if (len == 0)
5213 return 0;
5214 while (len--) {
5215 c = *vmid++;
5216 if (c >= 'A' && c <= 'Z')
5217 c += 'a' - 'A';
5218
5219 hash = (hash + (c << LPFC_VMID_HASH_SHIFT) +
5220 (c >> LPFC_VMID_HASH_SHIFT)) * 19;
5221 }
5222
5223 return hash & LPFC_VMID_HASH_MASK;
5224 }
5225
5226 /*
5227 * lpfc_vmid_update_entry - update the vmid entry in the hash table
5228 * @vport: The virtual port for which this call is being executed.
5229 * @cmd: address of scsi cmmd descriptor
5230 * @vmp: Pointer to a VMID entry representing a VM sending IO
5231 * @tag: VMID tag
5232 */
> 5233 void lpfc_vmid_update_entry(struct lpfc_vport *vport, struct scsi_cmnd
5234 *cmd, struct lpfc_vmid *vmp,
5235 union lpfc_vmid_io_tag *tag)
5236 {
5237 u64 *lta;
5238
5239 if (vport->vmid_priority_tagging)
5240 tag->cs_ctl_vmid = vmp->un.cs_ctl_vmid;
5241 else
5242 tag->app_id = vmp->un.app_id;
5243
5244 if (cmd->sc_data_direction == DMA_TO_DEVICE)
5245 vmp->io_wr_cnt++;
5246 else
5247 vmp->io_rd_cnt++;
5248
5249 /* update the last access timestamp in the table */
5250 lta = per_cpu_ptr(vmp->last_io_time, raw_smp_processor_id());
5251 *lta = jiffies;
5252 }
5253
> 5254 void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, struct lpfc_vmid *vmid)
5255 {
5256 u32 hash;
5257 struct lpfc_vmid *pvmid;
5258
5259 if (vport->port_type == LPFC_PHYSICAL_PORT) {
5260 vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport);
5261 } else {
5262 hash = lpfc_vmid_hash_fn(vmid->host_vmid, vmid->vmid_len);
5263 pvmid =
5264 lpfc_get_vmid_from_hastable(vport->phba->pport, hash,
5265 vmid->host_vmid);
5266 if (!pvmid)
5267 vmid->un.cs_ctl_vmid = pvmid->un.cs_ctl_vmid;
5268 else
5269 vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport);
5270 }
5271 }
5272
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 31312 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-nvme/attachments/20201220/f9f19d80/attachment-0001.gz>
More information about the Linux-nvme
mailing list