Subject: Re: [net-next PATCH v2 5/9] octeontx2-af: Add packet path between representor and VF

From: kernel test robot <[email-masked]>
Date: Wed, 24 Apr 2024 00:13:39 +0800

Hi Geetha,

kernel test robot noticed the following build warnings:

[auto build test WARNING on next-20240422]
[also build test WARNING on v6.9-rc5]
[cannot apply to net-next/main linus/master horms-ipvs/master v6.9-rc5 v6.9-rc4 v6.9-rc3]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Geetha-sowjanya/octeontx2-pf-Refactoring-RVU-driver/20240422-175819
base:   next-20240422
patch link:    https://lore.kernel.org/r/20240422095401.14245-6-gakula%40marvell.com
patch subject: [net-next PATCH v2 5/9] octeontx2-af: Add packet path between representor and VF
config: alpha-randconfig-r122-20240423 (https://download.01.org/0day-ci/archive/20240424/[email-masked]/config)
compiler: alpha-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240424/[email-masked]/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 <[email-masked]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email-masked]/

sparse warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c:39:38: sparse: sparse: cast to restricted __be16
>> drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c:39:38: sparse: sparse: cast to restricted __be16
>> drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c:39:38: sparse: sparse: cast to restricted __be16
>> drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c:39:38: sparse: sparse: cast to restricted __be16
>> drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c:95:31: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be16 [assigned] [usertype] vlan_etype @@     got int @@
   drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c:95:31: sparse:     expected restricted __be16 [assigned] [usertype] vlan_etype
   drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c:95:31: sparse:     got int
   drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c:96:29: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be16 [assigned] [usertype] vlan_etype @@     got int @@
   drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c:96:29: sparse:     expected restricted __be16 [assigned] [usertype] vlan_etype
   drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c:96:29: sparse:     got int
>> drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c:97:29: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be16 [assigned] [usertype] vlan_tci @@     got unsigned short [assigned] [usertype] vlan_tci @@
   drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c:97:29: sparse:     expected restricted __be16 [assigned] [usertype] vlan_tci
   drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c:97:29: sparse:     got unsigned short [assigned] [usertype] vlan_tci
>> drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c:98:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be16 [assigned] [usertype] vlan_tci @@     got int @@
   drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c:98:27: sparse:     expected restricted __be16 [assigned] [usertype] vlan_tci
   drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c:98:27: sparse:     got int

vim +39 drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c

    25	
    26	static int rvu_rep_tx_vlan_cfg(struct rvu *rvu,  u16 pcifunc,
    27				       u16 vlan_tci, int *vidx)
    28	{
    29		struct nix_vtag_config_rsp rsp = {};
    30		struct nix_vtag_config req = {};
    31		u64 etype = ETH_P_8021Q;
    32		int err;
    33	
    34		/* Insert vlan tag */
    35		req.hdr.pcifunc = pcifunc;
    36		req.vtag_size = VTAGSIZE_T4;
    37		req.cfg_type = 0; /* tx vlan cfg */
    38		req.tx.cfg_vtag0 = true;
  > 39		req.tx.vtag0 = etype << 48 | ntohs(vlan_tci);
    40	
    41		err = rvu_mbox_handler_nix_vtag_cfg(rvu, &req, &rsp);
    42		if (err) {
    43			dev_err(rvu->dev, "Tx vlan config failed\n");
    44			return err;
    45		}
    46		*vidx = rsp.vtag0_idx;
    47		return 0;
    48	}
    49	
    50	static int rvu_rep_rx_vlan_cfg(struct rvu *rvu, u16 pcifunc)
    51	{
    52		struct nix_vtag_config req = {};
    53		struct nix_vtag_config_rsp rsp;
    54	
    55		/* config strip, capture and size */
    56		req.hdr.pcifunc = pcifunc;
    57		req.vtag_size = VTAGSIZE_T4;
    58		req.cfg_type = 1; /* rx vlan cfg */
    59		req.rx.vtag_type = NIX_AF_LFX_RX_VTAG_TYPE0;
    60		req.rx.strip_vtag = true;
    61		req.rx.capture_vtag = false;
    62	
    63		return rvu_mbox_handler_nix_vtag_cfg(rvu, &req, &rsp);
    64	}
    65	
    66	static int rvu_rep_install_rx_rule(struct rvu *rvu, u16 pcifunc,
    67					   u16 entry, bool rte)
    68	{
    69		struct npc_install_flow_req req = {};
    70		struct npc_install_flow_rsp rsp = {};
    71		struct rvu_pfvf *pfvf;
    72		u16 vlan_tci, rep_id;
    73	
    74		pfvf = rvu_get_pfvf(rvu, pcifunc);
    75	
    76		/* To stree the traffic from Representee to Representor */
    77		rep_id = (u16)rvu_rep_get_vlan_id(rvu, pcifunc);
    78		if (rte) {
    79			vlan_tci = rep_id | 0x1ull << 8;
    80			req.vf = rvu->rep_pcifunc;
    81			req.op = NIX_RX_ACTIONOP_UCAST;
    82			req.index = rep_id;
    83		} else {
    84			vlan_tci = rep_id;
    85			req.vf = pcifunc;
    86			req.op = NIX_RX_ACTION_DEFAULT;
    87		}
    88	
    89		rvu_rep_rx_vlan_cfg(rvu, req.vf);
    90		req.entry = entry;
    91		req.hdr.pcifunc = 0; /* AF is requester */
    92		req.features = BIT_ULL(NPC_OUTER_VID) | BIT_ULL(NPC_VLAN_ETYPE_CTAG);
    93		req.vtag0_valid = true;
    94		req.vtag0_type = NIX_AF_LFX_RX_VTAG_TYPE0;
  > 95		req.packet.vlan_etype = ETH_P_8021Q;
    96		req.mask.vlan_etype = ETH_P_8021Q;
  > 97		req.packet.vlan_tci = vlan_tci;
  > 98		req.mask.vlan_tci = 0xffff;
    99	
   100		req.channel = RVU_SWITCH_LBK_CHAN;
   101		req.chan_mask = 0xffff;
   102		req.intf = pfvf->nix_rx_intf;
   103	
   104		return rvu_mbox_handler_npc_install_flow(rvu, &req, &rsp);
   105	}
   106	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki