struct sfc_dp_tx {
struct sfc_dp dp;
+ unsigned int features;
+#define SFC_DP_TX_FEAT_VLAN_INSERT 0x1
sfc_dp_tx_qcreate_t *qcreate;
sfc_dp_tx_qdestroy_t *qdestroy;
sfc_dp_tx_qstart_t *qstart;
DEV_TX_OFFLOAD_TCP_CKSUM;
dev_info->default_txconf.txq_flags = ETH_TXQ_FLAGS_NOXSUMSCTP;
- if (!encp->enc_hw_tx_insert_vlan_enabled)
+ if ((~sa->dp_tx->features & SFC_DP_TX_FEAT_VLAN_INSERT) ||
+ !encp->enc_hw_tx_insert_vlan_enabled)
dev_info->default_txconf.txq_flags |= ETH_TXQ_FLAGS_NOVLANOFFL;
else
dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_VLAN_INSERT;
rc = EINVAL;
}
- if (!encp->enc_hw_tx_insert_vlan_enabled &&
- (flags & ETH_TXQ_FLAGS_NOVLANOFFL) == 0) {
- sfc_err(sa, "VLAN offload is not supported");
- rc = EINVAL;
+ if ((flags & ETH_TXQ_FLAGS_NOVLANOFFL) == 0) {
+ if (!encp->enc_hw_tx_insert_vlan_enabled) {
+ sfc_err(sa, "VLAN offload is not supported");
+ rc = EINVAL;
+ } else if (~sa->dp_tx->features & SFC_DP_TX_FEAT_VLAN_INSERT) {
+ sfc_err(sa,
+ "VLAN offload is not supported by %s datapath",
+ sa->dp_tx->dp.name);
+ rc = EINVAL;
+ }
}
if ((flags & ETH_TXQ_FLAGS_NOXSUMSCTP) == 0) {
.type = SFC_DP_TX,
.hw_fw_caps = 0,
},
+ .features = SFC_DP_TX_FEAT_VLAN_INSERT,
.qcreate = sfc_efx_tx_qcreate,
.qdestroy = sfc_efx_tx_qdestroy,
.qstart = sfc_efx_tx_qstart,