mirror of
https://github.com/openvswitch/ovs
synced 2025-08-29 05:18:13 +00:00
dp-packet: Remove direct access to DPDK offloads.
Now that every use of ol_flags have been reworked, we can remove helper and additional field in dp_packet when not building with DPDK. Signed-off-by: David Marchand <david.marchand@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
parent
cf7b86db1f
commit
b8032fac2c
@ -56,11 +56,6 @@ dp_packet_gso_seg_new(const struct dp_packet *p, size_t hdr_len,
|
|||||||
seg->has_mark = p->has_mark;
|
seg->has_mark = p->has_mark;
|
||||||
*dp_packet_flow_mark_ptr(seg) = *dp_packet_flow_mark_ptr(p);
|
*dp_packet_flow_mark_ptr(seg) = *dp_packet_flow_mark_ptr(p);
|
||||||
|
|
||||||
/* The segment should inherit all the offloading flags from the
|
|
||||||
* original packet, except for the TCP segmentation, external
|
|
||||||
* buffer and indirect buffer flags. */
|
|
||||||
*dp_packet_ol_flags_ptr(seg) = *dp_packet_ol_flags_ptr(p)
|
|
||||||
& DP_PACKET_OL_SUPPORTED_MASK;
|
|
||||||
seg->offloads = p->offloads;
|
seg->offloads = p->offloads;
|
||||||
|
|
||||||
return seg;
|
return seg;
|
||||||
|
@ -198,9 +198,6 @@ dp_packet_clone_with_headroom(const struct dp_packet *buffer, size_t headroom)
|
|||||||
sizeof(struct dp_packet) -
|
sizeof(struct dp_packet) -
|
||||||
offsetof(struct dp_packet, l2_pad_size));
|
offsetof(struct dp_packet, l2_pad_size));
|
||||||
|
|
||||||
*dp_packet_ol_flags_ptr(new_buffer) = *dp_packet_ol_flags_ptr(buffer);
|
|
||||||
*dp_packet_ol_flags_ptr(new_buffer) &= DP_PACKET_OL_SUPPORTED_MASK;
|
|
||||||
|
|
||||||
dp_packet_set_tso_segsz(new_buffer, dp_packet_get_tso_segsz(buffer));
|
dp_packet_set_tso_segsz(new_buffer, dp_packet_get_tso_segsz(buffer));
|
||||||
|
|
||||||
if (dp_packet_rss_valid(buffer)) {
|
if (dp_packet_rss_valid(buffer)) {
|
||||||
|
@ -49,14 +49,6 @@ enum OVS_PACKED_ENUM dp_packet_source {
|
|||||||
|
|
||||||
#define DP_PACKET_CONTEXT_SIZE 64
|
#define DP_PACKET_CONTEXT_SIZE 64
|
||||||
|
|
||||||
#ifdef DPDK_NETDEV
|
|
||||||
#define DEF_OL_FLAG(NAME, DPDK_DEF, GENERIC_DEF) NAME = DPDK_DEF
|
|
||||||
#else
|
|
||||||
#define DEF_OL_FLAG(NAME, DPDK_DEF, GENERIC_DEF) NAME = GENERIC_DEF
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define DP_PACKET_OL_SUPPORTED_MASK 0
|
|
||||||
|
|
||||||
/* Bit masks for the 'offloads' member of the 'dp_packet' structure. */
|
/* Bit masks for the 'offloads' member of the 'dp_packet' structure. */
|
||||||
enum OVS_PACKED_ENUM dp_packet_offload_mask {
|
enum OVS_PACKED_ENUM dp_packet_offload_mask {
|
||||||
/* Bad IP checksum in the packet. */
|
/* Bad IP checksum in the packet. */
|
||||||
@ -133,7 +125,6 @@ struct dp_packet {
|
|||||||
uint16_t allocated_; /* Number of bytes allocated. */
|
uint16_t allocated_; /* Number of bytes allocated. */
|
||||||
uint16_t data_ofs; /* First byte actually in use. */
|
uint16_t data_ofs; /* First byte actually in use. */
|
||||||
uint32_t size_; /* Number of bytes in use. */
|
uint32_t size_; /* Number of bytes in use. */
|
||||||
uint32_t ol_flags; /* Offloading flags. */
|
|
||||||
uint32_t rss_hash; /* Packet hash. */
|
uint32_t rss_hash; /* Packet hash. */
|
||||||
uint32_t flow_mark; /* Packet flow mark. */
|
uint32_t flow_mark; /* Packet flow mark. */
|
||||||
uint16_t tso_segsz; /* TCP segment size. */
|
uint16_t tso_segsz; /* TCP segment size. */
|
||||||
@ -623,12 +614,6 @@ dp_packet_get_nd_payload(const struct dp_packet *b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DPDK_NETDEV
|
#ifdef DPDK_NETDEV
|
||||||
static inline uint64_t *
|
|
||||||
dp_packet_ol_flags_ptr(const struct dp_packet *b)
|
|
||||||
{
|
|
||||||
return CONST_CAST(uint64_t *, &b->mbuf.ol_flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint32_t *
|
static inline uint32_t *
|
||||||
dp_packet_rss_ptr(const struct dp_packet *b)
|
dp_packet_rss_ptr(const struct dp_packet *b)
|
||||||
{
|
{
|
||||||
@ -642,12 +627,6 @@ dp_packet_flow_mark_ptr(const struct dp_packet *b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
static inline uint32_t *
|
|
||||||
dp_packet_ol_flags_ptr(const struct dp_packet *b)
|
|
||||||
{
|
|
||||||
return CONST_CAST(uint32_t *, &b->ol_flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint32_t *
|
static inline uint32_t *
|
||||||
dp_packet_rss_ptr(const struct dp_packet *b)
|
dp_packet_rss_ptr(const struct dp_packet *b)
|
||||||
{
|
{
|
||||||
@ -1043,7 +1022,6 @@ dp_packet_rss_valid(const struct dp_packet *p)
|
|||||||
static inline void
|
static inline void
|
||||||
dp_packet_reset_offload(struct dp_packet *p)
|
dp_packet_reset_offload(struct dp_packet *p)
|
||||||
{
|
{
|
||||||
*dp_packet_ol_flags_ptr(p) &= ~DP_PACKET_OL_SUPPORTED_MASK;
|
|
||||||
p->has_hash = p->has_mark = false;
|
p->has_hash = p->has_mark = false;
|
||||||
p->offloads = 0;
|
p->offloads = 0;
|
||||||
}
|
}
|
||||||
|
@ -7164,9 +7164,7 @@ netdev_linux_prepend_vnet_hdr(struct dp_packet *b, int mtu)
|
|||||||
vnet->gso_type = VIRTIO_NET_HDR_GSO_TCPV6;
|
vnet->gso_type = VIRTIO_NET_HDR_GSO_TCPV6;
|
||||||
} else {
|
} else {
|
||||||
VLOG_ERR_RL(&rl, "Unknown gso_type for TSO packet. "
|
VLOG_ERR_RL(&rl, "Unknown gso_type for TSO packet. "
|
||||||
"Flags: %#"PRIx64", Offloads: %"PRIu32,
|
"Offloads: %"PRIu32, b->offloads);
|
||||||
(uint64_t) *dp_packet_ol_flags_ptr(b),
|
|
||||||
b->offloads);
|
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -7265,9 +7263,7 @@ netdev_linux_prepend_vnet_hdr(struct dp_packet *b, int mtu)
|
|||||||
/* This should only happen when a new L4 proto
|
/* This should only happen when a new L4 proto
|
||||||
* is not covered in above checks. */
|
* is not covered in above checks. */
|
||||||
VLOG_WARN_RL(&rl, "Unsupported L4 checksum offload. "
|
VLOG_WARN_RL(&rl, "Unsupported L4 checksum offload. "
|
||||||
"Flags: %"PRIu64", Offloads: %"PRIu32,
|
"Offloads: %"PRIu32, b->offloads);
|
||||||
(uint64_t)*dp_packet_ol_flags_ptr(b),
|
|
||||||
b->offloads);
|
|
||||||
vnet->csum_start = vnet->csum_offset = (OVS_FORCE __virtio16) 0;
|
vnet->csum_start = vnet->csum_offset = (OVS_FORCE __virtio16) 0;
|
||||||
vnet->flags = 0;
|
vnet->flags = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user