virtchnl: update and refactor
Subsystems (2)
cover virtchnl: update and refactor
The virtchnl.h file is used by i40e/ice physical function (PF) drivers and irdma when talking to the iavf driver. This series cleans up the header file by removing unused elements, adding/cleaning some comments, fixing the data structures so they are explicitly defined, including padding, and finally does a long overdue rename of the IWARP members in the structures to RDMA, since the ice driver and it's associated Intel Ethernet E800 series adapters support both RDMA and IWARP.
The whole series should result in no functional change, but hopefully clearer code.
Jesse Brandeburg (4):
virtchnl: remove unused structure declaration
virtchnl: update header and increase header clarity
virtchnl: do structure hardening
virtchnl: i40e/ice/iavf: rename iwarp to rdma
drivers/net/ethernet/intel/i40e/i40e_client.c | 2 +- .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 63 +++---- .../ethernet/intel/i40e/i40e_virtchnl_pf.h | 6 +- drivers/net/ethernet/intel/iavf/iavf.h | 6 +- drivers/net/ethernet/intel/iavf/iavf_client.c | 32 ++-- drivers/net/ethernet/intel/iavf/iavf_client.h | 2 +- drivers/net/ethernet/intel/iavf/iavf_common.c | 4 +- drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +- drivers/net/ethernet/intel/iavf/iavf_status.h | 2 +- .../net/ethernet/intel/iavf/iavf_virtchnl.c | 6 +- include/linux/avf/virtchnl.h | 159 ++++++++++-------- 11 files changed, 150 insertions(+), 134 deletions(-)
Signature · 5 lines
2.31.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH 1/4 virtchnl: remove unused structure declaration
Nothing uses virtchnl_msg, just remove it.
--- include/linux/avf/virtchnl.h | 13 ------------- 1 file changed, 13 deletions(-)
include/linux/avf/virtchnl.h +0 -13
@@ -162,19 +162,6 @@ enum virtchnl_ops {#define VIRTCHNL_CHECK_UNION_LEN (n,X ) enum virtchnl_static_asset_enum_##X \ { virtchnl_static_assert_##X = (n)/((sizeof(union X) == (n)) ? 1 : 0) } -/* Virtual channel message descriptor. This overlays the admin queue -* descriptor. All other data is passed in external buffers. -*/ - -struct virtchnl_msg { -u8 pad[8 ];/* AQ flags/opcode/len/retval fields */ -enum virtchnl_ops v_opcode;/* avoid confusion with desc->opcode */ -enum virtchnl_status_code v_retval;/* ditto for desc->retval */ -u32 vfid;/* used by PF when sending to VF */ -}; - -VIRTCHNL_CHECK_STRUCT_LEN (20 , virtchnl_msg); -/* Message descriptions and data structures. */ /* VIRTCHNL_OP_VERSION
Signature · 6 lines
2.31.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Re: [Intel-wired-lan] [PATCH net-next v1 1/4] virtchnl: remove unused structure declaration
include/linux/avf/virtchnl.h
Quoted 22 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Jesse Brandeburg
Sent: piątek, 16 grudnia 2022 21:07
To: [email protected]
Cc: Brandeburg, Jesse <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next v1 1/4] virtchnl: remove unused structure declarationNothing uses
virtchnl_msg, just remove it.Signed-off-by Jesse Brandeburg <[email protected]>--- include/linux/avf/virtchnl.h | 13 ------------- 1 file changed, 13 deletions(-)include/linux/avf/virtchnl.h index renamed from include/linux/avf/virtchnl.h +0
-0
d91af50ac58d..b1cfa84904b1100644include/linux/avf/virtchnl.h +0
-0
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH 2/4 virtchnl: update header and increase header clarity
In reply to Jesse BrandeburgWe already have the SPDX header, so just leave a copyright notice with an updated year and get rid of the boilerplate header (so 2002!).
In addition, update a couple of comments to clarify how the various parts of the virtchannel header interaction work.
No functional changes.
--- include/linux/avf/virtchnl.h | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-)
include/linux/avf/virtchnl.h +18 -15
@@ -1,21 +1,13 @@/* SPDX-License-Identifier: GPL-2.0-only */ -/******************************************************************************* -* -* Intel Ethernet Controller XL710 Family Linux Virtual Function Driver -* Copyright(c) 2013 - 2014 Intel Corporation. -* -* Contact Information: -* e1000-devel Mailing List <[email protected]> -* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 -* -******************************************************************************/ +/* Copyright (c) 2013-2022, Intel Corporation. */ #ifndef _VIRTCHNL_H_#define _VIRTCHNL_H_/* Description: -* This header file describes the VF-PF communication protocol used -* by the drivers for all devices starting from our 40G product line +* This header file describes the Virtual Function (VF) - Physical Function +* (PF) communication protocol used by the drivers for all devices starting +* from our 40G product line * * Admin queue buffer usage: * desc->opcode is always aqc_opc_send_msg_to_pf
@@ -29,8 +21,8 @@* have a maximum of sixteen queues for all of its VSIs. * * The PF is required to return a status code in v_retval for all messages -* except RESET_VF, which does not require any response. The return value -* is of status_code type, defined in the shared type.h. +* except RESET_VF, which does not require any response. The returned value +* is of virtchnl_status_code type, defined here. * * In general, VF driver initialization should roughly follow the order of * these opcodes. The VF driver must first validate the API version of the
@@ -323,6 +315,9 @@ VIRTCHNL_CHECK_STRUCT_LEN(40, virtchnl_rxq_info);* PF configures queues and returns status. * If the number of queues specified is greater than the number of queues * associated with the VSI, an error is returned and no queues are configured. +* NOTE: The VF is not required to configure all queues in a single request. +* It may send multiple messages. PF drivers must correctly handle all VF +* requests. */ struct virtchnl_queue_pair_info {/* NOTE: vsi_id and queue_id should be identical for both queues. */
@@ -360,8 +355,13 @@ struct virtchnl_vf_res_request {* VF uses this message to map vectors to queues. * The rxq_map and txq_map fields are bitmaps used to indicate which queues * are to be associated with the specified vector. -* The "other" causes are always mapped to vector 0. +* The "other" causes are always mapped to vector 0. The VF may not request +* that vector 0 be used for traffic. * PF configures interrupt mapping and returns status. +* NOTE: due to hardware requirements, all active queues (both TX and RX) +* should be mapped to interrupts, even if the driver intends to operate +* only in polling mode. In this case the interrupt may be disabled, but +* the ITR timer will still run to trigger writebacks. */ struct virtchnl_vector_map {u16 vsi_id;
@@ -388,6 +388,9 @@ VIRTCHNL_CHECK_STRUCT_LEN(14, virtchnl_irq_map_info);* (Currently, we only support 16 queues per VF, but we make the field * u32 to allow for expansion.) * PF performs requested action and returns status. +* NOTE: The VF is not required to enable/disable all queues in a single +* request. It may send multiple messages. +* PF drivers must correctly handle all VF requests. */ struct virtchnl_queue_select {u16 vsi_id;
Signature · 6 lines
2.31.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Re: [Intel-wired-lan] [PATCH net-next v1 2/4] virtchnl: update header and increase header clarity
include/linux/avf/virtchnl.h
Quoted 28 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Jesse Brandeburg
Sent: piątek, 16 grudnia 2022 21:07
To: [email protected]
Cc: Brandeburg, Jesse <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next v1 2/4] virtchnl: update header and increase header clarityWe already have the SPDX header, so just leave a copyright notice with an updated year and get rid of the boilerplate header (so 2002!).
In addition, update a couple of comments to clarify how the various parts of the virtchannel header interaction work.
No functional changes.
Signed-off-by Jesse Brandeburg <[email protected]>--- include/linux/avf/virtchnl.h | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-)include/linux/avf/virtchnl.h index renamed from include/linux/avf/virtchnl.h +0
-0
b1cfa84904b1..2e685aa37688100644include/linux/avf/virtchnl.h +0
-0
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH 3/4 virtchnl: do structure hardening
In reply to Jesse BrandeburgThe virtchnl interface can have a bunch of "soft" defined structures hardened by using explicit sizes for declarations, and then referring to the enum type that uses them in a comment. None of these changes should change any of the structure sizes.
Also, remove a duplicate line in a switch statement and let two cases uses the same code.
--- include/linux/avf/virtchnl.h | 48 ++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 16 deletions(-)
include/linux/avf/virtchnl.h +32 -16
@@ -214,7 +214,9 @@ enum virtchnl_vsi_type {struct virtchnl_vsi_resource {u16 vsi_id;u16 num_queue_pairs; -enum virtchnl_vsi_type vsi_type; + +/* see enum virtchnl_vsi_type */ +s32 vsi_type;u16 qset_handle;u8 default_mac_addr[ETH_ALEN ]; };
@@ -303,7 +305,9 @@ struct virtchnl_rxq_info {u8 rxdid;u8 pad1[2 ];u64 dma_ring_addr; -enum virtchnl_rx_hsplit rx_split_pos;/* deprecated with AVF 1.0 */ + +/* see enum virtchnl_rx_hsplit; deprecated with AVF 1.0 */ +s32 rx_split_pos;u32 pad2; };
@@ -955,8 +959,12 @@ enum virtchnl_flow_type {struct virtchnl_filter {union virtchnl_flow_spec data;union virtchnl_flow_spec mask; -enum virtchnl_flow_type flow_type; -enum virtchnl_action action; + +/* see enum virtchnl_flow_type */ +s32 flow_type; + +/* see enum virtchnl_action */ +s32 action;u32 action_meta;u8 field_flags;u8 pad[3 ];
@@ -984,7 +992,8 @@ enum virtchnl_event_codes {#define PF_EVENT_SEVERITY_CERTAIN_DOOM 255struct virtchnl_pf_event { -enum virtchnl_event_codes event; +/* see enum virtchnl_event_codes */ +s32 event;union {/* If the PF driver does not support the new speed reporting * capabilities then use link_event else use link_event_adv to
@@ -997,6 +1006,7 @@ struct virtchnl_pf_event {struct {enum virtchnl_link_speed link_speed;bool link_status; +u8 pad[3 ]; } link_event;struct {/* link_speed provided in Mbps */
@@ -1006,7 +1016,7 @@ struct virtchnl_pf_event { } link_event_adv; } event_data; -int severity; +s32 severity; };VIRTCHNL_CHECK_STRUCT_LEN (16 , virtchnl_pf_event);
@@ -1097,7 +1107,7 @@ enum virtchnl_rss_algorithm {#define VIRTCHNL_GET_PROTO_HDR_TYPE (hdr) \ (((hdr)->type) >> PROTO_HDR_SHIFT)#define VIRTCHNL_TEST_PROTO_HDR_TYPE (hdr, val) \ - ((hdr)->type == ((val) >> PROTO_HDR_SHIFT)) + ((hdr)->type == ((s32)((val) >> PROTO_HDR_SHIFT)))#define VIRTCHNL_TEST_PROTO_HDR (hdr, val) \ (VIRTCHNL_TEST_PROTO_HDR_TYPE((hdr), (val)) && \ VIRTCHNL_TEST_PROTO_HDR_FIELD((hdr), (val)))
@@ -1193,7 +1203,8 @@ enum virtchnl_proto_hdr_field { };struct virtchnl_proto_hdr { -enum virtchnl_proto_hdr_type type; +/* see enum virtchnl_proto_hdr_type */ +s32 type;u32 field_selector;/* a bit mask to select field for header type */ u8 buffer[64 ];/**
@@ -1223,15 +1234,18 @@ VIRTCHNL_CHECK_STRUCT_LEN(2312, virtchnl_proto_hdrs);struct virtchnl_rss_cfg {struct virtchnl_proto_hdrs proto_hdrs;/* protocol headers */ -enum virtchnl_rss_algorithm rss_algorithm;/* RSS algorithm type */ -u8 reserved[128 ];/* reserve for future */ + +/* see enum virtchnl_rss_algorithm; rss algorithm type */ +s32 rss_algorithm; +u8 reserved[128 ];/* reserve for future */ };VIRTCHNL_CHECK_STRUCT_LEN (2444 , virtchnl_rss_cfg);/* action configuration for FDIR */ struct virtchnl_filter_action { - enum virtchnl_action type; + /* see enum virtchnl_action type */ + s32 type; union { /* used for queue and qgroup action */ struct {
@@ -1319,7 +1333,9 @@ struct virtchnl_fdir_add {u16 validate_only;/* INPUT */ u32 flow_id;/* OUTPUT */ struct virtchnl_fdir_rule rule_cfg;/* INPUT */ -enum virtchnl_fdir_prgm_status status;/* OUTPUT */ + +/* see enum virtchnl_fdir_prgm_status; OUTPUT */ +s32 status; };VIRTCHNL_CHECK_STRUCT_LEN (2616 , virtchnl_fdir_add);
@@ -1332,7 +1348,9 @@ struct virtchnl_fdir_del {u16 vsi_id;/* INPUT */ u16 pad;u32 flow_id;/* INPUT */ -enum virtchnl_fdir_prgm_status status;/* OUTPUT */ + +/* see enum virtchnl_fdir_prgm_status; OUTPUT */ +s32 status; };VIRTCHNL_CHECK_STRUCT_LEN (12 , virtchnl_fdir_del);
@@ -1351,7 +1369,7 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode, u8 *msg, u16 msglen) {bool err_msg_format = false; -int valid_len =0 ; +u32 valid_len =0 ;/* Validate message length. */ switch (v_opcode) {
@@ -1492,8 +1510,6 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,case VIRTCHNL_OP_DISABLE_CHANNELS :break ;case VIRTCHNL_OP_ADD_CLOUD_FILTER : - valid_len =sizeof (struct virtchnl_filter ); -break ;case VIRTCHNL_OP_DEL_CLOUD_FILTER : valid_len =sizeof (struct virtchnl_filter );break ;
Signature · 6 lines
2.31.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Re: [Intel-wired-lan] [PATCH net-next v1 3/4] virtchnl: do structure hardening
include/linux/avf/virtchnl.h
Quoted 28 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Jesse Brandeburg
Sent: piątek, 16 grudnia 2022 21:07
To: [email protected]
Cc: Brandeburg, Jesse <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next v1 3/4] virtchnl: do structure hardeningThe virtchnl interface can have a bunch of "soft" defined structures hardened by using explicit sizes for declarations, and then referring to the enum type that uses them in a comment. None of these changes should change any of the structure sizes.
Also, remove a duplicate line in a switch statement and let two cases uses the same code.
Signed-off-by Jesse Brandeburg <[email protected]>--- include/linux/avf/virtchnl.h | 48 ++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 16 deletions(-)include/linux/avf/virtchnl.h index renamed from include/linux/avf/virtchnl.h +0
-0
2e685aa37688..5c630c818370100644include/linux/avf/virtchnl.h +0
-0
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH 4/4 virtchnl: i40e/ice/iavf: rename iwarp to rdma
In reply to Jesse BrandeburgSince the latest Intel hardware does both IWARP and ROCE, rename the term IWARP in the virtchnl header to be RDMA. Do this for both upper and lower case instances. Many of the non-virtchnl.h changes were done with regular expression replacements using perl like:
perl -p -i -e 's/_IWARP/_RDMA/' <files>
perl -p -i -e 's/_iwarp/_rdma/' <files>
and I had to pick up a few instances manually.
The virtchnl.h header has some comments and clarity added around when to use certain defines.
note: had to fix a checkpatch warning for a long line by wrapping one of the lines I changed.
--- drivers/net/ethernet/intel/i40e/i40e_client.c | 2 +- .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 63 +++++++++--------- .../ethernet/intel/i40e/i40e_virtchnl_pf.h | 6 +- drivers/net/ethernet/intel/iavf/iavf.h | 6 +- drivers/net/ethernet/intel/iavf/iavf_client.c | 32 ++++----- drivers/net/ethernet/intel/iavf/iavf_client.h | 2 +- drivers/net/ethernet/intel/iavf/iavf_common.c | 4 +- drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +- drivers/net/ethernet/intel/iavf/iavf_status.h | 2 +- .../net/ethernet/intel/iavf/iavf_virtchnl.c | 6 +- include/linux/avf/virtchnl.h | 65 +++++++++++-------- 11 files changed, 100 insertions(+), 90 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_client.c +1 -1
@@ -543,7 +543,7 @@ static int i40e_client_virtchnl_send(struct i40e_info *ldev,struct i40e_hw *hw = &pf->hw;i40e_status err; - err =i40e_aq_send_msg_to_vf (hw, vf_id,VIRTCHNL_OP_IWARP , + err =i40e_aq_send_msg_to_vf (hw, vf_id,VIRTCHNL_OP_RDMA ,0 , msg, len,NULL );if (err) dev_err(&pf->pdev->dev, "Unable to send iWarp message to VF, error %d, aq status %d\n",
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +32 -31
159 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h +3 -3
@@ -34,7 +34,7 @@ enum i40e_queue_ctrl {enum i40e_vf_states {I40E_VF_STATE_INIT =0 ,I40E_VF_STATE_ACTIVE , -I40E_VF_STATE_IWARPENA , +I40E_VF_STATE_RDMAENA ,I40E_VF_STATE_DISABLED ,I40E_VF_STATE_MC_PROMISC ,I40E_VF_STATE_UC_PROMISC ,
@@ -46,7 +46,7 @@ enum i40e_vf_states {enum i40e_vf_capabilities {I40E_VIRTCHNL_VF_CAP_PRIVILEGE =0 ,I40E_VIRTCHNL_VF_CAP_L2 , -I40E_VIRTCHNL_VF_CAP_IWARP , +I40E_VIRTCHNL_VF_CAP_RDMA , };/* In ADq, max 4 VSI's can be allocated per VF including primary VF VSI.
@@ -108,7 +108,7 @@ struct i40e_vf {u16 num_cloud_filters;/* RDMA Client */ -struct virtchnl_iwarp_qvlist_info *qvlist_info; +struct virtchnl_rdma_qvlist_info *qvlist_info; };void i40e_free_vfs (struct i40e_pf *pf);
drivers/net/ethernet/intel/iavf/iavf.h +3 -3
@@ -275,8 +275,8 @@ struct iavf_adapter {u64 hw_csum_rx_error;u32 rx_desc_count;int num_msix_vectors; -int num_iwarp_msix; -int iwarp_base_vector; +int num_rdma_msix; +int rdma_base_vector;u32 client_pending;struct iavf_client_instance *cinst;struct msix_entry *msix_entries;
@@ -383,7 +383,7 @@ struct iavf_adapter {enum virtchnl_ops current_op;#define CLIENT_ALLOWED (_a) ((_a)->vf_res ? \ (_a)->vf_res->vf_cap_flags & \ - VIRTCHNL_VF_OFFLOAD_IWARP : \ + VIRTCHNL_VF_OFFLOAD_RDMA : \ 0)#define CLIENT_ENABLED (_a) ((_a)->cinst)/* RSS by the PF should be preferred over RSS via other methods. */
drivers/net/ethernet/intel/iavf/iavf_client.c +16 -16
@@ -127,7 +127,7 @@ void iavf_notify_client_open(struct iavf_vsi *vsi) }/** -* iavf_client_release_qvlist - send a message to the PF to release iwarp qv map +* iavf_client_release_qvlist - send a message to the PF to release rdma qv map * @ldev: pointer to L2 context. * * Return 0 on success or < 0 on error
@@ -141,12 +141,12 @@ static int iavf_client_release_qvlist(struct iavf_info *ldev)return -EAGAIN ; err =iavf_aq_send_msg_to_pf (&adapter->hw, -VIRTCHNL_OP_RELEASE_IWARP_IRQ_MAP , +VIRTCHNL_OP_RELEASE_RDMA_IRQ_MAP ,IAVF_SUCCESS ,NULL ,0 ,NULL );if (err)dev_err (&adapter->pdev->dev, -"Unable to send iWarp vector release message to PF, error %d, aq status %d\n" , +"Unable to send RDMA vector release message to PF, error %d, aq status %d\n" , err, adapter->hw.aq.asq_last_status);return err;
@@ -215,9 +215,9 @@ iavf_client_add_instance(struct iavf_adapter *adapter) cinst->lan_info.params = params;set_bit (__IAVF_CLIENT_INSTANCE_NONE, &cinst->state); - cinst->lan_info.msix_count = adapter->num_iwarp_msix; + cinst->lan_info.msix_count = adapter->num_rdma_msix; cinst->lan_info.msix_entries = - &adapter->msix_entries[adapter->iwarp_base_vector]; + &adapter->msix_entries[adapter->rdma_base_vector]; mac =list_first_entry (&cinst->lan_info.netdev->dev_addrs.list, struct netdev_hw_addr, list);
@@ -425,17 +425,17 @@ static u32 iavf_client_virtchnl_send(struct iavf_info *ldev,if (adapter->aq_required)return -EAGAIN ; - err =iavf_aq_send_msg_to_pf (&adapter->hw,VIRTCHNL_OP_IWARP , + err =iavf_aq_send_msg_to_pf (&adapter->hw,VIRTCHNL_OP_RDMA ,IAVF_SUCCESS , msg, len,NULL );if (err) -dev_err (&adapter->pdev->dev,"Unable to send iWarp message to PF, error %d, aq status %d\n" , +dev_err (&adapter->pdev->dev,"Unable to send RDMA message to PF, error %d, aq status %d\n" , err, adapter->hw.aq.asq_last_status);return err; }/** -* iavf_client_setup_qvlist - send a message to the PF to setup iwarp qv map +* iavf_client_setup_qvlist - send a message to the PF to setup rdma qv map * @ldev: pointer to L2 context. * @client: Client pointer. * @qvlist_info: queue and vector list
@@ -446,7 +446,7 @@ static int iavf_client_setup_qvlist(struct iavf_info *ldev,struct iavf_client *client, struct iavf_qvlist_info *qvlist_info) { - struct virtchnl_iwarp_qvlist_info *v_qvlist_info; + struct virtchnl_rdma_qvlist_info *v_qvlist_info;struct iavf_adapter *adapter = ldev->vf;struct iavf_qv_info *qv_info;enum iavf_status err;
@@ -463,23 +463,23 @@ static int iavf_client_setup_qvlist(struct iavf_info *ldev,continue ; v_idx = qv_info->v_idx;if ((v_idx >= - (adapter->iwarp_base_vector + adapter->num_iwarp_msix)) || - (v_idx < adapter->iwarp_base_vector)) + (adapter->rdma_base_vector + adapter->num_rdma_msix)) || + (v_idx < adapter->rdma_base_vector))return -EINVAL ; } - v_qvlist_info = (struct virtchnl_iwarp_qvlist_info *)qvlist_info; + v_qvlist_info = (struct virtchnl_rdma_qvlist_info *)qvlist_info; msg_size =struct_size (v_qvlist_info, qv_info, v_qvlist_info->num_vectors -1 ); - adapter->client_pending |=BIT (VIRTCHNL_OP_CONFIG_IWARP_IRQ_MAP ); + adapter->client_pending |=BIT (VIRTCHNL_OP_CONFIG_RDMA_IRQ_MAP ); err =iavf_aq_send_msg_to_pf (&adapter->hw, -VIRTCHNL_OP_CONFIG_IWARP_IRQ_MAP ,IAVF_SUCCESS , +VIRTCHNL_OP_CONFIG_RDMA_IRQ_MAP ,IAVF_SUCCESS , (u8 *)v_qvlist_info, msg_size,NULL );if (err) {dev_err (&adapter->pdev->dev, -"Unable to send iWarp vector config message to PF, error %d, aq status %d\n" , +"Unable to send RDMA vector config message to PF, error %d, aq status %d\n" , err, adapter->hw.aq.asq_last_status); goto out; }
@@ -488,7 +488,7 @@ static int iavf_client_setup_qvlist(struct iavf_info *ldev,for (i =0 ; i <5 ; i++) {msleep (100 );if (!(adapter->client_pending & -BIT (VIRTCHNL_OP_CONFIG_IWARP_IRQ_MAP ))) { +BIT (VIRTCHNL_OP_CONFIG_RDMA_IRQ_MAP ))) { err =0 ;break ; }
drivers/net/ethernet/intel/iavf/iavf_client.h +1 -1
@@ -159,7 +159,7 @@ struct iavf_client {#define IAVF_CLIENT_FLAGS_LAUNCH_ON_PROBE BIT(0)#define IAVF_TX_FLAGS_NOTIFY_OTHER_EVENTS BIT(2)u8 type; -#define IAVF_CLIENT_IWARP 0 +#define IAVF_CLIENT_RDMA 0struct iavf_client_ops *ops;/* client ops provided by the client */ };
drivers/net/ethernet/intel/iavf/iavf_common.c +2 -2
@@ -223,8 +223,8 @@ const char *iavf_stat_str(struct iavf_hw *hw, enum iavf_status stat_err)return "IAVF_ERR_ADMIN_QUEUE_FULL" ;case IAVF_ERR_ADMIN_QUEUE_NO_WORK :return "IAVF_ERR_ADMIN_QUEUE_NO_WORK" ; -case IAVF_ERR_BAD_IWARP_CQE : -return "IAVF_ERR_BAD_IWARP_CQE" ; +case IAVF_ERR_BAD_RDMA_CQE : +return "IAVF_ERR_BAD_RDMA_CQE" ;case IAVF_ERR_NVM_BLANK_MODE :return "IAVF_ERR_NVM_BLANK_MODE" ;case IAVF_ERR_NOT_IMPLEMENTED :
drivers/net/ethernet/intel/iavf/iavf_main.c +1 -1
@@ -106,7 +106,7 @@ int iavf_status_to_errno(enum iavf_status status)case IAVF_ERR_SRQ_ENABLED :case IAVF_ERR_ADMIN_QUEUE_ERROR :case IAVF_ERR_ADMIN_QUEUE_FULL : -case IAVF_ERR_BAD_IWARP_CQE : +case IAVF_ERR_BAD_RDMA_CQE :case IAVF_ERR_NVM_BLANK_MODE :case IAVF_ERR_PE_DOORBELL_NOT_ENABLED :case IAVF_ERR_DIAG_TEST_FAILED :
drivers/net/ethernet/intel/iavf/iavf_status.h +1 -1
@@ -64,7 +64,7 @@ enum iavf_status {IAVF_ERR_BUF_TOO_SHORT =-55 ,IAVF_ERR_ADMIN_QUEUE_FULL =-56 ,IAVF_ERR_ADMIN_QUEUE_NO_WORK =-57 , -IAVF_ERR_BAD_IWARP_CQE =-58 , +IAVF_ERR_BAD_RDMA_CQE =-58 ,IAVF_ERR_NVM_BLANK_MODE =-59 ,IAVF_ERR_NOT_IMPLEMENTED =-60 , IAVF_ERR_PE_DOORBELL_NOT_ENABLED = -61,
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +3 -3
@@ -2290,7 +2290,7 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,if (v_opcode != adapter->current_op)return ;break ; -case VIRTCHNL_OP_IWARP : +case VIRTCHNL_OP_RDMA :/* Gobble zero-length replies from the PF. They indicate that * a previous message was received OK, and the client doesn't * care about that.
@@ -2299,9 +2299,9 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,iavf_notify_client_message (&adapter->vsi, msg, msglen);break ; -case VIRTCHNL_OP_CONFIG_IWARP_IRQ_MAP : +case VIRTCHNL_OP_CONFIG_RDMA_IRQ_MAP : adapter->client_pending &= - ~(BIT (VIRTCHNL_OP_CONFIG_IWARP_IRQ_MAP )); + ~(BIT (VIRTCHNL_OP_CONFIG_RDMA_IRQ_MAP ));break ;case VIRTCHNL_OP_GET_RSS_HENA_CAPS : {struct virtchnl_rss_hena *vrh = (struct virtchnl_rss_hena *)msg;
include/linux/avf/virtchnl.h +37 -28
132 lines not on this page · raw message
Signature · 6 lines
2.31.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
A message that is not in the archive (sent off-list or not yet received): BN7PR11MB2788EDE812D1209E725FD0B9E6C99@BN7PR11MB2788.namprd11.prod.outlook.com
Kaliszczuk, Leszek
Tested-by Jakub AndrysiakRe: [Intel-wired-lan] [PATCH net-next v1 4/4] virtchnl: i40e/ice/iavf: rename iwarp to rdma
Quoted 24 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Jesse Brandeburg
Sent: Friday, December 16, 2022 9:07 PM
To: [email protected]
Cc: Brandeburg, Jesse <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next v1 4/4] virtchnl: i40e/ice/iavf:
rename iwarp to rdmaSince the latest Intel hardware does both IWARP and ROCE, rename the term IWARP in the virtchnl header to be RDMA. Do this for both upper and lower case instances. Many of the
non-virtchnl.hchanges were done with regular expression replacements using perl like:
perl -p -i -e 's/_IWARP/_RDMA/' <files>
perl -p -i -e 's/_iwarp/_rdma/' <files>
and I had to pick up a few instances manually.The
virtchnl.hheader has some comments and clarity added around when to use certain defines.note: had to fix a checkpatch warning for a long line by wrapping one of the lines I changed.
Signed-off-by Jesse Brandeburg <[email protected]>
Quoted 14 lines
--- drivers/net/ethernet/intel/i40e/i40e_client.c | 2 +- .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 63 +++++++++--------- .../ethernet/intel/i40e/i40e_virtchnl_pf.h | 6 +- drivers/net/ethernet/intel/iavf/iavf.h | 6 +- drivers/net/ethernet/intel/iavf/iavf_client.c | 32 ++++----- drivers/net/ethernet/intel/iavf/iavf_client.h | 2 +- drivers/net/ethernet/intel/iavf/iavf_common.c | 4 +- drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +- drivers/net/ethernet/intel/iavf/iavf_status.h | 2 +- .../net/ethernet/intel/iavf/iavf_virtchnl.c | 6 +- include/linux/avf/virtchnl.h | 65 +++++++++++-------- 11 files changed, 100 insertions(+), 90 deletions(-)
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan