@@ -595,7 +595,7 @@ static bool idpf_rx_singleq_is_non_eop(const union virtchnl2_rx_desc *rx_desc)
595595 */
596596static void idpf_rx_singleq_csum (struct idpf_rx_queue * rxq ,
597597 struct sk_buff * skb ,
598- struct idpf_rx_csum_decoded csum_bits ,
598+ struct libeth_rx_csum csum_bits ,
599599 struct libeth_rx_pt decoded )
600600{
601601 bool ipv4 , ipv6 ;
@@ -661,10 +661,10 @@ static void idpf_rx_singleq_csum(struct idpf_rx_queue *rxq,
661661 *
662662 * Return: parsed checksum status.
663663 **/
664- static struct idpf_rx_csum_decoded
664+ static struct libeth_rx_csum
665665idpf_rx_singleq_base_csum (const union virtchnl2_rx_desc * rx_desc )
666666{
667- struct idpf_rx_csum_decoded csum_bits = { };
667+ struct libeth_rx_csum csum_bits = { };
668668 u32 rx_error , rx_status ;
669669 u64 qword ;
670670
@@ -696,10 +696,10 @@ idpf_rx_singleq_base_csum(const union virtchnl2_rx_desc *rx_desc)
696696 *
697697 * Return: parsed checksum status.
698698 **/
699- static struct idpf_rx_csum_decoded
699+ static struct libeth_rx_csum
700700idpf_rx_singleq_flex_csum (const union virtchnl2_rx_desc * rx_desc )
701701{
702- struct idpf_rx_csum_decoded csum_bits = { };
702+ struct libeth_rx_csum csum_bits = { };
703703 u16 rx_status0 , rx_status1 ;
704704
705705 rx_status0 = le16_to_cpu (rx_desc -> flex_nic_wb .status_error0 );
@@ -798,7 +798,7 @@ idpf_rx_singleq_process_skb_fields(struct idpf_rx_queue *rx_q,
798798 u16 ptype )
799799{
800800 struct libeth_rx_pt decoded = rx_q -> rx_ptype_lkup [ptype ];
801- struct idpf_rx_csum_decoded csum_bits ;
801+ struct libeth_rx_csum csum_bits ;
802802
803803 /* modifies the skb - consumes the enet header */
804804 skb -> protocol = eth_type_trans (skb , rx_q -> netdev );
@@ -891,6 +891,7 @@ bool idpf_rx_singleq_buf_hw_alloc_all(struct idpf_rx_queue *rx_q,
891891 * idpf_rx_singleq_extract_base_fields - Extract fields from the Rx descriptor
892892 * @rx_desc: the descriptor to process
893893 * @fields: storage for extracted values
894+ * @ptype: pointer that will store packet type
894895 *
895896 * Decode the Rx descriptor and extract relevant information including the
896897 * size and Rx packet type.
@@ -900,20 +901,21 @@ bool idpf_rx_singleq_buf_hw_alloc_all(struct idpf_rx_queue *rx_q,
900901 */
901902static void
902903idpf_rx_singleq_extract_base_fields (const union virtchnl2_rx_desc * rx_desc ,
903- struct idpf_rx_extracted * fields )
904+ struct libeth_rqe_info * fields , u32 * ptype )
904905{
905906 u64 qword ;
906907
907908 qword = le64_to_cpu (rx_desc -> base_wb .qword1 .status_error_ptype_len );
908909
909- fields -> size = FIELD_GET (VIRTCHNL2_RX_BASE_DESC_QW1_LEN_PBUF_M , qword );
910- fields -> rx_ptype = FIELD_GET (VIRTCHNL2_RX_BASE_DESC_QW1_PTYPE_M , qword );
910+ fields -> len = FIELD_GET (VIRTCHNL2_RX_BASE_DESC_QW1_LEN_PBUF_M , qword );
911+ * ptype = FIELD_GET (VIRTCHNL2_RX_BASE_DESC_QW1_PTYPE_M , qword );
911912}
912913
913914/**
914915 * idpf_rx_singleq_extract_flex_fields - Extract fields from the Rx descriptor
915916 * @rx_desc: the descriptor to process
916917 * @fields: storage for extracted values
918+ * @ptype: pointer that will store packet type
917919 *
918920 * Decode the Rx descriptor and extract relevant information including the
919921 * size and Rx packet type.
@@ -923,30 +925,31 @@ idpf_rx_singleq_extract_base_fields(const union virtchnl2_rx_desc *rx_desc,
923925 */
924926static void
925927idpf_rx_singleq_extract_flex_fields (const union virtchnl2_rx_desc * rx_desc ,
926- struct idpf_rx_extracted * fields )
928+ struct libeth_rqe_info * fields , u32 * ptype )
927929{
928- fields -> size = FIELD_GET (VIRTCHNL2_RX_FLEX_DESC_PKT_LEN_M ,
929- le16_to_cpu (rx_desc -> flex_nic_wb .pkt_len ));
930- fields -> rx_ptype = FIELD_GET (VIRTCHNL2_RX_FLEX_DESC_PTYPE_M ,
931- le16_to_cpu (rx_desc -> flex_nic_wb .ptype_flex_flags0 ));
930+ fields -> len = FIELD_GET (VIRTCHNL2_RX_FLEX_DESC_PKT_LEN_M ,
931+ le16_to_cpu (rx_desc -> flex_nic_wb .pkt_len ));
932+ * ptype = FIELD_GET (VIRTCHNL2_RX_FLEX_DESC_PTYPE_M ,
933+ le16_to_cpu (rx_desc -> flex_nic_wb .ptype_flex_flags0 ));
932934}
933935
934936/**
935937 * idpf_rx_singleq_extract_fields - Extract fields from the Rx descriptor
936938 * @rx_q: Rx descriptor queue
937939 * @rx_desc: the descriptor to process
938940 * @fields: storage for extracted values
941+ * @ptype: pointer that will store packet type
939942 *
940943 */
941944static void
942945idpf_rx_singleq_extract_fields (const struct idpf_rx_queue * rx_q ,
943946 const union virtchnl2_rx_desc * rx_desc ,
944- struct idpf_rx_extracted * fields )
947+ struct libeth_rqe_info * fields , u32 * ptype )
945948{
946949 if (rx_q -> rxdids == VIRTCHNL2_RXDID_1_32B_BASE_M )
947- idpf_rx_singleq_extract_base_fields (rx_desc , fields );
950+ idpf_rx_singleq_extract_base_fields (rx_desc , fields , ptype );
948951 else
949- idpf_rx_singleq_extract_flex_fields (rx_desc , fields );
952+ idpf_rx_singleq_extract_flex_fields (rx_desc , fields , ptype );
950953}
951954
952955/**
@@ -966,9 +969,10 @@ static int idpf_rx_singleq_clean(struct idpf_rx_queue *rx_q, int budget)
966969
967970 /* Process Rx packets bounded by budget */
968971 while (likely (total_rx_pkts < (unsigned int )budget )) {
969- struct idpf_rx_extracted fields = { };
972+ struct libeth_rqe_info fields = { };
970973 union virtchnl2_rx_desc * rx_desc ;
971974 struct idpf_rx_buf * rx_buf ;
975+ u32 ptype ;
972976
973977 /* get the Rx desc from Rx queue based on 'next_to_clean' */
974978 rx_desc = & rx_q -> rx [ntc ];
@@ -989,16 +993,16 @@ static int idpf_rx_singleq_clean(struct idpf_rx_queue *rx_q, int budget)
989993 */
990994 dma_rmb ();
991995
992- idpf_rx_singleq_extract_fields (rx_q , rx_desc , & fields );
996+ idpf_rx_singleq_extract_fields (rx_q , rx_desc , & fields , & ptype );
993997
994998 rx_buf = & rx_q -> rx_buf [ntc ];
995- if (!libeth_rx_sync_for_cpu (rx_buf , fields .size ))
999+ if (!libeth_rx_sync_for_cpu (rx_buf , fields .len ))
9961000 goto skip_data ;
9971001
9981002 if (skb )
999- idpf_rx_add_frag (rx_buf , skb , fields .size );
1003+ idpf_rx_add_frag (rx_buf , skb , fields .len );
10001004 else
1001- skb = idpf_rx_build_skb (rx_buf , fields .size );
1005+ skb = idpf_rx_build_skb (rx_buf , fields .len );
10021006
10031007 /* exit if we failed to retrieve a buffer */
10041008 if (!skb )
@@ -1033,8 +1037,7 @@ static int idpf_rx_singleq_clean(struct idpf_rx_queue *rx_q, int budget)
10331037 total_rx_bytes += skb -> len ;
10341038
10351039 /* protocol */
1036- idpf_rx_singleq_process_skb_fields (rx_q , skb ,
1037- rx_desc , fields .rx_ptype );
1040+ idpf_rx_singleq_process_skb_fields (rx_q , skb , rx_desc , ptype );
10381041
10391042 /* send completed skb up the stack */
10401043 napi_gro_receive (rx_q -> pp -> p .napi , skb );
0 commit comments