Lines Matching +full:sub +full:- +full:frame

1 // SPDX-License-Identifier: GPL-2.0-only
4 * Copyright (c) 2016-2018 Cavium Inc.
27 QEDF_ERR(&qedf->dbg_ctx, in qedf_fcoe_send_vlan_req()
32 eth_fr = (char *)skb->data; in qedf_fcoe_send_vlan_req()
36 ether_addr_copy(vlan->eth.h_source, qedf->mac); in qedf_fcoe_send_vlan_req()
37 ether_addr_copy(vlan->eth.h_dest, my_fcoe_all_fcfs); in qedf_fcoe_send_vlan_req()
38 vlan->eth.h_proto = htons(ETH_P_FIP); in qedf_fcoe_send_vlan_req()
40 vlan->fip.fip_ver = FIP_VER_ENCAPS(FIP_VER); in qedf_fcoe_send_vlan_req()
41 vlan->fip.fip_op = htons(FIP_OP_VLAN); in qedf_fcoe_send_vlan_req()
42 vlan->fip.fip_subcode = FIP_SC_VL_REQ; in qedf_fcoe_send_vlan_req()
43 vlan->fip.fip_dl_len = htons(sizeof(vlan->desc) / FIP_BPW); in qedf_fcoe_send_vlan_req()
45 vlan->desc.mac.fd_desc.fip_dtype = FIP_DT_MAC; in qedf_fcoe_send_vlan_req()
46 vlan->desc.mac.fd_desc.fip_dlen = sizeof(vlan->desc.mac) / FIP_BPW; in qedf_fcoe_send_vlan_req()
47 ether_addr_copy(vlan->desc.mac.fd_mac, qedf->mac); in qedf_fcoe_send_vlan_req()
49 vlan->desc.wwnn.fd_desc.fip_dtype = FIP_DT_NAME; in qedf_fcoe_send_vlan_req()
50 vlan->desc.wwnn.fd_desc.fip_dlen = sizeof(vlan->desc.wwnn) / FIP_BPW; in qedf_fcoe_send_vlan_req()
51 put_unaligned_be64(qedf->lport->wwnn, &vlan->desc.wwnn.fd_wwn); in qedf_fcoe_send_vlan_req()
54 skb->protocol = htons(ETH_P_FIP); in qedf_fcoe_send_vlan_req()
58 QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC, "Sending FIP VLAN " in qedf_fcoe_send_vlan_req()
61 if (atomic_read(&qedf->link_state) != QEDF_LINK_UP) { in qedf_fcoe_send_vlan_req()
62 QEDF_WARN(&(qedf->dbg_ctx), "Cannot send vlan request " in qedf_fcoe_send_vlan_req()
70 rc = qed_ops->ll2->start_xmit(qedf->cdev, skb, flags); in qedf_fcoe_send_vlan_req()
72 QEDF_ERR(&qedf->dbg_ctx, "start_xmit failed rc = %d.\n", rc); in qedf_fcoe_send_vlan_req()
88 fiph = (struct fip_header *)(((void *)skb->data) + 2 * ETH_ALEN + 2); in qedf_fcoe_process_vlan_resp()
90 rlen = ntohs(fiph->fip_dl_len) * 4; in qedf_fcoe_process_vlan_resp()
93 dlen = desc->fip_dlen * FIP_BPW; in qedf_fcoe_process_vlan_resp()
94 switch (desc->fip_dtype) { in qedf_fcoe_process_vlan_resp()
96 vid = ntohs(((struct fip_vlan_desc *)desc)->fd_vlan); in qedf_fcoe_process_vlan_resp()
100 rlen -= dlen; in qedf_fcoe_process_vlan_resp()
103 if (atomic_read(&qedf->link_state) == QEDF_LINK_DOWN) { in qedf_fcoe_process_vlan_resp()
104 QEDF_INFO(&qedf->dbg_ctx, QEDF_LOG_DISC, in qedf_fcoe_process_vlan_resp()
109 QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC, "VLAN response, " in qedf_fcoe_process_vlan_resp()
112 if (vid > 0 && qedf->vlan_id != vid) { in qedf_fcoe_process_vlan_resp()
116 if (!completion_done(&qedf->fipvlan_compl)) in qedf_fcoe_process_vlan_resp()
117 complete(&qedf->fipvlan_compl); in qedf_fcoe_process_vlan_resp()
127 u8 sub; in qedf_fip_send() local
128 int rc = -1; in qedf_fip_send()
130 if (!test_bit(QEDF_LL2_STARTED, &qedf->flags)) { in qedf_fip_send()
131 QEDF_WARN(&(qedf->dbg_ctx), "LL2 not started\n"); in qedf_fip_send()
136 fiph = (struct fip_header *) ((void *)skb->data + 2 * ETH_ALEN + 2); in qedf_fip_send()
138 op = ntohs(fiph->fip_op); in qedf_fip_send()
139 sub = fiph->fip_subcode; in qedf_fip_send()
142 * Add VLAN tag to non-offload FIP frame based on current stored VLAN in qedf_fip_send()
145 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), qedf->vlan_id); in qedf_fip_send()
150 QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_LL2, "FIP frame send: " in qedf_fip_send()
151 "dest=%pM op=%x sub=%x vlan=%04x.", eth_hdr->h_dest, op, sub, in qedf_fip_send()
155 skb->data, skb->len, false); in qedf_fip_send()
157 rc = qed_ops->ll2->start_xmit(qedf->cdev, skb, 0); in qedf_fip_send()
159 QEDF_ERR(&qedf->dbg_ctx, "start_xmit failed rc = %d.\n", rc); in qedf_fip_send()
178 u8 sub; in qedf_fip_recv() local
187 fiph = (struct fip_header *) ((void *)skb->data + 2 * ETH_ALEN + 2); in qedf_fip_recv()
188 op = ntohs(fiph->fip_op); in qedf_fip_recv()
189 sub = fiph->fip_subcode; in qedf_fip_recv()
191 QEDF_INFO(&qedf->dbg_ctx, QEDF_LOG_LL2, in qedf_fip_recv()
192 "FIP frame received: skb=%p fiph=%p source=%pM destn=%pM op=%x sub=%x vlan=%04x", in qedf_fip_recv()
193 skb, fiph, eth_hdr->h_source, eth_hdr->h_dest, op, in qedf_fip_recv()
194 sub, vlan); in qedf_fip_recv()
197 skb->data, skb->len, false); in qedf_fip_recv()
199 if (!ether_addr_equal(eth_hdr->h_dest, qedf->mac) && in qedf_fip_recv()
200 !ether_addr_equal(eth_hdr->h_dest, fcoe_all_enode) && in qedf_fip_recv()
201 !ether_addr_equal(eth_hdr->h_dest, qedf->data_src_addr)) { in qedf_fip_recv()
202 QEDF_INFO(&qedf->dbg_ctx, QEDF_LOG_LL2, in qedf_fip_recv()
204 op, eth_hdr->h_dest, qedf->mac, in qedf_fip_recv()
205 qedf->data_src_addr); in qedf_fip_recv()
211 if (op == FIP_OP_VLAN && sub == FIP_SC_VL_NOTE) { in qedf_fip_recv()
214 } else if (op == FIP_OP_CTRL && sub == FIP_SC_CLR_VLINK) { in qedf_fip_recv()
215 QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC, "Clear virtual " in qedf_fip_recv()
219 if (qedf->ctlr.sel_fcf == NULL) { in qedf_fip_recv()
220 QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC, in qedf_fip_recv()
231 rlen = ntohs(fiph->fip_dl_len) * FIP_BPW; in qedf_fip_recv()
234 dlen = desc->fip_dlen * FIP_BPW; in qedf_fip_recv()
235 switch (desc->fip_dtype) { in qedf_fip_recv()
238 QEDF_INFO(&qedf->dbg_ctx, QEDF_LOG_DISC, in qedf_fip_recv()
239 "Switch fd_mac=%pM.\n", mp->fd_mac); in qedf_fip_recv()
240 if (ether_addr_equal(mp->fd_mac, in qedf_fip_recv()
241 qedf->ctlr.sel_fcf->fcf_mac)) in qedf_fip_recv()
246 switch_name = get_unaligned_be64(&wp->fd_wwn); in qedf_fip_recv()
247 QEDF_INFO(&qedf->dbg_ctx, QEDF_LOG_DISC, in qedf_fip_recv()
250 qedf->ctlr.sel_fcf->switch_name); in qedf_fip_recv()
252 qedf->ctlr.sel_fcf->switch_name) in qedf_fip_recv()
259 QEDF_ERR(&qedf->dbg_ctx, in qedf_fip_recv()
261 ntoh24(vp->fd_fc_id), vp->fd_mac, in qedf_fip_recv()
262 get_unaligned_be64(&vp->fd_wwpn)); in qedf_fip_recv()
266 if ((get_unaligned_be64(&vp->fd_wwpn) == in qedf_fip_recv()
267 qedf->wwpn) || in qedf_fip_recv()
268 (ntoh24(vp->fd_fc_id) == in qedf_fip_recv()
269 qedf->lport->port_id) || in qedf_fip_recv()
270 (ether_addr_equal(vp->fd_mac, in qedf_fip_recv()
271 qedf->data_src_addr))) { in qedf_fip_recv()
280 rlen -= dlen; in qedf_fip_recv()
283 QEDF_INFO(&qedf->dbg_ctx, QEDF_LOG_DISC, in qedf_fip_recv()
287 qedf_ctx_soft_reset(qedf->lport); in qedf_fip_recv()
292 fcoe_ctlr_recv(&qedf->ctlr, skb); in qedf_fip_recv()
300 return qedf->data_src_addr; in qedf_get_src_mac()