[ovs-dev] [PATCH dpdk-latest 2/2] netdev-dpdk: Fix build with 21.11-rc1.

Stokes, Ian ian.stokes at intel.com
Tue Nov 2 14:39:51 UTC 2021


> > PKT_[RT]X_* and other mbuf macros have been prefixed with RTE_MBUF_ [1].
> > Update accordingly.
> >
> > 1: https://git.dpdk.org/dpdk/commit/?id=daa02b5cddbb
> >
> > Signed-off-by: David Marchand <david.marchand at redhat.com>
> 
> HI David, thanks for the patches, I was just running these through github and
> spotted there was a failure in the build not sure if it's related to these patches or
> possibly a different patch that has been upstream to DPDK main and may require
> a follow on patch
> 
> Error and build link below.

Apologies, forgot to add the build link.

https://github.com/istokes/ovs/actions/runs/1412616124

Regards
Ian
> 
> ../../lib/ofp-packet.c: note: in included file (through
> /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h, ../../lib/netdev-
> dpdk.h, ../../lib/dp-packet.h):
> /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_l2tpv2.h:92:37: error:
> invalid bitfield specifier for type restricted ovs_be16.
> /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_l2tpv2.h:93:37: error:
> invalid bitfield specifier for type restricted ovs_be16.
> /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_l2tpv2.h:94:40: error:
> invalid bitfield specifier for type restricted ovs_be16.
> /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_l2tpv2.h:95:37: error:
> invalid bitfield specifier for type restricted ovs_be16.
> /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_l2tpv2.h:96:40: error:
> invalid bitfield specifier for type restricted ovs_be16.
> /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_l2tpv2.h:97:37: error:
> invalid bitfield specifier for type restricted ovs_be16.
> /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_l2tpv2.h:98:37: error:
> invalid bitfield specifier for type restricted ovs_be16.
> /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_l2tpv2.h:99:40: error:
> invalid bitfield specifier for type restricted ovs_be16.
> /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_l2tpv2.h:100:39: error:
> invalid bitfield specifier for type restricted ovs_be16.
> 
> 
> Regards
> Ian
> 
> > ---
> >  lib/dp-packet.h   | 26 ++++++++++++++------------
> >  lib/netdev-dpdk.c | 18 +++++++++---------
> >  2 files changed, 23 insertions(+), 21 deletions(-)
> >
> > diff --git a/lib/dp-packet.h b/lib/dp-packet.h
> > index 3dc582fbfd..ee0805ae69 100644
> > --- a/lib/dp-packet.h
> > +++ b/lib/dp-packet.h
> > @@ -58,29 +58,31 @@ enum OVS_PACKED_ENUM dp_packet_source {
> >  enum dp_packet_offload_mask {
> >      /* Value 0 is not used. */
> >      /* Is the 'rss_hash' valid? */
> > -    DEF_OL_FLAG(DP_PACKET_OL_RSS_HASH, PKT_RX_RSS_HASH, 0x1),
> > +    DEF_OL_FLAG(DP_PACKET_OL_RSS_HASH, RTE_MBUF_F_RX_RSS_HASH,
> > 0x1),
> >      /* Is the 'flow_mark' valid? */
> > -    DEF_OL_FLAG(DP_PACKET_OL_FLOW_MARK, PKT_RX_FDIR_ID, 0x2),
> > +    DEF_OL_FLAG(DP_PACKET_OL_FLOW_MARK, RTE_MBUF_F_RX_FDIR_ID,
> > 0x2),
> >      /* Bad L4 checksum in the packet. */
> > -    DEF_OL_FLAG(DP_PACKET_OL_RX_L4_CKSUM_BAD,
> > PKT_RX_L4_CKSUM_BAD, 0x4),
> > +    DEF_OL_FLAG(DP_PACKET_OL_RX_L4_CKSUM_BAD,
> > RTE_MBUF_F_RX_L4_CKSUM_BAD, 0x4),
> >      /* Bad IP checksum in the packet. */
> > -    DEF_OL_FLAG(DP_PACKET_OL_RX_IP_CKSUM_BAD,
> > PKT_RX_IP_CKSUM_BAD, 0x8),
> > +    DEF_OL_FLAG(DP_PACKET_OL_RX_IP_CKSUM_BAD,
> > RTE_MBUF_F_RX_IP_CKSUM_BAD, 0x8),
> >      /* Valid L4 checksum in the packet. */
> > -    DEF_OL_FLAG(DP_PACKET_OL_RX_L4_CKSUM_GOOD,
> > PKT_RX_L4_CKSUM_GOOD, 0x10),
> > +    DEF_OL_FLAG(DP_PACKET_OL_RX_L4_CKSUM_GOOD,
> > RTE_MBUF_F_RX_L4_CKSUM_GOOD,
> > +                0x10),
> >      /* Valid IP checksum in the packet. */
> > -    DEF_OL_FLAG(DP_PACKET_OL_RX_IP_CKSUM_GOOD,
> > PKT_RX_IP_CKSUM_GOOD, 0x20),
> > +    DEF_OL_FLAG(DP_PACKET_OL_RX_IP_CKSUM_GOOD,
> > RTE_MBUF_F_RX_IP_CKSUM_GOOD,
> > +                0x20),
> >      /* TCP Segmentation Offload. */
> > -    DEF_OL_FLAG(DP_PACKET_OL_TX_TCP_SEG, PKT_TX_TCP_SEG, 0x40),
> > +    DEF_OL_FLAG(DP_PACKET_OL_TX_TCP_SEG, RTE_MBUF_F_TX_TCP_SEG,
> > 0x40),
> >      /* Offloaded packet is IPv4. */
> > -    DEF_OL_FLAG(DP_PACKET_OL_TX_IPV4, PKT_TX_IPV4, 0x80),
> > +    DEF_OL_FLAG(DP_PACKET_OL_TX_IPV4, RTE_MBUF_F_TX_IPV4, 0x80),
> >      /* Offloaded packet is IPv6. */
> > -    DEF_OL_FLAG(DP_PACKET_OL_TX_IPV6, PKT_TX_IPV6, 0x100),
> > +    DEF_OL_FLAG(DP_PACKET_OL_TX_IPV6, RTE_MBUF_F_TX_IPV6, 0x100),
> >      /* Offload TCP checksum. */
> > -    DEF_OL_FLAG(DP_PACKET_OL_TX_TCP_CKSUM, PKT_TX_TCP_CKSUM,
> > 0x200),
> > +    DEF_OL_FLAG(DP_PACKET_OL_TX_TCP_CKSUM,
> > RTE_MBUF_F_TX_TCP_CKSUM, 0x200),
> >      /* Offload UDP checksum. */
> > -    DEF_OL_FLAG(DP_PACKET_OL_TX_UDP_CKSUM, PKT_TX_UDP_CKSUM,
> > 0x400),
> > +    DEF_OL_FLAG(DP_PACKET_OL_TX_UDP_CKSUM,
> > RTE_MBUF_F_TX_UDP_CKSUM, 0x400),
> >      /* Offload SCTP checksum. */
> > -    DEF_OL_FLAG(DP_PACKET_OL_TX_SCTP_CKSUM, PKT_TX_SCTP_CKSUM,
> > 0x800),
> > +    DEF_OL_FLAG(DP_PACKET_OL_TX_SCTP_CKSUM,
> > RTE_MBUF_F_TX_SCTP_CKSUM, 0x800),
> >      /* Adding new field requires adding to DP_PACKET_OL_SUPPORTED_MASK.
> > */
> >  };
> >
> > diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> > index 6d3fd6beda..db08aec440 100644
> > --- a/lib/netdev-dpdk.c
> > +++ b/lib/netdev-dpdk.c
> > @@ -2165,14 +2165,14 @@ netdev_dpdk_prep_hwol_packet(struct
> > netdev_dpdk *dev, struct rte_mbuf *mbuf)
> >  {
> >      struct dp_packet *pkt = CONTAINER_OF(mbuf, struct dp_packet, mbuf);
> >
> > -    if (mbuf->ol_flags & PKT_TX_L4_MASK) {
> > +    if (mbuf->ol_flags & RTE_MBUF_F_TX_L4_MASK) {
> >          mbuf->l2_len = (char *)dp_packet_l3(pkt) - (char *)dp_packet_eth(pkt);
> >          mbuf->l3_len = (char *)dp_packet_l4(pkt) - (char *)dp_packet_l3(pkt);
> >          mbuf->outer_l2_len = 0;
> >          mbuf->outer_l3_len = 0;
> >      }
> >
> > -    if (mbuf->ol_flags & PKT_TX_TCP_SEG) {
> > +    if (mbuf->ol_flags & RTE_MBUF_F_TX_TCP_SEG) {
> >          struct tcp_header *th = dp_packet_l4(pkt);
> >
> >          if (!th) {
> > @@ -2182,11 +2182,11 @@ netdev_dpdk_prep_hwol_packet(struct
> > netdev_dpdk *dev, struct rte_mbuf *mbuf)
> >          }
> >
> >          mbuf->l4_len = TCP_OFFSET(th->tcp_ctl) * 4;
> > -        mbuf->ol_flags |= PKT_TX_TCP_CKSUM;
> > +        mbuf->ol_flags |= RTE_MBUF_F_TX_TCP_CKSUM;
> >          mbuf->tso_segsz = dev->mtu - mbuf->l3_len - mbuf->l4_len;
> >
> > -        if (mbuf->ol_flags & PKT_TX_IPV4) {
> > -            mbuf->ol_flags |= PKT_TX_IP_CKSUM;
> > +        if (mbuf->ol_flags & RTE_MBUF_F_TX_IPV4) {
> > +            mbuf->ol_flags |= RTE_MBUF_F_TX_IP_CKSUM;
> >          }
> >      }
> >      return true;
> > @@ -2533,7 +2533,7 @@ netdev_dpdk_filter_packet_len(struct netdev_dpdk
> > *dev, struct rte_mbuf **pkts,
> >      for (i = 0; i < pkt_cnt; i++) {
> >          pkt = pkts[i];
> >          if (OVS_UNLIKELY((pkt->pkt_len > dev->max_packet_len)
> > -            && !(pkt->ol_flags & PKT_TX_TCP_SEG))) {
> > +            && !(pkt->ol_flags & RTE_MBUF_F_TX_TCP_SEG))) {
> >              VLOG_WARN_RL(&rl, "%s: Too big size %" PRIu32 " "
> >                           "max_packet_len %d", dev->up.name, pkt->pkt_len,
> >                           dev->max_packet_len);
> > @@ -2755,12 +2755,12 @@ dpdk_copy_dp_packet_to_mbuf(struct
> > rte_mempool *mp, struct dp_packet *pkt_orig)
> >      mbuf_dest->tx_offload = pkt_orig->mbuf.tx_offload;
> >      mbuf_dest->packet_type = pkt_orig->mbuf.packet_type;
> >      mbuf_dest->ol_flags |= (pkt_orig->mbuf.ol_flags &
> > -                            ~(EXT_ATTACHED_MBUF | IND_ATTACHED_MBUF));
> > +                            ~(RTE_MBUF_F_EXTERNAL | RTE_MBUF_F_INDIRECT));
> >
> >      memcpy(&pkt_dest->l2_pad_size, &pkt_orig->l2_pad_size,
> >             sizeof(struct dp_packet) - offsetof(struct dp_packet, l2_pad_size));
> >
> > -    if (mbuf_dest->ol_flags & PKT_TX_L4_MASK) {
> > +    if (mbuf_dest->ol_flags & RTE_MBUF_F_TX_L4_MASK) {
> >          mbuf_dest->l2_len = (char *)dp_packet_l3(pkt_dest)
> >                                  - (char *)dp_packet_eth(pkt_dest);
> >          mbuf_dest->l3_len = (char *)dp_packet_l4(pkt_dest)
> > @@ -2805,7 +2805,7 @@ dpdk_do_tx_copy(struct netdev *netdev, int qid,
> > struct dp_packet_batch *batch)
> >          uint32_t size = dp_packet_size(packet);
> >
> >          if (size > dev->max_packet_len
> > -            && !(packet->mbuf.ol_flags & PKT_TX_TCP_SEG)) {
> > +            && !(packet->mbuf.ol_flags & RTE_MBUF_F_TX_TCP_SEG)) {
> >              VLOG_WARN_RL(&rl, "Too big size %u max_packet_len %d", size,
> >                           dev->max_packet_len);
> >              mtu_drops++;
> > --
> > 2.23.0



More information about the dev mailing list